aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-04-05scsi: ufs: core: Fix out-of-bounds warnings in ufshcd_exec_raw_upiu_cmd()Gustavo A. R. Silva2-21/+29
Fix the following out-of-bounds warnings by enclosing some structure members into new structure objects upiu_req and upiu_rsp: include/linux/fortify-string.h:20:29: warning: '__builtin_memcpy' offset [29, 48] from the object at 'treq' is out of the bounds of referenced subobject 'req_header' with type 'struct utp_upiu_header' at offset 16 [-Warray-bounds] include/linux/fortify-string.h:20:29: warning: '__builtin_memcpy' offset [61, 80] from the object at 'treq' is out of the bounds of referenced subobject 'rsp_header' with type 'struct utp_upiu_header' at offset 48 [-Warray-bounds] arch/m68k/include/asm/string.h:72:25: warning: '__builtin_memcpy' offset [29, 48] from the object at 'treq' is out of the bounds of referenced subobject 'req_header' with type 'struct utp_upiu_header' at offset 16 [-Warray-bounds] arch/m68k/include/asm/string.h:72:25: warning: '__builtin_memcpy' offset [61, 80] from the object at 'treq' is out of the bounds of referenced subobject 'rsp_header' with type 'struct utp_upiu_header' at offset 48 [-Warray-bounds] Refactor the code by making it more structured. The problem is that the original code is trying to copy data into a bunch of struct members adjacent to each other in a single call to memcpy(). Now that a new struct _upiu_req_ enclosing all those adjacent members is introduced, memcpy() doesn't overrun the length of &treq.req_header, because the address of the new struct object _upiu_req_ is used as the destination, instead. The same problem is present when memcpy() overruns the length of the source &treq.rsp_header; in this case the address of the new struct object _upiu_rsp_ is used, instead. Also, this helps with the ongoing efforts to enable -Warray-bounds and avoid confusing the compiler. Link: https://github.com/KSPP/linux/issues/109 Link: https://lore.kernel.org/lkml/60640558.lsAxiK6otPwTo9rv%[email protected]/ Link: https://lore.kernel.org/r/20210331224338.GA347171@embeddedor Reported-by: kernel test robot <[email protected]> Reviewed-by: Avri Altman <[email protected]> Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]> Build-tested-by: kernel test robot <[email protected]>
2021-04-05scsi: fnic: Remove unnecessary spin_lock_init() and INIT_LIST_HEAD()Yang Yingliang1-3/+0
The spinlock and list head of fnic_list are initialized statically. It is unnecessary to initialize them. Link: https://lore.kernel.org/r/[email protected] Reported-by: Hulk Robot <[email protected]> Signed-off-by: Yang Yingliang <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05scsi: message: fusion: Use BUG_ON instead of if condition followed by BUGzhouchuangao1-4/+2
BUG_ON() uses unlikely in if() which can be optimized at compile time. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: zhouchuangao <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05scsi: mpt3sas: Block PCI config access from userspace during resetSreekanth Reddy1-0/+4
While diag reset is in progress there is short duration where all access to controller's PCI config space from the host needs to be blocked. This is due to a hardware limitation of the IOC controllers. Block all access to controller's config space from userland applications by calling pci_cfg_access_lock() while diag reset is in progress and unlocking it again after the controller comes back to ready state. Link: https://lore.kernel.org/r/[email protected] Cc: [email protected] #v5.4.108+ Signed-off-by: Sreekanth Reddy <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05scsi: mpt3sas: Fix endianness for ActiveCablePowerRequirementSreekanth Reddy1-1/+2
Covert ActiveCablePowerRequirement's value to target CPU endian before displaying it. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sreekanth Reddy <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05scsi: mpt3sas: Only one vSES is present even when IOC has multi vSESSreekanth Reddy1-1/+3
Whenever the driver is adding a vSES to virtual-phys list it is reinitializing the list head. Hence those vSES devices which were added previously are lost. Stop reinitializing the list every time a new vSES device is added. Link: https://lore.kernel.org/r/[email protected] Cc: [email protected] #v5.11.10+ Signed-off-by: Sreekanth Reddy <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05scsi: target: Make the virtual LUN 0 deviceKonstantin Shelekhin2-6/+2
Create the device for the virtual LUN 0 using the DUMMY flag. This change makes it possible to remove some special-casing in the INQUIRY code. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Roman Bolshakov <[email protected]> Reviewed-by: Mike Christie <[email protected]> Signed-off-by: Konstantin Shelekhin <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05scsi: target: Add the DUMMY flag to rd_mcpKonstantin Shelekhin2-4/+24
This commit adds the DUMMY flag to the rd_mcp backend that forces a logical unit to report itself as not connected device of an unknown type. Essentially this allows users to create devices identical to the device for the virtual LUN 0, making it possible to explicitly create a LUN 0 device and configure its WWNs (e.g. vendor or product name). Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Roman Bolshakov <[email protected]> Reviewed-by: Mike Christie <[email protected]> Signed-off-by: Konstantin Shelekhin <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05scsi: scsi_dh_alua: Remove check for ASC 24h in alua_rtpg()Ewan D. Milne1-2/+3
Some arrays return ILLEGAL_REQUEST with ASC 00h if they don't support the RTPG extended header so remove the check for INVALID FIELD IN CDB. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Ewan D. Milne <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05scsi: scsi_dh_alua: Prevent duplicate pg info print in alua_rtpg()John Pittman1-11/+19
Due to the frequency that alua_rtpg() is called, the path group info print within can print the same info multiple times in the logs, subsequent prints adding no new information or value. To reproduce: # modprobe scsi_debug vpd_use_hostno=0 # systemctl start multipathd.service To fix, check stored values, only printing at alua attach/activate and if any of the values change. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: David Jeffery <[email protected]> Reviewed-by: Laurence Oberman <[email protected]> Signed-off-by: John Pittman <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05scsi: scsi_transport_srp: Don't block target in SRP_PORT_LOST stateMartin Wilck1-1/+1
rport_dev_loss_timedout() sets the rport state to SRP_PORT_LOST and the SCSI target state to SDEV_TRANSPORT_OFFLINE. If this races with srp_reconnect_work(), a warning is printed: Mar 27 18:48:07 ictm1604s01h4 kernel: dev_loss_tmo expired for SRP port-18:1 / host18. Mar 27 18:48:07 ictm1604s01h4 kernel: ------------[ cut here ]------------ Mar 27 18:48:07 ictm1604s01h4 kernel: scsi_internal_device_block(18:0:0:100) failed: ret = -22 Mar 27 18:48:07 ictm1604s01h4 kernel: Call Trace: Mar 27 18:48:07 ictm1604s01h4 kernel: ? scsi_target_unblock+0x50/0x50 [scsi_mod] Mar 27 18:48:07 ictm1604s01h4 kernel: starget_for_each_device+0x80/0xb0 [scsi_mod] Mar 27 18:48:07 ictm1604s01h4 kernel: target_block+0x24/0x30 [scsi_mod] Mar 27 18:48:07 ictm1604s01h4 kernel: device_for_each_child+0x57/0x90 Mar 27 18:48:07 ictm1604s01h4 kernel: srp_reconnect_rport+0xe4/0x230 [scsi_transport_srp] Mar 27 18:48:07 ictm1604s01h4 kernel: srp_reconnect_work+0x40/0xc0 [scsi_transport_srp] Avoid this by not trying to block targets for rports in SRP_PORT_LOST state. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Martin Wilck <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05scsi: target: iscsi: Fix zero tag inside a trace eventRoman Bolshakov1-2/+1
target_sequencer_start event is triggered inside target_cmd_init_cdb(). se_cmd.tag is not initialized with ITT at the moment so the event always prints zero tag. Link: https://lore.kernel.org/r/[email protected] Cc: [email protected] # 5.10+ Reviewed-by: Mike Christie <[email protected]> Signed-off-by: Roman Bolshakov <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05scsi: pm80xx: Fix chip initialization failureViswas G1-4/+4
Inbound and outbound queues were not properly configured and that lead to MPI configuration failure. Fixes: 05c6c029a44d ("scsi: pm80xx: Increase number of supported queues") Cc: [email protected] # 5.10+ Link: https://lore.kernel.org/r/[email protected] Reported-and-tested-by: Ash Izat <[email protected]> Signed-off-by: Viswas G <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05scsi: smartpqi: Update version to 2.1.8-045Don Brace1-5/+5
Update version. Link: https://lore.kernel.org/r/161549387469.25025.12859568843576080076.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Gerry Morong <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Kevin Barnett <[email protected]> Reviewed-by: Martin Wilck <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05scsi: smartpqi: Add new PCI IDsKevin Barnett1-0/+156
Add support for newer hardware. Link: https://lore.kernel.org/r/161549386882.25025.2594251735886014958.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Scott Teel <[email protected]> Acked-by: Martin Wilck <[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-04-05scsi: smartpqi: Correct system hangs when resuming from hibernationKevin Barnett1-0/+7
Correct system hangs when resuming from hibernation after first successful hibernation/resume cycle. Rare condition involving OFA. Note: Suspend/resume is not supported on many platforms. It was originally intended for workstations. Link: https://lore.kernel.org/r/161549386295.25025.14555840632114761610.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Scott Teel <[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-04-05scsi: smartpqi: Update enclosure identifier in sysfsMurthy Bhat1-1/+0
Update enclosure identifier field corresponding to physical devices in lsscsi/sysfs. During device add the SCSI devtype is filled in during slave_configure(). However, when pqi_scsi_update_device() runs (REGNEWD) the firmware returns zero for the SCSI devtype field, and valid devtype is overwritten by zero. Due to this, lsscsi output shows wrong values. Link: https://lore.kernel.org/r/161549385708.25025.17234953506918043750.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Kevin Barnett <[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-04-05scsi: smartpqi: Add additional logging for LUN resetsKevin Barnett1-36/+89
LUN resets can take longer to complete. Adding in more driver logging helps show where the driver is in the reset process. Add a timeout in pqi_device_wait_for_pending_io() to cap how long the driver will wait for outstanding commands. Link: https://lore.kernel.org/r/161549385119.25025.10366493975709358647.stgit@brunhilda Reviewed-by: Mahesh Rajashekhara <[email protected]> Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[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-04-05scsi: smartpqi: Update SAS initiator_port_protocols and target_port_protocolsMurthy Bhat1-9/+19
Export valid sas initiator_port_protocols and target_port_protocols to sysfs. Needed for lsscsi to show correct values. Link: https://lore.kernel.org/r/161549384532.25025.1469409935400845385.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Kevin Barnett <[email protected]> Reviewed-by: Martin Wilck <[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-04-05scsi: smartpqi: Add phy ID support for the physical drivesMurthy Bhat3-0/+12
Display topology using PHY numbers. PHY (both local and remote) numbers corresponding to physical drives are read from BMIC_IDENTIFY_PHYSICAL_DEVICE. Link: https://lore.kernel.org/r/161549383947.25025.16977895345376485056.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Kevin Barnett <[email protected]> Reviewed-by: Martin Wilck <[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-04-05scsi: smartpqi: Convert snprintf() to scnprintf()Kevin Barnett1-12/+11
The entire Linux kernel has been slowly migrating from snprintf() to scnprintf(), so we are doing our part. This article explains the rationale for this change: https: //lwn.net/Articles/69419/ Link: https://lore.kernel.org/r/161549383357.25025.12363435617789964291.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Martin Wilck <[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-04-05scsi: smartpqi: Fix driver synchronization issuesKevin Barnett1-103/+3
- Synchronize OFA and controller offline events. Prevent I/O during the above conditions. - Cleanup pqi_device_wait_for_pending_io() by checking the device->scsi_cmds_outstanding instead of walking the device's list of commands. - Stop failing all I/O for all devices. This was causing OS to retry them, delaying OFA. - Clean up cache flush. The controller is checked for offline status in lower level functions. Link: https://lore.kernel.org/r/161549382770.25025.789855864026860170.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[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-04-05scsi: smartpqi: Update device scan operationsKevin Barnett1-8/+14
Change return type from EINPROGRESS to EBUSY to signal applications to retry a REGNEWD if the driver cannot process the REGNEWD. Events such as OFA, suspend, and shutdown return EINPROGRESS if a scan is currently running. This prevents applications from immediately retrying REGNEWD. Schedule a new REGNEWD if system low on memory. Link: https://lore.kernel.org/r/161549382157.25025.16054784597622125373.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[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-04-05scsi: smartpqi: Update OFA managementKevin Barnett2-196/+196
OFA, Online Firmware Activation, allows users to update firmware without a reboot. - Change OFA setup to a worker thread - Delay soft resets - Add OFA event handler to allow FW to initiate OFA - Add in-memory allocation to OFA events - Update OFA buffer size calculations - Add ability to cancel OFA events - Update OFA quiesce/un-quiesce - Prevent Kernel crashes while issuing ioctl during OFA - Returned EBUSY for pass-through IOCTLs throughout all stages of OFA - Add mutex to prevent parallel OFA updates. Link: https://lore.kernel.org/r/161549381563.25025.2647205502550052197.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Scott Teel <[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-04-05scsi: smartpqi: Update RAID bypass handlingKevin Barnett2-157/+19
Simplify AIO retry management by removing retry list and list management. Need to retry is already set in the response status. Also remove the bypass worker thread. Accelerated I/O requests bypass the RAID engine and go directly to either an HBA disk or to a physical component of a RAID volume. Link: https://lore.kernel.org/r/161549380976.25025.11776487034357231156.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Scott Teel <[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-04-05scsi: smartpqi: Update suspend/resume and shutdownKevin Barnett2-60/+64
For suspend/resume and shutdown prevent: Controller events, any new I/O requests, controller requests, REGNEWD, and reset operations. Wait for any pending completions from the controller to complete to avoid controller NMI events. Link: https://lore.kernel.org/r/161549380398.25025.12266769502766103580.stgit@brunhilda Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Scott Benesh <[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-04-05scsi: smartpqi: Synchronize device resets with mutexKevin Barnett2-36/+13
Remove some flags used to check for device resets already in progress. Allow only 1 reset operation at a time for the host. Link: https://lore.kernel.org/r/161549379810.25025.10194117431886743795.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[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-04-05scsi: smartpqi: Update soft reset management for OFAKevin Barnett1-33/+53
Cleanup soft reset code for Online Firmware Activation (OFA). OFA allows controller firmware updates without a reboot. OFA updates require an on-line controller reset to activate the updated firmware. There were some missing actions for some of the reset cases. The controller is first set back to sis mode before returning to pqi mode. Check to ensure the controller is in sis mode. Release QRM memory (OFA buffer) on OFA error conditions. Clean up controller state which can cause a kernel panic upon reboot after an unsuccessful OFA. Link: https://lore.kernel.org/r/161549379215.25025.10654441314249183621.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[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-04-05scsi: smartpqi: Update event handlerKevin Barnett2-6/+7
Change the data types for event_id and additional_event_id. Link: https://lore.kernel.org/r/161549378628.25025.14338046567871170916.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[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-04-05scsi: smartpqi: Add support for wwidKevin Barnett2-2/+27
WWID has been added to Report Physical LUNs in newer controller firmware. The presence of this field is detected by a feature bit. Add detection of this new feature and store the WWID when set. Link: https://lore.kernel.org/r/161549378041.25025.3869709982357729841.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[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-04-05scsi: smartpqi: Remove timeouts from internal cmdsKevin Barnett2-100/+46
Remove timeouts for driver-initiated commands. Responses to internal requests can take longer than hard coded timeout values and the driver will still have an outstanding request that may complete in the future with no context. Link: https://lore.kernel.org/r/161549377451.25025.12306492868851801623.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[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-04-05scsi: smartpqi: Disable WRITE SAME for HBA NVMe disksKevin Barnett1-2/+5
Controller does not support SCSI WRITE SAME for NVMe drives in HBA mode Link: https://lore.kernel.org/r/161549376866.25025.5961694654342018260.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Martin Wilck <[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-04-05scsi: smartpqi: Add host level stream detection enableDon Brace1-0/+32
Allow R5/R6 stream detection to be disabled/enabled using sysfs entry enable_stream_detection. Example usage: lsscsi [2:2:0:0] storage Adaptec 3258P-32i /e 0010 ^ | +---- NOTE: here host is host2 find /sys -name \*enable_stream\* /sys/devices/pci0000:36/0000:36:00.0/0000:37:00.0/0000:38:00.0/0000:39:00.0/host2/scsi_host/host2/enable_stream_detection /sys/devices/pci0000:5b/0000:5b:00.0/0000:5c:00.0/host3/scsi_host/host3/enable_stream_detection Current stream detection: cat /sys/devices/pci0000:36/0000:36:00.0/0000:37:00.0/0000:38:00.0/0000:39:00.0/host2/scsi_host/host2/enable_stream_detection 1 Turn off stream detection: echo 0 > /sys/devices/pci0000:36/0000:36:00.0/0000:37:00.0/0000:38:00.0/0000:39:00.0/host2/scsi_host/host2/enable_stream_detection Turn on stream detection: echo 1 > /sys/devices/pci0000:36/0000:36:00.0/0000:37:00.0/0000:38:00.0/0000:39:00.0/host2/scsi_host/host2/enable_stream_detection Link: https://lore.kernel.org/r/161549376281.25025.1132304698441513738.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Kevin Barnett <[email protected]> Reviewed-by: Martin Wilck <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05scsi: smartpqi: Add stream detectionDon Brace2-6/+90
Enhance performance by adding sequential stream detection for RAID5/RAID6 sequential write requests. Reduce stripe lock contention with full-stripe write operations. There is one common stripe lock for each RAID volume that can be set by either the RAID engine or the AIO engine. The AIO path has I/O request sizes well below the stripe size resulting in many Read-Modify-Write operations. Sending the request to the RAID engine allows for coalescing requests into full stripe operations resulting in reduced Read-Modify-Write operations. Link: https://lore.kernel.org/r/161549375693.25025.2962141451773219796.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Kevin Barnett <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05scsi: smartpqi: Align code with oob driverKevin Barnett4-231/+156
Reduce differences between out-of-box driver and kernel.org driver. No functional changes. Link: https://lore.kernel.org/r/161549375094.25025.9268879575316758510.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[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-04-05scsi: smartpqi: Add support for long firmware versionKevin Barnett2-12/+39
Add support for new "long" firmware version which requires minor driver changes to expose. Link: https://lore.kernel.org/r/161549374508.25025.15467221395888158022.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[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-04-05scsi: smartpqi: Add support for BMIC sense feature cmd and feature bitsKevin Barnett2-19/+388
Determine support for supported features from BMIC sense feature command instead of config table. Enable features such as: RAID 1/5/6 write support, SATA wwid, and encryption. Link: https://lore.kernel.org/r/161549373914.25025.7999816178098103135.stgit@brunhilda Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Benesh <[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-04-05scsi: smartpqi: Add support for RAID1 writesDon Brace2-82/+183
Add RAID1 write IU and implement RAID1 write support. Change brand names ADM/ADG to TRIPLE/RAID-6. Link: https://lore.kernel.org/r/161549373324.25025.2441592111049564780.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Kevin Barnett <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05scsi: smartpqi: Add support for RAID5 and RAID6 writesDon Brace2-6/+268
Add in new IU definition and implement support for RAID5 and RAID6 writes. Link: https://lore.kernel.org/r/161549372734.25025.963261942897080281.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Kevin Barnett <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05scsi: smartpqi: Refactor scatterlist codeDon Brace1-59/+42
Factor out code common to all scatter-gather list building to prepare for new AIO functionality. AIO (Accelerated I/O) requests go directly to disk No functional changes. Link: https://lore.kernel.org/r/161549372147.25025.9706613054649682229.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Kevin Barnett <[email protected]> Reviewed-by: Martin Wilck <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05scsi: smartpqi: Refactor aio submission codeDon Brace2-246/+360
Refactor aio submission code: 1. Break up function pqi_raid_bypass_submit_scsi_cmd() into smaller functions. 2. Add common block (rmd - raid_map_data) to carry around into newly added functions. 3. Prepare for new AIO functionality. No functional changes. Link: https://lore.kernel.org/r/161549371553.25025.8840958689316611074.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Kevin Barnett <[email protected]> Reviewed-by: Martin Wilck <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05scsi: smartpqi: Add support for new product idsKevin Barnett4-1/+23
Add support for newer hardware by adding in a product identifier. This identifier can then be used to check for the hardware generation. Link: https://lore.kernel.org/r/161549370966.25025.2968242206975557607.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Martin Wilck <[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-04-05scsi: smartpqi: Correct request leakage during reset operationsMurthy Bhat1-0/+4
While failing queued I/Os in TMF path, there was a request leak and hence stale entries in request pool with ref count being non-zero. In shutdown path we have a BUG_ON to catch stuck I/O either in firmware or in the driver. The stale requests caused a system crash. The I/O request pool leakage also lead to a significant performance drop. Link: https://lore.kernel.org/r/161549370379.25025.12793264112620796062.stgit@brunhilda Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Kevin Barnett <[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-04-05scsi: smartpqi: Use host-wide tag spaceDon Brace1-0/+1
Correct SCSI midlayer sending more requests than exposed host queue depth causing firmware ASSERT and lockup issues by enabling host-wide tags. Note: This also results in better performance. Link: https://lore.kernel.org/r/161549369787.25025.8975999483518581619.stgit@brunhilda Suggested-by: Ming Lei <[email protected]> Suggested-by: John Garry <[email protected]> Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Kevin Barnett <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05Merge branch '5.12/scsi-fixes' into 5.13/scsi-stagingMartin K. Petersen20-103/+168
Pull 5.12/scsi-fixes into the 5.13 SCSI tree to provide a baseline for some UFS changes that would otherwise cause conflicts during the merge. Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-01scsi: ufs: core: Fix wrong Task Tag used in task management request UPIUsCan Guo1-17/+13
In __ufshcd_issue_tm_cmd(), it is not correct to use hba->nutrs + req->tag as the Task Tag in a TMR UPIU. Directly use req->tag as the Task Tag. Fixes: e293313262d3 ("scsi: ufs: Fix broken task management command implementation") Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Can Guo <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-01scsi: ufs: core: Fix task management request completion timeoutCan Guo1-0/+1
ufshcd_tmc_handler() calls blk_mq_tagset_busy_iter(fn = ufshcd_compl_tm()), but since blk_mq_tagset_busy_iter() only iterates over all reserved tags and requests which are not in IDLE state, ufshcd_compl_tm() never gets a chance to run. Thus, TMR always ends up with completion timeout. Fix it by calling blk_mq_start_request() in __ufshcd_issue_tm_cmd(). Link: https://lore.kernel.org/r/[email protected] Fixes: 69a6c269c097 ("scsi: ufs: Use blk_{get,put}_request() to allocate and free TMFs") Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Can Guo <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-01scsi: message: mptlan: Replace one-element array with flexible-array memberGustavo A. R. Silva2-8/+5
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use "flexible array members"[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. Refactor the code according to the use of a flexible-array member in struct _SGE_TRANSACTION32 instead of one-element array. Also, this helps with the ongoing efforts to enable -Warray-bounds by fixing the following warning: CC [M] drivers/message/fusion/mptlan.o drivers/message/fusion/mptlan.c: In function ‘mpt_lan_sdu_send’: drivers/message/fusion/mptlan.c:759:28: warning: array subscript 1 is above array bounds of ‘U32[1]’ {aka ‘unsigned int[1]’} [-Warray-bounds] 759 | pTrans->TransactionDetails[1] = cpu_to_le32((mac[2] << 24) | | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://www.kernel.org/doc/html/v5.10/process/deprecated.html#zero-length-and-one-element-arrays Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/109 Link: https://lore.kernel.org/r/20210324233344.GA99059@embeddedor Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-01scsi: message: fusion: Replace one-element array with flexible-array memberGustavo A. R. Silva1-1/+1
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use "flexible array members"[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. Also, this helps with the ongoing efforts to enable -Warray-bounds by fixing the following warning: drivers/message/fusion/mptbase.c: In function ‘mptbase_reply’: drivers/message/fusion/mptbase.c:7747:62: warning: array subscript 1 is above array bounds of ‘U32[1]’ {aka ‘unsigned int[1]’} [-Warray-bounds] 7747 | ioc->events[idx].data[ii] = le32_to_cpu(pEventReply->Data[ii]); ./include/uapi/linux/byteorder/little_endian.h:34:51: note: in definition of macro ‘__le32_to_cpu’ 34 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) | ^ drivers/message/fusion/mptbase.c:7747:33: note: in expansion of macro ‘le32_to_cpu’ 7747 | ioc->events[idx].data[ii] = le32_to_cpu(pEventReply->Data[ii]); | [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://www.kernel.org/doc/html/v5.10/process/deprecated.html#zero-length-and-one-element-arrays Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/109 Link: https://lore.kernel.org/r/20210324230036.GA67851@embeddedor Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-01scsi: fcoe: Fix mismatched fcoe_wwn_from_mac declarationArnd Bergmann1-1/+1
An old cleanup changed the array size from MAX_ADDR_LEN to unspecified in the declaration, but now gcc-11 warns about this: drivers/scsi/fcoe/fcoe_ctlr.c:1972:37: error: argument 1 of type ‘unsigned char[32]’ with mismatched bound [-Werror=array-parameter=] 1972 | u64 fcoe_wwn_from_mac(unsigned char mac[MAX_ADDR_LEN], | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ In file included from /git/arm-soc/drivers/scsi/fcoe/fcoe_ctlr.c:33: include/scsi/libfcoe.h:252:37: note: previously declared as ‘unsigned char[]’ 252 | u64 fcoe_wwn_from_mac(unsigned char mac[], unsigned int, unsigned int); | ~~~~~~~~~~~~~~^~~~~ Change the type back to what the function definition uses. Link: https://lore.kernel.org/r/[email protected] Fixes: fdd78027fd47 ("[SCSI] fcoe: cleans up libfcoe.h and adds fcoe.h for fcoe module") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>