Skip to content

Commit aa5ad10

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: "Updates to the usual drivers (target, ufs, smartpqi, lpfc). There are some core changes, mostly around reworking some of our user context assumptions in device put and moving some code around. The remaining updates are bug fixes and minor changes" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (138 commits) scsi: sg: Fix get_user() in call sg_scsi_ioctl() scsi: megaraid_sas: Fix some spelling mistakes in comment scsi: core: Use SCSI_SCAN_INITIAL in do_scsi_scan_host() scsi: core: Use SCSI_SCAN_RESCAN in __scsi_add_device() scsi: ufs: ufs-mediatek: Remove unnecessary return code scsi: ufs: core: Fix the polling implementation scsi: libsas: Do not export sas_ata_wait_after_reset() scsi: hisi_sas: Fix SATA devices missing issue during I_T nexus reset scsi: libsas: Add smp_ata_check_ready_type() scsi: Revert "scsi: hisi_sas: Don't send bcast events from HW during nexus HA reset" scsi: Revert "scsi: hisi_sas: Drain bcast events in hisi_sas_rescan_topology()" scsi: ufs: ufs-mediatek: Modify the return value scsi: ufs: ufs-mediatek: Remove unneeded code scsi: device_handler: alua: Call scsi_device_put() from non-atomic context scsi: device_handler: alua: Revert "Move a scsi_device_put() call out of alua_check_vpd()" scsi: snic: Fix possible UAF in snic_tgt_create() scsi: qla2xxx: Initialize vha->unknown_atio_[list, work] for NPIV hosts scsi: qla2xxx: Remove duplicate of vha->iocb_work initialization scsi: fcoe: Fix transport not deattached when fcoe_if_init() fails scsi: sd: Use 16-byte SYNCHRONIZE CACHE on ZBC devices ...
2 parents e2ca6ba + 4e80eef commit aa5ad10

File tree

103 files changed

+2535
-1191
lines changed

Some content is hidden

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

103 files changed

+2535
-1191
lines changed

Documentation/scsi/scsi_eh.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,17 @@ The timeout handler is scsi_timeout(). When a timeout occurs, this function
9292
1. invokes optional hostt->eh_timed_out() callback. Return value can
9393
be one of
9494

95-
- BLK_EH_RESET_TIMER
95+
- SCSI_EH_RESET_TIMER
9696
This indicates that more time is required to finish the
9797
command. Timer is restarted.
9898

99-
- BLK_EH_DONE
99+
- SCSI_EH_NOT_HANDLED
100100
eh_timed_out() callback did not handle the command.
101101
Step #2 is taken.
102102

103+
- SCSI_EH_DONE
104+
eh_timed_out() completed the command.
105+
103106
2. scsi_abort_command() is invoked to schedule an asynchronous abort which may
104107
issue a retry scmd->allowed + 1 times. Asynchronous aborts are not invoked
105108
for commands for which the SCSI_EH_ABORT_SCHEDULED flag is set (this

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9362,7 +9362,7 @@ F: Documentation/devicetree/bindings/infiniband/hisilicon-hns-roce.txt
93629362
F: drivers/infiniband/hw/hns/
93639363

93649364
HISILICON SAS Controller
9365-
M: John Garry <john.garry@huawei.com>
9365+
M: Xiang Chen <chenxiang66@hisilicon.com>
93669366
S: Supported
93679367
W: http://www.hisilicon.com
93689368
F: Documentation/devicetree/bindings/scsi/hisilicon-sas.txt

drivers/message/fusion/mptctl.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2879,7 +2879,6 @@ static struct mpt_pci_driver mptctl_driver = {
28792879
static int __init mptctl_init(void)
28802880
{
28812881
int err;
2882-
int where = 1;
28832882

28842883
show_mptmod_ver(my_NAME, my_VERSION);
28852884

@@ -2898,7 +2897,6 @@ static int __init mptctl_init(void)
28982897
/*
28992898
* Install our handler
29002899
*/
2901-
++where;
29022900
mptctl_id = mpt_register(mptctl_reply, MPTCTL_DRIVER,
29032901
"mptctl_reply");
29042902
if (!mptctl_id || mptctl_id >= MPT_MAX_PROTOCOL_DRIVERS) {

drivers/message/fusion/mptsas.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,12 +1952,12 @@ mptsas_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt)
19521952
* @sc: scsi command that the midlayer is about to time out
19531953
*
19541954
**/
1955-
static enum blk_eh_timer_return mptsas_eh_timed_out(struct scsi_cmnd *sc)
1955+
static enum scsi_timeout_action mptsas_eh_timed_out(struct scsi_cmnd *sc)
19561956
{
19571957
MPT_SCSI_HOST *hd;
19581958
MPT_ADAPTER *ioc;
19591959
VirtDevice *vdevice;
1960-
enum blk_eh_timer_return rc = BLK_EH_DONE;
1960+
enum scsi_timeout_action rc = SCSI_EH_NOT_HANDLED;
19611961

19621962
hd = shost_priv(sc->device->host);
19631963
if (hd == NULL) {
@@ -1980,15 +1980,15 @@ static enum blk_eh_timer_return mptsas_eh_timed_out(struct scsi_cmnd *sc)
19801980
dtmprintk(ioc, printk(MYIOC_s_WARN_FMT ": %s: ioc is in reset,"
19811981
"SML need to reset the timer (sc=%p)\n",
19821982
ioc->name, __func__, sc));
1983-
rc = BLK_EH_RESET_TIMER;
1983+
rc = SCSI_EH_RESET_TIMER;
19841984
}
19851985
vdevice = sc->device->hostdata;
19861986
if (vdevice && vdevice->vtarget && (vdevice->vtarget->inDMD
19871987
|| vdevice->vtarget->deleted)) {
19881988
dtmprintk(ioc, printk(MYIOC_s_WARN_FMT ": %s: target removed "
19891989
"or in device removal delay (sc=%p)\n",
19901990
ioc->name, __func__, sc));
1991-
rc = BLK_EH_RESET_TIMER;
1991+
rc = SCSI_EH_RESET_TIMER;
19921992
goto done;
19931993
}
19941994

drivers/scsi/BusLogic.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2198,7 +2198,7 @@ static int blogic_slaveconfig(struct scsi_device *dev)
21982198

21992199
static int __init blogic_init(void)
22002200
{
2201-
int adapter_count = 0, drvr_optindex = 0, probeindex;
2201+
int drvr_optindex = 0, probeindex;
22022202
struct blogic_adapter *adapter;
22032203
int ret = 0;
22042204

@@ -2368,10 +2368,8 @@ static int __init blogic_init(void)
23682368
list_del(&myadapter->host_list);
23692369
scsi_host_put(host);
23702370
ret = -ENODEV;
2371-
} else {
2371+
} else
23722372
scsi_scan_host(host);
2373-
adapter_count++;
2374-
}
23752373
}
23762374
} else {
23772375
/*

drivers/scsi/NCR5380.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ static void NCR5380_dma_complete(struct Scsi_Host *instance)
858858
* latency, but a bus reset will reset chip logic. Checking for parity error
859859
* is unnecessary because that interrupt is never enabled. A Loss of BSY
860860
* condition will clear DMA Mode. We can tell when this occurs because the
861-
* the Busy Monitor interrupt is enabled together with DMA Mode.
861+
* Busy Monitor interrupt is enabled together with DMA Mode.
862862
*/
863863

864864
static irqreturn_t __maybe_unused NCR5380_intr(int irq, void *dev_id)

drivers/scsi/bfa/bfa_fc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1548,7 +1548,7 @@ enum fdmi_port_attribute_type {
15481548
struct fdmi_attr_s {
15491549
__be16 type;
15501550
__be16 len;
1551-
u8 value[1];
1551+
u8 value[];
15521552
};
15531553

15541554
/*

drivers/scsi/bfa/bfad_bsg.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2540,6 +2540,35 @@ bfad_iocmd_vf_clr_stats(struct bfad_s *bfad, void *cmd)
25402540
return 0;
25412541
}
25422542

2543+
/*
2544+
* Set the SCSI device sdev_bflags - sdev_bflags are used by the
2545+
* SCSI mid-layer to choose LUN Scanning mode REPORT_LUNS vs. Sequential Scan
2546+
*
2547+
* Internally iterates over all the ITNIM's part of the im_port & sets the
2548+
* sdev_bflags for the scsi_device associated with LUN #0.
2549+
*/
2550+
static void bfad_reset_sdev_bflags(struct bfad_im_port_s *im_port,
2551+
int lunmask_cfg)
2552+
{
2553+
const u32 scan_flags = BLIST_NOREPORTLUN | BLIST_SPARSELUN;
2554+
struct bfad_itnim_s *itnim;
2555+
struct scsi_device *sdev;
2556+
unsigned long flags;
2557+
2558+
spin_lock_irqsave(im_port->shost->host_lock, flags);
2559+
list_for_each_entry(itnim, &im_port->itnim_mapped_list, list_entry) {
2560+
sdev = __scsi_device_lookup(im_port->shost, itnim->channel,
2561+
itnim->scsi_tgt_id, 0);
2562+
if (sdev) {
2563+
if (lunmask_cfg == BFA_TRUE)
2564+
sdev->sdev_bflags |= scan_flags;
2565+
else
2566+
sdev->sdev_bflags &= ~scan_flags;
2567+
}
2568+
}
2569+
spin_unlock_irqrestore(im_port->shost->host_lock, flags);
2570+
}
2571+
25432572
/* Function to reset the LUN SCAN mode */
25442573
static void
25452574
bfad_iocmd_lunmask_reset_lunscan_mode(struct bfad_s *bfad, int lunmask_cfg)

drivers/scsi/bfa/bfad_im.h

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -198,30 +198,4 @@ irqreturn_t bfad_intx(int irq, void *dev_id);
198198
int bfad_im_bsg_request(struct bsg_job *job);
199199
int bfad_im_bsg_timeout(struct bsg_job *job);
200200

201-
/*
202-
* Macro to set the SCSI device sdev_bflags - sdev_bflags are used by the
203-
* SCSI mid-layer to choose LUN Scanning mode REPORT_LUNS vs. Sequential Scan
204-
*
205-
* Internally iterate's over all the ITNIM's part of the im_port & set's the
206-
* sdev_bflags for the scsi_device associated with LUN #0.
207-
*/
208-
#define bfad_reset_sdev_bflags(__im_port, __lunmask_cfg) do { \
209-
struct scsi_device *__sdev = NULL; \
210-
struct bfad_itnim_s *__itnim = NULL; \
211-
u32 scan_flags = BLIST_NOREPORTLUN | BLIST_SPARSELUN; \
212-
list_for_each_entry(__itnim, &((__im_port)->itnim_mapped_list), \
213-
list_entry) { \
214-
__sdev = scsi_device_lookup((__im_port)->shost, \
215-
__itnim->channel, \
216-
__itnim->scsi_tgt_id, 0); \
217-
if (__sdev) { \
218-
if ((__lunmask_cfg) == BFA_TRUE) \
219-
__sdev->sdev_bflags |= scan_flags; \
220-
else \
221-
__sdev->sdev_bflags &= ~scan_flags; \
222-
scsi_device_put(__sdev); \
223-
} \
224-
} \
225-
} while (0)
226-
227201
#endif

drivers/scsi/csiostor/csio_wr.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,6 @@ csio_wr_process_fl(struct csio_hw *hw, struct csio_q *q,
10511051
struct csio_fl_dma_buf flb;
10521052
struct csio_dma_buf *buf, *fbuf;
10531053
uint32_t bufsz, len, lastlen = 0;
1054-
int n;
10551054
struct csio_q *flq = hw->wrm.q_arr[q->un.iq.flq_idx];
10561055

10571056
CSIO_DB_ASSERT(flq != NULL);
@@ -1071,7 +1070,7 @@ csio_wr_process_fl(struct csio_hw *hw, struct csio_q *q,
10711070
flb.totlen = len;
10721071

10731072
/* Consume all freelist buffers used for len bytes */
1074-
for (n = 0, fbuf = flb.flbufs; ; n++, fbuf++) {
1073+
for (fbuf = flb.flbufs; ; fbuf++) {
10751074
buf = &flq->un.fl.bufs[flq->cidx];
10761075
bufsz = csio_wr_fl_bufsz(sge, buf);
10771076

0 commit comments

Comments
 (0)