diff options
-rw-r--r-- | drivers/scsi/pm8001/pm8001_chips.h | 4 | ||||
-rw-r--r-- | drivers/scsi/pm8001/pm8001_hwi.c | 89 | ||||
-rw-r--r-- | drivers/scsi/pm8001/pm8001_hwi.h | 2 |
3 files changed, 49 insertions, 46 deletions
diff --git a/drivers/scsi/pm8001/pm8001_chips.h b/drivers/scsi/pm8001/pm8001_chips.h index 4efa4d0950e5..9241c7826034 100644 --- a/drivers/scsi/pm8001/pm8001_chips.h +++ b/drivers/scsi/pm8001/pm8001_chips.h | |||
@@ -46,9 +46,9 @@ static inline u32 pm8001_read_32(void *virt_addr) | |||
46 | return *((u32 *)virt_addr); | 46 | return *((u32 *)virt_addr); |
47 | } | 47 | } |
48 | 48 | ||
49 | static inline void pm8001_write_32(void *addr, u32 offset, u32 val) | 49 | static inline void pm8001_write_32(void *addr, u32 offset, __le32 val) |
50 | { | 50 | { |
51 | *((u32 *)(addr + offset)) = val; | 51 | *((__le32 *)(addr + offset)) = val; |
52 | } | 52 | } |
53 | 53 | ||
54 | static inline u32 pm8001_cr32(struct pm8001_hba_info *pm8001_ha, u32 bar, | 54 | static inline u32 pm8001_cr32(struct pm8001_hba_info *pm8001_ha, u32 bar, |
diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c index dc28ae186450..5022bf7af3c8 100644 --- a/drivers/scsi/pm8001/pm8001_hwi.c +++ b/drivers/scsi/pm8001/pm8001_hwi.c | |||
@@ -1246,7 +1246,7 @@ static int mpi_msg_free_get(struct inbound_queue_table *circularQ, | |||
1246 | consumer_index = pm8001_read_32(circularQ->ci_virt); | 1246 | consumer_index = pm8001_read_32(circularQ->ci_virt); |
1247 | circularQ->consumer_index = cpu_to_le32(consumer_index); | 1247 | circularQ->consumer_index = cpu_to_le32(consumer_index); |
1248 | if (((circularQ->producer_idx + bcCount) % 256) == | 1248 | if (((circularQ->producer_idx + bcCount) % 256) == |
1249 | circularQ->consumer_index) { | 1249 | le32_to_cpu(circularQ->consumer_index)) { |
1250 | *messagePtr = NULL; | 1250 | *messagePtr = NULL; |
1251 | return -1; | 1251 | return -1; |
1252 | } | 1252 | } |
@@ -1355,7 +1355,8 @@ static u32 mpi_msg_consume(struct pm8001_hba_info *pm8001_ha, | |||
1355 | u32 header_tmp; | 1355 | u32 header_tmp; |
1356 | do { | 1356 | do { |
1357 | /* If there are not-yet-delivered messages ... */ | 1357 | /* If there are not-yet-delivered messages ... */ |
1358 | if (circularQ->producer_index != circularQ->consumer_idx) { | 1358 | if (le32_to_cpu(circularQ->producer_index) |
1359 | != circularQ->consumer_idx) { | ||
1359 | /*Get the pointer to the circular queue buffer element*/ | 1360 | /*Get the pointer to the circular queue buffer element*/ |
1360 | msgHeader = (struct mpi_msg_hdr *) | 1361 | msgHeader = (struct mpi_msg_hdr *) |
1361 | (circularQ->base_virt + | 1362 | (circularQ->base_virt + |
@@ -1363,14 +1364,14 @@ static u32 mpi_msg_consume(struct pm8001_hba_info *pm8001_ha, | |||
1363 | /* read header */ | 1364 | /* read header */ |
1364 | header_tmp = pm8001_read_32(msgHeader); | 1365 | header_tmp = pm8001_read_32(msgHeader); |
1365 | msgHeader_tmp = cpu_to_le32(header_tmp); | 1366 | msgHeader_tmp = cpu_to_le32(header_tmp); |
1366 | if (0 != (msgHeader_tmp & 0x80000000)) { | 1367 | if (0 != (le32_to_cpu(msgHeader_tmp) & 0x80000000)) { |
1367 | if (OPC_OUB_SKIP_ENTRY != | 1368 | if (OPC_OUB_SKIP_ENTRY != |
1368 | (msgHeader_tmp & 0xfff)) { | 1369 | (le32_to_cpu(msgHeader_tmp) & 0xfff)) { |
1369 | *messagePtr1 = | 1370 | *messagePtr1 = |
1370 | ((u8 *)msgHeader) + | 1371 | ((u8 *)msgHeader) + |
1371 | sizeof(struct mpi_msg_hdr); | 1372 | sizeof(struct mpi_msg_hdr); |
1372 | *pBC = (u8)((msgHeader_tmp >> 24) & | 1373 | *pBC = (u8)((le32_to_cpu(msgHeader_tmp) |
1373 | 0x1f); | 1374 | >> 24) & 0x1f); |
1374 | PM8001_IO_DBG(pm8001_ha, | 1375 | PM8001_IO_DBG(pm8001_ha, |
1375 | pm8001_printk(": CI=%d PI=%d " | 1376 | pm8001_printk(": CI=%d PI=%d " |
1376 | "msgHeader=%x\n", | 1377 | "msgHeader=%x\n", |
@@ -1381,8 +1382,8 @@ static u32 mpi_msg_consume(struct pm8001_hba_info *pm8001_ha, | |||
1381 | } else { | 1382 | } else { |
1382 | circularQ->consumer_idx = | 1383 | circularQ->consumer_idx = |
1383 | (circularQ->consumer_idx + | 1384 | (circularQ->consumer_idx + |
1384 | ((msgHeader_tmp >> 24) & 0x1f)) | 1385 | ((le32_to_cpu(msgHeader_tmp) |
1385 | % 256; | 1386 | >> 24) & 0x1f)) % 256; |
1386 | msgHeader_tmp = 0; | 1387 | msgHeader_tmp = 0; |
1387 | pm8001_write_32(msgHeader, 0, 0); | 1388 | pm8001_write_32(msgHeader, 0, 0); |
1388 | /* update the CI of outbound queue */ | 1389 | /* update the CI of outbound queue */ |
@@ -1394,7 +1395,8 @@ static u32 mpi_msg_consume(struct pm8001_hba_info *pm8001_ha, | |||
1394 | } else { | 1395 | } else { |
1395 | circularQ->consumer_idx = | 1396 | circularQ->consumer_idx = |
1396 | (circularQ->consumer_idx + | 1397 | (circularQ->consumer_idx + |
1397 | ((msgHeader_tmp >> 24) & 0x1f)) % 256; | 1398 | ((le32_to_cpu(msgHeader_tmp) >> 24) & |
1399 | 0x1f)) % 256; | ||
1398 | msgHeader_tmp = 0; | 1400 | msgHeader_tmp = 0; |
1399 | pm8001_write_32(msgHeader, 0, 0); | 1401 | pm8001_write_32(msgHeader, 0, 0); |
1400 | /* update the CI of outbound queue */ | 1402 | /* update the CI of outbound queue */ |
@@ -1410,7 +1412,8 @@ static u32 mpi_msg_consume(struct pm8001_hba_info *pm8001_ha, | |||
1410 | producer_index = pm8001_read_32(pi_virt); | 1412 | producer_index = pm8001_read_32(pi_virt); |
1411 | circularQ->producer_index = cpu_to_le32(producer_index); | 1413 | circularQ->producer_index = cpu_to_le32(producer_index); |
1412 | } | 1414 | } |
1413 | } while (circularQ->producer_index != circularQ->consumer_idx); | 1415 | } while (le32_to_cpu(circularQ->producer_index) != |
1416 | circularQ->consumer_idx); | ||
1414 | /* while we don't have any more not-yet-delivered message */ | 1417 | /* while we don't have any more not-yet-delivered message */ |
1415 | /* report empty */ | 1418 | /* report empty */ |
1416 | return MPI_IO_STATUS_BUSY; | 1419 | return MPI_IO_STATUS_BUSY; |
@@ -3060,7 +3063,7 @@ static void pm8001_hw_event_ack_req(struct pm8001_hba_info *pm8001_ha, | |||
3060 | 3063 | ||
3061 | memset((u8 *)&payload, 0, sizeof(payload)); | 3064 | memset((u8 *)&payload, 0, sizeof(payload)); |
3062 | circularQ = &pm8001_ha->inbnd_q_tbl[Qnum]; | 3065 | circularQ = &pm8001_ha->inbnd_q_tbl[Qnum]; |
3063 | payload.tag = 1; | 3066 | payload.tag = cpu_to_le32(1); |
3064 | payload.sea_phyid_portid = cpu_to_le32(((SEA & 0xFFFF) << 8) | | 3067 | payload.sea_phyid_portid = cpu_to_le32(((SEA & 0xFFFF) << 8) | |
3065 | ((phyId & 0x0F) << 4) | (port_id & 0x0F)); | 3068 | ((phyId & 0x0F) << 4) | (port_id & 0x0F)); |
3066 | payload.param0 = cpu_to_le32(param0); | 3069 | payload.param0 = cpu_to_le32(param0); |
@@ -3132,9 +3135,9 @@ hw_event_sas_phy_up(struct pm8001_hba_info *pm8001_ha, void *piomb) | |||
3132 | phy->phy_type |= PORT_TYPE_SAS; | 3135 | phy->phy_type |= PORT_TYPE_SAS; |
3133 | phy->identify.device_type = deviceType; | 3136 | phy->identify.device_type = deviceType; |
3134 | phy->phy_attached = 1; | 3137 | phy->phy_attached = 1; |
3135 | if (phy->identify.device_type == SAS_END_DEV) | 3138 | if (phy->identify.device_type == SAS_END_DEVICE) |
3136 | phy->identify.target_port_protocols = SAS_PROTOCOL_SSP; | 3139 | phy->identify.target_port_protocols = SAS_PROTOCOL_SSP; |
3137 | else if (phy->identify.device_type != NO_DEVICE) | 3140 | else if (phy->identify.device_type != SAS_PHY_UNUSED) |
3138 | phy->identify.target_port_protocols = SAS_PROTOCOL_SMP; | 3141 | phy->identify.target_port_protocols = SAS_PROTOCOL_SMP; |
3139 | phy->sas_phy.oob_mode = SAS_OOB_MODE; | 3142 | phy->sas_phy.oob_mode = SAS_OOB_MODE; |
3140 | sas_ha->notify_phy_event(&phy->sas_phy, PHYE_OOB_DONE); | 3143 | sas_ha->notify_phy_event(&phy->sas_phy, PHYE_OOB_DONE); |
@@ -3278,7 +3281,7 @@ static int mpi_reg_resp(struct pm8001_hba_info *pm8001_ha, void *piomb) | |||
3278 | (struct dev_reg_resp *)(piomb + 4); | 3281 | (struct dev_reg_resp *)(piomb + 4); |
3279 | 3282 | ||
3280 | htag = le32_to_cpu(registerRespPayload->tag); | 3283 | htag = le32_to_cpu(registerRespPayload->tag); |
3281 | ccb = &pm8001_ha->ccb_info[registerRespPayload->tag]; | 3284 | ccb = &pm8001_ha->ccb_info[htag]; |
3282 | pm8001_dev = ccb->device; | 3285 | pm8001_dev = ccb->device; |
3283 | status = le32_to_cpu(registerRespPayload->status); | 3286 | status = le32_to_cpu(registerRespPayload->status); |
3284 | device_id = le32_to_cpu(registerRespPayload->device_id); | 3287 | device_id = le32_to_cpu(registerRespPayload->device_id); |
@@ -3352,7 +3355,7 @@ mpi_fw_flash_update_resp(struct pm8001_hba_info *pm8001_ha, void *piomb) | |||
3352 | struct fw_control_ex fw_control_context; | 3355 | struct fw_control_ex fw_control_context; |
3353 | struct fw_flash_Update_resp *ppayload = | 3356 | struct fw_flash_Update_resp *ppayload = |
3354 | (struct fw_flash_Update_resp *)(piomb + 4); | 3357 | (struct fw_flash_Update_resp *)(piomb + 4); |
3355 | u32 tag = le32_to_cpu(ppayload->tag); | 3358 | u32 tag = ppayload->tag; |
3356 | struct pm8001_ccb_info *ccb = &pm8001_ha->ccb_info[tag]; | 3359 | struct pm8001_ccb_info *ccb = &pm8001_ha->ccb_info[tag]; |
3357 | status = le32_to_cpu(ppayload->status); | 3360 | status = le32_to_cpu(ppayload->status); |
3358 | memcpy(&fw_control_context, | 3361 | memcpy(&fw_control_context, |
@@ -3441,13 +3444,12 @@ mpi_task_abort_resp(struct pm8001_hba_info *pm8001_ha, void *piomb) | |||
3441 | 3444 | ||
3442 | struct task_abort_resp *pPayload = | 3445 | struct task_abort_resp *pPayload = |
3443 | (struct task_abort_resp *)(piomb + 4); | 3446 | (struct task_abort_resp *)(piomb + 4); |
3444 | ccb = &pm8001_ha->ccb_info[pPayload->tag]; | ||
3445 | t = ccb->task; | ||
3446 | |||
3447 | 3447 | ||
3448 | status = le32_to_cpu(pPayload->status); | 3448 | status = le32_to_cpu(pPayload->status); |
3449 | tag = le32_to_cpu(pPayload->tag); | 3449 | tag = le32_to_cpu(pPayload->tag); |
3450 | scp = le32_to_cpu(pPayload->scp); | 3450 | scp = le32_to_cpu(pPayload->scp); |
3451 | ccb = &pm8001_ha->ccb_info[tag]; | ||
3452 | t = ccb->task; | ||
3451 | PM8001_IO_DBG(pm8001_ha, | 3453 | PM8001_IO_DBG(pm8001_ha, |
3452 | pm8001_printk(" status = 0x%x\n", status)); | 3454 | pm8001_printk(" status = 0x%x\n", status)); |
3453 | if (t == NULL) | 3455 | if (t == NULL) |
@@ -3473,7 +3475,7 @@ mpi_task_abort_resp(struct pm8001_hba_info *pm8001_ha, void *piomb) | |||
3473 | t->task_state_flags &= ~SAS_TASK_AT_INITIATOR; | 3475 | t->task_state_flags &= ~SAS_TASK_AT_INITIATOR; |
3474 | t->task_state_flags |= SAS_TASK_STATE_DONE; | 3476 | t->task_state_flags |= SAS_TASK_STATE_DONE; |
3475 | spin_unlock_irqrestore(&t->task_state_lock, flags); | 3477 | spin_unlock_irqrestore(&t->task_state_lock, flags); |
3476 | pm8001_ccb_task_free(pm8001_ha, t, ccb, pPayload->tag); | 3478 | pm8001_ccb_task_free(pm8001_ha, t, ccb, tag); |
3477 | mb(); | 3479 | mb(); |
3478 | t->task_done(t); | 3480 | t->task_done(t); |
3479 | return 0; | 3481 | return 0; |
@@ -3700,7 +3702,7 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void* piomb) | |||
3700 | static void process_one_iomb(struct pm8001_hba_info *pm8001_ha, void *piomb) | 3702 | static void process_one_iomb(struct pm8001_hba_info *pm8001_ha, void *piomb) |
3701 | { | 3703 | { |
3702 | u32 pHeader = (u32)*(u32 *)piomb; | 3704 | u32 pHeader = (u32)*(u32 *)piomb; |
3703 | u8 opc = (u8)((le32_to_cpu(pHeader)) & 0xFFF); | 3705 | u8 opc = (u8)(pHeader & 0xFFF); |
3704 | 3706 | ||
3705 | PM8001_MSG_DBG(pm8001_ha, pm8001_printk("process_one_iomb:")); | 3707 | PM8001_MSG_DBG(pm8001_ha, pm8001_printk("process_one_iomb:")); |
3706 | 3708 | ||
@@ -3867,7 +3869,7 @@ static int process_oq(struct pm8001_hba_info *pm8001_ha) | |||
3867 | { | 3869 | { |
3868 | struct outbound_queue_table *circularQ; | 3870 | struct outbound_queue_table *circularQ; |
3869 | void *pMsg1 = NULL; | 3871 | void *pMsg1 = NULL; |
3870 | u8 bc = 0; | 3872 | u8 uninitialized_var(bc); |
3871 | u32 ret = MPI_IO_STATUS_FAIL; | 3873 | u32 ret = MPI_IO_STATUS_FAIL; |
3872 | unsigned long flags; | 3874 | unsigned long flags; |
3873 | 3875 | ||
@@ -3882,11 +3884,10 @@ static int process_oq(struct pm8001_hba_info *pm8001_ha) | |||
3882 | mpi_msg_free_set(pm8001_ha, pMsg1, circularQ, bc); | 3884 | mpi_msg_free_set(pm8001_ha, pMsg1, circularQ, bc); |
3883 | } | 3885 | } |
3884 | if (MPI_IO_STATUS_BUSY == ret) { | 3886 | if (MPI_IO_STATUS_BUSY == ret) { |
3885 | u32 producer_idx; | ||
3886 | /* Update the producer index from SPC */ | 3887 | /* Update the producer index from SPC */ |
3887 | producer_idx = pm8001_read_32(circularQ->pi_virt); | 3888 | circularQ->producer_index = |
3888 | circularQ->producer_index = cpu_to_le32(producer_idx); | 3889 | cpu_to_le32(pm8001_read_32(circularQ->pi_virt)); |
3889 | if (circularQ->producer_index == | 3890 | if (le32_to_cpu(circularQ->producer_index) == |
3890 | circularQ->consumer_idx) | 3891 | circularQ->consumer_idx) |
3891 | /* OQ is empty */ | 3892 | /* OQ is empty */ |
3892 | break; | 3893 | break; |
@@ -3918,9 +3919,9 @@ pm8001_chip_make_sg(struct scatterlist *scatter, int nr, void *prd) | |||
3918 | } | 3919 | } |
3919 | } | 3920 | } |
3920 | 3921 | ||
3921 | static void build_smp_cmd(u32 deviceID, u32 hTag, struct smp_req *psmp_cmd) | 3922 | static void build_smp_cmd(u32 deviceID, __le32 hTag, struct smp_req *psmp_cmd) |
3922 | { | 3923 | { |
3923 | psmp_cmd->tag = cpu_to_le32(hTag); | 3924 | psmp_cmd->tag = hTag; |
3924 | psmp_cmd->device_id = cpu_to_le32(deviceID); | 3925 | psmp_cmd->device_id = cpu_to_le32(deviceID); |
3925 | psmp_cmd->len_ip_ir = cpu_to_le32(1|(1 << 1)); | 3926 | psmp_cmd->len_ip_ir = cpu_to_le32(1|(1 << 1)); |
3926 | } | 3927 | } |
@@ -4004,7 +4005,7 @@ static int pm8001_chip_ssp_io_req(struct pm8001_hba_info *pm8001_ha, | |||
4004 | struct ssp_ini_io_start_req ssp_cmd; | 4005 | struct ssp_ini_io_start_req ssp_cmd; |
4005 | u32 tag = ccb->ccb_tag; | 4006 | u32 tag = ccb->ccb_tag; |
4006 | int ret; | 4007 | int ret; |
4007 | __le64 phys_addr; | 4008 | u64 phys_addr; |
4008 | struct inbound_queue_table *circularQ; | 4009 | struct inbound_queue_table *circularQ; |
4009 | u32 opc = OPC_INB_SSPINIIOSTART; | 4010 | u32 opc = OPC_INB_SSPINIIOSTART; |
4010 | memset(&ssp_cmd, 0, sizeof(ssp_cmd)); | 4011 | memset(&ssp_cmd, 0, sizeof(ssp_cmd)); |
@@ -4025,15 +4026,15 @@ static int pm8001_chip_ssp_io_req(struct pm8001_hba_info *pm8001_ha, | |||
4025 | /* fill in PRD (scatter/gather) table, if any */ | 4026 | /* fill in PRD (scatter/gather) table, if any */ |
4026 | if (task->num_scatter > 1) { | 4027 | if (task->num_scatter > 1) { |
4027 | pm8001_chip_make_sg(task->scatter, ccb->n_elem, ccb->buf_prd); | 4028 | pm8001_chip_make_sg(task->scatter, ccb->n_elem, ccb->buf_prd); |
4028 | phys_addr = cpu_to_le64(ccb->ccb_dma_handle + | 4029 | phys_addr = ccb->ccb_dma_handle + |
4029 | offsetof(struct pm8001_ccb_info, buf_prd[0])); | 4030 | offsetof(struct pm8001_ccb_info, buf_prd[0]); |
4030 | ssp_cmd.addr_low = lower_32_bits(phys_addr); | 4031 | ssp_cmd.addr_low = cpu_to_le32(lower_32_bits(phys_addr)); |
4031 | ssp_cmd.addr_high = upper_32_bits(phys_addr); | 4032 | ssp_cmd.addr_high = cpu_to_le32(upper_32_bits(phys_addr)); |
4032 | ssp_cmd.esgl = cpu_to_le32(1<<31); | 4033 | ssp_cmd.esgl = cpu_to_le32(1<<31); |
4033 | } else if (task->num_scatter == 1) { | 4034 | } else if (task->num_scatter == 1) { |
4034 | __le64 dma_addr = cpu_to_le64(sg_dma_address(task->scatter)); | 4035 | u64 dma_addr = sg_dma_address(task->scatter); |
4035 | ssp_cmd.addr_low = lower_32_bits(dma_addr); | 4036 | ssp_cmd.addr_low = cpu_to_le32(lower_32_bits(dma_addr)); |
4036 | ssp_cmd.addr_high = upper_32_bits(dma_addr); | 4037 | ssp_cmd.addr_high = cpu_to_le32(upper_32_bits(dma_addr)); |
4037 | ssp_cmd.len = cpu_to_le32(task->total_xfer_len); | 4038 | ssp_cmd.len = cpu_to_le32(task->total_xfer_len); |
4038 | ssp_cmd.esgl = 0; | 4039 | ssp_cmd.esgl = 0; |
4039 | } else if (task->num_scatter == 0) { | 4040 | } else if (task->num_scatter == 0) { |
@@ -4056,7 +4057,7 @@ static int pm8001_chip_sata_req(struct pm8001_hba_info *pm8001_ha, | |||
4056 | int ret; | 4057 | int ret; |
4057 | struct sata_start_req sata_cmd; | 4058 | struct sata_start_req sata_cmd; |
4058 | u32 hdr_tag, ncg_tag = 0; | 4059 | u32 hdr_tag, ncg_tag = 0; |
4059 | __le64 phys_addr; | 4060 | u64 phys_addr; |
4060 | u32 ATAP = 0x0; | 4061 | u32 ATAP = 0x0; |
4061 | u32 dir; | 4062 | u32 dir; |
4062 | struct inbound_queue_table *circularQ; | 4063 | struct inbound_queue_table *circularQ; |
@@ -4095,13 +4096,13 @@ static int pm8001_chip_sata_req(struct pm8001_hba_info *pm8001_ha, | |||
4095 | /* fill in PRD (scatter/gather) table, if any */ | 4096 | /* fill in PRD (scatter/gather) table, if any */ |
4096 | if (task->num_scatter > 1) { | 4097 | if (task->num_scatter > 1) { |
4097 | pm8001_chip_make_sg(task->scatter, ccb->n_elem, ccb->buf_prd); | 4098 | pm8001_chip_make_sg(task->scatter, ccb->n_elem, ccb->buf_prd); |
4098 | phys_addr = cpu_to_le64(ccb->ccb_dma_handle + | 4099 | phys_addr = ccb->ccb_dma_handle + |
4099 | offsetof(struct pm8001_ccb_info, buf_prd[0])); | 4100 | offsetof(struct pm8001_ccb_info, buf_prd[0]); |
4100 | sata_cmd.addr_low = lower_32_bits(phys_addr); | 4101 | sata_cmd.addr_low = lower_32_bits(phys_addr); |
4101 | sata_cmd.addr_high = upper_32_bits(phys_addr); | 4102 | sata_cmd.addr_high = upper_32_bits(phys_addr); |
4102 | sata_cmd.esgl = cpu_to_le32(1 << 31); | 4103 | sata_cmd.esgl = cpu_to_le32(1 << 31); |
4103 | } else if (task->num_scatter == 1) { | 4104 | } else if (task->num_scatter == 1) { |
4104 | __le64 dma_addr = cpu_to_le64(sg_dma_address(task->scatter)); | 4105 | u64 dma_addr = sg_dma_address(task->scatter); |
4105 | sata_cmd.addr_low = lower_32_bits(dma_addr); | 4106 | sata_cmd.addr_low = lower_32_bits(dma_addr); |
4106 | sata_cmd.addr_high = upper_32_bits(dma_addr); | 4107 | sata_cmd.addr_high = upper_32_bits(dma_addr); |
4107 | sata_cmd.len = cpu_to_le32(task->total_xfer_len); | 4108 | sata_cmd.len = cpu_to_le32(task->total_xfer_len); |
@@ -4245,7 +4246,7 @@ static int pm8001_chip_dereg_dev_req(struct pm8001_hba_info *pm8001_ha, | |||
4245 | 4246 | ||
4246 | circularQ = &pm8001_ha->inbnd_q_tbl[0]; | 4247 | circularQ = &pm8001_ha->inbnd_q_tbl[0]; |
4247 | memset(&payload, 0, sizeof(payload)); | 4248 | memset(&payload, 0, sizeof(payload)); |
4248 | payload.tag = 1; | 4249 | payload.tag = cpu_to_le32(1); |
4249 | payload.device_id = cpu_to_le32(device_id); | 4250 | payload.device_id = cpu_to_le32(device_id); |
4250 | PM8001_MSG_DBG(pm8001_ha, | 4251 | PM8001_MSG_DBG(pm8001_ha, |
4251 | pm8001_printk("unregister device device_id = %d\n", device_id)); | 4252 | pm8001_printk("unregister device device_id = %d\n", device_id)); |
@@ -4269,7 +4270,7 @@ static int pm8001_chip_phy_ctl_req(struct pm8001_hba_info *pm8001_ha, | |||
4269 | u32 opc = OPC_INB_LOCAL_PHY_CONTROL; | 4270 | u32 opc = OPC_INB_LOCAL_PHY_CONTROL; |
4270 | memset(&payload, 0, sizeof(payload)); | 4271 | memset(&payload, 0, sizeof(payload)); |
4271 | circularQ = &pm8001_ha->inbnd_q_tbl[0]; | 4272 | circularQ = &pm8001_ha->inbnd_q_tbl[0]; |
4272 | payload.tag = 1; | 4273 | payload.tag = cpu_to_le32(1); |
4273 | payload.phyop_phyid = | 4274 | payload.phyop_phyid = |
4274 | cpu_to_le32(((phy_op & 0xff) << 8) | (phyId & 0x0F)); | 4275 | cpu_to_le32(((phy_op & 0xff) << 8) | (phyId & 0x0F)); |
4275 | ret = mpi_build_cmd(pm8001_ha, circularQ, opc, &payload); | 4276 | ret = mpi_build_cmd(pm8001_ha, circularQ, opc, &payload); |
@@ -4563,8 +4564,10 @@ pm8001_chip_fw_flash_update_build(struct pm8001_hba_info *pm8001_ha, | |||
4563 | payload.cur_image_offset = cpu_to_le32(info->cur_image_offset); | 4564 | payload.cur_image_offset = cpu_to_le32(info->cur_image_offset); |
4564 | payload.total_image_len = cpu_to_le32(info->total_image_len); | 4565 | payload.total_image_len = cpu_to_le32(info->total_image_len); |
4565 | payload.len = info->sgl.im_len.len ; | 4566 | payload.len = info->sgl.im_len.len ; |
4566 | payload.sgl_addr_lo = lower_32_bits(info->sgl.addr); | 4567 | payload.sgl_addr_lo = |
4567 | payload.sgl_addr_hi = upper_32_bits(info->sgl.addr); | 4568 | cpu_to_le32(lower_32_bits(le64_to_cpu(info->sgl.addr))); |
4569 | payload.sgl_addr_hi = | ||
4570 | cpu_to_le32(upper_32_bits(le64_to_cpu(info->sgl.addr))); | ||
4568 | ret = mpi_build_cmd(pm8001_ha, circularQ, opc, &payload); | 4571 | ret = mpi_build_cmd(pm8001_ha, circularQ, opc, &payload); |
4569 | return ret; | 4572 | return ret; |
4570 | } | 4573 | } |
diff --git a/drivers/scsi/pm8001/pm8001_hwi.h b/drivers/scsi/pm8001/pm8001_hwi.h index 909132041c07..1a4611eb0321 100644 --- a/drivers/scsi/pm8001/pm8001_hwi.h +++ b/drivers/scsi/pm8001/pm8001_hwi.h | |||
@@ -625,7 +625,7 @@ struct set_nvm_data_req { | |||
625 | __le32 tag; | 625 | __le32 tag; |
626 | __le32 len_ir_vpdd; | 626 | __le32 len_ir_vpdd; |
627 | __le32 vpd_offset; | 627 | __le32 vpd_offset; |
628 | u32 reserved[8]; | 628 | __le32 reserved[8]; |
629 | __le32 resp_addr_lo; | 629 | __le32 resp_addr_lo; |
630 | __le32 resp_addr_hi; | 630 | __le32 resp_addr_hi; |
631 | __le32 resp_len; | 631 | __le32 resp_len; |