Re: [GIT PULL] SCSI fixes for 5.0-rc7

2019-03-02 Thread pr-tracker-bot
The pull request you sent on Sat, 02 Mar 2019 07:49:48 -0800:

> git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-fixes

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/df49fd0ff83a0c20c5ce68a790a4f43601ecdc4a

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker


[GIT PULL] SCSI fixes for 5.0-rc7

2019-03-02 Thread James Bottomley
Nine small fixes.  The resume fix is a cosmetic removal of a warning
with an incorrect condition causing it to alarm people wrongly.  The
other eight patches correct a thinko in Christoph Hellwig's DMA
conversion series.  Without it all these drivers end up with 32 bit DMA
masks meaning they bounce any page over 4GB before sending it to the
controller.  Nowadays, even laptops mostly have memory above 4GB, so
this can lead to significant performance degradation with all the
bouncing.

The patch is available here:

git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-fixes

The short changelog is:

Bart Van Assche (1):
  scsi: core: Avoid that system resume triggers a kernel warning

Hannes Reinecke (8):
  scsi: hptiop: fix calls to dma_set_mask()
  scsi: hisi_sas: fix calls to dma_set_mask_and_coherent()
  scsi: csiostor: fix calls to dma_set_mask_and_coherent()
  scsi: bfa: fix calls to dma_set_mask_and_coherent()
  scsi: aic94xx: fix calls to dma_set_mask_and_coherent()
  scsi: 3w-sas: fix calls to dma_set_mask_and_coherent()
  scsi: 3w-9xxx: fix calls to dma_set_mask_and_coherent()
  scsi: lpfc: fix calls to dma_set_mask_and_coherent()

And the diffstat:

 drivers/scsi/3w-9xxx.c | 14 +-
 drivers/scsi/3w-sas.c  | 12 
 drivers/scsi/aic94xx/aic94xx_init.c|  8 +---
 drivers/scsi/bfa/bfad.c| 18 +-
 drivers/scsi/csiostor/csio_init.c  |  7 +--
 drivers/scsi/hisi_sas/hisi_sas_main.c  |  8 ++--
 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c |  8 +---
 drivers/scsi/hptiop.c  | 10 +++---
 drivers/scsi/lpfc/lpfc_init.c  | 19 ---
 drivers/scsi/scsi_lib.c|  1 -
 10 files changed, 70 insertions(+), 35 deletions(-)

With full diff below.

James

---

diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index a3c20e3a8b7c..3337b1e80412 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -2009,7 +2009,7 @@ static int twa_probe(struct pci_dev *pdev, const struct 
pci_device_id *dev_id)
struct Scsi_Host *host = NULL;
TW_Device_Extension *tw_dev;
unsigned long mem_addr, mem_len;
-   int retval = -ENODEV;
+   int retval;
 
retval = pci_enable_device(pdev);
if (retval) {
@@ -2020,8 +2020,10 @@ static int twa_probe(struct pci_dev *pdev, const struct 
pci_device_id *dev_id)
pci_set_master(pdev);
pci_try_set_mwi(pdev);
 
-   if (dma_set_mask_and_coherent(>dev, DMA_BIT_MASK(64)) ||
-   dma_set_mask_and_coherent(>dev, DMA_BIT_MASK(32))) {
+   retval = dma_set_mask_and_coherent(>dev, DMA_BIT_MASK(64));
+   if (retval)
+   retval = dma_set_mask_and_coherent(>dev, 
DMA_BIT_MASK(32));
+   if (retval) {
TW_PRINTK(host, TW_DRIVER, 0x23, "Failed to set dma mask");
retval = -ENODEV;
goto out_disable_device;
@@ -2240,8 +2242,10 @@ static int twa_resume(struct pci_dev *pdev)
pci_set_master(pdev);
pci_try_set_mwi(pdev);
 
-   if (dma_set_mask_and_coherent(>dev, DMA_BIT_MASK(64)) ||
-   dma_set_mask_and_coherent(>dev, DMA_BIT_MASK(32))) {
+   retval = dma_set_mask_and_coherent(>dev, DMA_BIT_MASK(64));
+   if (retval)
+   retval = dma_set_mask_and_coherent(>dev, 
DMA_BIT_MASK(32));
+   if (retval) {
TW_PRINTK(host, TW_DRIVER, 0x40, "Failed to set dma mask during 
resume");
retval = -ENODEV;
goto out_disable_device;
diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c
index e8f5f7c63190..2d15b878bd94 100644
--- a/drivers/scsi/3w-sas.c
+++ b/drivers/scsi/3w-sas.c
@@ -1572,8 +1572,10 @@ static int twl_probe(struct pci_dev *pdev, const struct 
pci_device_id *dev_id)
pci_set_master(pdev);
pci_try_set_mwi(pdev);
 
-   if (dma_set_mask_and_coherent(>dev, DMA_BIT_MASK(64)) ||
-   dma_set_mask_and_coherent(>dev, DMA_BIT_MASK(32))) {
+   retval = dma_set_mask_and_coherent(>dev, DMA_BIT_MASK(64));
+   if (retval)
+   retval = dma_set_mask_and_coherent(>dev, 
DMA_BIT_MASK(32));
+   if (retval) {
TW_PRINTK(host, TW_DRIVER, 0x18, "Failed to set dma mask");
retval = -ENODEV;
goto out_disable_device;
@@ -1804,8 +1806,10 @@ static int twl_resume(struct pci_dev *pdev)
pci_set_master(pdev);
pci_try_set_mwi(pdev);
 
-   if (dma_set_mask_and_coherent(>dev, DMA_BIT_MASK(64)) ||
-   dma_set_mask_and_coherent(>dev, DMA_BIT_MASK(32))) {
+   retval = dma_set_mask_and_coherent(>dev, DMA_BIT_MASK(64));
+   if (retval)
+   retval = dma_set_mask_and_coherent(>dev, 
DMA_BIT_MASK(32));
+   if (retval) {
TW_PRINTK(host, TW_DRIVER, 0x25, "Failed to set dma mask during 
resume");
retval = -ENODEV;

Re: [GIT PULL] SCSI fixes for 5.0-rc7

2019-02-23 Thread pr-tracker-bot
The pull request you sent on Fri, 22 Feb 2019 19:08:00 -0800:

> git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-fixes

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/6089a91fc02e0a4f8962f0df1be236c44248d7ea

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker


[GIT PULL] SCSI fixes for 5.0-rc7

2019-02-22 Thread James Bottomley
Four small fixes: three in drivers and one in the core.  The core fix
is also minor in scope since the bug it fixes is only known to affect
systems using SCSI reservations.  Of the driver bugs, the libsas one is
 the most major because it can lead to multiple disks on the same
expander not being exposed.

The patch is available here:

git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-fixes

The short changelog is:

Anoob Soman (1):
  scsi: libiscsi: Fix race between iscsi_xmit_task and iscsi_complete_task

John Garry (1):
  scsi: libsas: Fix rphy phy_identifier for PHYs with end devices attached

Martin Wilck (1):
  scsi: core: reset host byte in DID_NEXUS_FAILURE case

Masato Suzuki (1):
  scsi: sd_zbc: Fix sd_zbc_report_zones() buffer allocation

And the diffstat:

 drivers/scsi/libiscsi.c| 6 ++
 drivers/scsi/libsas/sas_expander.c | 2 ++
 drivers/scsi/scsi_lib.c| 1 +
 drivers/scsi/sd_zbc.c  | 8 +---
 4 files changed, 14 insertions(+), 3 deletions(-)

With full diff below.

James

---

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index b8d325ce8754..120fc520f27a 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -1459,7 +1459,13 @@ static int iscsi_xmit_task(struct iscsi_conn *conn)
if (test_bit(ISCSI_SUSPEND_BIT, >suspend_tx))
return -ENODATA;
 
+   spin_lock_bh(>session->back_lock);
+   if (conn->task == NULL) {
+   spin_unlock_bh(>session->back_lock);
+   return -ENODATA;
+   }
__iscsi_get_task(task);
+   spin_unlock_bh(>session->back_lock);
spin_unlock_bh(>session->frwd_lock);
rc = conn->session->tt->xmit_task(task);
spin_lock_bh(>session->frwd_lock);
diff --git a/drivers/scsi/libsas/sas_expander.c 
b/drivers/scsi/libsas/sas_expander.c
index 17eb4185f29d..f21c93bbb35c 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -828,6 +828,7 @@ static struct domain_device *sas_ex_discover_end_dev(
rphy = sas_end_device_alloc(phy->port);
if (!rphy)
goto out_free;
+   rphy->identify.phy_identifier = phy_id;
 
child->rphy = rphy;
get_device(>dev);
@@ -854,6 +855,7 @@ static struct domain_device *sas_ex_discover_end_dev(
 
child->rphy = rphy;
get_device(>dev);
+   rphy->identify.phy_identifier = phy_id;
sas_fill_in_rphy(child, rphy);
 
list_add_tail(>disco_list_node, 
>port->disco_list);
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 6d65ac584eba..f8d51c3d5582 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -655,6 +655,7 @@ static blk_status_t scsi_result_to_blk_status(struct 
scsi_cmnd *cmd, int result)
set_host_byte(cmd, DID_OK);
return BLK_STS_TARGET;
case DID_NEXUS_FAILURE:
+   set_host_byte(cmd, DID_OK);
return BLK_STS_NEXUS;
case DID_ALLOC_FAILURE:
set_host_byte(cmd, DID_OK);
diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c
index fff86940388b..a340af797a85 100644
--- a/drivers/scsi/sd_zbc.c
+++ b/drivers/scsi/sd_zbc.c
@@ -142,10 +142,12 @@ int sd_zbc_report_zones(struct gendisk *disk, sector_t 
sector,
return -EOPNOTSUPP;
 
/*
-* Get a reply buffer for the number of requested zones plus a header.
-* For ATA, buffers must be aligned to 512B.
+* Get a reply buffer for the number of requested zones plus a header,
+* without exceeding the device maximum command size. For ATA disks,
+* buffers must be aligned to 512B.
 */
-   buflen = roundup((nrz + 1) * 64, 512);
+   buflen = min(queue_max_hw_sectors(disk->queue) << 9,
+roundup((nrz + 1) * 64, 512));
buf = kmalloc(buflen, gfp_mask);
if (!buf)
return -ENOMEM;