switch most scsi drivers to the generic DMA API

2018-10-11 Thread Christoph Hellwig
A lot of SCSI drivers still use the legacy PCI DMA API. While a few of them have various oddities that should be deal with separately, most of them can be very trivially converted over. Two interesting things to look out for: - pci_(z)alloc_consistent forced GFP_ATOMIC allocations, which is a

[PATCH 03/28] 3w-xxx: fully convert to the generic DMA API

2018-10-11 Thread Christoph Hellwig
The driver is currently using an odd mix of legacy PCI DMA API and generic DMA API calls, switch it over to the generic API entirely. Signed-off-by: Christoph Hellwig --- drivers/scsi/3w-.c | 20 ++-- drivers/scsi/3w-.h | 1 - 2 files changed, 14 insertions(+), 7

[PATCH 01/28] aic94xx: fully convert to the generic DMA API

2018-10-11 Thread Christoph Hellwig
The driver is currently using an odd mix of legacy PCI DMA API and generic DMA API calls, switch it over to the generic API entirely. Signed-off-by: Christoph Hellwig --- drivers/scsi/aic94xx/aic94xx_init.c | 9 ++ drivers/scsi/aic94xx/aic94xx_task.c | 46 ++--- 2

[PATCH 14/28] mpt3sas: switch to generic DMA API

2018-10-11 Thread Christoph Hellwig
Switch from the legacy PCI DMA API to the generic DMA API. Also simplify setting the DMA mask a bit. Signed-off-by: Christoph Hellwig --- drivers/scsi/mpt3sas/mpt3sas_base.c | 67 drivers/scsi/mpt3sas/mpt3sas_ctl.c | 34 ++--

[PATCH 12/28] megaraid_mbox: switch to generic DMA API

2018-10-11 Thread Christoph Hellwig
Switch from the legacy PCI DMA API to the generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/megaraid/megaraid_mbox.c | 51 +-- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_mbox.c

[PATCH 11/28] hpsa: switch to generic DMA API

2018-10-11 Thread Christoph Hellwig
Switch from the legacy PCI DMA API to the generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/hpsa.c | 136 ++-- 1 file changed, 69 insertions(+), 67 deletions(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index

[PATCH 09/28] csiostor: switch to generic DMA API

2018-10-11 Thread Christoph Hellwig
Switch from the legacy PCI DMA API to the generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/csiostor/csio_init.c | 7 ++- drivers/scsi/csiostor/csio_lnode.c | 6 +++--- drivers/scsi/csiostor/csio_scsi.c | 12 ++-- drivers/scsi/csiostor/csio_wr.c| 17

[PATCH 10/28] fnic: switch to generic DMA API

2018-10-11 Thread Christoph Hellwig
Switch from the legacy PCI DMA API to the generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/fnic/fnic_fcs.c | 41 +++ drivers/scsi/fnic/fnic_main.c | 19 ++-- drivers/scsi/fnic/fnic_scsi.c | 38 ++--

[PATCH 15/28] mvumi: switch to generic DMA API

2018-10-11 Thread Christoph Hellwig
Switch from the legacy PCI DMA API to the generic DMA API. Also reuse an existing helper (after fixing the error return) to set the DMA mask instead of having three copies of the code. Signed-off-by: Christoph Hellwig --- drivers/scsi/mvumi.c | 89 ++--

[PATCH 13/28] megaraid_sas: switch to generic DMA API

2018-10-11 Thread Christoph Hellwig
Switch from the legacy PCI DMA API to the generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/megaraid/megaraid_sas_base.c | 150 ++-- drivers/scsi/megaraid/megaraid_sas_fusion.c | 16 +-- 2 files changed, 83 insertions(+), 83 deletions(-) diff --git

[PATCH 07/28] atp870u: switch to generic DMA API

2018-10-11 Thread Christoph Hellwig
Switch from the legacy PCI DMA API to the generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/atp870u.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 8996d2329e11..802d15018ec0 100644 ---

[PATCH 02/28] 3w-9xxx: fully convert to the generic DMA API

2018-10-11 Thread Christoph Hellwig
The driver is currently using an odd mix of legacy PCI DMA API and generic DMA API calls, switch it over to the generic API entirely. Signed-off-by: Christoph Hellwig --- drivers/scsi/3w-9xxx.c | 50 -- 1 file changed, 24 insertions(+), 26 deletions(-)

[PATCH 05/28] BusLogic: switch to generic DMA API

2018-10-11 Thread Christoph Hellwig
Switch from the legacy PCI DMA API to the generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/BusLogic.c | 36 +++- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c index

[PATCH 04/28] 3w-sas: fully convert to the generic DMA API

2018-10-11 Thread Christoph Hellwig
The driver is currently using an odd mix of legacy PCI DMA API and generic DMA API calls, switch it over to the generic API entirely. Signed-off-by: Christoph Hellwig --- drivers/scsi/3w-sas.c | 38 +- 1 file changed, 17 insertions(+), 21 deletions(-) diff

[PATCH 08/28] be2iscsi: switch to generic DMA API

2018-10-11 Thread Christoph Hellwig
Switch from the legacy PCI DMA API to the generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/be2iscsi/be_cmds.c | 10 ++--- drivers/scsi/be2iscsi/be_iscsi.c | 13 +++--- drivers/scsi/be2iscsi/be_main.c | 72 ++-- drivers/scsi/be2iscsi/be_mgmt.c |

[PATCH 19/28] qedf: fully convert to the generic DMA API

2018-10-11 Thread Christoph Hellwig
The driver is currently using an odd mix of legacy PCI DMA API and generic DMA API calls, switch it over to the generic API entirely. Signed-off-by: Christoph Hellwig --- drivers/scsi/qedf/qedf_main.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH 18/28] pm8001: switch to generic DMA API

2018-10-11 Thread Christoph Hellwig
Switch from the legacy PCI DMA API to the generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/pm8001/pm8001_hwi.c | 22 +++--- drivers/scsi/pm8001/pm8001_init.c | 28 +--- drivers/scsi/pm8001/pm8001_sas.c | 8

[PATCH 17/28] nsp32: switch to generic DMA API

2018-10-11 Thread Christoph Hellwig
Switch from the legacy PCI DMA API to the generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/nsp32.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c index 8620ac5d6e41..5aac3e801903 100644 ---

[PATCH 06/28] a100u2w: switch to generic DMA API

2018-10-11 Thread Christoph Hellwig
Switch from the legacy PCI DMA API to the generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/a100u2w.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c index 23b17621b6d2..a90986feb827

[PATCH 27/28] ips: switch to generic DMA API

2018-10-11 Thread Christoph Hellwig
Switch from the legacy PCI DMA API to the generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/ips.c | 80 -- 1 file changed, 41 insertions(+), 39 deletions(-) diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index

[PATCH 25/28] vmw_pscsi: switch to generic DMA API

2018-10-11 Thread Christoph Hellwig
Switch from the legacy PCI DMA API to the generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/vmw_pvscsi.c | 77 +++ 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c index

[PATCH 28/28] mesh: switch to generic DMA API

2018-10-11 Thread Christoph Hellwig
Switch from the legacy PCI DMA API to the generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/mesh.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/mesh.c b/drivers/scsi/mesh.c index 82e01dbe90af..ec6940f2fcb3 100644 ---

[PATCH 26/28] smartpqi: fully convert to the generic DMA API

2018-10-11 Thread Christoph Hellwig
The driver is currently using an odd mix of legacy PCI DMA API and generic DMA API calls, switch it over to the generic API entirely. Signed-off-by: Christoph Hellwig --- drivers/scsi/smartpqi/smartpqi_init.c | 100 +++--- drivers/scsi/smartpqi/smartpqi_sis.c | 11 ++- 2

[PATCH 24/28] snic: switch to generic DMA API

2018-10-11 Thread Christoph Hellwig
Switch from the legacy PCI DMA API to the generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/snic/snic_disc.c | 7 --- drivers/scsi/snic/snic_io.c | 25 + drivers/scsi/snic/snic_main.c | 24 ++-- drivers/scsi/snic/snic_scsi.c |

[PATCH 20/28] qedi: fully convert to the generic DMA API

2018-10-11 Thread Christoph Hellwig
The driver is currently using an odd mix of legacy PCI DMA API and generic DMA API calls, switch it over to the generic API entirely. Signed-off-by: Christoph Hellwig --- drivers/scsi/qedi/qedi_main.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH 21/28] qla1280: switch to generic DMA API

2018-10-11 Thread Christoph Hellwig
Switch from the legacy PCI DMA API to the generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/qla1280.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c index

[PATCH 22/28] qla2xxx: fully convert to the generic DMA API

2018-10-11 Thread Christoph Hellwig
The driver is currently using an odd mix of legacy PCI DMA API and generic DMA API calls, switch it over to the generic API entirely. Signed-off-by: Christoph Hellwig --- drivers/scsi/qla2xxx/qla_target.c | 8 drivers/scsi/qla2xxx/tcm_qla2xxx.c | 2 +- 2 files changed, 5

[PATCH 23/28] qla4xxx: fully convert to the generic DMA API

2018-10-11 Thread Christoph Hellwig
The driver is currently using an odd mix of legacy PCI DMA API and generic DMA API calls, switch it over to the generic API entirely. Signed-off-by: Christoph Hellwig --- drivers/scsi/qla4xxx/ql4_os.c | 22 -- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git

[PATCH 16/28] mvsas: fully convert to the generic DMA API

2018-10-11 Thread Christoph Hellwig
The driver is currently using an odd mix of legacy PCI DMA API and generic DMA API calls, switch it over to the generic API entirely. Signed-off-by: Christoph Hellwig --- drivers/scsi/mvsas/mv_init.c | 21 +++-- drivers/scsi/mvsas/mv_sas.c | 12 ++-- 2 files changed, 9

Re: [PATCH 26/28] smartpqi: fully convert to the generic DMA API

2018-10-11 Thread Don Brace
On 10/11/18 1:50 PM, Christoph Hellwig wrote: The driver is currently using an odd mix of legacy PCI DMA API and generic DMA API calls, switch it over to the generic API entirely. Signed-off-by: Christoph Hellwig Tested-by: Don Brace Acked-by: Don Brace ---

Re: [PATCH 11/28] hpsa: switch to generic DMA API

2018-10-11 Thread Don Brace
On 10/11/18 1:49 PM, Christoph Hellwig wrote: Switch from the legacy PCI DMA API to the generic DMA API. Signed-off-by: Christoph Hellwig Tested-by: Don Brace Acked-by: Don Brace

Re: [PATCH 3/5] esp_scsi: use strong typing for the dev field

2018-10-11 Thread Finn Thain
On Thu, 11 Oct 2018, Christoph Hellwig wrote: > esp->dev is a void pointer that points either to a struct device, or a > struct platform_device. As we can easily get from the device to the > platform_device if needed change it to always point to a struct device > and properly type the pointer to

RE: [PATCH v4 1/6] mpt3sas: Introduce mpt3sas_base_pci_device_is_available

2018-10-11 Thread Sreekanth Reddy
HI Bjorn, Please provide your valuable suggestion/reply here. Thank you, Sreekanth -Original Message- From: Suganath Prabu Subramani [mailto:suganath-prabu.subram...@broadcom.com] Sent: Monday, October 8, 2018 12:15 PM To: helg...@kernel.org Cc: lu...@wunner.de;

Re: [PATCH 5/5] esp_scsi: move dma mapping into the core code

2018-10-11 Thread Finn Thain
On Thu, 11 Oct 2018, Christoph Hellwig wrote: > index 90604bff8dd2..73fcbd65b9fe 100644 > --- a/drivers/scsi/esp_scsi.c > +++ b/drivers/scsi/esp_scsi.c > @@ -369,19 +369,25 @@ static void esp_map_dma(struct esp *esp, struct > scsi_cmnd *cmd) > { > struct esp_cmd_priv *spriv =

Re: [PATCH 0/7] hisi_sas: Misc bugfixes and an optimisation patch

2018-10-11 Thread Christoph Hellwig
On Wed, Oct 10, 2018 at 09:58:25PM -0400, Martin K. Petersen wrote: > > This is because the IPTT index must be a unique value per HBA. However, > > if we switched to SCSI MQ, the block layer tag becomes unique per queue, > > and not per HBA. > > That doesn't sound right. blk-mq tags are always

[PATCH v2 01/11] scsi: sd_zbc: Rearrange code

2018-10-11 Thread Damien Le Moal
Move the urswrz check out of sd_zbc_read_zones() and into sd_zbc_read_zoned_characteristics() where that value is obtained (read from the disk zoned characteristics VPD page). Since this function now does more than simply reading the VPD page, rename it to sd_zbc_check_zoned_characteristics().

[PATCH v2 02/11] scsi: sd_zbc: Reduce boot device scan and revalidate time

2018-10-11 Thread Damien Le Moal
Handling checks of ZBC device capacity using the max_lba field of the REPORT ZONES command reply for disks with rc_basis == 0 can be done using the same report zones command reply used to check the "same" field. Avoid executing a report zones command solely to check the disk capacity by merging

[PATCH v2 06/11] block: Introduce BLKGETZONESZ ioctl

2018-10-11 Thread Damien Le Moal
Get a zoned block device zone size in number of 512 B sectors. The zone size is always 0 for regular block devices. Signed-off-by: Damien Le Moal --- block/ioctl.c | 2 ++ include/uapi/linux/blkzoned.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/block/ioctl.c

[PATCH v2 03/11] scsi: sd_zbc: Fix sd_zbc_check_zones() error checks

2018-10-11 Thread Damien Le Moal
The 32 bits overflow check for the zone size value is already done within sd_zbc_check_zones() with the test: } else if (logical_to_sectors(sdkp->device, zone_blocks) > UINT_MAX) { so there is no need to check again for an out of range value in sd_zbc_read_zones(). Simplify the code and fix

[PATCH v2 00/11] Zoned block device support improvements

2018-10-11 Thread Damien Le Moal
This series improves zoned block device support (reduce overhead) and introduces many simplifications to the code (overall, there are more deletions than insertions). In more details: * Patches 1 to 3 are SCSI side (sd driver) cleanups and improvements reducing the overhead of report zones

[PATCH v2 07/11] block: Introduce BLKGETNRZONES ioctl

2018-10-11 Thread Damien Le Moal
Get a zoned block device total number of zones. The device can be a partition of the whole device. The number of zones is always 0 for regular block devices. Signed-off-by: Damien Le Moal --- block/ioctl.c | 2 ++ include/uapi/linux/blkzoned.h | 1 + 2 files changed, 3

[PATCH v2 05/11] block: Limit allocation of zone descriptors for report zones

2018-10-11 Thread Damien Le Moal
There is no point in allocating more zone descriptors than the number of zones a block device has for doing a zone report. Avoid doing that in blkdev_report_zones_ioctl() by limiting the number of zone decriptors allocated internally to process the user request. Signed-off-by: Damien Le Moal

[PATCH v2 04/11] block: Introduce blkdev_nr_zones() helper

2018-10-11 Thread Damien Le Moal
Introduce the blkdev_nr_zones() helper function to get the total number of zones of a zoned block device. This number is always 0 for a regular block device (q->limits.zoned == BLK_ZONED_NONE case). Replace hard-coded number of zones calculation in dmz_get_zoned_device() with a call to this

[PATCH v2 11/11] block: Introduce blk_revalidate_disk_zones()

2018-10-11 Thread Damien Le Moal
Drivers exposing zoned block devices have to initialize and maintain correctness (i.e. revalidate) of the device zone bitmaps attached to the device request queue (seq_zones_bitmap and seq_zones_wlock). To simplify coding this, introduce a generic helper function blk_revalidate_disk_zones()

[PATCH v2 10/11] block: add a report_zones method

2018-10-11 Thread Damien Le Moal
From: Christoph Hellwig Dispatching a report zones command through the request queue is a major pain due to the command reply payload rewriting necessary. Given that blkdev_report_zones() is executing everything synchronously, implement report zones as a block device file operation instead,

[PATCH v2 08/11] block: Improve zone reset execution

2018-10-11 Thread Damien Le Moal
There is no need to synchronously execute all REQ_OP_ZONE_RESET BIOs necessary to reset a range of zones. Similarly to what is done for discard BIOs in blk-lib.c, all zone reset BIOs can be chained and executed asynchronously and a synchronous call done only for the last BIO of the chain. Modify

[PATCH v2 09/11] block: Expose queue nr_zones in sysfs

2018-10-11 Thread Damien Le Moal
Expose through sysfs the nr_zones field of a zoned block device request queue. This represents the total number of zones of the device calculated using the known disk capacity and zone size. Exposing this value helps in debugging disk issues as well as facilitating scripts based use of the disk

[PATCH] megaraid_mbox: remove bogus use of pci_dma_sync_sg_* APIs

2018-10-11 Thread Christoph Hellwig
The dma_map_sg / dma_unmap_sg APIs called from scsi_dma_map / scsi_dma_unmap already transfer memory ownership to the device or cpu respectively. Adding additional calls to pci_dma_sync_sg_* will in fact lead to data corruption if we end up using swiotlb for some reason. Also remove the now

[PATCH] lpfc: remove a bogus pci_dma_sync_single_for_device call

2018-10-11 Thread Christoph Hellwig
dma_alloc_coherent allocates memory that can be used by the cpu and the device at the same time, calls to pci_dma_sync_* are not required, and in fact actively harmful on some architectures like arm. Signed-off-by: Christoph Hellwig --- drivers/scsi/lpfc/lpfc_bsg.c | 3 --- 1 file changed, 3

Re: [PATCH 3/4] esp_scsi: use strong typing for the dev field

2018-10-11 Thread Christoph Hellwig
On Thu, Oct 11, 2018 at 11:10:36AM +1100, Finn Thain wrote: > If you do so, can you also eliminate the dev argument to > scsi_esp_register()? Sure. > > - struct platform_device *op = esp->dev; > > + struct platform_device *op = to_platform_device(esp->dev); > > > > - esp->command_block

Re: [PATCH 2/2] target: Fix target_wait_for_sess_cmds breakage with active signals

2018-10-11 Thread Peter Zijlstra
On Wed, Oct 10, 2018 at 10:40:12PM -0700, Nicholas A. Bellinger wrote: > Hey Peter & Co, > > On Wed, 2018-10-10 at 10:43 +0200, Peter Zijlstra wrote: > > On Wed, Oct 10, 2018 at 03:23:10AM +, Nicholas A. Bellinger wrote: > > > From: Nicholas Bellinger > > > > > > With the addition of commit

Re: [PATCH] lpfc: remove a bogus pci_dma_sync_single_for_device call

2018-10-11 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG

Re: [PATCH] megaraid_mbox: remove bogus use of pci_dma_sync_sg_* APIs

2018-10-11 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG

Re: [PATCH 0/7] hisi_sas: Misc bugfixes and an optimisation patch

2018-10-11 Thread John Garry
On 11/10/2018 07:36, Christoph Hellwig wrote: On Wed, Oct 10, 2018 at 09:58:25PM -0400, Martin K. Petersen wrote: This is because the IPTT index must be a unique value per HBA. However, if we switched to SCSI MQ, the block layer tag becomes unique per queue, and not per HBA. That doesn't

Re: [PATCH 0/7] hisi_sas: Misc bugfixes and an optimisation patch

2018-10-11 Thread Christoph Hellwig
On Thu, Oct 11, 2018 at 10:59:11AM +0100, John Garry wrote: > > > blk-mq tags are always per-host (which has actually caused problems for > > ATA, which is now using its own per-device tags). > > > > So, for example, if Scsi_host.can_queue = 2048 and Scsi_host.nr_hw_queues = > 16, then rq tags

Re: [Qemu-devel] virtio-console downgrade the virtio-pci-blk performance

2018-10-11 Thread Feng Li
Add Amit Shah. After some tests, we found: - the virtio serial port number is inversely proportional to the iSCSI virtio-blk-pci performance. If we set the virio-serial ports to 2("), the performance downgrade is minimal. - use local disk/ram disk as virtio-blk-pci disk, the performance

[PATCH v2 1/1] scsi: ufs: make UFS Tx lane1 clock optional for QCOM platforms

2018-10-11 Thread Can Guo
From: Venkat Gopalakrishnan Per Qcom's UFS host controller HW design, the UFS Tx lane1 clock could be muxed with Tx lane0 clock, hence keep Tx lane1 clock optional by ignoring it if it is not provided in device tree. This change also performs some cleanup to lanes per direction checks when

Re: [PATCH 2/2] target: Fix target_wait_for_sess_cmds breakage with active signals

2018-10-11 Thread Ly, Bryant
> On Oct 11, 2018, at 12:56 AM, Nicholas A. Bellinger > wrote: > > Hello MNC & Co, > > On Wed, 2018-10-10 at 11:58 -0500, Mike Christie wrote: >> On 10/09/2018 10:23 PM, Nicholas A. Bellinger wrote: >>> From: Nicholas Bellinger >>> >>> With the addition of commit 00d909a107 in v4.19-rc,

Re: [PATCH 0/7] hisi_sas: Misc bugfixes and an optimisation patch

2018-10-11 Thread John Garry
On 11/10/2018 11:15, Christoph Hellwig wrote: On Thu, Oct 11, 2018 at 10:59:11AM +0100, John Garry wrote: blk-mq tags are always per-host (which has actually caused problems for ATA, which is now using its own per-device tags). So, for example, if Scsi_host.can_queue = 2048 and

Re: [PATCH 0/7] hisi_sas: Misc bugfixes and an optimisation patch

2018-10-11 Thread Ming Lei
On Thu, Oct 11, 2018 at 02:12:11PM +0100, John Garry wrote: > On 11/10/2018 11:15, Christoph Hellwig wrote: > > On Thu, Oct 11, 2018 at 10:59:11AM +0100, John Garry wrote: > > > > > > > blk-mq tags are always per-host (which has actually caused problems for > > > > ATA, which is now using its own

Re: [PATCH 0/7] hisi_sas: Misc bugfixes and an optimisation patch

2018-10-11 Thread John Garry
On 11/10/2018 14:32, Ming Lei wrote: On Thu, Oct 11, 2018 at 02:12:11PM +0100, John Garry wrote: On 11/10/2018 11:15, Christoph Hellwig wrote: On Thu, Oct 11, 2018 at 10:59:11AM +0100, John Garry wrote: blk-mq tags are always per-host (which has actually caused problems for ATA, which is

[PATCH 2/5] sun_esp: don't use GFP_ATOMIC for command block allocation

2018-10-11 Thread Christoph Hellwig
esp_sbus_map_command_block is called straight from the probe routine without any locks held, so we can safely use GFP_KERNEL here. Signed-off-by: Christoph Hellwig --- drivers/scsi/sun_esp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/sun_esp.c

[PATCH 1/5] am53c974: use the generic DMA API

2018-10-11 Thread Christoph Hellwig
Remove usage of the legacy PCI DMA API. To make this easier we also store a struct device instead of pci_dev in the dev field of struct esp. Signed-off-by: Christoph Hellwig --- drivers/scsi/am53c974.c | 32 +++- 1 file changed, 15 insertions(+), 17 deletions(-)

various esp_scsi cleanups V2

2018-10-11 Thread Christoph Hellwig
Mostly to avoid methods calls for dma mapping, but also to tidy up a few bits found while doing that. Changes since v1: - fix a sun_esp compiler failure in an intermediate patch - drop the dev argument to scsi_esp_register

[PATCH 5/5] esp_scsi: move dma mapping into the core code

2018-10-11 Thread Christoph Hellwig
Except for the mac_esp driver, which uses PIO or pseudo DMA, all drivers share the same dma mapping calls. Move the dma mapping into the core code using the scsi_dma_map / scsi_dma_unmap helpers, with a special identify mapping variant triggered off a new ESP_FLAG_NO_DMA_MAP flag for mac_esp.

[PATCH 3/5] esp_scsi: use strong typing for the dev field

2018-10-11 Thread Christoph Hellwig
esp->dev is a void pointer that points either to a struct device, or a struct platform_device. As we can easily get from the device to the platform_device if needed change it to always point to a struct device and properly type the pointer to avoid errors. Signed-off-by: Christoph Hellwig ---

[PATCH 4/5] esp_scsi: remove the dev argument to scsi_esp_register

2018-10-11 Thread Christoph Hellwig
We can simplify use esp->dev now. Signed-off-by: Christoph Hellwig --- drivers/scsi/am53c974.c | 2 +- drivers/scsi/esp_scsi.c | 8 drivers/scsi/esp_scsi.h | 5 ++--- drivers/scsi/jazz_esp.c | 2 +- drivers/scsi/mac_esp.c | 2 +- drivers/scsi/sun3x_esp.c | 2 +-

dma-related cleanups for dc95x

2018-10-11 Thread Christoph Hellwig
A few bits found when auditing DMA API use. The first list cleanup isn't directly related, but I had to to do this first to fully understand the code..

[PATCH 4/4] dc395x: use generic DMA API

2018-10-11 Thread Christoph Hellwig
Convert the driver from the legacy pci_* DMA API to the generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/dc395x.c | 37 +++-- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index

[PATCH 2/4] dc395x: fix dma API usage in srb_done

2018-10-11 Thread Christoph Hellwig
We can't just transfer ownership to the CPU and then unmap, as this will break with swiotlb. Instead unmap the command and sense buffer a little earlier in the I/O completion handler and get rid of the pci_dma_sync_sg_for_cpu call entirely. Signed-off-by: Christoph Hellwig ---

[PATCH 3/4] dc395x: fix DMA API usage in sg_update_list

2018-10-11 Thread Christoph Hellwig
We need to transfer device ownership to the CPU before we can manipulate the mapped data. Signed-off-by: Christoph Hellwig --- drivers/scsi/dc395x.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index 8d7a26a33951..f3b65e5efe2b 100644 ---

[PATCH 1/4] dc395x: simplify list handling

2018-10-11 Thread Christoph Hellwig
Remove the list wrappers, including the pointless list iteration before deletion. Signed-off-by: Christoph Hellwig --- drivers/scsi/dc395x.c | 152 -- 1 file changed, 26 insertions(+), 126 deletions(-) diff --git a/drivers/scsi/dc395x.c

Re: [PATCH v2 09/11] block: Expose queue nr_zones in sysfs

2018-10-11 Thread Ewan D. Milne
So in v2 you moved the #ifdef CONFIG_BLK_DEV_ZONED so that nr_zones is always present? It was previously changed to keep the request_queue size smaller. Would make more sense to make the nr_zones sysfs code here conditional on CONFIG_BLK_DEV_ZONED? -Ewan On Thu, 2018-10-11 at 16:09 +0900,