aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-12 12:50:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-12 12:50:42 -0400
commitc9b8af00ff71f86ff3d092cc60ca673e1d0eae5b (patch)
tree25cc016481cc693552bebb4040041817280c2ccf /drivers/s390/scsi
parentc59a264c9e932c828d533497e286b89e43c8d1be (diff)
parent82681a318f9f028ea64e61f24bbd9ac535531921 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (154 commits) [SCSI] osd: Remove out-of-tree left overs [SCSI] libosd: Use REQ_QUIET requests. [SCSI] osduld: use filp_open() when looking up an osd-device [SCSI] libosd: Define an osd_dev wrapper to retrieve the request_queue [SCSI] libosd: osd_req_{read,write} takes a length parameter [SCSI] libosd: Let _osd_req_finalize_data_integrity receive number of out_bytes [SCSI] libosd: osd_req_{read,write}_kern new API [SCSI] libosd: Better printout of OSD target system information [SCSI] libosd: OSD2r05: Attribute definitions [SCSI] libosd: OSD2r05: Additional command enums [SCSI] mpt fusion: fix up doc book comments [SCSI] mpt fusion: Added support for Broadcast primitives Event handling [SCSI] mpt fusion: Queue full event handling [SCSI] mpt fusion: RAID device handling and Dual port Raid support is added [SCSI] mpt fusion: Put IOC into ready state if it not already in ready state [SCSI] mpt fusion: Code Cleanup patch [SCSI] mpt fusion: Rescan SAS topology added [SCSI] mpt fusion: SAS topology scan changes, expander events [SCSI] mpt fusion: Firmware event implementation using seperate WorkQueue [SCSI] mpt fusion: rewrite of ioctl_cmds internal generated function ...
Diffstat (limited to 'drivers/s390/scsi')
-rw-r--r--drivers/s390/scsi/zfcp_ccw.c30
-rw-r--r--drivers/s390/scsi/zfcp_dbf.c10
-rw-r--r--drivers/s390/scsi/zfcp_def.h7
-rw-r--r--drivers/s390/scsi/zfcp_erp.c8
-rw-r--r--drivers/s390/scsi/zfcp_ext.h1
-rw-r--r--drivers/s390/scsi/zfcp_fc.c7
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c29
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c13
8 files changed, 68 insertions, 37 deletions
diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c
index 733fe3bf628..b2fe5cdbcae 100644
--- a/drivers/s390/scsi/zfcp_ccw.c
+++ b/drivers/s390/scsi/zfcp_ccw.c
@@ -11,6 +11,24 @@
11 11
12#include "zfcp_ext.h" 12#include "zfcp_ext.h"
13 13
14#define ZFCP_MODEL_PRIV 0x4
15
16static struct ccw_device_id zfcp_ccw_device_id[] = {
17 { CCW_DEVICE_DEVTYPE(0x1731, 0x3, 0x1732, 0x3) },
18 { CCW_DEVICE_DEVTYPE(0x1731, 0x3, 0x1732, ZFCP_MODEL_PRIV) },
19 {},
20};
21MODULE_DEVICE_TABLE(ccw, zfcp_ccw_device_id);
22
23/**
24 * zfcp_ccw_priv_sch - check if subchannel is privileged
25 * @adapter: Adapter/Subchannel to check
26 */
27int zfcp_ccw_priv_sch(struct zfcp_adapter *adapter)
28{
29 return adapter->ccw_device->id.dev_model == ZFCP_MODEL_PRIV;
30}
31
14/** 32/**
15 * zfcp_ccw_probe - probe function of zfcp driver 33 * zfcp_ccw_probe - probe function of zfcp driver
16 * @ccw_device: pointer to belonging ccw device 34 * @ccw_device: pointer to belonging ccw device
@@ -176,8 +194,8 @@ static int zfcp_ccw_notify(struct ccw_device *ccw_device, int event)
176 "ccnoti4", NULL); 194 "ccnoti4", NULL);
177 break; 195 break;
178 case CIO_BOXED: 196 case CIO_BOXED:
179 dev_warn(&adapter->ccw_device->dev, 197 dev_warn(&adapter->ccw_device->dev, "The FCP device "
180 "The ccw device did not respond in time.\n"); 198 "did not respond within the specified time\n");
181 zfcp_erp_adapter_shutdown(adapter, 0, "ccnoti5", NULL); 199 zfcp_erp_adapter_shutdown(adapter, 0, "ccnoti5", NULL);
182 break; 200 break;
183 } 201 }
@@ -199,14 +217,6 @@ static void zfcp_ccw_shutdown(struct ccw_device *cdev)
199 up(&zfcp_data.config_sema); 217 up(&zfcp_data.config_sema);
200} 218}
201 219
202static struct ccw_device_id zfcp_ccw_device_id[] = {
203 { CCW_DEVICE_DEVTYPE(0x1731, 0x3, 0x1732, 0x3) },
204 { CCW_DEVICE_DEVTYPE(0x1731, 0x3, 0x1732, 0x4) }, /* priv. */
205 {},
206};
207
208MODULE_DEVICE_TABLE(ccw, zfcp_ccw_device_id);
209
210static struct ccw_driver zfcp_ccw_driver = { 220static struct ccw_driver zfcp_ccw_driver = {
211 .owner = THIS_MODULE, 221 .owner = THIS_MODULE,
212 .name = "zfcp", 222 .name = "zfcp",
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c
index 0a1a5dd8d01..b99b87ce5a3 100644
--- a/drivers/s390/scsi/zfcp_dbf.c
+++ b/drivers/s390/scsi/zfcp_dbf.c
@@ -163,7 +163,7 @@ void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *fsf_req)
163 } 163 }
164 164
165 response->fsf_command = fsf_req->fsf_command; 165 response->fsf_command = fsf_req->fsf_command;
166 response->fsf_reqid = (unsigned long)fsf_req; 166 response->fsf_reqid = fsf_req->req_id;
167 response->fsf_seqno = fsf_req->seq_no; 167 response->fsf_seqno = fsf_req->seq_no;
168 response->fsf_issued = fsf_req->issued; 168 response->fsf_issued = fsf_req->issued;
169 response->fsf_prot_status = qtcb->prefix.prot_status; 169 response->fsf_prot_status = qtcb->prefix.prot_status;
@@ -737,7 +737,7 @@ void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *fsf_req)
737 spin_lock_irqsave(&adapter->san_dbf_lock, flags); 737 spin_lock_irqsave(&adapter->san_dbf_lock, flags);
738 memset(r, 0, sizeof(*r)); 738 memset(r, 0, sizeof(*r));
739 strncpy(r->tag, "octc", ZFCP_DBF_TAG_SIZE); 739 strncpy(r->tag, "octc", ZFCP_DBF_TAG_SIZE);
740 r->fsf_reqid = (unsigned long)fsf_req; 740 r->fsf_reqid = fsf_req->req_id;
741 r->fsf_seqno = fsf_req->seq_no; 741 r->fsf_seqno = fsf_req->seq_no;
742 r->s_id = fc_host_port_id(adapter->scsi_host); 742 r->s_id = fc_host_port_id(adapter->scsi_host);
743 r->d_id = wka_port->d_id; 743 r->d_id = wka_port->d_id;
@@ -773,7 +773,7 @@ void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *fsf_req)
773 spin_lock_irqsave(&adapter->san_dbf_lock, flags); 773 spin_lock_irqsave(&adapter->san_dbf_lock, flags);
774 memset(r, 0, sizeof(*r)); 774 memset(r, 0, sizeof(*r));
775 strncpy(r->tag, "rctc", ZFCP_DBF_TAG_SIZE); 775 strncpy(r->tag, "rctc", ZFCP_DBF_TAG_SIZE);
776 r->fsf_reqid = (unsigned long)fsf_req; 776 r->fsf_reqid = fsf_req->req_id;
777 r->fsf_seqno = fsf_req->seq_no; 777 r->fsf_seqno = fsf_req->seq_no;
778 r->s_id = wka_port->d_id; 778 r->s_id = wka_port->d_id;
779 r->d_id = fc_host_port_id(adapter->scsi_host); 779 r->d_id = fc_host_port_id(adapter->scsi_host);
@@ -803,7 +803,7 @@ static void zfcp_san_dbf_event_els(const char *tag, int level,
803 spin_lock_irqsave(&adapter->san_dbf_lock, flags); 803 spin_lock_irqsave(&adapter->san_dbf_lock, flags);
804 memset(rec, 0, sizeof(*rec)); 804 memset(rec, 0, sizeof(*rec));
805 strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE); 805 strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE);
806 rec->fsf_reqid = (unsigned long)fsf_req; 806 rec->fsf_reqid = fsf_req->req_id;
807 rec->fsf_seqno = fsf_req->seq_no; 807 rec->fsf_seqno = fsf_req->seq_no;
808 rec->s_id = s_id; 808 rec->s_id = s_id;
809 rec->d_id = d_id; 809 rec->d_id = d_id;
@@ -965,7 +965,7 @@ static void zfcp_scsi_dbf_event(const char *tag, const char *tag2, int level,
965 ZFCP_DBF_SCSI_FCP_SNS_INFO); 965 ZFCP_DBF_SCSI_FCP_SNS_INFO);
966 } 966 }
967 967
968 rec->fsf_reqid = (unsigned long)fsf_req; 968 rec->fsf_reqid = fsf_req->req_id;
969 rec->fsf_seqno = fsf_req->seq_no; 969 rec->fsf_seqno = fsf_req->seq_no;
970 rec->fsf_issued = fsf_req->issued; 970 rec->fsf_issued = fsf_req->issued;
971 } 971 }
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index 4c362a9069f..2074d45dbf6 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -47,13 +47,6 @@
47 47
48/********************* CIO/QDIO SPECIFIC DEFINES *****************************/ 48/********************* CIO/QDIO SPECIFIC DEFINES *****************************/
49 49
50/* Adapter Identification Parameters */
51#define ZFCP_CONTROL_UNIT_TYPE 0x1731
52#define ZFCP_CONTROL_UNIT_MODEL 0x03
53#define ZFCP_DEVICE_TYPE 0x1732
54#define ZFCP_DEVICE_MODEL 0x03
55#define ZFCP_DEVICE_MODEL_PRIV 0x04
56
57/* DMQ bug workaround: don't use last SBALE */ 50/* DMQ bug workaround: don't use last SBALE */
58#define ZFCP_MAX_SBALES_PER_SBAL (QDIO_MAX_ELEMENTS_PER_BUFFER - 1) 51#define ZFCP_MAX_SBALES_PER_SBAL (QDIO_MAX_ELEMENTS_PER_BUFFER - 1)
59 52
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index fdc9b4352a6..e50ea465bc2 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -880,6 +880,7 @@ static int zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *act)
880 zfcp_port_put(port); 880 zfcp_port_put(port);
881 return ZFCP_ERP_CONTINUES; 881 return ZFCP_ERP_CONTINUES;
882 } 882 }
883 /* fall through */
883 case ZFCP_ERP_STEP_NAMESERVER_LOOKUP: 884 case ZFCP_ERP_STEP_NAMESERVER_LOOKUP:
884 if (!port->d_id) 885 if (!port->d_id)
885 return ZFCP_ERP_FAILED; 886 return ZFCP_ERP_FAILED;
@@ -894,8 +895,13 @@ static int zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *act)
894 act->step = ZFCP_ERP_STEP_PORT_CLOSING; 895 act->step = ZFCP_ERP_STEP_PORT_CLOSING;
895 return ZFCP_ERP_CONTINUES; 896 return ZFCP_ERP_CONTINUES;
896 } 897 }
897 /* fall through otherwise */
898 } 898 }
899 if (port->d_id && !(p_status & ZFCP_STATUS_COMMON_NOESC)) {
900 port->d_id = 0;
901 _zfcp_erp_port_reopen(port, 0, "erpsoc1", NULL);
902 return ZFCP_ERP_EXIT;
903 }
904 /* fall through otherwise */
899 } 905 }
900 return ZFCP_ERP_FAILED; 906 return ZFCP_ERP_FAILED;
901} 907}
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h
index 2e31b536548..120a9a1c81f 100644
--- a/drivers/s390/scsi/zfcp_ext.h
+++ b/drivers/s390/scsi/zfcp_ext.h
@@ -27,6 +27,7 @@ extern int zfcp_sg_setup_table(struct scatterlist *, int);
27 27
28/* zfcp_ccw.c */ 28/* zfcp_ccw.c */
29extern int zfcp_ccw_register(void); 29extern int zfcp_ccw_register(void);
30extern int zfcp_ccw_priv_sch(struct zfcp_adapter *);
30extern struct zfcp_adapter *zfcp_get_adapter_by_busid(char *); 31extern struct zfcp_adapter *zfcp_get_adapter_by_busid(char *);
31 32
32/* zfcp_cfdc.c */ 33/* zfcp_cfdc.c */
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c
index 19ae0842047..bb2752b4130 100644
--- a/drivers/s390/scsi/zfcp_fc.c
+++ b/drivers/s390/scsi/zfcp_fc.c
@@ -150,9 +150,14 @@ static void _zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req, u32 range,
150 struct zfcp_port *port; 150 struct zfcp_port *port;
151 151
152 read_lock_irqsave(&zfcp_data.config_lock, flags); 152 read_lock_irqsave(&zfcp_data.config_lock, flags);
153 list_for_each_entry(port, &fsf_req->adapter->port_list_head, list) 153 list_for_each_entry(port, &fsf_req->adapter->port_list_head, list) {
154 if ((port->d_id & range) == (elem->nport_did & range)) 154 if ((port->d_id & range) == (elem->nport_did & range))
155 zfcp_test_link(port); 155 zfcp_test_link(port);
156 if (!port->d_id)
157 zfcp_erp_port_reopen(port,
158 ZFCP_STATUS_COMMON_ERP_FAILED,
159 "fcrscn1", NULL);
160 }
156 161
157 read_unlock_irqrestore(&zfcp_data.config_lock, flags); 162 read_unlock_irqrestore(&zfcp_data.config_lock, flags);
158} 163}
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 74dee32afba..e6dae3744e7 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -526,6 +526,7 @@ static int zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *req)
526 break; 526 break;
527 case FSF_TOPO_AL: 527 case FSF_TOPO_AL:
528 fc_host_port_type(shost) = FC_PORTTYPE_NLPORT; 528 fc_host_port_type(shost) = FC_PORTTYPE_NLPORT;
529 /* fall through */
529 default: 530 default:
530 dev_err(&adapter->ccw_device->dev, 531 dev_err(&adapter->ccw_device->dev,
531 "Unknown or unsupported arbitrated loop " 532 "Unknown or unsupported arbitrated loop "
@@ -897,6 +898,7 @@ static void zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *req)
897 switch (fsq->word[0]) { 898 switch (fsq->word[0]) {
898 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: 899 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
899 zfcp_test_link(unit->port); 900 zfcp_test_link(unit->port);
901 /* fall through */
900 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: 902 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
901 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 903 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
902 break; 904 break;
@@ -993,6 +995,7 @@ static void zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *req)
993 break; 995 break;
994 case FSF_PORT_HANDLE_NOT_VALID: 996 case FSF_PORT_HANDLE_NOT_VALID:
995 zfcp_erp_adapter_reopen(adapter, 0, "fsscth1", req); 997 zfcp_erp_adapter_reopen(adapter, 0, "fsscth1", req);
998 /* fall through */
996 case FSF_GENERIC_COMMAND_REJECTED: 999 case FSF_GENERIC_COMMAND_REJECTED:
997 case FSF_PAYLOAD_SIZE_MISMATCH: 1000 case FSF_PAYLOAD_SIZE_MISMATCH:
998 case FSF_REQUEST_SIZE_TOO_LARGE: 1001 case FSF_REQUEST_SIZE_TOO_LARGE:
@@ -1399,7 +1402,7 @@ static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req)
1399 struct fsf_plogi *plogi; 1402 struct fsf_plogi *plogi;
1400 1403
1401 if (req->status & ZFCP_STATUS_FSFREQ_ERROR) 1404 if (req->status & ZFCP_STATUS_FSFREQ_ERROR)
1402 return; 1405 goto out;
1403 1406
1404 switch (header->fsf_status) { 1407 switch (header->fsf_status) {
1405 case FSF_PORT_ALREADY_OPEN: 1408 case FSF_PORT_ALREADY_OPEN:
@@ -1461,6 +1464,9 @@ static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req)
1461 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1464 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1462 break; 1465 break;
1463 } 1466 }
1467
1468out:
1469 zfcp_port_put(port);
1464} 1470}
1465 1471
1466/** 1472/**
@@ -1473,6 +1479,7 @@ int zfcp_fsf_open_port(struct zfcp_erp_action *erp_action)
1473 struct qdio_buffer_element *sbale; 1479 struct qdio_buffer_element *sbale;
1474 struct zfcp_adapter *adapter = erp_action->adapter; 1480 struct zfcp_adapter *adapter = erp_action->adapter;
1475 struct zfcp_fsf_req *req; 1481 struct zfcp_fsf_req *req;
1482 struct zfcp_port *port = erp_action->port;
1476 int retval = -EIO; 1483 int retval = -EIO;
1477 1484
1478 spin_lock_bh(&adapter->req_q_lock); 1485 spin_lock_bh(&adapter->req_q_lock);
@@ -1493,16 +1500,18 @@ int zfcp_fsf_open_port(struct zfcp_erp_action *erp_action)
1493 sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY; 1500 sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY;
1494 1501
1495 req->handler = zfcp_fsf_open_port_handler; 1502 req->handler = zfcp_fsf_open_port_handler;
1496 req->qtcb->bottom.support.d_id = erp_action->port->d_id; 1503 req->qtcb->bottom.support.d_id = port->d_id;
1497 req->data = erp_action->port; 1504 req->data = port;
1498 req->erp_action = erp_action; 1505 req->erp_action = erp_action;
1499 erp_action->fsf_req = req; 1506 erp_action->fsf_req = req;
1507 zfcp_port_get(port);
1500 1508
1501 zfcp_fsf_start_erp_timer(req); 1509 zfcp_fsf_start_erp_timer(req);
1502 retval = zfcp_fsf_req_send(req); 1510 retval = zfcp_fsf_req_send(req);
1503 if (retval) { 1511 if (retval) {
1504 zfcp_fsf_req_free(req); 1512 zfcp_fsf_req_free(req);
1505 erp_action->fsf_req = NULL; 1513 erp_action->fsf_req = NULL;
1514 zfcp_port_put(port);
1506 } 1515 }
1507out: 1516out:
1508 spin_unlock_bh(&adapter->req_q_lock); 1517 spin_unlock_bh(&adapter->req_q_lock);
@@ -1590,8 +1599,10 @@ static void zfcp_fsf_open_wka_port_handler(struct zfcp_fsf_req *req)
1590 case FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED: 1599 case FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED:
1591 dev_warn(&req->adapter->ccw_device->dev, 1600 dev_warn(&req->adapter->ccw_device->dev,
1592 "Opening WKA port 0x%x failed\n", wka_port->d_id); 1601 "Opening WKA port 0x%x failed\n", wka_port->d_id);
1602 /* fall through */
1593 case FSF_ADAPTER_STATUS_AVAILABLE: 1603 case FSF_ADAPTER_STATUS_AVAILABLE:
1594 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1604 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1605 /* fall through */
1595 case FSF_ACCESS_DENIED: 1606 case FSF_ACCESS_DENIED:
1596 wka_port->status = ZFCP_WKA_PORT_OFFLINE; 1607 wka_port->status = ZFCP_WKA_PORT_OFFLINE;
1597 break; 1608 break;
@@ -1876,7 +1887,7 @@ static void zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *req)
1876 1887
1877 if (!(adapter->connection_features & FSF_FEATURE_NPIV_MODE) && 1888 if (!(adapter->connection_features & FSF_FEATURE_NPIV_MODE) &&
1878 (adapter->adapter_features & FSF_FEATURE_LUN_SHARING) && 1889 (adapter->adapter_features & FSF_FEATURE_LUN_SHARING) &&
1879 (adapter->ccw_device->id.dev_model != ZFCP_DEVICE_MODEL_PRIV)) { 1890 !zfcp_ccw_priv_sch(adapter)) {
1880 exclusive = (bottom->lun_access_info & 1891 exclusive = (bottom->lun_access_info &
1881 FSF_UNIT_ACCESS_EXCLUSIVE); 1892 FSF_UNIT_ACCESS_EXCLUSIVE);
1882 readwrite = (bottom->lun_access_info & 1893 readwrite = (bottom->lun_access_info &
@@ -2314,7 +2325,7 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *unit,
2314{ 2325{
2315 struct zfcp_fsf_req *req; 2326 struct zfcp_fsf_req *req;
2316 struct fcp_cmnd_iu *fcp_cmnd_iu; 2327 struct fcp_cmnd_iu *fcp_cmnd_iu;
2317 unsigned int sbtype; 2328 unsigned int sbtype = SBAL_FLAGS0_TYPE_READ;
2318 int real_bytes, retval = -EIO; 2329 int real_bytes, retval = -EIO;
2319 struct zfcp_adapter *adapter = unit->port->adapter; 2330 struct zfcp_adapter *adapter = unit->port->adapter;
2320 2331
@@ -2356,11 +2367,9 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *unit,
2356 switch (scsi_cmnd->sc_data_direction) { 2367 switch (scsi_cmnd->sc_data_direction) {
2357 case DMA_NONE: 2368 case DMA_NONE:
2358 req->qtcb->bottom.io.data_direction = FSF_DATADIR_CMND; 2369 req->qtcb->bottom.io.data_direction = FSF_DATADIR_CMND;
2359 sbtype = SBAL_FLAGS0_TYPE_READ;
2360 break; 2370 break;
2361 case DMA_FROM_DEVICE: 2371 case DMA_FROM_DEVICE:
2362 req->qtcb->bottom.io.data_direction = FSF_DATADIR_READ; 2372 req->qtcb->bottom.io.data_direction = FSF_DATADIR_READ;
2363 sbtype = SBAL_FLAGS0_TYPE_READ;
2364 fcp_cmnd_iu->rddata = 1; 2373 fcp_cmnd_iu->rddata = 1;
2365 break; 2374 break;
2366 case DMA_TO_DEVICE: 2375 case DMA_TO_DEVICE:
@@ -2369,8 +2378,6 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *unit,
2369 fcp_cmnd_iu->wddata = 1; 2378 fcp_cmnd_iu->wddata = 1;
2370 break; 2379 break;
2371 case DMA_BIDIRECTIONAL: 2380 case DMA_BIDIRECTIONAL:
2372 default:
2373 retval = -EIO;
2374 goto failed_scsi_cmnd; 2381 goto failed_scsi_cmnd;
2375 } 2382 }
2376 2383
@@ -2394,9 +2401,7 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *unit,
2394 scsi_sglist(scsi_cmnd), 2401 scsi_sglist(scsi_cmnd),
2395 FSF_MAX_SBALS_PER_REQ); 2402 FSF_MAX_SBALS_PER_REQ);
2396 if (unlikely(real_bytes < 0)) { 2403 if (unlikely(real_bytes < 0)) {
2397 if (req->sbal_number < FSF_MAX_SBALS_PER_REQ) 2404 if (req->sbal_number >= FSF_MAX_SBALS_PER_REQ) {
2398 retval = -EIO;
2399 else {
2400 dev_err(&adapter->ccw_device->dev, 2405 dev_err(&adapter->ccw_device->dev,
2401 "Oversize data package, unit 0x%016Lx " 2406 "Oversize data package, unit 0x%016Lx "
2402 "on port 0x%016Lx closed\n", 2407 "on port 0x%016Lx closed\n",
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index e8fbeaeb5fb..7d0da230eb6 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -12,6 +12,10 @@
12#include "zfcp_ext.h" 12#include "zfcp_ext.h"
13#include <asm/atomic.h> 13#include <asm/atomic.h>
14 14
15static unsigned int default_depth = 32;
16module_param_named(queue_depth, default_depth, uint, 0600);
17MODULE_PARM_DESC(queue_depth, "Default queue depth for new SCSI devices");
18
15/* Find start of Sense Information in FCP response unit*/ 19/* Find start of Sense Information in FCP response unit*/
16char *zfcp_get_fcp_sns_info_ptr(struct fcp_rsp_iu *fcp_rsp_iu) 20char *zfcp_get_fcp_sns_info_ptr(struct fcp_rsp_iu *fcp_rsp_iu)
17{ 21{
@@ -24,6 +28,12 @@ char *zfcp_get_fcp_sns_info_ptr(struct fcp_rsp_iu *fcp_rsp_iu)
24 return fcp_sns_info_ptr; 28 return fcp_sns_info_ptr;
25} 29}
26 30
31static int zfcp_scsi_change_queue_depth(struct scsi_device *sdev, int depth)
32{
33 scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), depth);
34 return sdev->queue_depth;
35}
36
27static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt) 37static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt)
28{ 38{
29 struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata; 39 struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata;
@@ -34,7 +44,7 @@ static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt)
34static int zfcp_scsi_slave_configure(struct scsi_device *sdp) 44static int zfcp_scsi_slave_configure(struct scsi_device *sdp)
35{ 45{
36 if (sdp->tagged_supported) 46 if (sdp->tagged_supported)
37 scsi_adjust_queue_depth(sdp, MSG_SIMPLE_TAG, 32); 47 scsi_adjust_queue_depth(sdp, MSG_SIMPLE_TAG, default_depth);
38 else 48 else
39 scsi_adjust_queue_depth(sdp, 0, 1); 49 scsi_adjust_queue_depth(sdp, 0, 1);
40 return 0; 50 return 0;
@@ -647,6 +657,7 @@ struct zfcp_data zfcp_data = {
647 .name = "zfcp", 657 .name = "zfcp",
648 .module = THIS_MODULE, 658 .module = THIS_MODULE,
649 .proc_name = "zfcp", 659 .proc_name = "zfcp",
660 .change_queue_depth = zfcp_scsi_change_queue_depth,
650 .slave_alloc = zfcp_scsi_slave_alloc, 661 .slave_alloc = zfcp_scsi_slave_alloc,
651 .slave_configure = zfcp_scsi_slave_configure, 662 .slave_configure = zfcp_scsi_slave_configure,
652 .slave_destroy = zfcp_scsi_slave_destroy, 663 .slave_destroy = zfcp_scsi_slave_destroy,