Skip to content

Commit

Permalink
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/jejb/scsi

Pull SCSI updates from James Bottomley:
 "This update includes the usual round of major driver updates
  (hisi_sas, ufs, fnic, cxlflash, be2iscsi, ipr, stex). There's also the
  usual amount of cosmetic and spelling stuff"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (155 commits)
  scsi: qla4xxx: fix spelling mistake: "Tempalate" -> "Template"
  scsi: stex: make S6flag static
  scsi: mac_esp: fix to pass correct device identity to free_irq()
  scsi: aacraid: pci_alloc_consistent() failures on ARM64
  scsi: ufs: make ufshcd_get_lists_status() register operation obvious
  scsi: ufs: use MASK_EE_STATUS
  scsi: mac_esp: Replace bogus memory barrier with spinlock
  scsi: fcoe: make fcoe_e_d_tov and fcoe_r_a_tov static
  scsi: sd_zbc: Do not write lock zones for reset
  scsi: sd_zbc: Remove superfluous assignments
  scsi: sd: sd_zbc: Rename sd_zbc_setup_write_cmnd
  scsi: Improve scsi_get_sense_info_fld
  scsi: sd: Cleanup sd_done sense data handling
  scsi: sd: Improve sd_completed_bytes
  scsi: sd: Fix function descriptions
  scsi: mpt3sas: remove redundant wmb
  scsi: mpt: Move scsi_remove_host() out of mptscsih_remove_host()
  scsi: sg: reset 'res_in_use' after unlinking reserved array
  scsi: mvumi: remove code handling zero scsi_sg_count(scmd) case
  scsi: fusion: fix spelling mistake: "Persistancy" -> "Persistency"
  ...
  • Loading branch information
Linus Torvalds committed May 4, 2017
2 parents 2bd8040 + e7731da commit 8d5e72d
Show file tree
Hide file tree
Showing 119 changed files with 4,299 additions and 2,748 deletions.
5 changes: 5 additions & 0 deletions Documentation/powerpc/cxlflash.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ DK_CXLFLASH_USER_VIRTUAL
resource handle that is provided is already referencing provisioned
storage. This is reflected by the last LBA being a non-zero value.

When a LUN is accessible from more than one port, this ioctl will
return with the DK_CXLFLASH_ALL_PORTS_ACTIVE return flag set. This
provides the user with a hint that I/O can be retried in the event
of an I/O error as the LUN can be reached over multiple paths.

DK_CXLFLASH_VLUN_RESIZE
-----------------------
This ioctl is responsible for resizing a previously created virtual
Expand Down
30 changes: 12 additions & 18 deletions Documentation/scsi/scsi_eh.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ with the command.
scmd is requeued to blk queue.

- otherwise
scsi_eh_scmd_add(scmd, 0) is invoked for the command. See
scsi_eh_scmd_add(scmd) is invoked for the command. See
[1-3] for details of this function.


Expand Down Expand Up @@ -103,13 +103,14 @@ function
eh_timed_out() callback did not handle the command.
Step #2 is taken.

2. If the host supports asynchronous completion (as indicated by the
no_async_abort setting in the host template) scsi_abort_command()
is invoked to schedule an asynchrous abort. If that fails
Step #3 is taken.
2. scsi_abort_command() is invoked to schedule an asynchrous abort.
Asynchronous abort are not invoked for commands which the
SCSI_EH_ABORT_SCHEDULED flag is set (this indicates that the command
already had been aborted once, and this is a retry which failed),
or when the EH deadline is expired. In these case Step #3 is taken.

2. scsi_eh_scmd_add(scmd, SCSI_EH_CANCEL_CMD) is invoked for the
command. See [1-3] for more information.
3. scsi_eh_scmd_add(scmd, SCSI_EH_CANCEL_CMD) is invoked for the
command. See [1-4] for more information.

[1-3] Asynchronous command aborts

Expand All @@ -124,16 +125,13 @@ function

scmds enter EH via scsi_eh_scmd_add(), which does the following.

1. Turns on scmd->eh_eflags as requested. It's 0 for error
completions and SCSI_EH_CANCEL_CMD for timeouts.
1. Links scmd->eh_entry to shost->eh_cmd_q

2. Links scmd->eh_entry to shost->eh_cmd_q
2. Sets SHOST_RECOVERY bit in shost->shost_state

3. Sets SHOST_RECOVERY bit in shost->shost_state
3. Increments shost->host_failed

4. Increments shost->host_failed

5. Wakes up SCSI EH thread if shost->host_busy == shost->host_failed
4. Wakes up SCSI EH thread if shost->host_busy == shost->host_failed

As can be seen above, once any scmd is added to shost->eh_cmd_q,
SHOST_RECOVERY shost_state bit is turned on. This prevents any new
Expand Down Expand Up @@ -249,7 +247,6 @@ scmd->allowed.

1. Error completion / time out
ACTION: scsi_eh_scmd_add() is invoked for scmd
- set scmd->eh_eflags
- add scmd to shost->eh_cmd_q
- set SHOST_RECOVERY
- shost->host_failed++
Expand All @@ -263,7 +260,6 @@ scmd->allowed.

3. scmd recovered
ACTION: scsi_eh_finish_cmd() is invoked to EH-finish scmd
- clear scmd->eh_eflags
- scsi_setup_cmd_retry()
- move from local eh_work_q to local eh_done_q
LOCKING: none
Expand Down Expand Up @@ -456,8 +452,6 @@ except for #1 must be implemented by eh_strategy_handler().

- shost->host_failed is zero.

- Each scmd's eh_eflags field is cleared.

- Each scmd is in such a state that scsi_setup_cmd_retry() on the
scmd doesn't make any difference.

Expand Down
1 change: 0 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -10079,7 +10079,6 @@ F: drivers/scsi/pmcraid.*
PMC SIERRA PM8001 DRIVER
M: Jack Wang <jinpu.wang@profitbricks.com>
M: lindar_liu@usish.com
L: pmchba@pmcs.com
L: linux-scsi@vger.kernel.org
S: Supported
F: drivers/scsi/pm8001/
Expand Down
2 changes: 1 addition & 1 deletion drivers/message/fusion/mptbase.c
Original file line number Diff line number Diff line change
Expand Up @@ -7396,7 +7396,7 @@ mpt_display_event_info(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply)
break;
case MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED:
snprintf(evStr, EVENT_DESCR_STR_SZ,
"SAS Device Status Change: No Persistancy: "
"SAS Device Status Change: No Persistency: "
"id=%d channel=%d", id, channel);
break;
case MPI_EVENT_SAS_DEV_STAT_RC_UNSUPPORTED:
Expand Down
7 changes: 6 additions & 1 deletion drivers/message/fusion/mptfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1329,7 +1329,7 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
WQ_MEM_RECLAIM);
if (!ioc->fc_rescan_work_q) {
error = -ENOMEM;
goto out_mptfc_probe;
goto out_mptfc_host;
}

/*
Expand All @@ -1351,6 +1351,9 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)

return 0;

out_mptfc_host:
scsi_remove_host(sh);

out_mptfc_probe:

mptscsih_remove(pdev);
Expand Down Expand Up @@ -1530,6 +1533,8 @@ static void mptfc_remove(struct pci_dev *pdev)
}
}

scsi_remove_host(ioc->sh);

mptscsih_remove(pdev);
}

Expand Down
2 changes: 0 additions & 2 deletions drivers/message/fusion/mptscsih.c
Original file line number Diff line number Diff line change
Expand Up @@ -1176,8 +1176,6 @@ mptscsih_remove(struct pci_dev *pdev)
MPT_SCSI_HOST *hd;
int sz1;

scsi_remove_host(host);

if((hd = shost_priv(host)) == NULL)
return;

Expand Down
10 changes: 9 additions & 1 deletion drivers/message/fusion/mptspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1548,11 +1548,19 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
return error;
}

static void mptspi_remove(struct pci_dev *pdev)
{
MPT_ADAPTER *ioc = pci_get_drvdata(pdev);

scsi_remove_host(ioc->sh);
mptscsih_remove(pdev);
}

static struct pci_driver mptspi_driver = {
.name = "mptspi",
.id_table = mptspi_pci_table,
.probe = mptspi_probe,
.remove = mptscsih_remove,
.remove = mptspi_remove,
.shutdown = mptscsih_shutdown,
#ifdef CONFIG_PM
.suspend = mptscsih_suspend,
Expand Down
7 changes: 6 additions & 1 deletion drivers/misc/enclosure.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ enclosure_register(struct device *dev, const char *name, int components,
for (i = 0; i < components; i++) {
edev->component[i].number = -1;
edev->component[i].slot = -1;
edev->component[i].power_status = 1;
edev->component[i].power_status = -1;
}

mutex_lock(&container_list_lock);
Expand Down Expand Up @@ -594,6 +594,11 @@ static ssize_t get_component_power_status(struct device *cdev,

if (edev->cb->get_power_status)
edev->cb->get_power_status(edev, ecomp);

/* If still uninitialized, the callback failed or does not exist. */
if (ecomp->power_status == -1)
return (edev->cb->get_power_status) ? -EIO : -ENOTTY;

return snprintf(buf, 40, "%s\n", ecomp->power_status ? "on" : "off");
}

Expand Down
14 changes: 11 additions & 3 deletions drivers/scsi/BusLogic.c
Original file line number Diff line number Diff line change
Expand Up @@ -3009,7 +3009,7 @@ static int blogic_hostreset(struct scsi_cmnd *SCpnt)

spin_lock_irq(SCpnt->device->host->host_lock);

blogic_inc_count(&stats->adatper_reset_req);
blogic_inc_count(&stats->adapter_reset_req);

rc = blogic_resetadapter(adapter, false);
spin_unlock_irq(SCpnt->device->host->host_lock);
Expand Down Expand Up @@ -3560,8 +3560,16 @@ Target Requested Completed Requested Completed Requested Completed\n\
struct blogic_tgt_flags *tgt_flags = &adapter->tgt_flags[tgt];
if (!tgt_flags->tgt_exists)
continue;
seq_printf(m, "\
%2d %5d %5d %5d %5d %5d %5d %5d %5d %5d\n", tgt, tgt_stats[tgt].aborts_request, tgt_stats[tgt].aborts_tried, tgt_stats[tgt].aborts_done, tgt_stats[tgt].bdr_request, tgt_stats[tgt].bdr_tried, tgt_stats[tgt].bdr_done, tgt_stats[tgt].adatper_reset_req, tgt_stats[tgt].adapter_reset_attempt, tgt_stats[tgt].adapter_reset_done);
seq_printf(m, " %2d %5d %5d %5d %5d %5d %5d %5d %5d %5d\n",
tgt, tgt_stats[tgt].aborts_request,
tgt_stats[tgt].aborts_tried,
tgt_stats[tgt].aborts_done,
tgt_stats[tgt].bdr_request,
tgt_stats[tgt].bdr_tried,
tgt_stats[tgt].bdr_done,
tgt_stats[tgt].adapter_reset_req,
tgt_stats[tgt].adapter_reset_attempt,
tgt_stats[tgt].adapter_reset_done);
}
seq_printf(m, "\nExternal Host Adapter Resets: %d\n", adapter->ext_resets);
seq_printf(m, "Host Adapter Internal Errors: %d\n", adapter->adapter_intern_errors);
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/BusLogic.h
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ struct blogic_tgt_stats {
unsigned short bdr_request;
unsigned short bdr_tried;
unsigned short bdr_done;
unsigned short adatper_reset_req;
unsigned short adapter_reset_req;
unsigned short adapter_reset_attempt;
unsigned short adapter_reset_done;
};
Expand Down
13 changes: 6 additions & 7 deletions drivers/scsi/aacraid/aachba.c
Original file line number Diff line number Diff line change
Expand Up @@ -1678,8 +1678,8 @@ int aac_issue_bmic_identify(struct aac_dev *dev, u32 bus, u32 target)
sizeof(struct sgentry) + sizeof(struct sgentry64);
datasize = sizeof(struct aac_ciss_identify_pd);

identify_resp = pci_alloc_consistent(dev->pdev, datasize, &addr);

identify_resp = dma_alloc_coherent(&dev->pdev->dev, datasize, &addr,
GFP_KERNEL);
if (!identify_resp)
goto fib_free_ptr;

Expand Down Expand Up @@ -1720,7 +1720,7 @@ int aac_issue_bmic_identify(struct aac_dev *dev, u32 bus, u32 target)
dev->hba_map[bus][target].qd_limit =
identify_resp->current_queue_depth_limit;

pci_free_consistent(dev->pdev, datasize, (void *)identify_resp, addr);
dma_free_coherent(&dev->pdev->dev, datasize, identify_resp, addr);

aac_fib_complete(fibptr);

Expand Down Expand Up @@ -1814,9 +1814,8 @@ int aac_report_phys_luns(struct aac_dev *dev, struct fib *fibptr, int rescan)
datasize = sizeof(struct aac_ciss_phys_luns_resp)
+ (AAC_MAX_TARGETS - 1) * sizeof(struct _ciss_lun);

phys_luns = (struct aac_ciss_phys_luns_resp *) pci_alloc_consistent(
dev->pdev, datasize, &addr);

phys_luns = dma_alloc_coherent(&dev->pdev->dev, datasize, &addr,
GFP_KERNEL);
if (phys_luns == NULL) {
rcode = -ENOMEM;
goto err_out;
Expand Down Expand Up @@ -1861,7 +1860,7 @@ int aac_report_phys_luns(struct aac_dev *dev, struct fib *fibptr, int rescan)
aac_update_hba_map(dev, phys_luns, rescan);
}

pci_free_consistent(dev->pdev, datasize, (void *) phys_luns, addr);
dma_free_coherent(&dev->pdev->dev, datasize, phys_luns, addr);
err_out:
return rcode;
}
Expand Down
6 changes: 4 additions & 2 deletions drivers/scsi/aacraid/commctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ static int ioctl_send_fib(struct aac_dev * dev, void __user *arg)
goto cleanup;
}

kfib = pci_alloc_consistent(dev->pdev, size, &daddr);
kfib = dma_alloc_coherent(&dev->pdev->dev, size, &daddr,
GFP_KERNEL);
if (!kfib) {
retval = -ENOMEM;
goto cleanup;
Expand Down Expand Up @@ -160,7 +161,8 @@ static int ioctl_send_fib(struct aac_dev * dev, void __user *arg)
retval = -EFAULT;
cleanup:
if (hw_fib) {
pci_free_consistent(dev->pdev, size, kfib, fibptr->hw_fib_pa);
dma_free_coherent(&dev->pdev->dev, size, kfib,
fibptr->hw_fib_pa);
fibptr->hw_fib_pa = hw_fib_pa;
fibptr->hw_fib_va = hw_fib;
}
Expand Down
3 changes: 1 addition & 2 deletions drivers/scsi/aacraid/comminit.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long co
size = fibsize + aac_init_size + commsize + commalign +
printfbufsiz + host_rrq_size;

base = pci_alloc_consistent(dev->pdev, size, &phys);

base = dma_alloc_coherent(&dev->pdev->dev, size, &phys, GFP_KERNEL);
if (base == NULL) {
printk(KERN_ERR "aacraid: unable to create mapping.\n");
return 0;
Expand Down
20 changes: 11 additions & 9 deletions drivers/scsi/aacraid/commsup.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ static int fib_map_alloc(struct aac_dev *dev)
}

dprintk((KERN_INFO
"allocate hardware fibs pci_alloc_consistent(%p, %d * (%d + %d), %p)\n",
dev->pdev, dev->max_cmd_size, dev->scsi_host_ptr->can_queue,
"allocate hardware fibs dma_alloc_coherent(%p, %d * (%d + %d), %p)\n",
&dev->pdev->dev, dev->max_cmd_size, dev->scsi_host_ptr->can_queue,
AAC_NUM_MGT_FIB, &dev->hw_fib_pa));
dev->hw_fib_va = pci_alloc_consistent(dev->pdev,
dev->hw_fib_va = dma_alloc_coherent(&dev->pdev->dev,
(dev->max_cmd_size + sizeof(struct aac_fib_xporthdr))
* (dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB) + (ALIGN32 - 1),
&dev->hw_fib_pa);
&dev->hw_fib_pa, GFP_KERNEL);
if (dev->hw_fib_va == NULL)
return -ENOMEM;
return 0;
Expand All @@ -106,8 +106,8 @@ void aac_fib_map_free(struct aac_dev *dev)
fib_size = dev->max_fib_size + sizeof(struct aac_fib_xporthdr);
alloc_size = fib_size * num_fibs + ALIGN32 - 1;

pci_free_consistent(dev->pdev, alloc_size, dev->hw_fib_va,
dev->hw_fib_pa);
dma_free_coherent(&dev->pdev->dev, alloc_size, dev->hw_fib_va,
dev->hw_fib_pa);

dev->hw_fib_va = NULL;
dev->hw_fib_pa = 0;
Expand Down Expand Up @@ -1571,7 +1571,8 @@ static int _aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type)
* case.
*/
aac_fib_map_free(aac);
pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr, aac->comm_phys);
dma_free_coherent(&aac->pdev->dev, aac->comm_size, aac->comm_addr,
aac->comm_phys);
aac->comm_addr = NULL;
aac->comm_phys = 0;
kfree(aac->queues);
Expand Down Expand Up @@ -2319,7 +2320,8 @@ static int aac_send_wellness_command(struct aac_dev *dev, char *wellness_str,
if (!fibptr)
goto out;

dma_buf = pci_alloc_consistent(dev->pdev, datasize, &addr);
dma_buf = dma_alloc_coherent(&dev->pdev->dev, datasize, &addr,
GFP_KERNEL);
if (!dma_buf)
goto fib_free_out;

Expand Down Expand Up @@ -2354,7 +2356,7 @@ static int aac_send_wellness_command(struct aac_dev *dev, char *wellness_str,
ret = aac_fib_send(ScsiPortCommand64, fibptr, sizeof(struct aac_srb),
FsaNormal, 1, 1, NULL, NULL);

pci_free_consistent(dev->pdev, datasize, (void *)dma_buf, addr);
dma_free_coherent(&dev->pdev->dev, datasize, dma_buf, addr);

/*
* Do not set XferState to zero unless
Expand Down
8 changes: 4 additions & 4 deletions drivers/scsi/aacraid/linit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1592,8 +1592,8 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
out_unmap:
aac_fib_map_free(aac);
if (aac->comm_addr)
pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr,
aac->comm_phys);
dma_free_coherent(&aac->pdev->dev, aac->comm_size,
aac->comm_addr, aac->comm_phys);
kfree(aac->queues);
aac_adapter_ioremap(aac, 0);
kfree(aac->fibs);
Expand Down Expand Up @@ -1729,8 +1729,8 @@ static void aac_remove_one(struct pci_dev *pdev)

__aac_shutdown(aac);
aac_fib_map_free(aac);
pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr,
aac->comm_phys);
dma_free_coherent(&aac->pdev->dev, aac->comm_size, aac->comm_addr,
aac->comm_phys);
kfree(aac->queues);

aac_adapter_ioremap(aac, 0);
Expand Down
Loading

0 comments on commit 8d5e72d

Please sign in to comment.