smartpqi updates
Subsystems (2)
Don Brace
maintainercover smartpqi updates
These patches are based on Martin Petersen's 6.16/scsi-queue tree
https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git
6.16/scsi-queue
There are two main functional changes in this patch series:
smartpqi-take-drives-offline-when-controller-is-offline smartpqi-fix-smp_processor_id-call-trace-for-preemptible-kernels
The other two patches add PCI-IDs for new controllers and change the driver version.
This set of changes consists of:
* smartpqi-take-drives-offline-when-controller-is-offline On rare occasions, the controller can lock up and the driver was removing the controller instance from OS but leaving the drives exposed and their state was still 'running'.
This patch sets the drive state as 'offline' to avoid confusion.
* smartpqi-add-new-pci_ids
Add support for more PCI devices.
* smartpqi-enhance_wwid-logging-logic
Cosmetic change for logging WWIDs for NVMe devices and for drives that support the extended format.
* smartpqi-fix-smp_processor_id-call-trace-for-preemptible-kernels When preemption is enabled, there are call traces in the console logs which are annoying. The call trace mentions using smp_processor_id(). Since the driver is only using this function call when accessing a per_cpu variable, we changed the call to raw_smp_processor_id(). This patch was written by
Yi Zhang <[email protected]> and I am posting it on his behalf.
* smartpqi-update-driver-version-to-2.1.34-035
No functional changes.
---
David Strahan (2):
smartpqi: take drives offline when controller is offline
smartpqi: add new pci ids
Don Brace (1):
smartpqi: update driver version to 2.1.34-035
Venkatesh Emparala (1):
Enhance WWID Logging Logic.
Yi Zhang (1):
smartpqi: fix smp_processor_id() call trace for preemptible kernels
drivers/scsi/smartpqi/smartpqi_init.c | 140 ++++++++++++++++++++++++-- 1 file changed, 130 insertions(+), 10 deletions(-)
Signature · 1 line
2.49.0.391.g4bbb303af6
Don Brace
maintainerPATCH 1/5 smartpqi: take drives offline when controller is offline
From: David Strahan <[email protected]>
When the controller is unexpectedly taken offline, show its drives as offline.
During a controller lockup, the physical and logical drives under the locked up controller are still listed at the OS level.
I.E.
The controller is offline but the status of each drive is 'running'.
--- drivers/scsi/smartpqi/smartpqi_init.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
drivers/scsi/smartpqi/smartpqi_init.c +23 -0
@@ -67,6 +67,7 @@ static struct pqi_cmd_priv *pqi_cmd_priv(struct scsi_cmnd *cmd)static void pqi_verify_structures (void );static void pqi_take_ctrl_offline (struct pqi_ctrl_info *ctrl_info,enum pqi_ctrl_shutdown_reason ctrl_shutdown_reason); +static void pqi_take_ctrl_devices_offline (struct pqi_ctrl_info *ctrl_info);static void pqi_ctrl_offline_worker (struct work_struct *work);static int pqi_scan_scsi_devices (struct pqi_ctrl_info *ctrl_info);static void pqi_scan_start (struct Scsi_Host *shost);
@@ -9128,6 +9129,7 @@ static void pqi_take_ctrl_offline_deferred(struct pqi_ctrl_info *ctrl_info)pqi_ctrl_wait_until_quiesced (ctrl_info);pqi_fail_all_outstanding_requests (ctrl_info);pqi_ctrl_unblock_requests (ctrl_info); +pqi_take_ctrl_devices_offline (ctrl_info); }static void pqi_ctrl_offline_worker (struct work_struct *work)
@@ -9202,6 +9204,27 @@ static void pqi_take_ctrl_offline(struct pqi_ctrl_info *ctrl_info,schedule_work (&ctrl_info->ctrl_offline_work); } +static void pqi_take_ctrl_devices_offline (struct pqi_ctrl_info *ctrl_info) +{ +int rc; +unsigned long flags; +struct pqi_scsi_dev *device; + +spin_lock_irqsave (&ctrl_info->scsi_device_list_lock, flags); +list_for_each_entry (device, &ctrl_info->scsi_device_list, scsi_device_list_entry) { + rc =list_is_last (&device->scsi_device_list_entry, &ctrl_info->scsi_device_list); +if (rc) +continue ; + +/* +* Is the sdev pointer NULL? +*/ +if (device->sdev) +scsi_device_set_state (device->sdev,SDEV_OFFLINE ); + } +spin_unlock_irqrestore (&ctrl_info->scsi_device_list_lock, flags); +} +static void pqi_print_ctrl_info (struct pci_dev *pci_dev,const struct pci_device_id *id) {
Signature · 1 line
2.49.0.391.g4bbb303af6
Don Brace
maintainerPATCH 2/5 smartpqi: add new pci ids
In reply to Don BraceFrom: David Strahan <[email protected]>
Add in support for more PCI devices.
All PCI ID entries in Hex.
Add PCI IDs for Ramaxel controllers:
VID / DID / SVID / SDID
---- ---- ---- ----
Ramaxel SmartHBA RX8238-16i 9005 028f 1018 8238
Ramaxel SSSRAID card 9005 028f 1f3f 0610
Add PCI ID for Alibaba controller:
VID / DID / SVID / SDID
---- ---- ---- ----
HBA AS1340 9005 028f 1ded 3301Add PCI IDs for Inspur controller:
VID / DID / SVID / SDID
---- ---- ---- ----
RT0800M6E2i 9005 028f 1bd4 00a3Add PCI IDs for Delta controllers:
VID / DID / SVID / SDID
---- ---- ---- ----
ThinkSystem 4450-8i SAS/SATA/NVMe PCIe Gen4 9005 028f 1d49 0222
24Gb HBA
ThinkSystem 4450-16i SAS/SATA/NVMe PCIe Gen4 9005 028f 1d49 0223
24Gb HBA
ThinkSystem 4450-8e SAS/SATA PCIe Gen4 9005 028f 1d49 0224
24Gb HBA
ThinkSystem RAID 4450-16e PCIe Gen4 24Gb 9005 028f 1d49 0225
Adapter HBA
ThinkSystem RAID 5450-16i PCIe Gen4 24Gb Adapter 9005 028f 1d49 0521 ThinkSystem RAID 9450-8i 4GB Flash PCIe Gen4 9005 028f 1d49 0624
24Gb Adapter
ThinkSystem RAID 9450-16i 4GB Flash PCIe Gen4 9005 028f 1d49 0625
24Gb Adapter
ThinkSystem RAID 9450-16i 4GB Flash PCIe Gen4 9005 028f 1d49 0626
24Gb Adapter
ThinkSystem RAID 9450-32i 8GB Flash PCIe Gen4 9005 028f 1d49 0627
24Gb Adapter
ThinkSystem RAID 9450-16e 4GB Flash PCIe Gen4 9005 028f 1d49 0628
24Gb Adapter
Add PCI ID for Cloudnine Controller:
VID / DID / SVID / SDID
---- ---- ---- ----
SmartHBA P6600-24i 9005 028f 1f51 100bAdd PCI IDs for Hurraydata Controllers:
VID / DID / SVID / SDID
---- ---- ---- ----
HRDT TrustHBA H4100-8i 9005 028f 207d 4044
HRDT TrustHBA H4100-8e 9005 028f 207d 4054
HRDT TrustHBA H4100-16i 9005 028f 207d 4084
HRDT TrustHBA H4100-16e 9005 028f 207d 4094
HRDT TrustRAID D3152s-8i 9005 028f 207d 4140
HRDT TrustRAID D3154s-8i 9005 028f 207d 4240--- drivers/scsi/smartpqi/smartpqi_init.c | 84 +++++++++++++++++++++++++++ 1 file changed, 84 insertions(+)
drivers/scsi/smartpqi/smartpqi_init.c +84 -0
@@ -9731,6 +9731,10 @@ static const struct pci_device_id pqi_pci_id_table[] = {PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f ,0x1bd4 ,0x0089 ) }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +0x1bd4 ,0x00a3 ) + }, {PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f ,0x1ff9 ,0x00a1 )
@@ -10067,6 +10071,30 @@ static const struct pci_device_id pqi_pci_id_table[] = {PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f ,PCI_VENDOR_ID_ADAPTEC2 ,0x14f0 ) }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +0x207d ,0x4044 ) + }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +0x207d ,0x4054 ) + }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +0x207d ,0x4084 ) + }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +0x207d ,0x4094 ) + }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +0x207d ,0x4140 ) + }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +0x207d ,0x4240 ) + }, {PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f ,PCI_VENDOR_ID_ADVANTECH ,0x8312 )
@@ -10283,6 +10311,14 @@ static const struct pci_device_id pqi_pci_id_table[] = {PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f ,0x1cc4 ,0x0201 ) }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +0x1018 ,0x8238 ) + }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +0x1f3f ,0x0610 ) + }, {PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f ,PCI_VENDOR_ID_LENOVO ,0x0220 )
@@ -10291,10 +10327,30 @@ static const struct pci_device_id pqi_pci_id_table[] = {PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f ,PCI_VENDOR_ID_LENOVO ,0x0221 ) }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +PCI_VENDOR_ID_LENOVO ,0x0222 ) + }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +PCI_VENDOR_ID_LENOVO ,0x0223 ) + }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +PCI_VENDOR_ID_LENOVO ,0x0224 ) + }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +PCI_VENDOR_ID_LENOVO ,0x0225 ) + }, {PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f ,PCI_VENDOR_ID_LENOVO ,0x0520 ) }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +PCI_VENDOR_ID_LENOVO ,0x0521 ) + }, {PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f ,PCI_VENDOR_ID_LENOVO ,0x0522 )
@@ -10315,6 +10371,26 @@ static const struct pci_device_id pqi_pci_id_table[] = {PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f ,PCI_VENDOR_ID_LENOVO ,0x0623 ) }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +PCI_VENDOR_ID_LENOVO ,0x0624 ) + }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +PCI_VENDOR_ID_LENOVO ,0x0625 ) + }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +PCI_VENDOR_ID_LENOVO ,0x0626 ) + }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +PCI_VENDOR_ID_LENOVO ,0x0627 ) + }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +PCI_VENDOR_ID_LENOVO ,0x0628 ) + }, {PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f ,0x1014 ,0x0718 )
@@ -10343,6 +10419,10 @@ static const struct pci_device_id pqi_pci_id_table[] = {PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f ,0x1137 ,0x0300 ) }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +0x1ded ,0x3301 ) + }, {PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f ,0x1ff9 ,0x0045 )
@@ -10491,6 +10571,10 @@ static const struct pci_device_id pqi_pci_id_table[] = {PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f ,0x1f51 ,0x100a ) }, + { +PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f , +0x1f51 ,0x100b ) + }, {PCI_DEVICE_SUB (PCI_VENDOR_ID_ADAPTEC2 ,0x028f ,0x1f51 ,0x100e )
Signature · 1 line
2.49.0.391.g4bbb303af6
Don Brace
maintainerPATCH 3/5 Enhance WWID Logging Logic.
In reply to Don BraceFrom: Venkatesh Emparala <[email protected]>
Log the extended WWID for NVMe devices and for devices that have the firmware feature bit "PQI_FIRMWARE_FEATURE_RPL_EXTENDED_FORMAT_4_5" enabled.
Log 8-bytes otherwise.
--- drivers/scsi/smartpqi/smartpqi_init.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-)
drivers/scsi/smartpqi/smartpqi_init.c +18 -5
@@ -2011,18 +2011,31 @@ static void pqi_dev_info(struct pqi_ctrl_info *ctrl_info,PQI_DEV_INFO_BUFFER_LENGTH - count, "-:-"); -if (pqi_is_logical_device (device)) +if (pqi_is_logical_device (device)) { count +=scnprintf (buffer + count,PQI_DEV_INFO_BUFFER_LENGTH - count," %08x%08x" , *((u32 *)&device->scsi3addr), *((u32 *)&device->scsi3addr[4 ])); -else + }else if (ctrl_info->rpl_extended_format_4_5_supported) { +if (device->device_type ==SA_DEVICE_TYPE_NVME ) + count +=scnprintf (buffer + count, +PQI_DEV_INFO_BUFFER_LENGTH - count, +" %016llx%016llx" , +get_unaligned_be64 (&device->wwid[0 ]), +get_unaligned_be64 (&device->wwid[8 ])); +else + count +=scnprintf (buffer + count, +PQI_DEV_INFO_BUFFER_LENGTH - count, +" %016llx" , +get_unaligned_be64 (&device->wwid[0 ])); + }else { count +=scnprintf (buffer + count,PQI_DEV_INFO_BUFFER_LENGTH - count, -" %016llx%016llx" , -get_unaligned_be64 (&device->wwid[0 ]), -get_unaligned_be64 (&device->wwid[8 ])); +" %016llx" , +get_unaligned_be64 (&device->wwid[0 ])); + } + count += scnprintf(buffer + count, PQI_DEV_INFO_BUFFER_LENGTH - count, " %s %.8s %.16s ",
Signature · 1 line
2.49.0.391.g4bbb303af6
Don Brace
maintainerPATCH 4/5 smartpqi: fix smp_processor_id() call trace for preemptible kernels
In reply to Don BraceFrom: Yi Zhang <[email protected]>
Correct kernel call trace when calling smp_processor_id() when called in preemptible kernels by using raw_smp_processor_id().
smp_processor_id() checks to see if preemption is disabled and if not, issue an error message followed by a call to dump_stack().
Brief example of call trace:
kernel: check_preemption_disabled: 436 callbacks suppressed
kernel: BUG: using smp_processor_id() in preemptible [00000000]
code: kworker/u1025:0/2354
kernel: caller is pqi_scsi_queue_command+0x183/0x310 [smartpqi]
kernel: CPU: 129 PID: 2354 Comm: kworker/u1025:0
kernel: ...
kernel: Workqueue: writeback wb_workfn (flush-253:0)
kernel: Call Trace:
kernel: <TASK>
kernel: dump_stack_lvl+0x34/0x48
kernel: check_preemption_disabled+0xdd/0xe0
kernel: pqi_scsi_queue_command+0x183/0x310 [smartpqi]
kernel: ...--- drivers/scsi/smartpqi/smartpqi_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/smartpqi/smartpqi_init.c +2 -2
@@ -6003,7 +6003,7 @@ static bool pqi_is_parity_write_stream(struct pqi_ctrl_info *ctrl_info, pqi_stream_data->next_lba = rmd.first_block + rmd.block_cnt; pqi_stream_data->last_accessed = jiffies; -per_cpu_ptr (device->raid_io_stats,smp_processor_id ())->write_stream_cnt++; +per_cpu_ptr (device->raid_io_stats,raw_smp_processor_id ())->write_stream_cnt++;return true; }
@@ -6082,7 +6082,7 @@ static int pqi_scsi_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scm rc =pqi_raid_bypass_submit_scsi_cmd (ctrl_info, device, scmd, queue_group);if (rc ==0 || rc ==SCSI_MLQUEUE_HOST_BUSY ) { raid_bypassed = true; -per_cpu_ptr (device->raid_io_stats,smp_processor_id ())->raid_bypass_cnt++; +per_cpu_ptr (device->raid_io_stats,raw_smp_processor_id ())->raid_bypass_cnt++; } }if (!raid_bypassed)
Signature · 1 line
2.49.0.391.g4bbb303af6
Don Brace
maintainerPATCH 5/5 smartpqi: update driver version to 2.1.34-035
In reply to Don BraceUpdate driver version to 2.1.34-035.
--- drivers/scsi/smartpqi/smartpqi_init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/smartpqi/smartpqi_init.c +3 -3
@@ -32,11 +32,11 @@#define BUILD_TIMESTAMP #endif -#define DRIVER_VERSION "2.1.30-031" +#define DRIVER_VERSION "2.1.34-035"#define DRIVER_MAJOR 2#define DRIVER_MINOR 1 -#define DRIVER_RELEASE 30 -#define DRIVER_REVISION 31 +#define DRIVER_RELEASE 34 +#define DRIVER_REVISION 35#define DRIVER_NAME "Microchip SmartPQI Driver (v" \ DRIVER_VERSION BUILD_TIMESTAMP ")"
Signature · 1 line
2.49.0.391.g4bbb303af6
Martin K. Petersen
AppliedDon,
Quoted 3 lines
These patches are based on Martin Petersen's 6.16/scsi-queue tree
https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git
6.16/scsi-queue
Applied to 6.16/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen
Martin K. Petersen
AppliedQuoted 9 lines · Don Brace
These patches are based on Martin Petersen's 6.16/scsi-queue tree
https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git
6.16/scsi-queueThere are two main functional changes in this patch series:
smartpqi-take-drives-offline-when-controller-is-offline smartpqi-fix-smp_processor_id-call-trace-for-preemptible-kernels[...]
Applied to 6.16/scsi-queue, thanks!
[1/5] smartpqi: take drives offline when controller is offline
https://git.kernel.org/mkp/scsi/c/32c79c268078 [2/5] smartpqi: add new pci ids https://git.kernel.org/mkp/scsi/c/01b8bdddcfab [3/5] Enhance WWID Logging Logic. https://git.kernel.org/mkp/scsi/c/001164fc3082 [4/5] smartpqi: fix smp_processor_id() call trace for preemptible kernels https://git.kernel.org/mkp/scsi/c/42d033cf4b51 [5/5] smartpqi: update driver version to 2.1.34-035 https://git.kernel.org/mkp/scsi/c/6e6d9e85bad2
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering