aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r--drivers/scsi/qla2xxx/qla_def.h3
-rw-r--r--drivers/scsi/qla2xxx/qla_gbl.h1
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c12
-rw-r--r--drivers/scsi/qla2xxx/qla_isr.c44
-rw-r--r--drivers/scsi/qla2xxx/qla_mid.c8
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c12
-rw-r--r--drivers/scsi/qla2xxx/qla_sup.c3
-rw-r--r--drivers/scsi/qla2xxx/qla_version.h2
8 files changed, 32 insertions, 53 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 608e675f68c8..1263d9796e89 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -1586,8 +1586,7 @@ typedef struct fc_port {
1586 */ 1586 */
1587#define FCF_FABRIC_DEVICE BIT_0 1587#define FCF_FABRIC_DEVICE BIT_0
1588#define FCF_LOGIN_NEEDED BIT_1 1588#define FCF_LOGIN_NEEDED BIT_1
1589#define FCF_TAPE_PRESENT BIT_2 1589#define FCF_FCP2_DEVICE BIT_2
1590#define FCF_FCP2_DEVICE BIT_3
1591 1590
1592/* No loop ID flag. */ 1591/* No loop ID flag. */
1593#define FC_NO_LOOP_ID 0x1000 1592#define FC_NO_LOOP_ID 0x1000
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index f61fb8d01330..8bc6f53691e9 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -453,6 +453,5 @@ extern void qla24xx_wrt_req_reg(struct qla_hw_data *, uint16_t, uint16_t);
453extern void qla25xx_wrt_req_reg(struct qla_hw_data *, uint16_t, uint16_t); 453extern void qla25xx_wrt_req_reg(struct qla_hw_data *, uint16_t, uint16_t);
454extern void qla25xx_wrt_rsp_reg(struct qla_hw_data *, uint16_t, uint16_t); 454extern void qla25xx_wrt_rsp_reg(struct qla_hw_data *, uint16_t, uint16_t);
455extern void qla24xx_wrt_rsp_reg(struct qla_hw_data *, uint16_t, uint16_t); 455extern void qla24xx_wrt_rsp_reg(struct qla_hw_data *, uint16_t, uint16_t);
456extern struct scsi_qla_host * qla25xx_get_host(struct rsp_que *);
457 456
458#endif /* _QLA_GBL_H */ 457#endif /* _QLA_GBL_H */
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index b4a0eac8f96d..3f8e8495b743 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -205,7 +205,7 @@ qla2x00_async_login_done(struct scsi_qla_host *vha, fc_port_t *fcport,
205 205
206 switch (data[0]) { 206 switch (data[0]) {
207 case MBS_COMMAND_COMPLETE: 207 case MBS_COMMAND_COMPLETE:
208 if (fcport->flags & FCF_TAPE_PRESENT) 208 if (fcport->flags & FCF_FCP2_DEVICE)
209 opts |= BIT_1; 209 opts |= BIT_1;
210 rval = qla2x00_get_port_database(vha, fcport, opts); 210 rval = qla2x00_get_port_database(vha, fcport, opts);
211 if (rval != QLA_SUCCESS) 211 if (rval != QLA_SUCCESS)
@@ -2726,7 +2726,7 @@ qla2x00_configure_fabric(scsi_qla_host_t *vha)
2726 2726
2727 /* 2727 /*
2728 * Logout all previous fabric devices marked lost, except 2728 * Logout all previous fabric devices marked lost, except
2729 * tape devices. 2729 * FCP2 devices.
2730 */ 2730 */
2731 list_for_each_entry(fcport, &vha->vp_fcports, list) { 2731 list_for_each_entry(fcport, &vha->vp_fcports, list) {
2732 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) 2732 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags))
@@ -2739,7 +2739,7 @@ qla2x00_configure_fabric(scsi_qla_host_t *vha)
2739 qla2x00_mark_device_lost(vha, fcport, 2739 qla2x00_mark_device_lost(vha, fcport,
2740 ql2xplogiabsentdevice, 0); 2740 ql2xplogiabsentdevice, 0);
2741 if (fcport->loop_id != FC_NO_LOOP_ID && 2741 if (fcport->loop_id != FC_NO_LOOP_ID &&
2742 (fcport->flags & FCF_TAPE_PRESENT) == 0 && 2742 (fcport->flags & FCF_FCP2_DEVICE) == 0 &&
2743 fcport->port_type != FCT_INITIATOR && 2743 fcport->port_type != FCT_INITIATOR &&
2744 fcport->port_type != FCT_BROADCAST) { 2744 fcport->port_type != FCT_BROADCAST) {
2745 ha->isp_ops->fabric_logout(vha, 2745 ha->isp_ops->fabric_logout(vha,
@@ -3018,7 +3018,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha,
3018 fcport->d_id.b24 = new_fcport->d_id.b24; 3018 fcport->d_id.b24 = new_fcport->d_id.b24;
3019 fcport->flags |= FCF_LOGIN_NEEDED; 3019 fcport->flags |= FCF_LOGIN_NEEDED;
3020 if (fcport->loop_id != FC_NO_LOOP_ID && 3020 if (fcport->loop_id != FC_NO_LOOP_ID &&
3021 (fcport->flags & FCF_TAPE_PRESENT) == 0 && 3021 (fcport->flags & FCF_FCP2_DEVICE) == 0 &&
3022 fcport->port_type != FCT_INITIATOR && 3022 fcport->port_type != FCT_INITIATOR &&
3023 fcport->port_type != FCT_BROADCAST) { 3023 fcport->port_type != FCT_BROADCAST) {
3024 ha->isp_ops->fabric_logout(vha, fcport->loop_id, 3024 ha->isp_ops->fabric_logout(vha, fcport->loop_id,
@@ -3272,9 +3272,9 @@ qla2x00_fabric_dev_login(scsi_qla_host_t *vha, fc_port_t *fcport,
3272 3272
3273 rval = qla2x00_fabric_login(vha, fcport, next_loopid); 3273 rval = qla2x00_fabric_login(vha, fcport, next_loopid);
3274 if (rval == QLA_SUCCESS) { 3274 if (rval == QLA_SUCCESS) {
3275 /* Send an ADISC to tape devices.*/ 3275 /* Send an ADISC to FCP2 devices.*/
3276 opts = 0; 3276 opts = 0;
3277 if (fcport->flags & FCF_TAPE_PRESENT) 3277 if (fcport->flags & FCF_FCP2_DEVICE)
3278 opts |= BIT_1; 3278 opts |= BIT_1;
3279 rval = qla2x00_get_port_database(vha, fcport, opts); 3279 rval = qla2x00_get_port_database(vha, fcport, opts);
3280 if (rval != QLA_SUCCESS) { 3280 if (rval != QLA_SUCCESS) {
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index ffd0efdff40e..6fc63b98818c 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -1917,6 +1917,7 @@ qla24xx_msix_rsp_q(int irq, void *dev_id)
1917 struct rsp_que *rsp; 1917 struct rsp_que *rsp;
1918 struct device_reg_24xx __iomem *reg; 1918 struct device_reg_24xx __iomem *reg;
1919 struct scsi_qla_host *vha; 1919 struct scsi_qla_host *vha;
1920 unsigned long flags;
1920 1921
1921 rsp = (struct rsp_que *) dev_id; 1922 rsp = (struct rsp_que *) dev_id;
1922 if (!rsp) { 1923 if (!rsp) {
@@ -1927,15 +1928,15 @@ qla24xx_msix_rsp_q(int irq, void *dev_id)
1927 ha = rsp->hw; 1928 ha = rsp->hw;
1928 reg = &ha->iobase->isp24; 1929 reg = &ha->iobase->isp24;
1929 1930
1930 spin_lock_irq(&ha->hardware_lock); 1931 spin_lock_irqsave(&ha->hardware_lock, flags);
1931 1932
1932 vha = qla25xx_get_host(rsp); 1933 vha = pci_get_drvdata(ha->pdev);
1933 qla24xx_process_response_queue(vha, rsp); 1934 qla24xx_process_response_queue(vha, rsp);
1934 if (!ha->flags.disable_msix_handshake) { 1935 if (!ha->flags.disable_msix_handshake) {
1935 WRT_REG_DWORD(&reg->hccr, HCCRX_CLR_RISC_INT); 1936 WRT_REG_DWORD(&reg->hccr, HCCRX_CLR_RISC_INT);
1936 RD_REG_DWORD_RELAXED(&reg->hccr); 1937 RD_REG_DWORD_RELAXED(&reg->hccr);
1937 } 1938 }
1938 spin_unlock_irq(&ha->hardware_lock); 1939 spin_unlock_irqrestore(&ha->hardware_lock, flags);
1939 1940
1940 return IRQ_HANDLED; 1941 return IRQ_HANDLED;
1941} 1942}
@@ -1946,6 +1947,7 @@ qla25xx_msix_rsp_q(int irq, void *dev_id)
1946 struct qla_hw_data *ha; 1947 struct qla_hw_data *ha;
1947 struct rsp_que *rsp; 1948 struct rsp_que *rsp;
1948 struct device_reg_24xx __iomem *reg; 1949 struct device_reg_24xx __iomem *reg;
1950 unsigned long flags;
1949 1951
1950 rsp = (struct rsp_que *) dev_id; 1952 rsp = (struct rsp_que *) dev_id;
1951 if (!rsp) { 1953 if (!rsp) {
@@ -1958,10 +1960,10 @@ qla25xx_msix_rsp_q(int irq, void *dev_id)
1958 /* Clear the interrupt, if enabled, for this response queue */ 1960 /* Clear the interrupt, if enabled, for this response queue */
1959 if (rsp->options & ~BIT_6) { 1961 if (rsp->options & ~BIT_6) {
1960 reg = &ha->iobase->isp24; 1962 reg = &ha->iobase->isp24;
1961 spin_lock_irq(&ha->hardware_lock); 1963 spin_lock_irqsave(&ha->hardware_lock, flags);
1962 WRT_REG_DWORD(&reg->hccr, HCCRX_CLR_RISC_INT); 1964 WRT_REG_DWORD(&reg->hccr, HCCRX_CLR_RISC_INT);
1963 RD_REG_DWORD_RELAXED(&reg->hccr); 1965 RD_REG_DWORD_RELAXED(&reg->hccr);
1964 spin_unlock_irq(&ha->hardware_lock); 1966 spin_unlock_irqrestore(&ha->hardware_lock, flags);
1965 } 1967 }
1966 queue_work_on((int) (rsp->id - 1), ha->wq, &rsp->q_work); 1968 queue_work_on((int) (rsp->id - 1), ha->wq, &rsp->q_work);
1967 1969
@@ -1979,6 +1981,7 @@ qla24xx_msix_default(int irq, void *dev_id)
1979 uint32_t stat; 1981 uint32_t stat;
1980 uint32_t hccr; 1982 uint32_t hccr;
1981 uint16_t mb[4]; 1983 uint16_t mb[4];
1984 unsigned long flags;
1982 1985
1983 rsp = (struct rsp_que *) dev_id; 1986 rsp = (struct rsp_que *) dev_id;
1984 if (!rsp) { 1987 if (!rsp) {
@@ -1990,7 +1993,7 @@ qla24xx_msix_default(int irq, void *dev_id)
1990 reg = &ha->iobase->isp24; 1993 reg = &ha->iobase->isp24;
1991 status = 0; 1994 status = 0;
1992 1995
1993 spin_lock_irq(&ha->hardware_lock); 1996 spin_lock_irqsave(&ha->hardware_lock, flags);
1994 vha = pci_get_drvdata(ha->pdev); 1997 vha = pci_get_drvdata(ha->pdev);
1995 do { 1998 do {
1996 stat = RD_REG_DWORD(&reg->host_status); 1999 stat = RD_REG_DWORD(&reg->host_status);
@@ -2039,7 +2042,7 @@ qla24xx_msix_default(int irq, void *dev_id)
2039 } 2042 }
2040 WRT_REG_DWORD(&reg->hccr, HCCRX_CLR_RISC_INT); 2043 WRT_REG_DWORD(&reg->hccr, HCCRX_CLR_RISC_INT);
2041 } while (0); 2044 } while (0);
2042 spin_unlock_irq(&ha->hardware_lock); 2045 spin_unlock_irqrestore(&ha->hardware_lock, flags);
2043 2046
2044 if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags) && 2047 if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags) &&
2045 (status & MBX_INTERRUPT) && ha->flags.mbox_int) { 2048 (status & MBX_INTERRUPT) && ha->flags.mbox_int) {
@@ -2277,30 +2280,3 @@ int qla25xx_request_irq(struct rsp_que *rsp)
2277 msix->rsp = rsp; 2280 msix->rsp = rsp;
2278 return ret; 2281 return ret;
2279} 2282}
2280
2281struct scsi_qla_host *
2282qla25xx_get_host(struct rsp_que *rsp)
2283{
2284 srb_t *sp;
2285 struct qla_hw_data *ha = rsp->hw;
2286 struct scsi_qla_host *vha = NULL;
2287 struct sts_entry_24xx *pkt;
2288 struct req_que *req;
2289 uint16_t que;
2290 uint32_t handle;
2291
2292 pkt = (struct sts_entry_24xx *) rsp->ring_ptr;
2293 que = MSW(pkt->handle);
2294 handle = (uint32_t) LSW(pkt->handle);
2295 req = ha->req_q_map[que];
2296 if (handle < MAX_OUTSTANDING_COMMANDS) {
2297 sp = req->outstanding_cmds[handle];
2298 if (sp)
2299 return sp->fcport->vha;
2300 else
2301 goto base_que;
2302 }
2303base_que:
2304 vha = pci_get_drvdata(ha->pdev);
2305 return vha;
2306}
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
index b901aa267e7d..ff17dee28613 100644
--- a/drivers/scsi/qla2xxx/qla_mid.c
+++ b/drivers/scsi/qla2xxx/qla_mid.c
@@ -636,13 +636,15 @@ failed:
636 636
637static void qla_do_work(struct work_struct *work) 637static void qla_do_work(struct work_struct *work)
638{ 638{
639 unsigned long flags;
639 struct rsp_que *rsp = container_of(work, struct rsp_que, q_work); 640 struct rsp_que *rsp = container_of(work, struct rsp_que, q_work);
640 struct scsi_qla_host *vha; 641 struct scsi_qla_host *vha;
642 struct qla_hw_data *ha = rsp->hw;
641 643
642 spin_lock_irq(&rsp->hw->hardware_lock); 644 spin_lock_irqsave(&rsp->hw->hardware_lock, flags);
643 vha = qla25xx_get_host(rsp); 645 vha = pci_get_drvdata(ha->pdev);
644 qla24xx_process_response_queue(vha, rsp); 646 qla24xx_process_response_queue(vha, rsp);
645 spin_unlock_irq(&rsp->hw->hardware_lock); 647 spin_unlock_irqrestore(&rsp->hw->hardware_lock, flags);
646} 648}
647 649
648/* create response queue */ 650/* create response queue */
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 209f50e788a1..8529eb1f3cd4 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -1188,7 +1188,6 @@ qla2xxx_slave_configure(struct scsi_device *sdev)
1188 scsi_qla_host_t *vha = shost_priv(sdev->host); 1188 scsi_qla_host_t *vha = shost_priv(sdev->host);
1189 struct qla_hw_data *ha = vha->hw; 1189 struct qla_hw_data *ha = vha->hw;
1190 struct fc_rport *rport = starget_to_rport(sdev->sdev_target); 1190 struct fc_rport *rport = starget_to_rport(sdev->sdev_target);
1191 fc_port_t *fcport = *(fc_port_t **)rport->dd_data;
1192 struct req_que *req = vha->req; 1191 struct req_que *req = vha->req;
1193 1192
1194 if (sdev->tagged_supported) 1193 if (sdev->tagged_supported)
@@ -1197,8 +1196,6 @@ qla2xxx_slave_configure(struct scsi_device *sdev)
1197 scsi_deactivate_tcq(sdev, req->max_q_depth); 1196 scsi_deactivate_tcq(sdev, req->max_q_depth);
1198 1197
1199 rport->dev_loss_tmo = ha->port_down_retry_count; 1198 rport->dev_loss_tmo = ha->port_down_retry_count;
1200 if (sdev->type == TYPE_TAPE)
1201 fcport->flags |= FCF_TAPE_PRESENT;
1202 1199
1203 return 0; 1200 return 0;
1204} 1201}
@@ -2805,7 +2802,7 @@ void qla2x00_relogin(struct scsi_qla_host *vha)
2805 2802
2806 fcport->login_retry--; 2803 fcport->login_retry--;
2807 if (fcport->flags & FCF_FABRIC_DEVICE) { 2804 if (fcport->flags & FCF_FABRIC_DEVICE) {
2808 if (fcport->flags & FCF_TAPE_PRESENT) 2805 if (fcport->flags & FCF_FCP2_DEVICE)
2809 ha->isp_ops->fabric_logout(vha, 2806 ha->isp_ops->fabric_logout(vha,
2810 fcport->loop_id, 2807 fcport->loop_id,
2811 fcport->d_id.b.domain, 2808 fcport->d_id.b.domain,
@@ -3141,7 +3138,10 @@ qla2x00_timer(scsi_qla_host_t *vha)
3141 if (!IS_QLA2100(ha) && vha->link_down_timeout) 3138 if (!IS_QLA2100(ha) && vha->link_down_timeout)
3142 atomic_set(&vha->loop_state, LOOP_DEAD); 3139 atomic_set(&vha->loop_state, LOOP_DEAD);
3143 3140
3144 /* Schedule an ISP abort to return any tape commands. */ 3141 /*
3142 * Schedule an ISP abort to return any FCP2-device
3143 * commands.
3144 */
3145 /* NPIV - scan physical port only */ 3145 /* NPIV - scan physical port only */
3146 if (!vha->vp_idx) { 3146 if (!vha->vp_idx) {
3147 spin_lock_irqsave(&ha->hardware_lock, 3147 spin_lock_irqsave(&ha->hardware_lock,
@@ -3158,7 +3158,7 @@ qla2x00_timer(scsi_qla_host_t *vha)
3158 if (sp->ctx) 3158 if (sp->ctx)
3159 continue; 3159 continue;
3160 sfcp = sp->fcport; 3160 sfcp = sp->fcport;
3161 if (!(sfcp->flags & FCF_TAPE_PRESENT)) 3161 if (!(sfcp->flags & FCF_FCP2_DEVICE))
3162 continue; 3162 continue;
3163 3163
3164 set_bit(ISP_ABORT_NEEDED, 3164 set_bit(ISP_ABORT_NEEDED,
diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c
index 010e69b29afe..371dc895972a 100644
--- a/drivers/scsi/qla2xxx/qla_sup.c
+++ b/drivers/scsi/qla2xxx/qla_sup.c
@@ -2292,11 +2292,14 @@ qla25xx_read_optrom_data(struct scsi_qla_host *vha, uint8_t *buf,
2292 uint32_t faddr, left, burst; 2292 uint32_t faddr, left, burst;
2293 struct qla_hw_data *ha = vha->hw; 2293 struct qla_hw_data *ha = vha->hw;
2294 2294
2295 if (IS_QLA25XX(ha) || IS_QLA81XX(ha))
2296 goto try_fast;
2295 if (offset & 0xfff) 2297 if (offset & 0xfff)
2296 goto slow_read; 2298 goto slow_read;
2297 if (length < OPTROM_BURST_SIZE) 2299 if (length < OPTROM_BURST_SIZE)
2298 goto slow_read; 2300 goto slow_read;
2299 2301
2302try_fast:
2300 optrom = dma_alloc_coherent(&ha->pdev->dev, OPTROM_BURST_SIZE, 2303 optrom = dma_alloc_coherent(&ha->pdev->dev, OPTROM_BURST_SIZE,
2301 &optrom_dma, GFP_KERNEL); 2304 &optrom_dma, GFP_KERNEL);
2302 if (!optrom) { 2305 if (!optrom) {
diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h
index a65dd95507c6..ed36279a33c1 100644
--- a/drivers/scsi/qla2xxx/qla_version.h
+++ b/drivers/scsi/qla2xxx/qla_version.h
@@ -7,7 +7,7 @@
7/* 7/*
8 * Driver version 8 * Driver version
9 */ 9 */
10#define QLA2XXX_VERSION "8.03.01-k9" 10#define QLA2XXX_VERSION "8.03.01-k10"
11 11
12#define QLA_DRIVER_MAJOR_VER 8 12#define QLA_DRIVER_MAJOR_VER 8
13#define QLA_DRIVER_MINOR_VER 3 13#define QLA_DRIVER_MINOR_VER 3