aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-10-16scsi: atp870u: Call scsi_done() directlyBart Van Assche1-12/+1
Conditional statements are faster than indirect calls. Hence call scsi_done() directly. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: arcmsr: Call scsi_done() directlyBart Van Assche1-9/+8
Conditional statements are faster than indirect calls. Hence call scsi_done() directly. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: aic7xxx: Call scsi_done() directlyBart Van Assche2-4/+2
Conditional statements are faster than indirect calls. Hence call scsi_done() directly. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: aha1542: Call scsi_done() directlyBart Van Assche1-6/+4
Conditional statements are faster than indirect calls. Hence call scsi_done() directly. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: aha152x: Call scsi_done() directlyBart Van Assche1-10/+17
Conditional statements are faster than indirect calls. Hence call scsi_done() and reset_done() directly. The changes in this patch are as follows: - Remove the 'done' argument from aha152x_internal_queue(). - Change ptr->scsi_done(ptr) into aha152x_scsi_done(ptr). - Inside aha152x_scsi_done(), check the 'resetting' flag of SCp.phase since aha152x_internal_queue() specifies the 'reset_done' function pointer if and only if the third argument has the value 'resetting'. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: advansys: Call scsi_done() directlyBart Van Assche1-2/+1
Conditional statements are faster than indirect calls. Hence call scsi_done() directly. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: acornscsi: Call scsi_done() directlyBart Van Assche1-5/+1
Conditional statements are faster than indirect calls. Hence call scsi_done() directly. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: aacraid: Call scsi_done() directlyBart Van Assche1-5/+11
The aacraid driver invokes scmd->scsi_done(scmd) for two types of SCSI commands: - SCSI commands initialized by the SCSI mid-layer. - SCSI commands initialized by aac_probe_container(). The processing sequence for SCSI commands allocated by aac_probe_container() is as follows: aac_probe_container() -> _aac_probe_container(scmd, aac_probe_container_callback1) -> scmd->SCp.ptr = aac_probe_container_callback1 -> aac_fib_send(..., _aac_probe_container1, scmd) -> fibptr->callback = _aac_probe_container1 -> fibptr->callback_data = scmd fibptr->callback(scmd) -> _aac_probe_container1(scmd, fibptr) [ ... ] -> _aac_probe_container2(scmd, fibptr) -> Call scmd->SCp.ptr == aac_probe_container_callback1 -> scmd->device = NULL; The processing sequence for SCSI commands allocated by the SCSI mid-layer if _aac_probe_container() is called is as follows: aac_queuecommand() -> aac_scsi_cmd() -> _aac_probe_container(scmd, aac_probe_container_callback2) -> scmd->SCp.ptr = aac_probe_container_callback2 -> aac_fib_send(..., _aac_probe_container1, scmd) fibptr->callback(scmd) -> _aac_probe_container1(scmd, fibptr) [ ... ] -> _aac_probe_container2(scmd, fibptr) -> Call scmd->SCp.ptr == aac_probe_container_callback2 Preserve the existing call sequences by calling scsi_done() for commands submitted by the mid-layer or aac_probe_container_scsi_done() for commands submitted by aac_probe_container(). Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: aacraid: Introduce aac_scsi_done()Bart Van Assche1-17/+22
This patch does not change any functionality but makes the next patch in this series easier to read. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: a100u2w: Call scsi_done() directlyBart Van Assche1-2/+1
Conditional statements are faster than indirect calls. Hence call scsi_done() directly. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: NCR5380: Call scsi_done() directlyBart Van Assche1-6/+6
Conditional statements are faster than indirect calls. Hence call scsi_done() directly. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: BusLogic: Call scsi_done() directlyBart Van Assche1-5/+4
Conditional statements are faster than indirect calls. Hence call scsi_done() directly. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: 53c700: Call scsi_done() directlyBart Van Assche1-3/+2
Conditional statements are faster than indirect calls. Hence call scsi_done() directly. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: 3w-xxxx: Call scsi_done() directlyBart Van Assche1-8/+5
Conditional statements are faster than indirect calls. Hence call scsi_done() directly. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: 3w-sas: Call scsi_done() directlyBart Van Assche1-5/+2
Conditional statements are faster than indirect calls. Hence call scsi_done() directly. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: 3w-9xxx: Call scsi_done() directlyBart Van Assche1-5/+2
Conditional statements are faster than indirect calls. Hence call scsi_done() directly. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: zfcp_scsi: Call scsi_done() directlyBart Van Assche2-3/+3
Conditional statements are faster than indirect calls. Hence call scsi_done() directly. Link: https://lore.kernel.org/r/[email protected] Acked-by: Benjamin Block <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: message: fusion: Call scsi_done() directlyBart Van Assche4-11/+11
Conditional statements are faster than indirect calls. Hence call scsi_done() directly. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: ib_srp: Call scsi_done() directlyBart Van Assche1-4/+4
Conditional statements are faster than indirect calls. Hence call scsi_done() directly. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: firewire: sbp2: Call scsi_done() directlyBart Van Assche1-1/+1
Conditional statements are faster than indirect calls. Hence call scsi_done() directly. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: ata: Call scsi_done() directlyBart Van Assche2-8/+8
Conditional statements are faster than indirect calls. Hence call scsi_done() directly. Link: https://lore.kernel.org/r/[email protected] Acked-by: Damien Le Moal <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: core: Rename scsi_mq_done() into scsi_done() and export itBart Van Assche2-2/+5
Since the removal of the legacy block layer there is only one completion function left in the SCSI core, namely scsi_mq_done(). Rename it into scsi_done(). Export that function to allow SCSI LLDs to call it directly. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Benjamin Block <[email protected]> Reviewed-by: Bean Huo <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: core: Use a structure member to track the SCSI command submitterBart Van Assche4-11/+24
Conditional statements are faster than indirect calls. Use a structure member to track the SCSI command submitter such that later patches can call scsi_done(scmd) instead of scmd->scsi_done(scmd). The asymmetric behavior that scsi_send_eh_cmnd() sets the submission context to the SCSI error handler and that it does not restore the submission context to the SCSI core is retained. Link: https://lore.kernel.org/r/[email protected] Cc: Hannes Reinecke <[email protected]> Cc: Ming Lei <[email protected]> Cc: Christoph Hellwig <[email protected]> Reviewed-by: Benjamin Block <[email protected]> Reviewed-by: Bean Huo <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: core: pm: Only runtime resume if necessaryBart Van Assche2-55/+20
The following query shows which drivers define callbacks that are called by the power management support code in the SCSI core (scsi_pm.c): $ git grep -nHEwA16 "$(echo $(git grep -h 'scsi_register_driver(&' | sed 's/.*&//;s/\..*//') | sed 's/ /|/g')" | grep '\.pm[[:blank:]]*=[[:blank:]]' drivers/scsi/sd.c-620- .pm = &sd_pm_ops, drivers/scsi/sr.c-100- .pm = &sr_pm_ops, drivers/scsi/ufs/ufshcd.c-9765- .pm = &ufshcd_wl_pm_ops, Since unconditionally runtime resuming a device during system resume is not necessary, remove that code. Modify the SCSI disk (sd) driver such that it follows the same approach as the UFS driver, namely to skip system suspend and resume for devices that are runtime suspended. The CD-ROM code does not need to be updated since its PM callbacks do not affect the device power state. This patch has been tested as follows: [ shell 1 ] cd /sys/kernel/debug/tracing grep -E 'blk_(pre|post)_runtime|runtime_(suspend|resume)|autosuspend_delay|pm_runtime_(get|put)' available_filter_functions | while read a b; do echo "$a"; done | grep -v __pm_runtime_resume >set_ftrace_filter echo function > current_tracer echo 1 > tracing_on cat trace_pipe [ shell 2 ] cd /sys/block/sr0 # Increase the event poll interval to make it easier to derive from the # tracing output whether runtime power actions are the result of sg_inq. echo 30000 > events_poll_msecs cd device/power # Enable runtime power management. echo auto > control echo 1000 > autosuspend_delay_ms sleep 1 # Verify in shell 1 that sr0 has been runtime suspended sg_inq /dev/sr0 eject /dev/sr0 sg_inq /dev/sr0 # Disable runtime power management. echo on > control cd /sys/block/sda/device/power echo auto > control echo 1000 > autosuspend_delay_ms sleep 1 # Verify in shell 1 that sr0 has been runtime suspended sg_inq /dev/sda Link: https://lore.kernel.org/r/[email protected] Cc: Alan Stern <[email protected]> Cc: Dan Williams <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Martin Kepplinger <[email protected]> Tested-by: Martin Kepplinger <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: sd: Rename sd_resume() into sd_resume_system()Bart Van Assche1-3/+8
This patch does not change any functionality but makes the next patch in this series easier to read. Link: https://lore.kernel.org/r/[email protected] Cc: Alan Stern <[email protected]> Cc: Dan Williams <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Martin Kepplinger <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-16scsi: core: pm: Rely on the device driver core for async power managementBart Van Assche7-54/+22
Instead of implementing asynchronous resume support in the SCSI core, rely on the device driver core for resuming SCSI devices asynchronously. Instead of only supporting asynchronous resumes, also support asynchronous suspends. Link: https://lore.kernel.org/r/[email protected] Cc: Alan Stern <[email protected]> Cc: Dan Williams <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Martin Kepplinger <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-12scsi: Documentation: Fix typo in sysfs-driver-ufsSohaib Mohamed1-1/+1
Remove repeated word: "the The amount" Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sohaib Mohamed <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-12scsi: hisi_sas: Disable SATA disk phy for severe I_T nexus reset failureLuo Jiaxing1-5/+24
If the softreset fails in the I_T reset, libsas will then continue to issue a controller reset to try to recover. However a faulty disk may cause the softreset to fail, and resetting the controller will not help this scenario. Indeed, we will just continue the cycle of error handle handling to try to recover. So if the softreset fails upon certain conditions, just disable the phy associated with the disk. The user needs to handle this problem. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Luo Jiaxing <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-12scsi: libsas: Export sas_phy_enable()Luo Jiaxing2-1/+3
Export sas_phy_enable() so LLDDs can directly use it to control remote phys. We already do this for companion function sas_phy_reset(). Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Luo Jiaxing <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-12scsi: hisi_sas: Wait for phyup in hisi_sas_control_phy()Xiang Chen4-41/+39
When issuing a hardreset/linkreset/phy_set_linkrate from sysfs, the phy will be disabled and re-enabled for the directly attached scenario. It takes some time for the phy to come back up after re-enabling the phy. If the controller becomes suspended while waiting for the phy to come back, the phy up may be lost (along with the disk). To solve this problem, wait for the phy up to occur with a timeout. Indeed this is already done in hisi_sas_debug_I_T_nexus_reset() for local phys, so just relocate the functionality to hisi_sas_control_phy(). Since the HA workqueue is drained when suspending the controller, and the phy control function is called from the same workqueue, we can guarantee that the controller will not be suspended during this period. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Xiang Chen <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-12scsi: hisi_sas: Initialise devices in .slave_alloc callbackXiang Chen5-6/+18
Perform driver-specific SCSI device initialization in the designated SCSI midlayer callback instead of relying on the libsas "device found" callback. The SCSI midlayer .slave_alloc interface is called prior to sending any I/O to the device. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Xiang Chen <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-12scsi: core: Put LLD module refcnt after SCSI device is releasedMing Lei2-1/+12
SCSI host release is triggered when SCSI device is freed. We have to make sure that the low-level device driver module won't be unloaded before SCSI host instance is released because shost->hostt is required in the release handler. Make sure to put LLD module refcnt after SCSI device is released. Fixes a kernel panic of 'BUG: unable to handle page fault for address' reported by Changhui and Yi. Link: https://lore.kernel.org/r/[email protected] Cc: Greg Kroah-Hartman <[email protected]> Reported-by: Changhui Zhong <[email protected]> Reported-by: Yi Zhang <[email protected]> Tested-by: Yi Zhang <[email protected]> Signed-off-by: Ming Lei <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-12scsi: storvsc: Fix validation for unsolicited incoming packetsAndrea Parri (Microsoft)1-9/+23
The validation on the length of incoming packets performed in storvsc_on_channel_callback() does not apply to unsolicited packets with ID of 0 sent by Hyper-V. Adjust the validation for such unsolicited packets. Link: https://lore.kernel.org/r/[email protected] Fixes: 91b1b640b834b2 ("scsi: storvsc: Validate length of incoming packet in storvsc_on_channel_callback()") Reported-by: Dexuan Cui <[email protected]> Reviewed-by: Michael Kelley <[email protected]> Reviewed-by: Haiyang Zhang <[email protected]> Signed-off-by: Andrea Parri (Microsoft) <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-12scsi: ufs: core: Fix synchronization between scsi_unjam_host() and ↵Adrian Hunter1-0/+12
ufshcd_queuecommand() The SCSI error handler calls scsi_unjam_host() which can call the queue function ufshcd_queuecommand() indirectly. The error handler changes the state to UFSHCD_STATE_RESET while running, but error interrupts that happen while the error handler is running could change the state to UFSHCD_STATE_EH_SCHEDULED_NON_FATAL which would allow requests to go through ufshcd_queuecommand() even though the error handler is running. Block that hole by checking whether the error handler is in progress. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Asutosh Das <[email protected]> Signed-off-by: Adrian Hunter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-12scsi: ufs: mediatek: Support vops pre suspend to disable auto-hibern8Peter Wang7-9/+114
Mediatek UFS needs auto-hibern8 disabled before suspend. Introduce a solution to do pre-suspend before SSU (sleep). Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Bart Van Assche <[email protected]> Reviewed-by: Bean Huo <[email protected]> Signed-off-by: Peter Wang <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-12scsi: iscsi: Fix set_param() handlingMike Christie1-2/+0
In commit 9e67600ed6b8 ("scsi: iscsi: Fix race condition between login and sync thread") we meant to add a check where before we call ->set_param() we make sure the iscsi_cls_connection is bound. The problem is that between versions 4 and 5 of the patch the deletion of the unchecked set_param() call was dropped so we ended up with 2 calls. As a result we can still hit a crash where we access the unbound connection on the first call. This patch removes that first call. Fixes: 9e67600ed6b8 ("scsi: iscsi: Fix race condition between login and sync thread") Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Lee Duncan <[email protected]> Reviewed-by: Li Feng <[email protected]> Signed-off-by: Mike Christie <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-12scsi: core: Fix shost->cmd_per_lun calculation in scsi_add_host_with_dma()Dexuan Cui1-1/+2
After commit ea2f0f77538c ("scsi: core: Cap scsi_host cmd_per_lun at can_queue"), a 416-CPU VM running on Hyper-V hangs during boot because the hv_storvsc driver sets scsi_driver.can_queue to an integer value that exceeds SHRT_MAX, and hence scsi_add_host_with_dma() sets shost->cmd_per_lun to a negative "short" value. Use min_t(int, ...) to work around the issue. Link: https://lore.kernel.org/r/[email protected] Fixes: ea2f0f77538c ("scsi: core: Cap scsi_host cmd_per_lun at can_queue") Cc: [email protected] Reviewed-by: Haiyang Zhang <[email protected]> Reviewed-by: Ming Lei <[email protected]> Reviewed-by: John Garry <[email protected]> Signed-off-by: Dexuan Cui <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-12scsi: csiostor: Uninitialized data in csio_ln_vnp_read_cbfn()Dan Carpenter1-1/+1
This variable is just a temporary variable, used to do an endian conversion. The problem is that the last byte is not initialized. After the conversion is completely done, the last byte is discarded so it doesn't cause a problem. But static checkers and the KMSan runtime checker can detect the uninitialized read and will complain about it. Link: https://lore.kernel.org/r/20211006073242.GA8404@kili Fixes: 5036f0a0ecd3 ("[SCSI] csiostor: Fix sparse warnings.") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-12Merge branch '5.15/scsi-fixes' into 5.16/scsi-stagingMartin K. Petersen40-349/+335
Merge the 5.15/scsi-fixes branch into the staging tree to resolve UFS conflict reported by sfr. Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-05scsi: smartpqi: Update version to 2.1.12-055Don Brace1-3/+3
Update driver version to reflect changes. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Acked-by: John Donnelly <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-05scsi: smartpqi: Add 3252-8i PCI idMike McGowen1-0/+4
Add PCI ID information for the Adaptec SmartRAID 3252-8i controller: 9005 / 028F / 9005 / 14A2 Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Scott Teel <[email protected]> Acked-by: John Donnelly <[email protected]> Signed-off-by: Mike McGowen <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-05scsi: smartpqi: Fix duplicate device nodes for tape changersKevin Barnett2-4/+20
Stop the OS from re-discovering multiple LUNs for tape drive and medium changer. Duplicate device nodes for Ultrium tape drive and medium changer are being created. The Ultrium tape drive is a multi-LUN SCSI target. It presents a LUN for the tape drive and a 2nd LUN for the medium changer. Our controller FW lists both LUNs in the RPL results. As a result, the smartpqi driver exposes both devices to the OS. Then the OS does its normal device discovery via the SCSI REPORT LUNS command, which causes it to re-discover both devices a 2nd time, which results in the duplicate device nodes. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Acked-by: John Donnelly <[email protected]> Signed-off-by: Kevin Barnett <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-05scsi: smartpqi: Fix boot failure during LUN rebuildMike McGowen1-1/+1
Move the delay in the register polling loop to the beginning of the loop to ensure there is always a delay between writing the register and reading it. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Scott Teel <[email protected]> Acked-by: John Donnelly <[email protected]> Signed-off-by: Mike McGowen <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-05scsi: smartpqi: Add extended report physical LUNsMike McGowen3-59/+147
Add support for the new extended formats in the data returned from the Report Physical LUNs command for controllers that enable this feature. The new formats allow the reporting of 16-byte WWIDs. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Scott Teel <[email protected]> Acked-by: John Donnelly <[email protected]> Signed-off-by: Mike McGowen <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-05scsi: smartpqi: Avoid failing I/Os for offline devicesMahesh Rajashekhara1-1/+8
Prevent kernel crash by failing outstanding I/O request when the OS takes device offline. When posted I/Os to the controller's inbound queue are not picked by the controller, the driver will halt the controller and take the controller offline. When the driver takes the controller offline, the driver will fail all the outstanding requests which can sometimes lead to an OS crash. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Scott Teel <[email protected]> Acked-by: John Donnelly <[email protected]> Signed-off-by: Mahesh Rajashekhara <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-05scsi: smartpqi: Add TEST UNIT READY check for SANITIZE operationDon Brace1-0/+87
Send a TEST UNIT READY to HBA disks and do not present them to the OS if 0x02/0x04/0x1b (SANITIZE IN PROGRESS) is returned. During boot-up, some OSes appear to hang when there are one or more disks undergoing a sanitize operation. According to SCSI SBC4 specification section 4.11.2 "Commands allowed during SANITIZE", some SCSI commands are permitted, but read/write operations are not. When the OS attempts to read the disk partition table a CHECK CONDITION ASC 0x04 ASCQ 0x1b is returned which causes the OS to retry the read until SANITIZE has completed. This can take hours. According to document HPE Smart Storage Administrator User Guide, during the sanitize erase operation, the drive is unusable. I.e. the expected behavior for SANITIZE is the that disk remains offline even after SANITIZE has completed. The customer is expected to re-enable the disk using the management utility. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Acked-by: John Donnelly <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-05scsi: smartpqi: Update LUN reset handlerKevin Barnett1-39/+66
Enhance check for commands queued to the controller. Add new function pqi_nonempty_inbound_queue_count() that will wait for all I/O queued for submission to controller across all queue groups to drain. Add helper functions to obtain queue command counts for each queue group. These queues should drain quickly as they are already staged to be submitted down to the controller's IB queue. Enhance check for outstanding command completion. Update the count of outstanding commands while waiting. This value was not re-obtained and was potentially causing infinite wait for all completions. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Acked-by: John Donnelly <[email protected]> Signed-off-by: Kevin Barnett <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-05scsi: smartpqi: Capture controller reason codesMurthy Bhat4-20/+57
In some rare cases, the driver can halt the controller. Add a reason code describing why the controller was halted. Store this reason code in a controller register to aid in debugging the issue. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Acked-by: John Donnelly <[email protected]> Signed-off-by: Murthy Bhat <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-05scsi: smartpqi: Add controller handshake during kdumpMahesh Rajashekhara3-2/+91
Correct kdump hangs when controller is locked up. There are occasions when a controller reboot (controller soft reset) is issued when a controller firmware crash dump is in progress. This leads to incomplete controller firmware crash dump: - When the controller crash dump is in progress, and a kdump is initiated, the driver issues inbound doorbell reset to bring back the controller in SIS mode. - If the controller is in locked up state, the inbound doorbell reset does not work causing controller initialization failures. This results in the driver hanging waiting for SIS mode. To avoid an incomplete controller crash dump, add in a controller crash dump handshake: - Controller will indicate start and end of the controller crash dump by setting some register bits. - Driver will look these bits when a kdump is initiated. If a controller crash dump is in progress, the driver will wait for the controller crash dump to complete before issuing the controller soft reset then complete driver initialization. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Acked-by: John Donnelly <[email protected]> Signed-off-by: Mahesh Rajashekhara <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-10-05scsi: smartpqi: Update device removal managementDon Brace1-36/+28
Update device removal path to handle issues for: - rmmod: Correct stack trace when removing devices. - rmmod: Synchronize SCSI cache. - Update handling for removing devices using sysfs. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Acked-by: John Donnelly <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>