Skip to content

Commit f290cba

Browse files
committed
Merge tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull late SCSI updates from James Bottomley: "This is mostly stuff which missed the initial pull. There's a new driver: qedi, and some ufs, ibmvscsis and ncr5380 updates plus some assorted driver fixes and also a fix for the bug where if a device goes into a blocked state between configuration and sysfs device add (which can be a long time under async probing) it would become permanently blocked" * tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (30 commits) scsi: avoid a permanent stop of the scsi device's request queue scsi: mpt3sas: Recognize and act on iopriority info scsi: qla2xxx: Fix Target mode handling with Multiqueue changes. scsi: qla2xxx: Add Block Multi Queue functionality. scsi: qla2xxx: Add multiple queue pair functionality. scsi: qla2xxx: Utilize pci_alloc_irq_vectors/pci_free_irq_vectors calls. scsi: qla2xxx: Only allow operational MBX to proceed during RESET. scsi: hpsa: remove memory allocate failure message scsi: Update 3ware driver email addresses scsi: zfcp: fix rport unblock race with LUN recovery scsi: zfcp: do not trace pure benign residual HBA responses at default level scsi: zfcp: fix use-after-"free" in FC ingress path after TMF scsi: libcxgbi: return error if interface is not up scsi: cxgb4i: libcxgbi: add missing module_put() scsi: cxgb4i: libcxgbi: cxgb4: add T6 iSCSI completion feature scsi: cxgb4i: libcxgbi: add active open cmd for T6 adapters scsi: cxgb4i: use cxgb4_tp_smt_idx() to get smt_idx scsi: qedi: Add QLogic FastLinQ offload iSCSI driver framework. scsi: aacraid: remove wildcard for series 9 controllers scsi: ibmvscsi: add write memory barrier to CRQ processing ...
2 parents 42e0372 + 3eff4c7 commit f290cba

Some content is hidden

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

64 files changed

+9670
-695
lines changed

Documentation/scsi/g_NCR5380.txt

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,15 @@ NCR53c400 extensions (c) 1994,1995,1996 Kevin Lentin
66
This file documents the NCR53c400 extensions by Kevin Lentin and some
77
enhancements to the NCR5380 core.
88

9-
This driver supports both NCR5380 and NCR53c400 cards in port or memory
10-
mapped modes. Currently this driver can only support one of those mapping
11-
modes at a time but it does support both of these chips at the same time.
12-
The next release of this driver will support port & memory mapped cards at
13-
the same time. It should be able to handle multiple different cards in the
14-
same machine.
9+
This driver supports NCR5380 and NCR53c400 and compatible cards in port or
10+
memory mapped modes.
1511

16-
The drivers/scsi/Makefile has an override in it for the most common
17-
NCR53c400 card, the Trantor T130B in its default configuration:
18-
Port: 0x350
19-
IRQ : 5
12+
Use of an interrupt is recommended, if supported by the board, as this will
13+
allow targets to disconnect and thereby improve SCSI bus utilization.
14+
15+
If the irq parameter is 254 or is omitted entirely, the driver will probe
16+
for the correct IRQ line automatically. If the irq parameter is 0 or 255
17+
then no IRQ will be used.
2018

2119
The NCR53c400 does not support DMA but it does have Pseudo-DMA which is
2220
supported by the driver.
@@ -47,22 +45,24 @@ These old-style parameters can support only one card:
4745
dtc_3181e=1 to set up for a Domex Technology Corp 3181E board
4846
hp_c2502=1 to set up for a Hewlett Packard C2502 board
4947

50-
e.g.
51-
OLD: modprobe g_NCR5380 ncr_irq=5 ncr_addr=0x350 ncr_5380=1
52-
NEW: modprobe g_NCR5380 irq=5 base=0x350 card=0
53-
for a port mapped NCR5380 board or
54-
55-
OLD: modprobe g_NCR5380 ncr_irq=255 ncr_addr=0xc8000 ncr_53c400=1
56-
NEW: modprobe g_NCR5380 irq=255 base=0xc8000 card=1
57-
for a memory mapped NCR53C400 board with interrupts disabled or
48+
E.g. Trantor T130B in its default configuration:
49+
modprobe g_NCR5380 irq=5 base=0x350 card=1
50+
or alternatively, using the old syntax,
51+
modprobe g_NCR5380 ncr_irq=5 ncr_addr=0x350 ncr_53c400=1
5852

59-
NEW: modprobe g_NCR5380 irq=0,7 base=0x240,0x300 card=3,4
60-
for two cards: DTC3181 (in non-PnP mode) at 0x240 with no IRQ
61-
and HP C2502 at 0x300 with IRQ 7
53+
E.g. a port mapped NCR5380 board, driver to probe for IRQ:
54+
modprobe g_NCR5380 base=0x350 card=0
55+
or alternatively,
56+
modprobe g_NCR5380 ncr_addr=0x350 ncr_5380=1
6257

63-
(255 should be specified for no or DMA interrupt, 254 to autoprobe for an
64-
IRQ line if overridden on the command line.)
58+
E.g. a memory mapped NCR53C400 board with no IRQ:
59+
modprobe g_NCR5380 irq=255 base=0xc8000 card=1
60+
or alternatively,
61+
modprobe g_NCR5380 ncr_irq=255 ncr_addr=0xc8000 ncr_53c400=1
6562

63+
E.g. two cards, DTC3181 (in non-PnP mode) at 0x240 with no IRQ
64+
and HP C2502 at 0x300 with IRQ 7:
65+
modprobe g_NCR5380 irq=0,7 base=0x240,0x300 card=3,4
6666

6767
Kevin Lentin
6868
K.Lentin@cs.monash.edu.au

MAINTAINERS

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ S: Maintained
143143
F: drivers/net/ethernet/3com/typhoon*
144144

145145
3WARE SAS/SATA-RAID SCSI DRIVERS (3W-XXXX, 3W-9XXX, 3W-SAS)
146-
M: Adam Radford <linuxraid@lsi.com>
146+
M: Adam Radford <aradford@gmail.com>
147147
L: linux-scsi@vger.kernel.org
148148
W: http://www.lsi.com
149149
S: Supported
@@ -10136,6 +10136,12 @@ F: drivers/net/ethernet/qlogic/qed/
1013610136
F: include/linux/qed/
1013710137
F: drivers/net/ethernet/qlogic/qede/
1013810138

10139+
QLOGIC QL41xxx ISCSI DRIVER
10140+
M: QLogic-Storage-Upstream@cavium.com
10141+
L: linux-scsi@vger.kernel.org
10142+
S: Supported
10143+
F: drivers/scsi/qedi/
10144+
1013910145
QNX4 FILESYSTEM
1014010146
M: Anders Larsen <al@alarsen.net>
1014110147
W: http://www.alarsen.net/linux/qnx4fs/

drivers/net/ethernet/chelsio/cxgb4/t4_msg.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ enum {
7676
CPL_PASS_ESTABLISH = 0x41,
7777
CPL_RX_DATA_DDP = 0x42,
7878
CPL_PASS_ACCEPT_REQ = 0x44,
79+
CPL_RX_ISCSI_CMP = 0x45,
7980
CPL_TRACE_PKT_T5 = 0x48,
8081
CPL_RX_ISCSI_DDP = 0x49,
8182

@@ -934,6 +935,18 @@ struct cpl_iscsi_data {
934935
__u8 status;
935936
};
936937

938+
struct cpl_rx_iscsi_cmp {
939+
union opcode_tid ot;
940+
__be16 pdu_len_ddp;
941+
__be16 len;
942+
__be32 seq;
943+
__be16 urg;
944+
__u8 rsvd;
945+
__u8 status;
946+
__be32 ulp_crc;
947+
__be32 ddpvld;
948+
};
949+
937950
struct cpl_tx_data_iso {
938951
__be32 op_to_scsi;
939952
__u8 reserved1;

drivers/s390/scsi/zfcp_dbf.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,12 @@ void zfcp_dbf_rec_trig(char *tag, struct zfcp_adapter *adapter,
289289

290290

291291
/**
292-
* zfcp_dbf_rec_run - trace event related to running recovery
292+
* zfcp_dbf_rec_run_lvl - trace event related to running recovery
293+
* @level: trace level to be used for event
293294
* @tag: identifier for event
294295
* @erp: erp_action running
295296
*/
296-
void zfcp_dbf_rec_run(char *tag, struct zfcp_erp_action *erp)
297+
void zfcp_dbf_rec_run_lvl(int level, char *tag, struct zfcp_erp_action *erp)
297298
{
298299
struct zfcp_dbf *dbf = erp->adapter->dbf;
299300
struct zfcp_dbf_rec *rec = &dbf->rec_buf;
@@ -319,10 +320,20 @@ void zfcp_dbf_rec_run(char *tag, struct zfcp_erp_action *erp)
319320
else
320321
rec->u.run.rec_count = atomic_read(&erp->adapter->erp_counter);
321322

322-
debug_event(dbf->rec, 1, rec, sizeof(*rec));
323+
debug_event(dbf->rec, level, rec, sizeof(*rec));
323324
spin_unlock_irqrestore(&dbf->rec_lock, flags);
324325
}
325326

327+
/**
328+
* zfcp_dbf_rec_run - trace event related to running recovery
329+
* @tag: identifier for event
330+
* @erp: erp_action running
331+
*/
332+
void zfcp_dbf_rec_run(char *tag, struct zfcp_erp_action *erp)
333+
{
334+
zfcp_dbf_rec_run_lvl(1, tag, erp);
335+
}
336+
326337
/**
327338
* zfcp_dbf_rec_run_wka - trace wka port event with info like running recovery
328339
* @tag: identifier for event

drivers/s390/scsi/zfcp_dbf.h

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* zfcp device driver
33
* debug feature declarations
44
*
5-
* Copyright IBM Corp. 2008, 2015
5+
* Copyright IBM Corp. 2008, 2016
66
*/
77

88
#ifndef ZFCP_DBF_H
@@ -283,6 +283,30 @@ struct zfcp_dbf {
283283
struct zfcp_dbf_scsi scsi_buf;
284284
};
285285

286+
/**
287+
* zfcp_dbf_hba_fsf_resp_suppress - true if we should not trace by default
288+
* @req: request that has been completed
289+
*
290+
* Returns true if FCP response with only benign residual under count.
291+
*/
292+
static inline
293+
bool zfcp_dbf_hba_fsf_resp_suppress(struct zfcp_fsf_req *req)
294+
{
295+
struct fsf_qtcb *qtcb = req->qtcb;
296+
u32 fsf_stat = qtcb->header.fsf_status;
297+
struct fcp_resp *fcp_rsp;
298+
u8 rsp_flags, fr_status;
299+
300+
if (qtcb->prefix.qtcb_type != FSF_IO_COMMAND)
301+
return false; /* not an FCP response */
302+
fcp_rsp = (struct fcp_resp *)&qtcb->bottom.io.fcp_rsp;
303+
rsp_flags = fcp_rsp->fr_flags;
304+
fr_status = fcp_rsp->fr_status;
305+
return (fsf_stat == FSF_FCP_RSP_AVAILABLE) &&
306+
(rsp_flags == FCP_RESID_UNDER) &&
307+
(fr_status == SAM_STAT_GOOD);
308+
}
309+
286310
static inline
287311
void zfcp_dbf_hba_fsf_resp(char *tag, int level, struct zfcp_fsf_req *req)
288312
{
@@ -304,7 +328,9 @@ void zfcp_dbf_hba_fsf_response(struct zfcp_fsf_req *req)
304328
zfcp_dbf_hba_fsf_resp("fs_perr", 1, req);
305329

306330
} else if (qtcb->header.fsf_status != FSF_GOOD) {
307-
zfcp_dbf_hba_fsf_resp("fs_ferr", 1, req);
331+
zfcp_dbf_hba_fsf_resp("fs_ferr",
332+
zfcp_dbf_hba_fsf_resp_suppress(req)
333+
? 5 : 1, req);
308334

309335
} else if ((req->fsf_command == FSF_QTCB_OPEN_PORT_WITH_DID) ||
310336
(req->fsf_command == FSF_QTCB_OPEN_LUN)) {
@@ -388,4 +414,15 @@ void zfcp_dbf_scsi_devreset(char *tag, struct scsi_cmnd *scmnd, u8 flag)
388414
_zfcp_dbf_scsi(tmp_tag, 1, scmnd, NULL);
389415
}
390416

417+
/**
418+
* zfcp_dbf_scsi_nullcmnd() - trace NULLify of SCSI command in dev/tgt-reset.
419+
* @scmnd: SCSI command that was NULLified.
420+
* @fsf_req: request that owned @scmnd.
421+
*/
422+
static inline void zfcp_dbf_scsi_nullcmnd(struct scsi_cmnd *scmnd,
423+
struct zfcp_fsf_req *fsf_req)
424+
{
425+
_zfcp_dbf_scsi("scfc__1", 3, scmnd, fsf_req);
426+
}
427+
391428
#endif /* ZFCP_DBF_H */

drivers/s390/scsi/zfcp_erp.c

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Error Recovery Procedures (ERP).
55
*
6-
* Copyright IBM Corp. 2002, 2015
6+
* Copyright IBM Corp. 2002, 2016
77
*/
88

99
#define KMSG_COMPONENT "zfcp"
@@ -1204,6 +1204,62 @@ static void zfcp_erp_action_dequeue(struct zfcp_erp_action *erp_action)
12041204
}
12051205
}
12061206

1207+
/**
1208+
* zfcp_erp_try_rport_unblock - unblock rport if no more/new recovery
1209+
* @port: zfcp_port whose fc_rport we should try to unblock
1210+
*/
1211+
static void zfcp_erp_try_rport_unblock(struct zfcp_port *port)
1212+
{
1213+
unsigned long flags;
1214+
struct zfcp_adapter *adapter = port->adapter;
1215+
int port_status;
1216+
struct Scsi_Host *shost = adapter->scsi_host;
1217+
struct scsi_device *sdev;
1218+
1219+
write_lock_irqsave(&adapter->erp_lock, flags);
1220+
port_status = atomic_read(&port->status);
1221+
if ((port_status & ZFCP_STATUS_COMMON_UNBLOCKED) == 0 ||
1222+
(port_status & (ZFCP_STATUS_COMMON_ERP_INUSE |
1223+
ZFCP_STATUS_COMMON_ERP_FAILED)) != 0) {
1224+
/* new ERP of severity >= port triggered elsewhere meanwhile or
1225+
* local link down (adapter erp_failed but not clear unblock)
1226+
*/
1227+
zfcp_dbf_rec_run_lvl(4, "ertru_p", &port->erp_action);
1228+
write_unlock_irqrestore(&adapter->erp_lock, flags);
1229+
return;
1230+
}
1231+
spin_lock(shost->host_lock);
1232+
__shost_for_each_device(sdev, shost) {
1233+
struct zfcp_scsi_dev *zsdev = sdev_to_zfcp(sdev);
1234+
int lun_status;
1235+
1236+
if (zsdev->port != port)
1237+
continue;
1238+
/* LUN under port of interest */
1239+
lun_status = atomic_read(&zsdev->status);
1240+
if ((lun_status & ZFCP_STATUS_COMMON_ERP_FAILED) != 0)
1241+
continue; /* unblock rport despite failed LUNs */
1242+
/* LUN recovery not given up yet [maybe follow-up pending] */
1243+
if ((lun_status & ZFCP_STATUS_COMMON_UNBLOCKED) == 0 ||
1244+
(lun_status & ZFCP_STATUS_COMMON_ERP_INUSE) != 0) {
1245+
/* LUN blocked:
1246+
* not yet unblocked [LUN recovery pending]
1247+
* or meanwhile blocked [new LUN recovery triggered]
1248+
*/
1249+
zfcp_dbf_rec_run_lvl(4, "ertru_l", &zsdev->erp_action);
1250+
spin_unlock(shost->host_lock);
1251+
write_unlock_irqrestore(&adapter->erp_lock, flags);
1252+
return;
1253+
}
1254+
}
1255+
/* now port has no child or all children have completed recovery,
1256+
* and no ERP of severity >= port was meanwhile triggered elsewhere
1257+
*/
1258+
zfcp_scsi_schedule_rport_register(port);
1259+
spin_unlock(shost->host_lock);
1260+
write_unlock_irqrestore(&adapter->erp_lock, flags);
1261+
}
1262+
12071263
static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result)
12081264
{
12091265
struct zfcp_adapter *adapter = act->adapter;
@@ -1214,6 +1270,7 @@ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result)
12141270
case ZFCP_ERP_ACTION_REOPEN_LUN:
12151271
if (!(act->status & ZFCP_STATUS_ERP_NO_REF))
12161272
scsi_device_put(sdev);
1273+
zfcp_erp_try_rport_unblock(port);
12171274
break;
12181275

12191276
case ZFCP_ERP_ACTION_REOPEN_PORT:
@@ -1224,7 +1281,7 @@ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result)
12241281
*/
12251282
if (act->step != ZFCP_ERP_STEP_UNINITIALIZED)
12261283
if (result == ZFCP_ERP_SUCCEEDED)
1227-
zfcp_scsi_schedule_rport_register(port);
1284+
zfcp_erp_try_rport_unblock(port);
12281285
/* fall through */
12291286
case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED:
12301287
put_device(&port->dev);

drivers/s390/scsi/zfcp_ext.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* External function declarations.
55
*
6-
* Copyright IBM Corp. 2002, 2015
6+
* Copyright IBM Corp. 2002, 2016
77
*/
88

99
#ifndef ZFCP_EXT_H
@@ -35,6 +35,8 @@ extern void zfcp_dbf_adapter_unregister(struct zfcp_adapter *);
3535
extern void zfcp_dbf_rec_trig(char *, struct zfcp_adapter *,
3636
struct zfcp_port *, struct scsi_device *, u8, u8);
3737
extern void zfcp_dbf_rec_run(char *, struct zfcp_erp_action *);
38+
extern void zfcp_dbf_rec_run_lvl(int level, char *tag,
39+
struct zfcp_erp_action *erp);
3840
extern void zfcp_dbf_rec_run_wka(char *, struct zfcp_fc_wka_port *, u64);
3941
extern void zfcp_dbf_hba_fsf_uss(char *, struct zfcp_fsf_req *);
4042
extern void zfcp_dbf_hba_fsf_res(char *, int, struct zfcp_fsf_req *);

drivers/s390/scsi/zfcp_fsf.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Interface to the FSF support functions.
55
*
6-
* Copyright IBM Corp. 2002, 2015
6+
* Copyright IBM Corp. 2002, 2016
77
*/
88

99
#ifndef FSF_H
@@ -78,6 +78,7 @@
7878
#define FSF_APP_TAG_CHECK_FAILURE 0x00000082
7979
#define FSF_REF_TAG_CHECK_FAILURE 0x00000083
8080
#define FSF_ADAPTER_STATUS_AVAILABLE 0x000000AD
81+
#define FSF_FCP_RSP_AVAILABLE 0x000000AF
8182
#define FSF_UNKNOWN_COMMAND 0x000000E2
8283
#define FSF_UNKNOWN_OP_SUBTYPE 0x000000E3
8384
#define FSF_INVALID_COMMAND_OPTION 0x000000E5

drivers/s390/scsi/zfcp_reqlist.h

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Data structure and helper functions for tracking pending FSF
55
* requests.
66
*
7-
* Copyright IBM Corp. 2009
7+
* Copyright IBM Corp. 2009, 2016
88
*/
99

1010
#ifndef ZFCP_REQLIST_H
@@ -180,4 +180,32 @@ static inline void zfcp_reqlist_move(struct zfcp_reqlist *rl,
180180
spin_unlock_irqrestore(&rl->lock, flags);
181181
}
182182

183+
/**
184+
* zfcp_reqlist_apply_for_all() - apply a function to every request.
185+
* @rl: the requestlist that contains the target requests.
186+
* @f: the function to apply to each request; the first parameter of the
187+
* function will be the target-request; the second parameter is the same
188+
* pointer as given with the argument @data.
189+
* @data: freely chosen argument; passed through to @f as second parameter.
190+
*
191+
* Uses :c:macro:`list_for_each_entry` to iterate over the lists in the hash-
192+
* table (not a 'safe' variant, so don't modify the list).
193+
*
194+
* Holds @rl->lock over the entire request-iteration.
195+
*/
196+
static inline void
197+
zfcp_reqlist_apply_for_all(struct zfcp_reqlist *rl,
198+
void (*f)(struct zfcp_fsf_req *, void *), void *data)
199+
{
200+
struct zfcp_fsf_req *req;
201+
unsigned long flags;
202+
unsigned int i;
203+
204+
spin_lock_irqsave(&rl->lock, flags);
205+
for (i = 0; i < ZFCP_REQ_LIST_BUCKETS; i++)
206+
list_for_each_entry(req, &rl->buckets[i], list)
207+
f(req, data);
208+
spin_unlock_irqrestore(&rl->lock, flags);
209+
}
210+
183211
#endif /* ZFCP_REQLIST_H */

0 commit comments

Comments
 (0)