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
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
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
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 ++--
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
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
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
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 ++--
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 ++--
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
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
---
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(-)
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
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
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 |
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
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
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
---
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
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
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
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
---
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
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 |
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
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
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
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
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
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
---
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
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
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;
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 =
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
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().
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
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
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
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
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
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
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
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()
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,
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
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
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
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
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
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
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
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
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
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
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
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
> 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,
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
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
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
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
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(-)
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
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.
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
---
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 +-
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..
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
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
---
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
---
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
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,
73 matches
Mail list logo