summaryrefslogtreecommitdiff
path: root/drivers/scsi/leapraid/leapraid_func.h
AgeCommit message (Collapse)Author
10 daysMerge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsiLinus Torvalds
Pull SCSI updates from James Bottomley: "Small number of driver updates (mpi3mr, ufs, scsi_debug). By far the biggest core change (at 4000+ lines) is the sense code rework to make our sense handling follow the 16 bit defines in the SCSI standard rather than our split ASC and ASCQ handling which ends up being confusing and difficult to grep. The changes should all be functionally equivalent and so far the bots and AI seem to agree; the code has been incubating in -next since 16 September with one reported issue fixed. The remaining updates are minor" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (114 commits) scsi: ufs: rpmb: Fix power-on UNIT ATTENTION retry scsi: bfa: Use snprintf() in bfa_fcs_fabric_psymb_init() scsi: bfa: Use snprintf() in bfa_fcs_fabric_nsymb_init() scsi: MAINTAINERS: Remove Avri Altman as UFS reviewer scsi: st: Relock the door after a reset scsi: st: Restore the drive buffering mode after reset scsi: st: Record the tape position after a successful MTLOAD scsi: st: Restore changed drive settings after reset also for MTLOAD and MTRETEN scsi: scsi_debug: Validate the access parameters of WRITE ATOMIC (16) scsi: scsi_debug: Map the region written by WRITE ATOMIC (16) scsi: scsi_debug: Refuse a short WRITE ATOMIC (16) before writing it scsi: scsi_debug: Advance the write pointer over the data written scsi: scsi_debug: Do not write a partial physical block to a zoned device scsi: scsi_debug: Enforce physical block alignment of zoned writes scsi: scsi_debug: Report the residual of a write scsi: scsi_debug: Avoid 32-bit overflow in WRITE SCATTERED offsets scsi: scsi_debug: Evaluate scsi_debug_lbp() only once scsi: scsi_debug: Take the zone metadata lock before the data lock scsi: scsi_debug: Refuse a negative physblk_exp scsi: scsi_debug: Make atomic writes and ZBC emulation mutually exclusive ...
2026-09-16scsi: leapraid: Use combined sense codesDamien Le Moal
Refactor the leapraid driver to use the 16-bit sense_code field of struct scsi_sense_hdr and replace all hard-coded additional sense codes and additional sense code qualifiers with the enum values defined in include/scsi/scsi_sense.h. This helps with code clarity as the sense codes being processed are easier to test and self-documented. With this change, the locally defined macros for ASC and ASCQ values are deleted. No functional change intended. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Hannes Reinecke <hare@kernel.org> Link: https://patch.msgid.link/20260908090308.1085097-21-dlemoal@kernel.org Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
2026-09-15scsi: leapraid: Avoid -Wformat-security warningArnd Bergmann
When extra warnings are enabled, the alloc_ordered_workqueue() function cannot be called with a variable name for the format string: drivers/scsi/leapraid/leapraid_os.c: In function 'leapraid_probe': drivers/scsi/leapraid/leapraid_os.c:2062:58: error: format not a string literal and no format arguments [-Werror=format-security] 2062 | alloc_ordered_workqueue(adapter->fw_evt_s.fw_evt_name, 0); | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ As the string is only assembled before the call and not used anywhere else, just fold the earlier snprintf() into the alloc_ordered_workqueue() call. Fixes: 5597088c9e79 ("scsi: leapraid: Add new SCSI driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Link: https://patch.msgid.link/20260915202134.3534708-1-arnd@kernel.org Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
2026-08-23scsi: leapraid: Standardize NCQ priority sysfs attributesDongdong Hao
Replace the earlier LeapRAID ncq_cmd_prio_enable attribute with the standard sas_ncq_prio_supported and sas_ncq_prio_enable names documented in Documentation/ABI/testing/sysfs-block-device, and rename the per-device NCQ priority state to match. The earlier ncq_cmd_prio_enable name has not yet been established as part of a released userspace ABI, so no compatibility alias is needed. For LeapRAID, sas_ncq_prio_enable is backed by the driver's per-device NCQ priority state and controls whether RT-class I/O requests are issued with command priority on supported SATA devices. Update leapraid.rst to describe the standard attribute names and paths, and clean up the surrounding RST text for consistency with kernel documentation style. Also switch the capability check from open-coded VPD page 0x89 parsing to sas_ata_ncq_prio_supported(), use kstrtobool() for the enable path, and expose the NCQ priority attributes only for SATA devices using LeapRAID's target-private SAS device state. Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Dongdong Hao <doubled@leap-io-kernel.com> Reviewed-by: Hannes Reinecke <hare@kernel.org> Link: https://patch.msgid.link/20260814090526.395704-1-doubled@leap-io-kernel.com Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
2026-08-07scsi: leapraid: Add new SCSI driverDongdong Hao
The LeapRAID driver provides support for LeapRAID PCIe RAID controllers, enabling communication between the host operating system, firmware, and hardware for efficient storage management. The driver is organized into several logical modules, each with a clear responsibility: leapraid_os.c: Integrates with the Linux SCSI subsystem, handling host template callbacks, PCIe device probing, and initialization. leapraid_func.c: Contains low-level routines for firmware/hardware interaction, interrupt handling, and reset logic. leapraid_app.c: Provides the ioctl interface for user-space tools. leapraid_transport.c: Manages interactions with the SCSI transport layer for SAS PHYs and ports. leapraid_func.h: Contains internal definitions shared among driver modules. leapraid.h: Contains low-level hardware definitions for driver/firmware interaction. The leapraid_probe() function orchestrates the setup: it allocates the adapter structure and SCSI host, configures hardware interfaces, and registers it with the SCSI mid-layer. Following registration, scsi_scan_host() is invoked to initiate device discovery, with firmware reporting devices via interrupt-driven events. This initial commit provides the necessary infrastructure for subsequent development of full I/O path handling, error recovery, and advanced management features. Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Hannes Reinecke <hare@kernel.org> Signed-off-by: Dongdong Hao <doubled@leap-io-kernel.com> Link: https://patch.msgid.link/0cbc6245aabdc6e8c90587675e76ba316c5b549e.1785823793.git.doubled@leap-io-kernel.com Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>