linux-stable/drivers/scsi/mpi3mr
Damien Le Moal a9624afc91 scsi: mpi3mr: Fix ATA NCQ priority support
commit 90e6f08915 upstream.

The function mpi3mr_qcmd() of the mpi3mr driver is able to indicate to
the HBA if a read or write command directed at an ATA device should be
translated to an NCQ read/write command with the high prioiryt bit set
when the request uses the RT priority class and the user has enabled NCQ
priority through sysfs.

However, unlike the mpt3sas driver, the mpi3mr driver does not define
the sas_ncq_prio_supported and sas_ncq_prio_enable sysfs attributes, so
the ncq_prio_enable field of struct mpi3mr_sdev_priv_data is never
actually set and NCQ Priority cannot ever be used.

Fix this by defining these missing atributes to allow a user to check if
an ATA device supports NCQ priority and to enable/disable the use of NCQ
priority. To do this, lift the function scsih_ncq_prio_supp() out of the
mpt3sas driver and make it the generic SCSI SAS transport function
sas_ata_ncq_prio_supported(). Nothing in that function is hardware
specific, so this function can be used in both the mpt3sas driver and
the mpi3mr driver.

Reported-by: Scott McCoy <scott.mccoy@wdc.com>
Fixes: 023ab2a9b4 ("scsi: mpi3mr: Add support for queue command processing")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20240611083435.92961-1-dlemoal@kernel.org
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-06-21 14:35:44 +02:00
..
mpi
Kconfig scsi: mpi3mr: Select CONFIG_SCSI_SAS_ATTRS 2022-10-22 03:14:51 +00:00
Makefile scsi: mpi3mr: Refer CONFIG_SCSI_MPI3MR in Makefile 2023-01-18 11:58:23 +01:00
mpi3mr.h scsi: mpi3mr: Fix expander node leak in mpi3mr_remove() 2023-03-22 13:33:42 +01:00
mpi3mr_app.c scsi: mpi3mr: Fix ATA NCQ priority support 2024-06-21 14:35:44 +02:00
mpi3mr_debug.h
mpi3mr_fw.c scsi: mpi3mr: Add PCI checks where SAS5116 diverges from SAS4116 2024-02-05 20:12:50 +00:00
mpi3mr_os.c scsi: mpi3mr: Add PCI checks where SAS5116 diverges from SAS4116 2024-02-05 20:12:50 +00:00
mpi3mr_transport.c scsi: mpi3mr: Bad drive in topology results kernel crash 2023-03-30 12:49:18 +02:00