Skip to content

Commit 8d5e72d

Browse files
committed
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/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" ...
2 parents 2bd8040 + e7731da commit 8d5e72d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+4299
-2748
lines changed

Documentation/powerpc/cxlflash.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,11 @@ DK_CXLFLASH_USER_VIRTUAL
239239
resource handle that is provided is already referencing provisioned
240240
storage. This is reflected by the last LBA being a non-zero value.
241241

242+
When a LUN is accessible from more than one port, this ioctl will
243+
return with the DK_CXLFLASH_ALL_PORTS_ACTIVE return flag set. This
244+
provides the user with a hint that I/O can be retried in the event
245+
of an I/O error as the LUN can be reached over multiple paths.
246+
242247
DK_CXLFLASH_VLUN_RESIZE
243248
-----------------------
244249
This ioctl is responsible for resizing a previously created virtual

Documentation/scsi/scsi_eh.txt

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ with the command.
7070
scmd is requeued to blk queue.
7171

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

7676

@@ -103,13 +103,14 @@ function
103103
eh_timed_out() callback did not handle the command.
104104
Step #2 is taken.
105105

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

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

114115
[1-3] Asynchronous command aborts
115116

@@ -124,16 +125,13 @@ function
124125

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

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

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

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

134-
4. Increments shost->host_failed
135-
136-
5. Wakes up SCSI EH thread if shost->host_busy == shost->host_failed
134+
4. Wakes up SCSI EH thread if shost->host_busy == shost->host_failed
137135

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

250248
1. Error completion / time out
251249
ACTION: scsi_eh_scmd_add() is invoked for scmd
252-
- set scmd->eh_eflags
253250
- add scmd to shost->eh_cmd_q
254251
- set SHOST_RECOVERY
255252
- shost->host_failed++
@@ -263,7 +260,6 @@ scmd->allowed.
263260

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

457453
- shost->host_failed is zero.
458454

459-
- Each scmd's eh_eflags field is cleared.
460-
461455
- Each scmd is in such a state that scsi_setup_cmd_retry() on the
462456
scmd doesn't make any difference.
463457

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10079,7 +10079,6 @@ F: drivers/scsi/pmcraid.*
1007910079
PMC SIERRA PM8001 DRIVER
1008010080
M: Jack Wang <jinpu.wang@profitbricks.com>
1008110081
M: lindar_liu@usish.com
10082-
L: pmchba@pmcs.com
1008310082
L: linux-scsi@vger.kernel.org
1008410083
S: Supported
1008510084
F: drivers/scsi/pm8001/

drivers/message/fusion/mptbase.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7396,7 +7396,7 @@ mpt_display_event_info(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply)
73967396
break;
73977397
case MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED:
73987398
snprintf(evStr, EVENT_DESCR_STR_SZ,
7399-
"SAS Device Status Change: No Persistancy: "
7399+
"SAS Device Status Change: No Persistency: "
74007400
"id=%d channel=%d", id, channel);
74017401
break;
74027402
case MPI_EVENT_SAS_DEV_STAT_RC_UNSUPPORTED:

drivers/message/fusion/mptfc.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,7 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
13291329
WQ_MEM_RECLAIM);
13301330
if (!ioc->fc_rescan_work_q) {
13311331
error = -ENOMEM;
1332-
goto out_mptfc_probe;
1332+
goto out_mptfc_host;
13331333
}
13341334

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

13521352
return 0;
13531353

1354+
out_mptfc_host:
1355+
scsi_remove_host(sh);
1356+
13541357
out_mptfc_probe:
13551358

13561359
mptscsih_remove(pdev);
@@ -1530,6 +1533,8 @@ static void mptfc_remove(struct pci_dev *pdev)
15301533
}
15311534
}
15321535

1536+
scsi_remove_host(ioc->sh);
1537+
15331538
mptscsih_remove(pdev);
15341539
}
15351540

drivers/message/fusion/mptscsih.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,8 +1176,6 @@ mptscsih_remove(struct pci_dev *pdev)
11761176
MPT_SCSI_HOST *hd;
11771177
int sz1;
11781178

1179-
scsi_remove_host(host);
1180-
11811179
if((hd = shost_priv(host)) == NULL)
11821180
return;
11831181

drivers/message/fusion/mptspi.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1548,11 +1548,19 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
15481548
return error;
15491549
}
15501550

1551+
static void mptspi_remove(struct pci_dev *pdev)
1552+
{
1553+
MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
1554+
1555+
scsi_remove_host(ioc->sh);
1556+
mptscsih_remove(pdev);
1557+
}
1558+
15511559
static struct pci_driver mptspi_driver = {
15521560
.name = "mptspi",
15531561
.id_table = mptspi_pci_table,
15541562
.probe = mptspi_probe,
1555-
.remove = mptscsih_remove,
1563+
.remove = mptspi_remove,
15561564
.shutdown = mptscsih_shutdown,
15571565
#ifdef CONFIG_PM
15581566
.suspend = mptscsih_suspend,

drivers/misc/enclosure.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ enclosure_register(struct device *dev, const char *name, int components,
148148
for (i = 0; i < components; i++) {
149149
edev->component[i].number = -1;
150150
edev->component[i].slot = -1;
151-
edev->component[i].power_status = 1;
151+
edev->component[i].power_status = -1;
152152
}
153153

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

595595
if (edev->cb->get_power_status)
596596
edev->cb->get_power_status(edev, ecomp);
597+
598+
/* If still uninitialized, the callback failed or does not exist. */
599+
if (ecomp->power_status == -1)
600+
return (edev->cb->get_power_status) ? -EIO : -ENOTTY;
601+
597602
return snprintf(buf, 40, "%s\n", ecomp->power_status ? "on" : "off");
598603
}
599604

drivers/scsi/BusLogic.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3009,7 +3009,7 @@ static int blogic_hostreset(struct scsi_cmnd *SCpnt)
30093009

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

3012-
blogic_inc_count(&stats->adatper_reset_req);
3012+
blogic_inc_count(&stats->adapter_reset_req);
30133013

30143014
rc = blogic_resetadapter(adapter, false);
30153015
spin_unlock_irq(SCpnt->device->host->host_lock);
@@ -3560,8 +3560,16 @@ Target Requested Completed Requested Completed Requested Completed\n\
35603560
struct blogic_tgt_flags *tgt_flags = &adapter->tgt_flags[tgt];
35613561
if (!tgt_flags->tgt_exists)
35623562
continue;
3563-
seq_printf(m, "\
3564-
%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);
3563+
seq_printf(m, " %2d %5d %5d %5d %5d %5d %5d %5d %5d %5d\n",
3564+
tgt, tgt_stats[tgt].aborts_request,
3565+
tgt_stats[tgt].aborts_tried,
3566+
tgt_stats[tgt].aborts_done,
3567+
tgt_stats[tgt].bdr_request,
3568+
tgt_stats[tgt].bdr_tried,
3569+
tgt_stats[tgt].bdr_done,
3570+
tgt_stats[tgt].adapter_reset_req,
3571+
tgt_stats[tgt].adapter_reset_attempt,
3572+
tgt_stats[tgt].adapter_reset_done);
35653573
}
35663574
seq_printf(m, "\nExternal Host Adapter Resets: %d\n", adapter->ext_resets);
35673575
seq_printf(m, "Host Adapter Internal Errors: %d\n", adapter->adapter_intern_errors);

drivers/scsi/BusLogic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ struct blogic_tgt_stats {
935935
unsigned short bdr_request;
936936
unsigned short bdr_tried;
937937
unsigned short bdr_done;
938-
unsigned short adatper_reset_req;
938+
unsigned short adapter_reset_req;
939939
unsigned short adapter_reset_attempt;
940940
unsigned short adapter_reset_done;
941941
};

drivers/scsi/aacraid/aachba.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,8 +1678,8 @@ int aac_issue_bmic_identify(struct aac_dev *dev, u32 bus, u32 target)
16781678
sizeof(struct sgentry) + sizeof(struct sgentry64);
16791679
datasize = sizeof(struct aac_ciss_identify_pd);
16801680

1681-
identify_resp = pci_alloc_consistent(dev->pdev, datasize, &addr);
1682-
1681+
identify_resp = dma_alloc_coherent(&dev->pdev->dev, datasize, &addr,
1682+
GFP_KERNEL);
16831683
if (!identify_resp)
16841684
goto fib_free_ptr;
16851685

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

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

17251725
aac_fib_complete(fibptr);
17261726

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

1817-
phys_luns = (struct aac_ciss_phys_luns_resp *) pci_alloc_consistent(
1818-
dev->pdev, datasize, &addr);
1819-
1817+
phys_luns = dma_alloc_coherent(&dev->pdev->dev, datasize, &addr,
1818+
GFP_KERNEL);
18201819
if (phys_luns == NULL) {
18211820
rcode = -ENOMEM;
18221821
goto err_out;
@@ -1861,7 +1860,7 @@ int aac_report_phys_luns(struct aac_dev *dev, struct fib *fibptr, int rescan)
18611860
aac_update_hba_map(dev, phys_luns, rescan);
18621861
}
18631862

1864-
pci_free_consistent(dev->pdev, datasize, (void *) phys_luns, addr);
1863+
dma_free_coherent(&dev->pdev->dev, datasize, phys_luns, addr);
18651864
err_out:
18661865
return rcode;
18671866
}

drivers/scsi/aacraid/commctrl.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ static int ioctl_send_fib(struct aac_dev * dev, void __user *arg)
100100
goto cleanup;
101101
}
102102

103-
kfib = pci_alloc_consistent(dev->pdev, size, &daddr);
103+
kfib = dma_alloc_coherent(&dev->pdev->dev, size, &daddr,
104+
GFP_KERNEL);
104105
if (!kfib) {
105106
retval = -ENOMEM;
106107
goto cleanup;
@@ -160,7 +161,8 @@ static int ioctl_send_fib(struct aac_dev * dev, void __user *arg)
160161
retval = -EFAULT;
161162
cleanup:
162163
if (hw_fib) {
163-
pci_free_consistent(dev->pdev, size, kfib, fibptr->hw_fib_pa);
164+
dma_free_coherent(&dev->pdev->dev, size, kfib,
165+
fibptr->hw_fib_pa);
164166
fibptr->hw_fib_pa = hw_fib_pa;
165167
fibptr->hw_fib_va = hw_fib;
166168
}

drivers/scsi/aacraid/comminit.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long co
9999
size = fibsize + aac_init_size + commsize + commalign +
100100
printfbufsiz + host_rrq_size;
101101

102-
base = pci_alloc_consistent(dev->pdev, size, &phys);
103-
102+
base = dma_alloc_coherent(&dev->pdev->dev, size, &phys, GFP_KERNEL);
104103
if (base == NULL) {
105104
printk(KERN_ERR "aacraid: unable to create mapping.\n");
106105
return 0;

drivers/scsi/aacraid/commsup.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ static int fib_map_alloc(struct aac_dev *dev)
7373
}
7474

7575
dprintk((KERN_INFO
76-
"allocate hardware fibs pci_alloc_consistent(%p, %d * (%d + %d), %p)\n",
77-
dev->pdev, dev->max_cmd_size, dev->scsi_host_ptr->can_queue,
76+
"allocate hardware fibs dma_alloc_coherent(%p, %d * (%d + %d), %p)\n",
77+
&dev->pdev->dev, dev->max_cmd_size, dev->scsi_host_ptr->can_queue,
7878
AAC_NUM_MGT_FIB, &dev->hw_fib_pa));
79-
dev->hw_fib_va = pci_alloc_consistent(dev->pdev,
79+
dev->hw_fib_va = dma_alloc_coherent(&dev->pdev->dev,
8080
(dev->max_cmd_size + sizeof(struct aac_fib_xporthdr))
8181
* (dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB) + (ALIGN32 - 1),
82-
&dev->hw_fib_pa);
82+
&dev->hw_fib_pa, GFP_KERNEL);
8383
if (dev->hw_fib_va == NULL)
8484
return -ENOMEM;
8585
return 0;
@@ -106,8 +106,8 @@ void aac_fib_map_free(struct aac_dev *dev)
106106
fib_size = dev->max_fib_size + sizeof(struct aac_fib_xporthdr);
107107
alloc_size = fib_size * num_fibs + ALIGN32 - 1;
108108

109-
pci_free_consistent(dev->pdev, alloc_size, dev->hw_fib_va,
110-
dev->hw_fib_pa);
109+
dma_free_coherent(&dev->pdev->dev, alloc_size, dev->hw_fib_va,
110+
dev->hw_fib_pa);
111111

112112
dev->hw_fib_va = NULL;
113113
dev->hw_fib_pa = 0;
@@ -1571,7 +1571,8 @@ static int _aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type)
15711571
* case.
15721572
*/
15731573
aac_fib_map_free(aac);
1574-
pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr, aac->comm_phys);
1574+
dma_free_coherent(&aac->pdev->dev, aac->comm_size, aac->comm_addr,
1575+
aac->comm_phys);
15751576
aac->comm_addr = NULL;
15761577
aac->comm_phys = 0;
15771578
kfree(aac->queues);
@@ -2319,7 +2320,8 @@ static int aac_send_wellness_command(struct aac_dev *dev, char *wellness_str,
23192320
if (!fibptr)
23202321
goto out;
23212322

2322-
dma_buf = pci_alloc_consistent(dev->pdev, datasize, &addr);
2323+
dma_buf = dma_alloc_coherent(&dev->pdev->dev, datasize, &addr,
2324+
GFP_KERNEL);
23232325
if (!dma_buf)
23242326
goto fib_free_out;
23252327

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

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

23592361
/*
23602362
* Do not set XferState to zero unless

drivers/scsi/aacraid/linit.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,8 +1592,8 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
15921592
out_unmap:
15931593
aac_fib_map_free(aac);
15941594
if (aac->comm_addr)
1595-
pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr,
1596-
aac->comm_phys);
1595+
dma_free_coherent(&aac->pdev->dev, aac->comm_size,
1596+
aac->comm_addr, aac->comm_phys);
15971597
kfree(aac->queues);
15981598
aac_adapter_ioremap(aac, 0);
15991599
kfree(aac->fibs);
@@ -1729,8 +1729,8 @@ static void aac_remove_one(struct pci_dev *pdev)
17291729

17301730
__aac_shutdown(aac);
17311731
aac_fib_map_free(aac);
1732-
pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr,
1733-
aac->comm_phys);
1732+
dma_free_coherent(&aac->pdev->dev, aac->comm_size, aac->comm_addr,
1733+
aac->comm_phys);
17341734
kfree(aac->queues);
17351735

17361736
aac_adapter_ioremap(aac, 0);

0 commit comments

Comments
 (0)