aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ibmvscsi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/ibmvscsi')
-rw-r--r--drivers/scsi/ibmvscsi/ibmvfc.c14
-rw-r--r--drivers/scsi/ibmvscsi/ibmvscsi.c16
2 files changed, 17 insertions, 13 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index 44f202f33101..ee0739b217b6 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -101,7 +101,7 @@ static const struct {
101 { IBMVFC_FABRIC_MAPPED, IBMVFC_UNABLE_TO_ESTABLISH, DID_ERROR, 1, 1, "unable to establish" }, 101 { IBMVFC_FABRIC_MAPPED, IBMVFC_UNABLE_TO_ESTABLISH, DID_ERROR, 1, 1, "unable to establish" },
102 { IBMVFC_FABRIC_MAPPED, IBMVFC_XPORT_FAULT, DID_OK, 1, 0, "transport fault" }, 102 { IBMVFC_FABRIC_MAPPED, IBMVFC_XPORT_FAULT, DID_OK, 1, 0, "transport fault" },
103 { IBMVFC_FABRIC_MAPPED, IBMVFC_CMD_TIMEOUT, DID_TIME_OUT, 1, 1, "command timeout" }, 103 { IBMVFC_FABRIC_MAPPED, IBMVFC_CMD_TIMEOUT, DID_TIME_OUT, 1, 1, "command timeout" },
104 { IBMVFC_FABRIC_MAPPED, IBMVFC_ENETDOWN, DID_NO_CONNECT, 1, 1, "network down" }, 104 { IBMVFC_FABRIC_MAPPED, IBMVFC_ENETDOWN, DID_TRANSPORT_DISRUPTED, 1, 1, "network down" },
105 { IBMVFC_FABRIC_MAPPED, IBMVFC_HW_FAILURE, DID_ERROR, 1, 1, "hardware failure" }, 105 { IBMVFC_FABRIC_MAPPED, IBMVFC_HW_FAILURE, DID_ERROR, 1, 1, "hardware failure" },
106 { IBMVFC_FABRIC_MAPPED, IBMVFC_LINK_DOWN_ERR, DID_REQUEUE, 0, 0, "link down" }, 106 { IBMVFC_FABRIC_MAPPED, IBMVFC_LINK_DOWN_ERR, DID_REQUEUE, 0, 0, "link down" },
107 { IBMVFC_FABRIC_MAPPED, IBMVFC_LINK_DEAD_ERR, DID_ERROR, 0, 0, "link dead" }, 107 { IBMVFC_FABRIC_MAPPED, IBMVFC_LINK_DEAD_ERR, DID_ERROR, 0, 0, "link dead" },
@@ -115,11 +115,11 @@ static const struct {
115 115
116 { IBMVFC_VIOS_FAILURE, IBMVFC_CRQ_FAILURE, DID_REQUEUE, 1, 1, "CRQ failure" }, 116 { IBMVFC_VIOS_FAILURE, IBMVFC_CRQ_FAILURE, DID_REQUEUE, 1, 1, "CRQ failure" },
117 { IBMVFC_VIOS_FAILURE, IBMVFC_SW_FAILURE, DID_ERROR, 0, 1, "software failure" }, 117 { IBMVFC_VIOS_FAILURE, IBMVFC_SW_FAILURE, DID_ERROR, 0, 1, "software failure" },
118 { IBMVFC_VIOS_FAILURE, IBMVFC_INVALID_PARAMETER, DID_ABORT, 0, 1, "invalid parameter" }, 118 { IBMVFC_VIOS_FAILURE, IBMVFC_INVALID_PARAMETER, DID_ERROR, 0, 1, "invalid parameter" },
119 { IBMVFC_VIOS_FAILURE, IBMVFC_MISSING_PARAMETER, DID_ABORT, 0, 1, "missing parameter" }, 119 { IBMVFC_VIOS_FAILURE, IBMVFC_MISSING_PARAMETER, DID_ERROR, 0, 1, "missing parameter" },
120 { IBMVFC_VIOS_FAILURE, IBMVFC_HOST_IO_BUS, DID_ERROR, 1, 1, "host I/O bus failure" }, 120 { IBMVFC_VIOS_FAILURE, IBMVFC_HOST_IO_BUS, DID_ERROR, 1, 1, "host I/O bus failure" },
121 { IBMVFC_VIOS_FAILURE, IBMVFC_TRANS_CANCELLED, DID_ABORT, 0, 1, "transaction cancelled" }, 121 { IBMVFC_VIOS_FAILURE, IBMVFC_TRANS_CANCELLED, DID_ERROR, 0, 1, "transaction cancelled" },
122 { IBMVFC_VIOS_FAILURE, IBMVFC_TRANS_CANCELLED_IMPLICIT, DID_ABORT, 0, 1, "transaction cancelled implicit" }, 122 { IBMVFC_VIOS_FAILURE, IBMVFC_TRANS_CANCELLED_IMPLICIT, DID_ERROR, 0, 1, "transaction cancelled implicit" },
123 { IBMVFC_VIOS_FAILURE, IBMVFC_INSUFFICIENT_RESOURCE, DID_REQUEUE, 1, 1, "insufficient resources" }, 123 { IBMVFC_VIOS_FAILURE, IBMVFC_INSUFFICIENT_RESOURCE, DID_REQUEUE, 1, 1, "insufficient resources" },
124 { IBMVFC_VIOS_FAILURE, IBMVFC_PLOGI_REQUIRED, DID_ERROR, 0, 1, "port login required" }, 124 { IBMVFC_VIOS_FAILURE, IBMVFC_PLOGI_REQUIRED, DID_ERROR, 0, 1, "port login required" },
125 { IBMVFC_VIOS_FAILURE, IBMVFC_COMMAND_FAILED, DID_ERROR, 1, 1, "command failed" }, 125 { IBMVFC_VIOS_FAILURE, IBMVFC_COMMAND_FAILED, DID_ERROR, 1, 1, "command failed" },
@@ -1145,10 +1145,10 @@ static void ibmvfc_set_login_info(struct ibmvfc_host *vhost)
1145 login_info->async.len = vhost->async_crq.size * sizeof(*vhost->async_crq.msgs); 1145 login_info->async.len = vhost->async_crq.size * sizeof(*vhost->async_crq.msgs);
1146 strncpy(login_info->partition_name, vhost->partition_name, IBMVFC_MAX_NAME); 1146 strncpy(login_info->partition_name, vhost->partition_name, IBMVFC_MAX_NAME);
1147 strncpy(login_info->device_name, 1147 strncpy(login_info->device_name,
1148 vhost->host->shost_gendev.bus_id, IBMVFC_MAX_NAME); 1148 dev_name(&vhost->host->shost_gendev), IBMVFC_MAX_NAME);
1149 1149
1150 location = of_get_property(of_node, "ibm,loc-code", NULL); 1150 location = of_get_property(of_node, "ibm,loc-code", NULL);
1151 location = location ? location : vhost->dev->bus_id; 1151 location = location ? location : dev_name(vhost->dev);
1152 strncpy(login_info->drc_name, location, IBMVFC_MAX_NAME); 1152 strncpy(login_info->drc_name, location, IBMVFC_MAX_NAME);
1153} 1153}
1154 1154
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 868d35ea01bb..5c541f7850f9 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -89,6 +89,7 @@ static int max_id = 64;
89static int max_channel = 3; 89static int max_channel = 3;
90static int init_timeout = 5; 90static int init_timeout = 5;
91static int max_requests = IBMVSCSI_MAX_REQUESTS_DEFAULT; 91static int max_requests = IBMVSCSI_MAX_REQUESTS_DEFAULT;
92static int max_events = IBMVSCSI_MAX_REQUESTS_DEFAULT + 2;
92 93
93static struct scsi_transport_template *ibmvscsi_transport_template; 94static struct scsi_transport_template *ibmvscsi_transport_template;
94 95
@@ -1633,7 +1634,7 @@ static struct scsi_host_template driver_template = {
1633static unsigned long ibmvscsi_get_desired_dma(struct vio_dev *vdev) 1634static unsigned long ibmvscsi_get_desired_dma(struct vio_dev *vdev)
1634{ 1635{
1635 /* iu_storage data allocated in initialize_event_pool */ 1636 /* iu_storage data allocated in initialize_event_pool */
1636 unsigned long desired_io = max_requests * sizeof(union viosrp_iu); 1637 unsigned long desired_io = max_events * sizeof(union viosrp_iu);
1637 1638
1638 /* add io space for sg data */ 1639 /* add io space for sg data */
1639 desired_io += (IBMVSCSI_MAX_SECTORS_DEFAULT * 512 * 1640 desired_io += (IBMVSCSI_MAX_SECTORS_DEFAULT * 512 *
@@ -1657,7 +1658,6 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id)
1657 1658
1658 vdev->dev.driver_data = NULL; 1659 vdev->dev.driver_data = NULL;
1659 1660
1660 driver_template.can_queue = max_requests - 2;
1661 host = scsi_host_alloc(&driver_template, sizeof(*hostdata)); 1661 host = scsi_host_alloc(&driver_template, sizeof(*hostdata));
1662 if (!host) { 1662 if (!host) {
1663 dev_err(&vdev->dev, "couldn't allocate host data\n"); 1663 dev_err(&vdev->dev, "couldn't allocate host data\n");
@@ -1673,12 +1673,12 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id)
1673 atomic_set(&hostdata->request_limit, -1); 1673 atomic_set(&hostdata->request_limit, -1);
1674 hostdata->host->max_sectors = IBMVSCSI_MAX_SECTORS_DEFAULT; 1674 hostdata->host->max_sectors = IBMVSCSI_MAX_SECTORS_DEFAULT;
1675 1675
1676 rc = ibmvscsi_ops->init_crq_queue(&hostdata->queue, hostdata, max_requests); 1676 rc = ibmvscsi_ops->init_crq_queue(&hostdata->queue, hostdata, max_events);
1677 if (rc != 0 && rc != H_RESOURCE) { 1677 if (rc != 0 && rc != H_RESOURCE) {
1678 dev_err(&vdev->dev, "couldn't initialize crq. rc=%d\n", rc); 1678 dev_err(&vdev->dev, "couldn't initialize crq. rc=%d\n", rc);
1679 goto init_crq_failed; 1679 goto init_crq_failed;
1680 } 1680 }
1681 if (initialize_event_pool(&hostdata->pool, max_requests, hostdata) != 0) { 1681 if (initialize_event_pool(&hostdata->pool, max_events, hostdata) != 0) {
1682 dev_err(&vdev->dev, "couldn't initialize event pool\n"); 1682 dev_err(&vdev->dev, "couldn't initialize event pool\n");
1683 goto init_pool_failed; 1683 goto init_pool_failed;
1684 } 1684 }
@@ -1730,7 +1730,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id)
1730 add_host_failed: 1730 add_host_failed:
1731 release_event_pool(&hostdata->pool, hostdata); 1731 release_event_pool(&hostdata->pool, hostdata);
1732 init_pool_failed: 1732 init_pool_failed:
1733 ibmvscsi_ops->release_crq_queue(&hostdata->queue, hostdata, max_requests); 1733 ibmvscsi_ops->release_crq_queue(&hostdata->queue, hostdata, max_events);
1734 init_crq_failed: 1734 init_crq_failed:
1735 scsi_host_put(host); 1735 scsi_host_put(host);
1736 scsi_host_alloc_failed: 1736 scsi_host_alloc_failed:
@@ -1742,7 +1742,7 @@ static int ibmvscsi_remove(struct vio_dev *vdev)
1742 struct ibmvscsi_host_data *hostdata = vdev->dev.driver_data; 1742 struct ibmvscsi_host_data *hostdata = vdev->dev.driver_data;
1743 release_event_pool(&hostdata->pool, hostdata); 1743 release_event_pool(&hostdata->pool, hostdata);
1744 ibmvscsi_ops->release_crq_queue(&hostdata->queue, hostdata, 1744 ibmvscsi_ops->release_crq_queue(&hostdata->queue, hostdata,
1745 max_requests); 1745 max_events);
1746 1746
1747 srp_remove_host(hostdata->host); 1747 srp_remove_host(hostdata->host);
1748 scsi_remove_host(hostdata->host); 1748 scsi_remove_host(hostdata->host);
@@ -1779,6 +1779,10 @@ int __init ibmvscsi_module_init(void)
1779{ 1779{
1780 int ret; 1780 int ret;
1781 1781
1782 /* Ensure we have two requests to do error recovery */
1783 driver_template.can_queue = max_requests;
1784 max_events = max_requests + 2;
1785
1782 if (firmware_has_feature(FW_FEATURE_ISERIES)) 1786 if (firmware_has_feature(FW_FEATURE_ISERIES))
1783 ibmvscsi_ops = &iseriesvscsi_ops; 1787 ibmvscsi_ops = &iseriesvscsi_ops;
1784 else if (firmware_has_feature(FW_FEATURE_VIO)) 1788 else if (firmware_has_feature(FW_FEATURE_VIO))