diff --git a/patches.suse/scsi-smartpqi-Add-controller-cache-flush-during-rmmo.patch b/patches.suse/scsi-smartpqi-Add-controller-cache-flush-during-rmmo.patch new file mode 100644 index 0000000..1a40df6 --- /dev/null +++ b/patches.suse/scsi-smartpqi-Add-controller-cache-flush-during-rmmo.patch @@ -0,0 +1,45 @@ +From: Gilbert Wu +Date: Tue, 8 Nov 2022 13:22:03 -0600 +Subject: scsi: smartpqi: Add controller cache flush during rmmod +Patch-mainline: v6.2-rc1 +Git-commit: 14063fb625c4541f48ff0dc7ae005b0d5a159c3f +References: bsc#1207315 + +Add in a call to flush the controller cache during driver removal. + +Reviewed-by: Scott Benesh +Reviewed-by: Mike Mcgowan +Reviewed-by: Kevin Barnett +Signed-off-by: Gilbert Wu +Signed-off-by: Don Brace +Link: https://lore.kernel.org/r/166793532388.322537.878022136408270892.stgit@brunhilda +Signed-off-by: Martin K. Petersen +Acked-by: Martin Wilck +--- + drivers/scsi/smartpqi/smartpqi_init.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/drivers/scsi/smartpqi/smartpqi_init.c ++++ b/drivers/scsi/smartpqi/smartpqi_init.c +@@ -9040,6 +9040,7 @@ static void pqi_pci_remove(struct pci_de + { + struct pqi_ctrl_info *ctrl_info; + u16 vendor_id; ++ int rc; + + ctrl_info = pci_get_drvdata(pci_dev); + if (!ctrl_info) +@@ -9051,6 +9052,13 @@ static void pqi_pci_remove(struct pci_de + else + ctrl_info->ctrl_removal_state = PQI_CTRL_GRACEFUL_REMOVAL; + ++ if (ctrl_info->ctrl_removal_state == PQI_CTRL_GRACEFUL_REMOVAL) { ++ rc = pqi_flush_cache(ctrl_info, RESTART); ++ if (rc) ++ dev_err(&pci_dev->dev, ++ "unable to flush controller cache during remove\n"); ++ } ++ + pqi_remove_ctrl(ctrl_info); + } + diff --git a/patches.suse/scsi-smartpqi-Add-new-controller-PCI-IDs.patch b/patches.suse/scsi-smartpqi-Add-new-controller-PCI-IDs.patch new file mode 100644 index 0000000..e43852c --- /dev/null +++ b/patches.suse/scsi-smartpqi-Add-new-controller-PCI-IDs.patch @@ -0,0 +1,127 @@ +From: Mike McGowen +Date: Tue, 8 Nov 2022 13:21:43 -0600 +Subject: scsi: smartpqi: Add new controller PCI IDs +Patch-mainline: v6.2-rc1 +Git-commit: 0b93cf2a9097b1c3d75642ef878ba87f15f03043 +References: bsc#1207315 + +All PCI ID entries in Hex. +Add PCI IDs for ByteDance controllers: + VID / DID / SVID / SDID + ---- ---- ---- ---- + ByteHBA JGH43024-8 9005 / 028f / 1e93 / 1000 + ByteHBA JGH43034-8 9005 / 028f / 1e93 / 1001 + ByteHBA JGH44014-8 9005 / 028f / 1e93 / 1002 + +Add PCI IDs for new Inspur controllers: + VID / DID / SVID / SDID + ---- ---- ---- ---- + INSPUR RT0800M7E 9005 / 028f / 1bd4 / 0086 + INSPUR RT0800M7H 9005 / 028f / 1bd4 / 0087 + INSPUR RT0804M7R 9005 / 028f / 1bd4 / 0088 + INSPUR RT0808M7R 9005 / 028f / 1bd4 / 0089 + +Add PCI IDs for new FAB A controllers: + VID / DID / SVID / SDID + ---- ---- ---- ---- + Adaptec SmartRAID 3254-16e /e 9005 / 028f / 9005 / 1475 + Adaptec HBA 1200-16e 9005 / 028f / 9005 / 14c3 + Adaptec HBA 1200-8e 9005 / 028f / 9005 / 14c4 + +Add H3C controller PCI IDs: + VID / DID / SVID / SDID + ---- ---- ---- ---- + H3C H4508-Mf-8i 9005 / 028f / 193d / 110b + +Reviewed-by: Scott Benesh +Reviewed-by: Scott Teel +Signed-off-by: Mike McGowen +Signed-off-by: Don Brace +Link: https://lore.kernel.org/r/166793530327.322537.6056884426657539311.stgit@brunhilda +Signed-off-by: Martin K. Petersen +Acked-by: Martin Wilck +--- + drivers/scsi/smartpqi/smartpqi_init.c | 44 ++++++++++++++++++++++++++++++++++ + 1 file changed, 44 insertions(+) + +--- a/drivers/scsi/smartpqi/smartpqi_init.c ++++ b/drivers/scsi/smartpqi/smartpqi_init.c +@@ -9322,6 +9322,10 @@ static const struct pci_device_id pqi_pc + }, + { + PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, ++ 0x193d, 0x110b) ++ }, ++ { ++ PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, + 0x193d, 0x8460) + }, + { +@@ -9422,6 +9426,22 @@ static const struct pci_device_id pqi_pc + }, + { + PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, ++ 0x1bd4, 0x0086) ++ }, ++ { ++ PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, ++ 0x1bd4, 0x0087) ++ }, ++ { ++ PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, ++ 0x1bd4, 0x0088) ++ }, ++ { ++ PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, ++ 0x1bd4, 0x0089) ++ }, ++ { ++ PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, + 0x19e5, 0xd227) + }, + { +@@ -9670,6 +9690,10 @@ static const struct pci_device_id pqi_pc + }, + { + PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, ++ PCI_VENDOR_ID_ADAPTEC2, 0x1475) ++ }, ++ { ++ PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, + PCI_VENDOR_ID_ADAPTEC2, 0x1480) + }, + { +@@ -9726,6 +9750,14 @@ static const struct pci_device_id pqi_pc + }, + { + PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, ++ PCI_VENDOR_ID_ADAPTEC2, 0x14c3) ++ }, ++ { ++ PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, ++ PCI_VENDOR_ID_ADAPTEC2, 0x14c4) ++ }, ++ { ++ PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, + PCI_VENDOR_ID_ADAPTEC2, 0x14d0) + }, + { +@@ -9962,6 +9994,18 @@ static const struct pci_device_id pqi_pc + }, + { + PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, ++ 0x1e93, 0x1000) ++ }, ++ { ++ PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, ++ 0x1e93, 0x1001) ++ }, ++ { ++ PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, ++ 0x1e93, 0x1002) ++ }, ++ { ++ PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, + PCI_ANY_ID, PCI_ANY_ID) + }, + { 0 } diff --git a/patches.suse/scsi-smartpqi-Change-sysfs-raid_level-attribute-to-N.patch b/patches.suse/scsi-smartpqi-Change-sysfs-raid_level-attribute-to-N.patch new file mode 100644 index 0000000..4295597 --- /dev/null +++ b/patches.suse/scsi-smartpqi-Change-sysfs-raid_level-attribute-to-N.patch @@ -0,0 +1,33 @@ +From: Kevin Barnett +Date: Tue, 8 Nov 2022 13:21:53 -0600 +Subject: scsi: smartpqi: Change sysfs raid_level attribute to N/A for + controllers +Patch-mainline: v6.2-rc1 +Git-commit: cbe42ac15698a23b204a9b5c66eb0067b22cbd42 +References: bsc#1207315 + +Change the sysfs raid_level attribute from "RAID-0" to N/A. + +Reviewed-by: Scott Benesh +Reviewed-by: Scott Teel +Reviewed-by: Mike McGowan +Signed-off-by: Kevin Barnett +Signed-off-by: Don Brace +Link: https://lore.kernel.org/r/166793531357.322537.8639138137605612362.stgit@brunhilda +Signed-off-by: Martin K. Petersen +Acked-by: Martin Wilck +--- + drivers/scsi/smartpqi/smartpqi_init.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/scsi/smartpqi/smartpqi_init.c ++++ b/drivers/scsi/smartpqi/smartpqi_init.c +@@ -7255,7 +7255,7 @@ static ssize_t pqi_raid_level_show(struc + return -ENODEV; + } + +- if (pqi_is_logical_device(device)) ++ if (pqi_is_logical_device(device) && device->devtype == TYPE_DISK) + raid_level = pqi_raid_level_to_string(device->raid_level); + else + raid_level = "N/A"; diff --git a/patches.suse/scsi-smartpqi-Change-version-to-2.1.20-035.patch b/patches.suse/scsi-smartpqi-Change-version-to-2.1.20-035.patch new file mode 100644 index 0000000..a9da826 --- /dev/null +++ b/patches.suse/scsi-smartpqi-Change-version-to-2.1.20-035.patch @@ -0,0 +1,36 @@ +From: Don Brace +Date: Tue, 8 Nov 2022 13:22:14 -0600 +Subject: scsi: smartpqi: Change version to 2.1.20-035 +Patch-mainline: v6.2-rc1 +Git-commit: 2ae45329a956ff86ff8bec36463b6f49d2ca9bea +References: bsc#1207315 + +Reviewed-by: Scott Benesh +Reviewed-by: Scott Teel +Reviewed-by: Gerry Morong +Reviewed-by: Kevin Barnett +Signed-off-by: Don Brace +Link: https://lore.kernel.org/r/166793533417.322537.3074216622272955440.stgit@brunhilda +Signed-off-by: Martin K. Petersen +Acked-by: Martin Wilck +--- + drivers/scsi/smartpqi/smartpqi_init.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/scsi/smartpqi/smartpqi_init.c ++++ b/drivers/scsi/smartpqi/smartpqi_init.c +@@ -33,11 +33,11 @@ + #define BUILD_TIMESTAMP + #endif + +-#define DRIVER_VERSION "2.1.18-045" ++#define DRIVER_VERSION "2.1.20-035" + #define DRIVER_MAJOR 2 + #define DRIVER_MINOR 1 +-#define DRIVER_RELEASE 18 +-#define DRIVER_REVISION 45 ++#define DRIVER_RELEASE 20 ++#define DRIVER_REVISION 35 + + #define DRIVER_NAME "Microchip SmartPQI Driver (v" \ + DRIVER_VERSION BUILD_TIMESTAMP ")" diff --git a/patches.suse/scsi-smartpqi-Convert-to-host_tagset.patch b/patches.suse/scsi-smartpqi-Convert-to-host_tagset.patch new file mode 100644 index 0000000..db0d949 --- /dev/null +++ b/patches.suse/scsi-smartpqi-Convert-to-host_tagset.patch @@ -0,0 +1,192 @@ +From: Don Brace +Date: Tue, 8 Nov 2022 13:21:38 -0600 +Subject: scsi: smartpqi: Convert to host_tagset +Patch-mainline: v6.2-rc1 +Git-commit: b27ac2faa2fc0b2677cf1cbd270af734a1f5fd95 +References: bsc#1207315 + +Add support for host_tagset. + +Also move the reserved command slots to the end of the pool to eliminate an +addition operation for every SCSI request. + +This patch was originally authored by Hannes Reinecke here: + +Link: https://lore.kernel.org/linux-block/20191126131009.71726-8-hare@suse.de/ + +But we NAKed this patch because we wanted to fully test multipath +failover operations. + +Suggested-by: Hannes Reinecke +Reviewed-by: Scott Benesh +Reviewed-by: Scott Teel +Reviewed-by: Mahesh Rajashekhara +Reviewed-by: Mike McGowen +Reviewed-by: Kevin Barnett +Signed-off-by: Don Brace +Link: https://lore.kernel.org/r/166793529811.322537.3294617845448383948.stgit@brunhilda +Signed-off-by: Martin K. Petersen +Acked-by: Martin Wilck +--- + drivers/scsi/smartpqi/smartpqi.h | 3 - + drivers/scsi/smartpqi/smartpqi_init.c | 68 +++++++++++++++++++++------------- + 2 files changed, 43 insertions(+), 28 deletions(-) + +--- a/drivers/scsi/smartpqi/smartpqi.h ++++ b/drivers/scsi/smartpqi/smartpqi.h +@@ -1307,7 +1307,6 @@ struct pqi_ctrl_info { + dma_addr_t error_buffer_dma_handle; + size_t sg_chain_buffer_length; + unsigned int num_queue_groups; +- u16 max_hw_queue_index; + u16 num_elements_per_iq; + u16 num_elements_per_oq; + u16 max_inbound_iu_length_per_firmware; +@@ -1369,8 +1368,6 @@ struct pqi_ctrl_info { + u64 sas_address; + + struct pqi_io_request *io_request_pool; +- u16 next_io_request_slot; +- + struct pqi_event events[PQI_NUM_SUPPORTED_EVENTS]; + struct work_struct event_work; + +--- a/drivers/scsi/smartpqi/smartpqi_init.c ++++ b/drivers/scsi/smartpqi/smartpqi_init.c +@@ -678,23 +678,36 @@ static inline void pqi_reinit_io_request + io_request->raid_bypass = false; + } + +-static struct pqi_io_request *pqi_alloc_io_request( +- struct pqi_ctrl_info *ctrl_info) ++static inline struct pqi_io_request *pqi_alloc_io_request(struct pqi_ctrl_info *ctrl_info, struct scsi_cmnd *scmd) + { + struct pqi_io_request *io_request; +- u16 i = ctrl_info->next_io_request_slot; /* benignly racy */ ++ u16 i; + +- while (1) { ++ if (scmd) { /* SML I/O request */ ++ u32 blk_tag = blk_mq_unique_tag(scsi_cmd_to_rq(scmd)); ++ ++ i = blk_mq_unique_tag_to_tag(blk_tag); + io_request = &ctrl_info->io_request_pool[i]; +- if (atomic_inc_return(&io_request->refcount) == 1) +- break; +- atomic_dec(&io_request->refcount); +- i = (i + 1) % ctrl_info->max_io_slots; ++ if (atomic_inc_return(&io_request->refcount) > 1) { ++ atomic_dec(&io_request->refcount); ++ return NULL; ++ } ++ } else { /* IOCTL or driver internal request */ ++ /* ++ * benignly racy - may have to wait for an open slot. ++ * command slot range is scsi_ml_can_queue - ++ * [scsi_ml_can_queue + (PQI_RESERVED_IO_SLOTS - 1)] ++ */ ++ i = 0; ++ while (1) { ++ io_request = &ctrl_info->io_request_pool[ctrl_info->scsi_ml_can_queue + i]; ++ if (atomic_inc_return(&io_request->refcount) == 1) ++ break; ++ atomic_dec(&io_request->refcount); ++ i = (i + 1) % PQI_RESERVED_IO_SLOTS; ++ } + } + +- /* benignly racy */ +- ctrl_info->next_io_request_slot = (i + 1) % ctrl_info->max_io_slots; +- + pqi_reinit_io_request(io_request); + + return io_request; +@@ -4586,7 +4599,7 @@ static int pqi_submit_raid_request_synch + goto out; + } + +- io_request = pqi_alloc_io_request(ctrl_info); ++ io_request = pqi_alloc_io_request(ctrl_info, NULL); + + put_unaligned_le16(io_request->index, + &(((struct pqi_raid_path_request *)request)->request_id)); +@@ -5233,7 +5246,6 @@ static void pqi_calculate_queue_resource + } + + ctrl_info->num_queue_groups = num_queue_groups; +- ctrl_info->max_hw_queue_index = num_queue_groups - 1; + + /* + * Make sure that the max. inbound IU length is an even multiple +@@ -5567,7 +5579,9 @@ static inline int pqi_raid_submit_scsi_c + { + struct pqi_io_request *io_request; + +- io_request = pqi_alloc_io_request(ctrl_info); ++ io_request = pqi_alloc_io_request(ctrl_info, scmd); ++ if (!io_request) ++ return SCSI_MLQUEUE_HOST_BUSY; + + return pqi_raid_submit_scsi_cmd_with_io_request(ctrl_info, io_request, + device, scmd, queue_group); +@@ -5671,7 +5685,9 @@ static int pqi_aio_submit_io(struct pqi_ + struct pqi_scsi_dev *device; + + device = scmd->device->hostdata; +- io_request = pqi_alloc_io_request(ctrl_info); ++ io_request = pqi_alloc_io_request(ctrl_info, scmd); ++ if (!io_request) ++ return SCSI_MLQUEUE_HOST_BUSY; + io_request->io_complete_callback = pqi_aio_io_complete; + io_request->scmd = scmd; + io_request->raid_bypass = raid_bypass; +@@ -5743,7 +5759,10 @@ static int pqi_aio_submit_r1_write_io(s + struct pqi_io_request *io_request; + struct pqi_aio_r1_path_request *r1_request; + +- io_request = pqi_alloc_io_request(ctrl_info); ++ io_request = pqi_alloc_io_request(ctrl_info, scmd); ++ if (!io_request) ++ return SCSI_MLQUEUE_HOST_BUSY; ++ + io_request->io_complete_callback = pqi_aio_io_complete; + io_request->scmd = scmd; + io_request->raid_bypass = true; +@@ -5801,7 +5820,9 @@ static int pqi_aio_submit_r56_write_io(s + struct pqi_io_request *io_request; + struct pqi_aio_r56_path_request *r56_request; + +- io_request = pqi_alloc_io_request(ctrl_info); ++ io_request = pqi_alloc_io_request(ctrl_info, scmd); ++ if (!io_request) ++ return SCSI_MLQUEUE_HOST_BUSY; + io_request->io_complete_callback = pqi_aio_io_complete; + io_request->scmd = scmd; + io_request->raid_bypass = true; +@@ -5860,13 +5881,10 @@ static int pqi_aio_submit_r56_write_io(s + static inline u16 pqi_get_hw_queue(struct pqi_ctrl_info *ctrl_info, + struct scsi_cmnd *scmd) + { +- u16 hw_queue; +- +- hw_queue = blk_mq_unique_tag_to_hwq(blk_mq_unique_tag(scsi_cmd_to_rq(scmd))); +- if (hw_queue > ctrl_info->max_hw_queue_index) +- hw_queue = 0; +- +- return hw_queue; ++ /* ++ * We are setting host_tagset = 1 during init. ++ */ ++ return blk_mq_unique_tag_to_hwq(blk_mq_unique_tag(scsi_cmd_to_rq(scmd))); + } + + static inline bool pqi_is_bypass_eligible_request(struct scsi_cmnd *scmd) +@@ -6268,7 +6286,7 @@ static int pqi_lun_reset(struct pqi_ctrl + struct pqi_scsi_dev *device; + + device = scmd->device->hostdata; +- io_request = pqi_alloc_io_request(ctrl_info); ++ io_request = pqi_alloc_io_request(ctrl_info, NULL); + io_request->io_complete_callback = pqi_lun_reset_complete; + io_request->context = &wait; + diff --git a/patches.suse/scsi-smartpqi-Correct-device-removal-for-multi-actua.patch b/patches.suse/scsi-smartpqi-Correct-device-removal-for-multi-actua.patch new file mode 100644 index 0000000..b41afcb --- /dev/null +++ b/patches.suse/scsi-smartpqi-Correct-device-removal-for-multi-actua.patch @@ -0,0 +1,119 @@ +From: Kumar Meiyappan +Date: Tue, 8 Nov 2022 13:21:58 -0600 +Subject: scsi: smartpqi: Correct device removal for multi-actuator devices +Patch-mainline: v6.2-rc1 +Git-commit: cc9befcbbb5ebce77726f938508700d913530035 +References: bsc#1207315 + +Correct device count for multi-actuator drives which can cause kernel +panics. + +Reviewed-by: Scott Benesh +Reviewed-by: Scott Teel +Reviewed-by: Mike Mcgowan +Reviewed-by: Kevin Barnett +Signed-off-by: Kumar Meiyappan +Signed-off-by: Don Brace +Link: https://lore.kernel.org/r/166793531872.322537.9003385780343419275.stgit@brunhilda +Signed-off-by: Martin K. Petersen +Acked-by: Martin Wilck +--- + drivers/scsi/smartpqi/smartpqi.h | 2 +- + drivers/scsi/smartpqi/smartpqi_init.c | 33 ++++++++++++++++++++++++--------- + 2 files changed, 25 insertions(+), 10 deletions(-) + +--- a/drivers/scsi/smartpqi/smartpqi.h ++++ b/drivers/scsi/smartpqi/smartpqi.h +@@ -1130,7 +1130,7 @@ struct pqi_scsi_dev { + u8 phy_id; + u8 ncq_prio_enable; + u8 ncq_prio_support; +- u8 multi_lun_device_lun_count; ++ u8 lun_count; + bool raid_bypass_configured; /* RAID bypass configured */ + bool raid_bypass_enabled; /* RAID bypass enabled */ + u32 next_bypass_group[RAID_MAP_MAX_DATA_DISKS_PER_ROW]; +--- a/drivers/scsi/smartpqi/smartpqi_init.c ++++ b/drivers/scsi/smartpqi/smartpqi_init.c +@@ -1623,9 +1623,7 @@ static int pqi_get_physical_device_info( + &id_phys->alternate_paths_phys_connector, + sizeof(device->phys_connector)); + device->bay = id_phys->phys_bay_in_box; +- device->multi_lun_device_lun_count = id_phys->multi_lun_device_lun_count; +- if (!device->multi_lun_device_lun_count) +- device->multi_lun_device_lun_count = 1; ++ device->lun_count = id_phys->multi_lun_device_lun_count; + if ((id_phys->even_more_flags & PQI_DEVICE_PHY_MAP_SUPPORTED) && + id_phys->phy_count) + device->phy_id = +@@ -1759,7 +1757,7 @@ out: + return offline; + } + +-static int pqi_get_device_info(struct pqi_ctrl_info *ctrl_info, ++static int pqi_get_device_info_phys_logical(struct pqi_ctrl_info *ctrl_info, + struct pqi_scsi_dev *device, + struct bmic_identify_physical_device *id_phys) + { +@@ -1776,6 +1774,20 @@ static int pqi_get_device_info(struct pq + return rc; + } + ++static int pqi_get_device_info(struct pqi_ctrl_info *ctrl_info, ++ struct pqi_scsi_dev *device, ++ struct bmic_identify_physical_device *id_phys) ++{ ++ int rc; ++ ++ rc = pqi_get_device_info_phys_logical(ctrl_info, device, id_phys); ++ ++ if (rc == 0 && device->lun_count == 0) ++ device->lun_count = 1; ++ ++ return rc; ++} ++ + static void pqi_show_volume_status(struct pqi_ctrl_info *ctrl_info, + struct pqi_scsi_dev *device) + { +@@ -1910,7 +1922,7 @@ static inline void pqi_remove_device(str + int rc; + int lun; + +- for (lun = 0; lun < device->multi_lun_device_lun_count; lun++) { ++ for (lun = 0; lun < device->lun_count; lun++) { + rc = pqi_device_wait_for_pending_io(ctrl_info, device, lun, + PQI_REMOVE_DEVICE_PENDING_IO_TIMEOUT_MSECS); + if (rc) +@@ -2089,6 +2101,7 @@ static void pqi_scsi_update_device(struc + existing_device->sas_address = new_device->sas_address; + existing_device->queue_depth = new_device->queue_depth; + existing_device->device_offline = false; ++ existing_device->lun_count = new_device->lun_count; + + if (pqi_is_logical_device(existing_device)) { + existing_device->is_external_raid_device = new_device->is_external_raid_device; +@@ -2121,10 +2134,6 @@ static void pqi_scsi_update_device(struc + existing_device->phy_connected_dev_type = new_device->phy_connected_dev_type; + memcpy(existing_device->box, new_device->box, sizeof(existing_device->box)); + memcpy(existing_device->phys_connector, new_device->phys_connector, sizeof(existing_device->phys_connector)); +- +- existing_device->multi_lun_device_lun_count = new_device->multi_lun_device_lun_count; +- if (existing_device->multi_lun_device_lun_count == 0) +- existing_device->multi_lun_device_lun_count = 1; + } + } + +@@ -6501,6 +6510,12 @@ static void pqi_slave_destroy(struct scs + mutex_unlock(&ctrl_info->scan_mutex); + return; + } ++ ++ device->lun_count--; ++ if (device->lun_count > 0) { ++ mutex_unlock(&ctrl_info->scan_mutex); ++ return; ++ } + + spin_lock_irqsave(&ctrl_info->scsi_device_list_lock, flags); + list_del(&device->scsi_device_list_entry); diff --git a/patches.suse/scsi-smartpqi-Correct-max-LUN-number.patch b/patches.suse/scsi-smartpqi-Correct-max-LUN-number.patch new file mode 100644 index 0000000..e9bb0a8 --- /dev/null +++ b/patches.suse/scsi-smartpqi-Correct-max-LUN-number.patch @@ -0,0 +1,34 @@ +From: Kevin Barnett +Date: Tue, 8 Nov 2022 13:21:48 -0600 +Subject: scsi: smartpqi: Correct max LUN number +Patch-mainline: v6.2-rc1 +Git-commit: 7c56850637ea820a89ce2f52fca66c5ae12d0f0a +References: bsc#1207315 + +Correct maximum LUN number for multi-actuator devices. + +When multi-actuator support was added to smartpqi, the maximum number of +LUNs supported for multi-actuator devices was supposed to be changed from +unlimited to 256, but the setting was inadvertently left at unlimited. + +Reviewed-by: Scott Benesh +Reviewed-by: Scott Teel +Signed-off-by: Kevin Barnett +Signed-off-by: Don Brace +Link: https://lore.kernel.org/r/166793530842.322537.816949081443241857.stgit@brunhilda +Signed-off-by: Martin K. Petersen +Acked-by: Martin Wilck +--- + drivers/scsi/smartpqi/smartpqi_init.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/scsi/smartpqi/smartpqi_init.c ++++ b/drivers/scsi/smartpqi/smartpqi_init.c +@@ -7423,7 +7423,6 @@ static int pqi_register_scsi(struct pqi_ + shost->max_channel = PQI_MAX_BUS; + shost->max_cmd_len = MAX_COMMAND_SIZE; + shost->max_lun = PQI_MAX_LUNS_PER_DEVICE; +- shost->max_lun = ~0; + shost->max_id = ~0; + shost->max_sectors = ctrl_info->max_sectors; + shost->can_queue = ctrl_info->scsi_ml_can_queue; diff --git a/patches.suse/scsi-smartpqi-Initialize-feature-section-info.patch b/patches.suse/scsi-smartpqi-Initialize-feature-section-info.patch new file mode 100644 index 0000000..9df4863 --- /dev/null +++ b/patches.suse/scsi-smartpqi-Initialize-feature-section-info.patch @@ -0,0 +1,31 @@ +From: Don Brace +Date: Tue, 8 Nov 2022 13:22:09 -0600 +Subject: scsi: smartpqi: Initialize feature section info +Patch-mainline: v6.2-rc1 +Git-commit: 921800a1deeaa832e4303e9335a31b4234c41ac1 +References: bsc#1207315 + +Initialize features to 0 before processing. + +Reviewed-by: Scott Benesh +Reviewed-by: Mike Mcgowan +Reviewed-by: Kevin Barnett +Signed-off-by: Don Brace +Link: https://lore.kernel.org/r/166793532902.322537.2436075977808555348.stgit@brunhilda +Signed-off-by: Martin K. Petersen +Acked-by: Martin Wilck +--- + drivers/scsi/smartpqi/smartpqi_init.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/scsi/smartpqi/smartpqi_init.c ++++ b/drivers/scsi/smartpqi/smartpqi_init.c +@@ -8004,7 +8004,7 @@ static int pqi_process_config_table(stru + struct pqi_config_table *config_table; + struct pqi_config_table_section_header *section; + struct pqi_config_table_section_info section_info; +- struct pqi_config_table_section_info feature_section_info; ++ struct pqi_config_table_section_info feature_section_info = {0}; + + table_length = ctrl_info->config_table_length; + if (table_length == 0) diff --git a/patches.suse/scsi-smartpqi-Replace-one-element-array-with-flexibl-ead82126.patch b/patches.suse/scsi-smartpqi-Replace-one-element-array-with-flexibl-ead82126.patch new file mode 100644 index 0000000..bc381d7 --- /dev/null +++ b/patches.suse/scsi-smartpqi-Replace-one-element-array-with-flexibl-ead82126.patch @@ -0,0 +1,50 @@ +From: "Gustavo A. R. Silva" +Date: Tue, 7 Feb 2023 15:59:43 -0600 +Subject: scsi: smartpqi: Replace one-element array with flexible-array member +Patch-mainline: v6.3-rc1 +Git-commit: ead821268c14a8f87b5cb1079aed10bb16373fe8 +References: bsc#1207315 + +One-element arrays are deprecated, and we are replacing them with flexible +array members instead. So, replace one-element array with flexible-array +member in struct report_log_lun_list. + +This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines +on memcpy(). + +Link: https://lore.kernel.org/r/Y+LJz/r6+UeLqnV3@work +Link: https://github.com/KSPP/linux/issues/79 +Link: https://github.com/KSPP/linux/issues/204 +Signed-off-by: Gustavo A. R. Silva +Acked-by: Don Brace +Reviewed-by: Kees Cook +Signed-off-by: Martin K. Petersen +Acked-by: Martin Wilck +--- + drivers/scsi/smartpqi/smartpqi.h | 2 +- + drivers/scsi/smartpqi/smartpqi_init.c | 3 ++- + 2 files changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/scsi/smartpqi/smartpqi.h ++++ b/drivers/scsi/smartpqi/smartpqi.h +@@ -954,7 +954,7 @@ struct report_log_lun { + + struct report_log_lun_list { + struct report_lun_header header; +- struct report_log_lun lun_entries[1]; ++ struct report_log_lun lun_entries[]; + }; + + struct report_phys_lun_8byte_wwid { +--- a/drivers/scsi/smartpqi/smartpqi_init.c ++++ b/drivers/scsi/smartpqi/smartpqi_init.c +@@ -1259,7 +1259,8 @@ static int pqi_get_device_lists(struct p + "report logical LUNs failed\n"); + + /* +- * Tack the controller itself onto the end of the logical device list. ++ * Tack the controller itself onto the end of the logical device list ++ * by adding a list entry that is all zeros. + */ + + logdev_data = *logdev_list; diff --git a/series.conf b/series.conf index 007771c..6e06204 100644 --- a/series.conf +++ b/series.conf @@ -36435,6 +36435,14 @@ patches.suse/scsi-qla2xxx-Fix-set-but-not-used-variable-warnings.patch patches.suse/scsi-qla2xxx-Remove-unused-variable-found_devs.patch patches.suse/scsi-lpfc-Remove-redundant-pointer-lp.patch + patches.suse/scsi-smartpqi-Convert-to-host_tagset.patch + patches.suse/scsi-smartpqi-Add-new-controller-PCI-IDs.patch + patches.suse/scsi-smartpqi-Correct-max-LUN-number.patch + patches.suse/scsi-smartpqi-Change-sysfs-raid_level-attribute-to-N.patch + patches.suse/scsi-smartpqi-Correct-device-removal-for-multi-actua.patch + patches.suse/scsi-smartpqi-Add-controller-cache-flush-during-rmmo.patch + patches.suse/scsi-smartpqi-Initialize-feature-section-info.patch + patches.suse/scsi-smartpqi-Change-version-to-2.1.20-035.patch patches.suse/scsi-scsi_debug-Fix-a-warning-in-resp_write_scat.patch patches.suse/scsi-lpfc-Use-memset_startat-helper.patch patches.suse/scsi-lpfc-Fix-WQ-CQ-EQ-resource-check.patch @@ -36905,6 +36913,7 @@ patches.suse/ipmi_ssif-Rename-idle-state-and-check.patch patches.suse/ipmi-ssif-Remove-rtc_us_timer.patch patches.suse/ipmi-ssif-Add-a-timer-between-request-retries.patch + patches.suse/scsi-smartpqi-Replace-one-element-array-with-flexibl-ead82126.patch patches.suse/mm-memcontrol-deprecate-charge-moving.patch patches.suse/ibmvnic-Assign-XPS-map-to-correct-queue-index.patch patches.suse/0001-net-tls-fix-possible-race-condition-between-do_tls_g.patch