diff options
author | peter chang <dpf@google.com> | 2019-11-14 15:39:05 +0530 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-11-19 21:37:33 -0500 |
commit | 91a43fa61f102e045d9bac07a4b7739a4bbe623a (patch) | |
tree | 6f582c88a6b802a043ffb285f05c6627e2a987bd /drivers/scsi/pm8001/pm8001_sas.h | |
parent | a88d9db94c4c9fb2b6ce9f5748928bef46aa9885 (diff) | |
download | lwn-91a43fa61f102e045d9bac07a4b7739a4bbe623a.tar.gz lwn-91a43fa61f102e045d9bac07a4b7739a4bbe623a.zip |
scsi: pm80xx: Fix command issue sizing
The commands to the controller are sent in fixed sized chunks which are set
per-chip-generation and stashed in iomb_size. The driver fills in structs
matching the register layout and memcpy this to memory shared with the
controller. However, there are two problem cases:
1) Things like phy_start_req are too large because they share the
sas_identify_frame definition with libsas, and it includes the crc
word. This means that it's overwriting the start of the next
command block, that's ok except if it happens at the end of the
shared memory area.
2) Things like set_nvm_data_req which are shared between the HAL
layers. This means that it's sending 'random' data for things that
are in the reserved area. So far we haven't found a case where the
controller FW cares, but sending possible gibberish (for most of
the structures this is in the reserved area so previously zeroed)
is not recommended.
Link: https://lore.kernel.org/r/20191114100910.6153-9-deepak.ukey@microchip.com
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: peter chang <dpf@google.com>
Signed-off-by: Deepak Ukey <deepak.ukey@microchip.com>
Signed-off-by: Viswas G <Viswas.G@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/pm8001/pm8001_sas.h')
-rw-r--r-- | drivers/scsi/pm8001/pm8001_sas.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/pm8001/pm8001_sas.h b/drivers/scsi/pm8001/pm8001_sas.h index 9e0da7bccb45..d64883b80da9 100644 --- a/drivers/scsi/pm8001/pm8001_sas.h +++ b/drivers/scsi/pm8001/pm8001_sas.h @@ -674,7 +674,8 @@ int pm8001_mem_alloc(struct pci_dev *pdev, void **virt_addr, void pm8001_chip_iounmap(struct pm8001_hba_info *pm8001_ha); int pm8001_mpi_build_cmd(struct pm8001_hba_info *pm8001_ha, struct inbound_queue_table *circularQ, - u32 opCode, void *payload, u32 responseQueue); + u32 opCode, void *payload, size_t nb, + u32 responseQueue); int pm8001_mpi_msg_free_get(struct inbound_queue_table *circularQ, u16 messageSize, void **messagePtr); u32 pm8001_mpi_msg_free_set(struct pm8001_hba_info *pm8001_ha, void *pMsg, |