From 1d64508810d8d15867251c75a68d7250278ce2bd Mon Sep 17 00:00:00 2001 From: Hannes Reinecke Date: Thu, 17 Mar 2016 08:39:45 +0100 Subject: scsi: disable automatic target scan On larger installations it is useful to disable automatic LUN scanning, and only add the required LUNs via udev rules. This can speed up bootup dramatically. This patch introduces a new scan module parameter value 'manual', which works like 'none', but can be overridden by setting the 'rescan' value from scsi_scan_target to 'SCSI_SCAN_MANUAL'. And it updates all relevant callers to set the 'rescan' value to 'SCSI_SCAN_MANUAL' if invoked via the 'scan' option in sysfs. Signed-off-by: Hannes Reinecke Reviewed-by: Ewan D. Milne Tested-by: Laurence Oberman Signed-off-by: Martin K. Petersen --- drivers/message/fusion/mptspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/message') diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index 613231c16194..031e088edb5e 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c @@ -1150,7 +1150,7 @@ static void mpt_work_wrapper(struct work_struct *work) } shost_printk(KERN_INFO, shost, MYIOC_s_FMT "Integrated RAID detects new device %d\n", ioc->name, disk); - scsi_scan_target(&ioc->sh->shost_gendev, 1, disk, 0, 1); + scsi_scan_target(&ioc->sh->shost_gendev, 1, disk, 0, SCSI_SCAN_RESCAN); } -- cgit v1.2.3 From 1354379b13f190ae5da21c26836a16ba56566ab3 Mon Sep 17 00:00:00 2001 From: Alexey Khoroshilov Date: Sat, 16 Apr 2016 02:12:29 +0300 Subject: mptsas: fix checks for dma mapping errors mptsas_smp_handler() checks for dma mapping errors by comparison returned address with zero, while pci_dma_mapping_error() should be used. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Acked-by: Sathya Prakash Veerichetty Signed-off-by: Martin K. Petersen --- drivers/message/fusion/mptsas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/message') diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 7ebccfa8072a..7ee1667acde4 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c @@ -2281,7 +2281,7 @@ static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, dma_addr_out = pci_map_single(ioc->pcidev, bio_data(req->bio), blk_rq_bytes(req), PCI_DMA_BIDIRECTIONAL); - if (!dma_addr_out) + if (pci_dma_mapping_error(ioc->pcidev, dma_addr_out)) goto put_mf; ioc->add_sge(psge, flagsLength, dma_addr_out); psge += ioc->SGE_size; @@ -2296,7 +2296,7 @@ static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, flagsLength |= blk_rq_bytes(rsp) + 4; dma_addr_in = pci_map_single(ioc->pcidev, bio_data(rsp->bio), blk_rq_bytes(rsp), PCI_DMA_BIDIRECTIONAL); - if (!dma_addr_in) + if (pci_dma_mapping_error(ioc->pcidev, dma_addr_in)) goto unmap; ioc->add_sge(psge, flagsLength, dma_addr_in); -- cgit v1.2.3