linux/drivers/scsi/libsas
Luo Jiaxing b3f6c2ca32 scsi: libsas: Set data_dir as DMA_NONE if libata marks qc as NODATA
[ Upstream commit 53de092f47 ]

It was discovered that sdparm will fail when attempting to disable write
cache on a SATA disk connected via libsas.

In the ATA command set the write cache state is controlled through the SET
FEATURES operation. This is roughly corresponds to MODE SELECT in SCSI and
the latter command is what is used in the SCSI-ATA translation layer. A
subtle difference is that a MODE SELECT carries data whereas SET FEATURES
is defined as a non-data command in ATA.

Set the DMA data direction to DMA_NONE if the requested ATA command is
identified as non-data.

[mkp: commit desc]

Fixes: fa1c1e8f1e ("[SCSI] Add SATA support to libsas")
Link: https://lore.kernel.org/r/1598426666-54544-1-git-send-email-luojiaxing@huawei.com
Reviewed-by: John Garry <john.garry@huawei.com>
Reviewed-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-09-17 13:47:43 +02:00
..
Kconfig treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 167 2019-05-30 11:26:39 -07:00
Makefile treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 167 2019-05-30 11:26:39 -07:00
sas_ata.c scsi: libsas: Set data_dir as DMA_NONE if libata marks qc as NODATA 2020-09-17 13:47:43 +02:00
sas_discover.c scsi: libsas: stop discovering if oob mode is disconnected 2020-01-09 10:19:46 +01:00
sas_event.c scsi: libsas: switch remaining files to SPDX tags 2019-05-21 06:16:22 -04:00
sas_expander.c SCSI misc on 20190709 2019-07-11 15:14:01 -07:00
sas_host_smp.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 372 2019-06-05 17:37:10 +02:00
sas_init.c SCSI misc on 20190709 2019-07-11 15:14:01 -07:00
sas_internal.h SCSI misc on 20190709 2019-07-11 15:14:01 -07:00
sas_phy.c SCSI misc on 20190709 2019-07-11 15:14:01 -07:00
sas_port.c scsi: libsas: aic94xx: hisi_sas: mvsas: pm8001: Use dev_is_expander() 2019-06-20 15:37:02 -04:00
sas_scsi_host.c SCSI fixes on 20190720 2019-07-20 10:04:58 -07:00
sas_task.c scsi: libsas: add a SPDX tag to sas_task.c 2019-05-21 06:16:22 -04:00