fix ATAPI support for libsas drivers
Subsystems (6)
Hi all,
this series fixes the ATAPI DMA drain refactoring for SAS HBAs that use libsas.
PATCH 1/2 libata: provide a ata_scsi_dma_need_drain stub for !CONFIG_ATA
SAS drivers can be compiled with ata support disabled. Provide a stub so that the drivers don't have to ifdef around wiring up ata_scsi_dma_need_drain.
--- include/linux/libata.h | 4 ++++ 1 file changed, 4 insertions(+)
include/linux/libata.h +4 -0
@@ -1092,7 +1092,11 @@ extern int ata_scsi_ioctl(struct scsi_device *dev, unsigned int cmd,#define ATA_SCSI_COMPAT_IOCTL /* empty */ #endif extern int ata_scsi_queuecmd (struct Scsi_Host *h,struct scsi_cmnd *cmd); +#if IS_ENABLED (CONFIG_ATA )bool ata_scsi_dma_need_drain (struct request *rq); +#else +#define ata_scsi_dma_need_drain NULL +#endif extern int ata_sas_scsi_ioctl (struct ata_port *ap,struct scsi_device *dev,unsigned int cmd,void __user *arg);extern bool ata_link_online (struct ata_link *link);
Signature · 1 line
2.26.2
Martin K. Petersen
AppliedRe: [PATCH 1/2] libata: provide a ata_scsi_dma_need_drain stub for !CONFIG_ATA
Quoted 3 lines · Christoph Hellwig
SAS drivers can be compiled with ata support disabled. Provide a stub so that the drivers don't have to ifdef around wiring up
ata_scsi_dma_need_drain.
Applied to 5.8/scsi-fixes, thanks!
[1/2] scsi: libata: Provide an ata_scsi_dma_need_drain stub for !CONFIG_ATA
https://git.kernel.org/mkp/scsi/c/7bb7ee8704fe [2/2] scsi: Wire up ata_scsi_dma_need_drain for SAS HBA drivers https://git.kernel.org/mkp/scsi/c/b8f1d1e05817
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
PATCH 2/2 scsi: wire up ata_scsi_dma_need_drain for SAS HBA drivers
In reply to Christoph HellwigWe need ata_scsi_dma_need_drain for all drivers wired up to drive ATAPI devices through libata. That also includes the SAS HBA drivers in addition to native libata HBA drivers.
--- drivers/scsi/aic94xx/aic94xx_init.c | 1 + drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 1 + drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 1 + drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 1 + drivers/scsi/ipr.c | 1 + drivers/scsi/isci/init.c | 1 + drivers/scsi/mvsas/mv_init.c | 1 + drivers/scsi/pm8001/pm8001_init.c | 1 + 8 files changed, 8 insertions(+)
drivers/scsi/aic94xx/aic94xx_init.c +1 -0
@@ -40,6 +40,7 @@ static struct scsi_host_template aic94xx_sht = {/* .name is initialized */ .name = "aic94xx", .queuecommand = sas_queuecommand, + .dma_need_drain = ata_scsi_dma_need_drain, .target_alloc = sas_target_alloc, .slave_configure = sas_slave_configure, .scan_finished = asd_scan_finished,
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +1 -0
@@ -1756,6 +1756,7 @@ static struct scsi_host_template sht_v1_hw = { .proc_name = DRV_NAME, .module = THIS_MODULE, .queuecommand = sas_queuecommand, + .dma_need_drain = ata_scsi_dma_need_drain, .target_alloc = sas_target_alloc, .slave_configure = hisi_sas_slave_configure, .scan_finished = hisi_sas_scan_finished,
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +1 -0
@@ -3532,6 +3532,7 @@ static struct scsi_host_template sht_v2_hw = { .proc_name = DRV_NAME, .module = THIS_MODULE, .queuecommand = sas_queuecommand, + .dma_need_drain = ata_scsi_dma_need_drain, .target_alloc = sas_target_alloc, .slave_configure = hisi_sas_slave_configure, .scan_finished = hisi_sas_scan_finished,
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +1 -0
@@ -3075,6 +3075,7 @@ static struct scsi_host_template sht_v3_hw = { .proc_name = DRV_NAME, .module = THIS_MODULE, .queuecommand = sas_queuecommand, + .dma_need_drain = ata_scsi_dma_need_drain, .target_alloc = sas_target_alloc, .slave_configure = hisi_sas_slave_configure, .scan_finished = hisi_sas_scan_finished,
drivers/scsi/ipr.c +1 -0
@@ -6731,6 +6731,7 @@ static struct scsi_host_template driver_template = { .compat_ioctl = ipr_ioctl, #endif .queuecommand = ipr_queuecommand, + .dma_need_drain = ata_scsi_dma_need_drain, .eh_abort_handler = ipr_eh_abort, .eh_device_reset_handler = ipr_eh_dev_reset, .eh_host_reset_handler = ipr_eh_host_reset,
drivers/scsi/isci/init.c +1 -0
@@ -153,6 +153,7 @@ static struct scsi_host_template isci_sht = { .name = DRV_NAME, .proc_name = DRV_NAME, .queuecommand = sas_queuecommand, + .dma_need_drain = ata_scsi_dma_need_drain, .target_alloc = sas_target_alloc, .slave_configure = sas_slave_configure, .scan_finished = isci_host_scan_finished,
drivers/scsi/mvsas/mv_init.c +1 -0
@@ -33,6 +33,7 @@ static struct scsi_host_template mvs_sht = { .module = THIS_MODULE, .name = DRV_NAME, .queuecommand = sas_queuecommand, + .dma_need_drain = ata_scsi_dma_need_drain, .target_alloc = sas_target_alloc, .slave_configure = sas_slave_configure, .scan_finished = mvs_scan_finished,
drivers/scsi/pm8001/pm8001_init.c +1 -0
@@ -87,6 +87,7 @@ static struct scsi_host_template pm8001_sht = { .module = THIS_MODULE, .name = DRV_NAME, .queuecommand = sas_queuecommand, + .dma_need_drain = ata_scsi_dma_need_drain, .target_alloc = sas_target_alloc, .slave_configure = sas_slave_configure, .scan_finished = pm8001_scan_finished,
Signature · 1 line
2.26.2
kernel test robot
build botRe: [PATCH 2/2] scsi: wire up ata_scsi_dma_need_drain for SAS HBA drivers
I love your patch! Yet something to improve:
Hi Christoph,
I love your patch! Yet something to improve:
[auto build test ERROR on block/for-next]
[cannot apply to mkp-scsi/for-next scsi/for-next]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Christoph-Hellwig/libata-provide-a-ata_scsi_dma_need_drain-stub-for-CONFIG_ATA/20200615-155912 base: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next config: arm64-randconfig-r012-20200615 (attached as .config) compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>, old ones prefixed by <<):
>> aarch64-linux-ld: drivers/scsi/aic94xx/aic94xx_init.o:(.data+0xcf0): undefined reference to `ata_scsi_dma_need_drain'
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
Quoted 6 lines · Christoph Hellwig
Hi all,
this series fixes the ATAPI DMA drain refactoring for SAS HBAs that use libsas.
.
Something I meant to ask before and was curious about, specifically since ipr doesn't actually use libsas: Why not wire up other SAS HBAs, like megaraid_sas?
Thanks,
John
Quoted 11 lines · John Garry
Quoted 6 lines · Christoph Hellwig
Hi all,
this series fixes the ATAPI DMA drain refactoring for SAS HBAs that use libsas.
.Something I meant to ask before and was curious about, specifically since ipr doesn't actually use libsas: Why not wire up other SAS HBAs, like
megaraid_sas?
megaraid_sas and mpt3sas don't use the libata code at all. ipr actually is a special case and uses libata directly instead of libsas (something I hadn't realized, but which doesn't change anything for the patches itself, just possibly the commit log).
Quoted 9 lines · Christoph Hellwig
Quoted 8 lines · John Garry
Quoted 6 lines · Christoph Hellwig
Hi all,
this series fixes the ATAPI DMA drain refactoring for SAS HBAs that use libsas.
.
Quoted 9 lines
Quoted 3 lines
Something I meant to ask before and was curious about, specifically since ipr doesn't actually use libsas: Why not wire up other SAS HBAs, like
megaraid_sas?
megaraid_sasand mpt3sas don't use the libata code at all. ipr actually is a special case and uses libata directly instead of libsas (something I hadn't realized, but which doesn't change anything for the patches itself, just possibly the commit log).
More to the point, megaraid_sas and mpt3sas have their own SATL in firmware so there is no need to use libata here.
Cheers,
Hannes
Signature · 4 lines
Dr. Hannes Reinecke Teamlead Storage & Networking [email protected] +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer
Quoted 14 lines · Hannes Reinecke
Quoted 13 lines · Christoph Hellwig
Quoted 11 lines · John Garry
Quoted 6 lines · Christoph Hellwig
Hi all,
this series fixes the ATAPI DMA drain refactoring for SAS HBAs that use libsas.
.Something I meant to ask before and was curious about, specifically since ipr doesn't actually use libsas: Why not wire up other SAS HBAs, like
megaraid_sas?
Quoted 6 lines
Quoted 5 lines
megaraid_sasand mpt3sas don't use the libata code at all. ipr actually is a special case and uses libata directly instead of libsas (something I hadn't realized, but which doesn't change anything for the patches itself, just possibly the commit log).More to the point,
megaraid_sasand mpt3sas have their own SATL in firmware so there is no need to use libata here.
ok.
BTW, @Christoph, I have no setup to verify this refactoring for anything which uses libsas (that I know about, anyway).
Thanks