Kevin Barnett
2d80f4054f
scsi: smartpqi: Update deleting a LUN via sysfs
...
Change removing a LUN using sysfs from an internal driver function
pqi_remove_all_scsi_devices() to using the .slave_destroy entry in the
scsi_host_template.
A LUN can be deleted via sysfs using this syntax:
echo 1 > /sys/block/sdX/device/delete
Link: https://lore.kernel.org/r/165730607154.177165.9723066932202995774.stgit@brunhilda
Reviewed-by: Scott Teel <scott.teel@microchip.com >
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com >
Signed-off-by: Don Brace <don.brace@microchip.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-13 23:42:04 -04:00
Mike McGowen
cf15c3e734
scsi: smartpqi: Add module param to disable managed ints
...
Allow SMP affinity to be changeable by disabling managed interrupts.
On distributions where the driver is enabled for multi-queue support the
driver utilizes kernel managed interrupts, which automatically distributes
interrupts to all available CPUs and assigns SMP affinity.
On most distributions, the affinity can not be changed by the user.
This change will allow managed interrupts to be disabled by the user via a
module parameter while still allowing multi-queue support to function
properly.
Use the module parameter disable_managed_interrupts=1
Link: https://lore.kernel.org/r/165730606638.177165.12846020942931640329.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com >
Reviewed-by: Scott Teel <scott.teel@microchip.com >
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com >
Signed-off-by: Mike McGowen <Mike.McGowen@microchip.com >
Signed-off-by: Don Brace <don.brace@microchip.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-13 23:42:04 -04:00
Kevin Barnett
6ce3cfb365
scsi: smartpqi: Fix RAID map race condition
...
Correct a rare stale RAID map access when performing AIO during a RAID
configuration change.
A race condition in the driver could cause it to access a stale RAID map
when a logical volume is reconfigured.
Modify the driver logic to invalidate a RAID map very early when a RAID
configuration change is detected and only switch to a new RAID map after
the driver detects that the RAID map has changed.
Link: https://lore.kernel.org/r/165730606128.177165.7671413443814750829.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com >
Reviewed-by: Scott Teel <scott.teel@microchip.com >
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com >
Signed-off-by: Don Brace <don.brace@microchip.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-13 23:42:04 -04:00
Mahesh Rajashekhara
69695aeaa6
scsi: smartpqi: Fix DMA direction for RAID requests
...
Correct a SOP READ and WRITE DMA flags for some requests.
This update corrects DMA direction issues with SCSI commands removed from
the controller's internal lookup table.
Currently, SCSI READ BLOCK LIMITS (0x5) was removed from the controller
lookup table and exposed a DMA direction flag issue.
SCSI READ BLOCK LIMITS was recently removed from our controller lookup
table so the controller uses the respective IU flag field to set the DMA
data direction. Since the DMA direction is incorrect the FW never completes
the request causing a hang.
Some SCSI commands which use SCSI READ BLOCK LIMITS
* sg_map
* mt -f /dev/stX status
After updating controller firmware, users may notice their tape units
failing. This patch resolves the issue.
Also, the AIO path DMA direction is correct.
The DMA direction flag is a day-one bug with no reported BZ.
Fixes: 6c223761eb ("smartpqi: initial commit of Microsemi smartpqi driver")
Link: https://lore.kernel.org/r/165730605618.177165.9054223644512926624.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com >
Reviewed-by: Scott Teel <scott.teel@microchip.com >
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com >
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com >
Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@microchip.com >
Signed-off-by: Don Brace <don.brace@microchip.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-13 23:42:04 -04:00
Kevin Barnett
85b41834b0
scsi: smartpqi: Stop logging spurious PQI reset failures
...
Change method used to detect controller firmware crash during PQI reset.
PQI reset can fail with error -6 if firmware takes > 100ms to complete
reset.
Method used by driver to detect controller firmware crash during PQI was
incorrect in some cases.
Link: https://lore.kernel.org/r/165730605108.177165.1132931838384767071.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com >
Reviewed-by: Scott Teel <scott.teel@microchip.com >
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com >
Signed-off-by: Don Brace <don.brace@microchip.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-13 23:42:03 -04:00
Mike McGowen
2a9c2ba2bc
scsi: smartpqi: Add PCI IDs for Lenovo controllers
...
Add PCI IDs for Lenovo controllers (values in hex):
VID / DID / SVID / SDID
---- ---- ---- ----
Lenovo 4350-8i HBA 9005 / 028f / 1d49 / 0220
Lenovo 4350-16i HBA 9005 / 028f / 1d49 / 0221
Lenovo 5350-8i RAID 9005 / 028f / 1d49 / 0520
Lenovo 5350-8i Internal RAID 9005 / 028f / 1d49 / 0522
Lenovo 9350-8i RAID 9005 / 028f / 1d49 / 0620
Lenovo 9350-8i Internal RAID 9005 / 028f / 1d49 / 0621
Lenovo 9350-16i RAID 9005 / 028f / 1d49 / 0622
Lenovo 9350-16i Internal RAID 9005 / 028f / 1d49 / 0623
Link: https://lore.kernel.org/r/165730604598.177165.9910276232981721083.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com >
Reviewed-by: Scott Teel <scott.teel@microchip.com >
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com >
Signed-off-by: Mike McGowen <Mike.McGowen@microchip.com >
Signed-off-by: Don Brace <don.brace@microchip.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-13 23:42:03 -04:00
Mike McGowen
44e68c4af5
scsi: smartpqi: Add PCI ID for Adaptec SmartHBA 2100-8i
...
Add the PCI ID for (values in hex):
VID / DID / SVID / SDID
---- ---- ---- ----
Adaptec SmartHBA 2100-8i-o 9005 / 0285 / 9005 / 0659
Link: https://lore.kernel.org/r/165730604089.177165.17257514581321583667.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com >
Reviewed-by: Scott Teel <scott.teel@microchip.com >
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com >
Signed-off-by: Mike McGowen <Mike.McGowen@microchip.com >
Signed-off-by: Don Brace <don.brace@microchip.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-13 23:42:03 -04:00
Sagar Biradar
331f7e998b
scsi: smartpqi: Fix PCI control linkdown system hang
...
Fail all outstanding requests after a PCI linkdown.
Block access to device SCSI attributes during the following conditions:
"Cable pull" is called PQI_CTRL_SURPRISE_REMOVAL.
"PCIe Link Down" is called PQI_CTRL_GRACEFUL_REMOVAL.
Block access to device SCSI attributes during and in rare instances when
the controller goes offline.
Either outstanding requests or the access of SCSI attributes post linkdown
can lead to a hang.
Post linkdown, driver does not fail the outstanding requests leading to
long wait time before all the IOs eventually fail.
Also access of the SCSI attributes by host applications can lead to a
system hang.
Link: https://lore.kernel.org/r/165730603578.177165.4699352086827187263.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com >
Reviewed-by: Scott Teel <scott.teel@microchip.com >
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com >
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com >
Signed-off-by: Sagar Biradar <sagar.biradar@microchip.com >
Signed-off-by: Don Brace <don.brace@microchip.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-13 23:42:03 -04:00
Kumar Meiyappan
904f2bfda6
scsi: smartpqi: Add driver support for multi-LUN devices
...
Add driver support for up to 256 LUNs per device.
Update AIO path to pass the appropriate LUN number for base-code to target
the correct LUN.
Update RAID IO path to pass the appropriate LUN number for FW to target the
correct LUN.
Pass the correct LUN number while doing a LUN reset.
Count the outstanding commands based on LUN number. While removing a
Multi-LUN device, wait for all outstanding commands to complete for all
LUNs.
Add Feature bit support.
Link: https://lore.kernel.org/r/165730603067.177165.14016422176841798336.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com >
Reviewed-by: Scott Teel <scott.teel@microchip.com >
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com >
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com >
Signed-off-by: Kumar Meiyappan <Kumar.Meiyappan@microchip.com >
Signed-off-by: Don Brace <don.brace@microchip.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-13 23:42:03 -04:00
Mike McGowen
297bdc540f
scsi: smartpqi: Close write read holes
...
Insert a minimum 1 millisecond delay after writing to a register before
reading from it.
SIS and PQI registers that can be both written to and read from can return
stale data if read from too soon after having been written to.
There is no read/write ordering or hazard detection on the inbound path to
the MSGU from the PCIe bus, therefore reads could pass writes.
Link: https://lore.kernel.org/r/165730602555.177165.11181012469428348394.stgit@brunhilda
Reviewed-by: Scott Teel <scott.teel@microchip.com >
Signed-off-by: Mike McGowen <mike.mcgowen@microchip.com >
Co-developed-by: Kevin Barnett <kevin.barnett@microchip.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com >
Signed-off-by: Don Brace <don.brace@microchip.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-13 23:42:03 -04:00
Murthy Bhat
dab5378485
scsi: smartpqi: Add PCI IDs for ramaxel controllers
...
Add the following controllers (values in hex):
VID / DID / SVID / SDID
---- / ---- / ---- / ----
Ramaxel FBGF-RAD PM8204 9005 / 028F / 1CC4 / 0101
Ramaxel FBGF-RAD PM8222 9005 / 028F / 1CC4 / 0201
Link: https://lore.kernel.org/r/165730602045.177165.3720208650043407285.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com >
Reviewed-by: Scott Teel <scott.teel@microchip.com >
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com >
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com >
Signed-off-by: Murthy Bhat <Murthy.Bhat@microchip.com >
Signed-off-by: Don Brace <don.brace@microchip.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-13 23:42:02 -04:00
Gilbert Wu
1d393227fc
scsi: smartpqi: Add controller fw version to console log
...
Print controller firmware version to OS message log during driver
initialization or after OFA.
Link: https://lore.kernel.org/r/165730601536.177165.17698744242908911822.stgit@brunhilda
Reviewed-by: Scott Benesh <scott.benesh@microchip.com >
Reviewed-by: Scott Teel <scott.teel@microchip.com >
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com >
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com >
Signed-off-by: Gilbert Wu <Gilbert.Wu@microchip.com >
Signed-off-by: Don Brace <don.brace@microchip.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-13 23:42:02 -04:00
Mike McGowen
4e7d26029e
scsi: smartpqi: Shorten drive visibility after removal
...
Check the response code returned from the LUN reset task management
function and if it indicates the LUN is not valid, do not retry.
Reduce rescan worker delay to 5 seconds for the event handler only.
The removal of a drive from the OS could have been delayed up to 30 seconds
after being physically pulled.
The driver was retrying a LUN reset 3 times even though the return code
indiciated the LUN was no longer valid. There was a 10 second delay between
each retry. Additionally, the rescan worker was scheduled to run 10 seconds
after the driver received the event.
Link: https://lore.kernel.org/r/165730601025.177165.9416869335174437006.stgit@brunhilda
Reviewed-by: Scott Teel <scott.teel@microchip.com >
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com >
Signed-off-by: Mike McGowen <Mike.McGowen@microchip.com >
Signed-off-by: Don Brace <don.brace@microchip.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-13 23:42:02 -04:00
Karan Tilak Kumar
aec95e3a8d
scsi: fnic: Refactor code in fnic probe to initialize SCSI layer
...
Refactor code from fnic probe into a different function so that
scsi layer initialization code is grouped together.
Also, add log messages for better debugging.
Link: https://lore.kernel.org/r/20220707205155.692688-1-kartilak@cisco.com
Co-developed-by: Gian Carlo Boffa <gcboffa@cisco.com >
Signed-off-by: Gian Carlo Boffa <gcboffa@cisco.com >
Co-developed-by: Arulprabhu Ponnusamy <arulponn@cisco.com >
Signed-off-by: Arulprabhu Ponnusamy <arulponn@cisco.com >
Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-13 23:21:10 -04:00
Michael Schmitz
f712e24c0b
scsi: gvp11.c: Fix DMA mask calculation error
...
DMA masks given in the Zorro ID table don't contain the 2 byte alignment
quirk seen in the GVP11_XFER_MASK macro from gvp11.h so no need to account
for that.
DMA masks passed to dma_set_mask_and_coherent() must be 64 bit, add the
missing cast in the TO_DMA_MASK macro used to convert driver DMA masks to
DMA API masks.
Link: https://lore.kernel.org/r/6d1d88ee-1cf6-c735-1e6d-bafd2096e322@gmail.com
Link: https://lore.kernel.org/r/20220713074913.7873-1-schmitzmic@gmail.com
Fixes: 158da6bcae ("scsi: gvp11: Convert m68k WD33C93 drivers to DMA API")
CC: linux-scsi@vger.kernel.org
Signed-off-by: Michael Schmitz <schmitzmic@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-13 23:18:26 -04:00
James Smart
b3d11f195c
scsi: lpfc: Copyright updates for 14.2.0.5 patches
...
Update copyrights to 2022 for files modified in the 14.2.0.5 patch set.
Link: https://lore.kernel.org/r/20220701211425.2708-13-jsmart2021@gmail.com
Co-developed-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-07 17:21:44 -04:00
James Smart
71faf8d30f
scsi: lpfc: Update lpfc version to 14.2.0.5
...
Update lpfc version to 14.2.0.5
Link: https://lore.kernel.org/r/20220701211425.2708-12-jsmart2021@gmail.com
Co-developed-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-07 17:21:44 -04:00
James Smart
7f86d2b847
scsi: lpfc: Remove Menlo/Hornet related code
...
The Menlo/Hornet adapter was never released to the field. As such, driver
code specific to the adapter is unnecessary and should be removed.
Link: https://lore.kernel.org/r/20220701211425.2708-11-jsmart2021@gmail.com
Co-developed-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-07 17:21:44 -04:00
James Smart
b21c9deb14
scsi: lpfc: Refactor lpfc_nvmet_prep_abort_wqe() into lpfc_sli_prep_abort_xri()
...
lpfc_nvmet_prep_abort_wqe() has a lot of common code with
lpfc_sli_prep_abort_xri().
Delete lpfc_nvmet_prep_abort_wqe() as the wqe can be filled out using the
generic lpfc_sli_prep_abort_xri routine(). Add the wqec option to
lpfc_sli_prep_abort_xri() for lpfc_nvmet_prep_abort_wqe().
Link: https://lore.kernel.org/r/20220701211425.2708-10-jsmart2021@gmail.com
Co-developed-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-07 17:21:44 -04:00
James Smart
ffc566411a
scsi: lpfc: Revert RSCN_MEMENTO workaround for misbehaved configuration
...
The RSCN_MEMENTO logic was to workaround a target that does not register
both FCP and NVMe FC4 types at the same time. This caused the
configuration to not produce a second RSCN for the NVMe FC4 type
registration in a timely manner. The intention of the RSCN_MEMENTO flag
was to always signal to try NVMe PRLI.
However, there are other FCP-only target arrays in correctly behaved
configurations that reject the NVMe PRLI followed by a LOGO leading to
never rediscovering the target after an issue_lip (as LOGO causes a repeat
of PLOGI/PRLIs).
Revert the RSCN_MEMENTO patch as it is causing correctly behaved configs to
fail while it exists only to succeed on a misbehaved config.
Link: https://lore.kernel.org/r/20220701211425.2708-9-jsmart2021@gmail.com
Fixes: 1045592fc9 ("scsi: lpfc: Introduce FC_RSCN_MEMENTO flag for tracking post RSCN completion")
Co-developed-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-07 17:21:44 -04:00
James Smart
ea92e173dc
scsi: lpfc: Fix lost NVMe paths during LIF bounce stress test
...
During a target link bounce test, the driver sees a mismatch between the
NPortId and the WWPN on the node structures (ndlps) involved. When this
occurs, the driver "swaps" the ndlp and new_ndlp node parameters to restore
WWPN/DID uniqueness in the fc_nodes list per vport. However, the driver
neglected to swap the nlp_fc4_type in the ndlp passed to
lpfc_plogi_confirm_nport causing a failure to recover the NVMe PLOGI/PRLI
and ultimately the NVMe paths.
Correct confirm_nport to preserve the fc4 types from the new-ndlp when the
data is moved over ot the ndlp structure.
Link: https://lore.kernel.org/r/20220701211425.2708-8-jsmart2021@gmail.com
Co-developed-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-07 17:21:43 -04:00
James Smart
43e19a96a7
scsi: lpfc: Fix attempted FA-PWWN usage after feature disable
...
Disabling FA-PWWN should be effective after port reset, but in some cases
it was found to be impossible to clear FA-PWWN usage without a driver
reload.
Clean up FA-PWWN flag management to make enable and disable of the feature
more robust.
Link: https://lore.kernel.org/r/20220701211425.2708-7-jsmart2021@gmail.com
Co-developed-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-07 17:21:43 -04:00
James Smart
2f67dc7970
scsi: lpfc: Fix possible memory leak when failing to issue CMF WQE
...
There is no corresponding free routine if lpfc_sli4_issue_wqe fails to
issue the CMF WQE in lpfc_issue_cmf_sync_wqe.
If ret_val is non-zero, then free the iocbq request structure.
Link: https://lore.kernel.org/r/20220701211425.2708-6-jsmart2021@gmail.com
Co-developed-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-07 17:21:43 -04:00
James Smart
0948a9c538
scsi: lpfc: Remove extra atomic_inc on cmd_pending in queuecommand after VMID
...
VMID introduced an extra increment of cmd_pending, causing double-counting
of the I/O. The normal increment ios performed in lpfc_get_scsi_buf.
Link: https://lore.kernel.org/r/20220701211425.2708-5-jsmart2021@gmail.com
Fixes: 33c79741de ("scsi: lpfc: vmid: Introduce VMID in I/O path")
Cc: <stable@vger.kernel.org > # v5.14+
Co-developed-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-07 17:21:43 -04:00
James Smart
35251b4d79
scsi: lpfc: Set PU field when providing D_ID in XMIT_ELS_RSP64_CX iocb
...
When providing a D_ID in XMIT_ELS_RSP64_CX iocb the PU field should
be set to 3 to describe the parameter being passed to firmware.
Link: https://lore.kernel.org/r/20220701211425.2708-4-jsmart2021@gmail.com
Co-developed-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-07 17:21:43 -04:00
James Smart
f8191d40aa
scsi: lpfc: Prevent buffer overflow crashes in debugfs with malformed user input
...
Malformed user input to debugfs results in buffer overflow crashes. Adapt
input string lengths to fit within internal buffers, leaving space for NULL
terminators.
Link: https://lore.kernel.org/r/20220701211425.2708-3-jsmart2021@gmail.com
Co-developed-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-07 17:21:43 -04:00
James Smart
4ecc9b0271
scsi: lpfc: Fix uninitialized cqe field in lpfc_nvme_cancel_iocb()
...
In lpfc_nvme_cancel_iocb(), a cqe is created locally from stack storage.
The code didn't initialize the total_data_placed word, inheriting stack
content.
Initialize the total_data_placed word.
Link: https://lore.kernel.org/r/20220701211425.2708-2-jsmart2021@gmail.com
Co-developed-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-07 17:21:42 -04:00
Martin K. Petersen
11e50ed239
Merge branch '5.19/scsi-fixes' into 5.20/scsi-staging
...
Bring in fixes to resolve a merge conflict in the lpfc driver update.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-07 17:20:43 -04:00
Bart Van Assche
88f1669019
scsi: sd: Rework asynchronous resume support
...
For some technologies, e.g. an ATA bus, resuming can take multiple
seconds. Waiting for resume to finish can cause a very noticeable delay.
Hence this commit that restores the behavior from before "scsi: core: pm:
Rely on the device driver core for async power management" for most SCSI
devices.
This commit introduces a behavior change: if the START command fails, do
not consider this as a SCSI disk resume failure.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=215880
Link: https://lore.kernel.org/r/20220630195703.10155-3-bvanassche@acm.org
Fixes: a19a93e4c6 ("scsi: core: pm: Rely on the device driver core for async power management")
Cc: Ming Lei <ming.lei@redhat.com >
Cc: Hannes Reinecke <hare@suse.de >
Cc: John Garry <john.garry@huawei.com >
Cc: ericspero@icloud.com
Cc: jason600.groome@gmail.com
Tested-by: jason600.groome@gmail.com
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-07 17:06:39 -04:00
Bart Van Assche
90552cd2d1
scsi: core: Move the definition of SCSI_QUEUE_DELAY
...
Move the definition of SCSI_QUEUE_DELAY to just above the function that
uses it.
Link: https://lore.kernel.org/r/20220630195703.10155-2-bvanassche@acm.org
Cc: Ming Lei <ming.lei@redhat.com >
Cc: Hannes Reinecke <hare@suse.de >
Cc: John Garry <john.garry@huawei.com >
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-07 17:06:39 -04:00
Jiapeng Chong
acd1a2786c
scsi: megaraid_sas: Clean up some inconsistent indenting
...
This was found by coccicheck:
drivers/scsi/megaraid/megaraid_sas_base.c:3950 process_fw_state_change_wq() warn: inconsistent indenting.
Link: https://lore.kernel.org/r/20220630074152.29171-1-jiapeng.chong@linux.alibaba.com
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-07 17:02:35 -04:00
Michael Schmitz
158da6bcae
scsi: gvp11: Convert m68k WD33C93 drivers to DMA API
...
Use dma_map_single() for gvp11 driver (leave bounce buffer logic
unchanged).
Use dma_set_mask_and_coherent() to avoid explicit cache flushes.
Compile-tested only.
CC: linux-scsi@vger.kernel.org
Link: https://lore.kernel.org/r/6d1d88ee-1cf6-c735-1e6d-bafd2096e322@gmail.com
Link: https://lore.kernel.org/r/20220630033302.3183-4-schmitzmic@gmail.com
Reviewed-by: Arnd Bergmann <arnd@arndb.de >
Signed-off-by: Michael Schmitz <schmitzmic@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
--
Changes from v1:
Arnd Bergmann:
- reorder bounce buffer copy and dma mapping
2022-07-07 17:01:22 -04:00
Michael Schmitz
479accbbb8
scsi: a2091: Convert m68k WD33C93 drivers to DMA API
...
Use dma_map_single() for a2091 driver (leave bounce buffer logic
unchanged).
Use dma_set_mask_and_coherent() to avoid explicit cache flushes.
Compile-tested only.
CC: linux-scsi@vger.kernel.org
Link: https://lore.kernel.org/r/6d1d88ee-1cf6-c735-1e6d-bafd2096e322@gmail.com
Link: https://lore.kernel.org/r/20220630033302.3183-3-schmitzmic@gmail.com
Reviewed-by: Arnd Bergmann <arnd@arndb.de >
Signed-off-by: Michael Schmitz <schmitzmic@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
--
Changes from v1:
Arnd Bergmann:
- reorder mapping and bounce buffer copy
2022-07-07 17:01:22 -04:00
Michael Schmitz
e214806d52
scsi: a3000: Convert m68k WD33C93 drivers to DMA API
...
Use dma_map_single() for a3000 driver (leave bounce buffer logic
unchanged).
Use dma_set_mask_and_coherent() to avoid explicit cache flushes.
Compile-tested only.
CC: linux-scsi@vger.kernel.org
Link: https://lore.kernel.org/r/6d1d88ee-1cf6-c735-1e6d-bafd2096e322@gmail.com
Link: https://lore.kernel.org/r/20220630033302.3183-2-schmitzmic@gmail.com
Reviewed-by: Arnd Bergmann <arnd@arndb.de >
Signed-off-by: Michael Schmitz <schmitzmic@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
--
Changes from v1:
- restore bounce buffer allocation (dropped in v1)
Arnd Bergmann:
- reorder dma mapping and bounce buffer copy
2022-07-07 17:01:22 -04:00
Li Zhijian
a2417db367
scsi: core: Shorten long warning messages
...
sdev_printk() will only accept messages up to 128 bytes.
Shorten strings exceeding 128 bytes avoid printing an incomplete sentence
like:
[ 475.156955] sd 9:0:0:0: Warning! Received an indication that the LUN assignments on this target have changed. The Linux SCSI layer does not automatical
Link: https://lore.kernel.org/r/20220630024516.1571209-1-lizhijian@fujitsu.com
Suggested-by: Finn Thain <fthain@linux-m68k.org >
Reviewed-by: Bart Van Assche <bvanassche@acm.org >
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-07 16:57:16 -04:00
Sreekanth Reddy
d29ea7b716
scsi: mpi3mr: Increase cmd_per_lun to 128
...
Increase cmd_per_lun to 128.
Link: https://lore.kernel.org/r/20220628074848.5036-3-sreekanth.reddy@broadcom.com
Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-07 16:46:11 -04:00
Sreekanth Reddy
465191d652
scsi: mpi3mr: Enable shared host tagset
...
Enable shared host tagset to make sure that total outstanding I/O count can
not exceed controller's can_queue setting.
Link: https://lore.kernel.org/r/20220628074848.5036-2-sreekanth.reddy@broadcom.com
Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-07 16:46:11 -04:00
Dan Carpenter
7c33e477bd
scsi: qla2xxx: Check correct variable in qla24xx_async_gffid()
...
There is a copy and paste bug here. It should check ".rsp" instead of
".req". The error message is copy and pasted as well so update that too.
Link: https://lore.kernel.org/r/YrK1A/t3L6HKnswO@kili
Fixes: 9c40c36e75 ("scsi: qla2xxx: edif: Reduce Initiator-Initiator thrashing")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-07-07 15:23:13 -04:00
Arnd Bergmann
b04e75a4a8
scsi: dpt_i2o: Remove obsolete driver
...
The dpt_i2o driver was fixed to stop using virt_to_bus() in 2008, but it
still has a stale reference in an error handling code path that could never
work. I submitted a patch to fix this reference earlier, but Hannes
Reinecke suggested that removing the driver may be just as good here.
The i2o driver layer was removed in 2015 with commit 4a72a7af46
("staging: remove i2o subsystem"), but the even older dpt_i2o scsi driver
stayed around.
The last non-cleanup patches I could find were from Miquel van Smoorenburg
and Mark Salyzyn back in 2008, they might know if there is any chance of
the hardware still being used anywhere.
Link: https://lore.kernel.org/linux-scsi/CAK8P3a1XfwkTOV7qOs1fTxf4vthNBRXKNu8A5V7TWnHT081NGA@mail.gmail.com/T/
Link: https://lore.kernel.org/r/20220624155226.2889613-3-arnd@kernel.org
Cc: Miquel van Smoorenburg <mikevs@xs4all.net >
Cc: Mark Salyzyn <salyzyn@android.com >
Cc: Hannes Reinecke <hare@suse.de >
Signed-off-by: Arnd Bergmann <arnd@arndb.de >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-06-27 22:56:21 -04:00
Arnd Bergmann
9f7c2232e1
scsi: BusLogic: Remove bus_to_virt()
...
The BusLogic driver is the last remaining driver that relies on the
deprecated bus_to_virt() function, which in turn only works on a few
architectures, and is incompatible with both swiotlb and iommu support.
Before commit 391e2f2560 ("[SCSI] BusLogic: Port driver to 64-bit."), the
driver had a dependency on x86-32, presumably because of this
problem. However, the change introduced another bug that made it still
impossible to use the driver on any 64-bit machine.
This was in turn fixed in commit 56f396146a ("scsi: BusLogic: Fix 64-bit
system enumeration error for Buslogic"), 8 years later, which shows that
there are not a lot of users.
Maciej is still using the driver on 32-bit hardware, and Khalid mentioned
that the driver works with the device emulation used in VirtualBox and
VMware. Both of those only emulate it for Windows 2000 and older operating
systems that did not ship with the better LSI logic driver.
Do a minimum fix that searches through the list of descriptors to find one
that matches the bus address. This is clearly as inefficient as was
indicated in the code comment about the lack of a bus_to_virt()
replacement. A better fix would likely involve changing out the entire
descriptor allocation for a simpler one, but that would be much more
invasive.
Link: https://lore.kernel.org/r/20220624155226.2889613-2-arnd@kernel.org
Cc: Maciej W. Rozycki <macro@orcam.me.uk >
Cc: Matt Wang <wwentao@vmware.com >
Tested-by: Khalid Aziz <khalid@gonehiking.org >
Reviewed-by: Robin Murphy <robin.murphy@arm.com >
Reviewed-by: Hannes Reinecke <hare@suse.de >
Acked-by: Khalid Aziz <khalid@gonehiking.org >
Signed-off-by: Arnd Bergmann <arnd@arndb.de >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-06-27 22:52:05 -04:00
Colin Ian King
07f0c8aff5
scsi: fcoe: Remove redundant assignment to variable 'wlen'
...
Variable wlen is being assigned a value that is never read, it is being
re-assigned with a different value later on. The assignment is redundant
and can be removed.
Cleans up clang scan build warning:
drivers/scsi/fcoe/fcoe.c:1491:2: warning: Value stored to 'wlen'
is never read [deadcode.DeadStores]
Link: https://lore.kernel.org/r/20220623164710.76831-1-colin.i.king@gmail.com
Signed-off-by: Colin Ian King <colin.i.king@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-06-27 22:45:25 -04:00
John Garry
fce54ed027
scsi: hisi_sas: Limit max hw sectors for v3 HW
...
If the controller is behind an IOMMU then the IOMMU IOVA caching range can
affect performance, as discussed in [0].
Limit the max HW sectors to not exceed this limit. We need to hardcode the
value until a proper DMA mapping API is available.
[0] https://lore.kernel.org/linux-iommu/20210129092120.1482-1-thunder.leizhen@huawei.com/
Link: https://lore.kernel.org/r/1655988119-223714-1-git-send-email-john.garry@huawei.com
Signed-off-by: John Garry <john.garry@huawei.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-06-27 22:43:57 -04:00
Tetsuo Handa
90c3ca3f24
scsi: mpt3sas: Remove flush_scheduled_work() call
...
It seems to me that mpt3sas driver is using dedicated workqueues and is not
calling schedule{,_delayed}_work{,_on}(). Then, there will be no work to
flush using flush_scheduled_work().
Link: https://lore.kernel.org/r/f3b97c7c-1094-4e46-20d8-4321716d6f3f@I-love.SAKURA.ne.jp
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-06-21 21:52:44 -04:00
Jiang Jian
bc98b503b1
scsi: sym53c8xx_2: Remove redundant "with"
...
Remove redundant "with" in comment
Link: https://lore.kernel.org/r/20220621162631.25353-1-jiangjian@cdjrlc.com
Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-06-21 21:41:19 -04:00
Jiang Jian
e448c8508d
scsi: snic: Remove redundant "on"
...
Remove redundant "on" in comment.
Link: https://lore.kernel.org/r/20220621150136.9264-1-jiangjian@cdjrlc.com
Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-06-21 21:40:11 -04:00
Jiang Jian
ebd676ff3b
scsi: aacraid: Remove redundant "the"
...
Remove redundant "the" in comment.
Link: https://lore.kernel.org/r/20220621142346.6429-1-jiangjian@cdjrlc.com
Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-06-21 21:39:55 -04:00
Jiang Jian
e1397bc6ad
scsi: hisi_sas: Align comments
...
Properly align comment lines in slot_index_alloc_quirk_v2_hw().
Link: https://lore.kernel.org/r/20220621072405.34394-1-jiangjian@cdjrlc.com
Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-06-21 21:33:19 -04:00
Zhang Jiaming
efef34cb45
scsi: mpt3sas: Fix whitespace and spelling mistake
...
There is a spelling mistake in _base_sas_ioc_info(). Change 'cant' to
'can't'.
Also fix up whitespace.
Link: https://lore.kernel.org/r/20220617101103.3162-1-jiaming@nfschina.com
Signed-off-by: Zhang Jiaming <jiaming@nfschina.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-06-21 21:31:44 -04:00
Ren Yu
13d2d34287
scsi: mpt3sas: Fix typo in comment
...
Spelling mistake in comment: non-succesfull -> non-successful.
Link: https://lore.kernel.org/r/20220617081557.9009-1-renyu@nfschina.com
Signed-off-by: Ren Yu <renyu@nfschina.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-06-21 21:29:35 -04:00
Mike Christie
6e637b723d
scsi: libiscsi: Improve conn_send_pdu API
...
The conn_send_pdu API is evil in that it returns a pointer to an
iscsi_task, but that task might have been freed already so you can't touch
it. This patch splits the task allocation and transmission, so functions
like iscsi_send_nopout() can access the task before its sent and do
whatever bookkeeping is needed before it is sent.
Link: https://lore.kernel.org/r/20220616224557.115234-10-michael.christie@oracle.com
Reviewed-by: Lee Duncan <lduncan@suse.com >
Signed-off-by: Mike Christie <michael.christie@oracle.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-06-21 21:19:23 -04:00