Commit 4a59f71d authored by andrew.vasquez@qlogic.com's avatar andrew.vasquez@qlogic.com Committed by James Bottomley

[SCSI] qla2xxx: Further restrict ZIO mode support.

Only support ZIO mode 6 on specific ISP types.
Signed-off-by: default avatarAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 6f641790
...@@ -507,9 +507,6 @@ qla2x00_zio_show(struct class_device *cdev, char *buf) ...@@ -507,9 +507,6 @@ qla2x00_zio_show(struct class_device *cdev, char *buf)
int len = 0; int len = 0;
switch (ha->zio_mode) { switch (ha->zio_mode) {
case QLA_ZIO_MODE_5:
len += snprintf(buf + len, PAGE_SIZE-len, "Mode 5\n");
break;
case QLA_ZIO_MODE_6: case QLA_ZIO_MODE_6:
len += snprintf(buf + len, PAGE_SIZE-len, "Mode 6\n"); len += snprintf(buf + len, PAGE_SIZE-len, "Mode 6\n");
break; break;
...@@ -527,20 +524,16 @@ qla2x00_zio_store(struct class_device *cdev, const char *buf, size_t count) ...@@ -527,20 +524,16 @@ qla2x00_zio_store(struct class_device *cdev, const char *buf, size_t count)
int val = 0; int val = 0;
uint16_t zio_mode; uint16_t zio_mode;
if (!IS_ZIO_SUPPORTED(ha))
return -ENOTSUPP;
if (sscanf(buf, "%d", &val) != 1) if (sscanf(buf, "%d", &val) != 1)
return -EINVAL; return -EINVAL;
switch (val) { if (val)
case 1:
zio_mode = QLA_ZIO_MODE_5;
break;
case 2:
zio_mode = QLA_ZIO_MODE_6; zio_mode = QLA_ZIO_MODE_6;
break; else
default:
zio_mode = QLA_ZIO_DISABLED; zio_mode = QLA_ZIO_DISABLED;
break;
}
/* Update per-hba values and queue a reset. */ /* Update per-hba values and queue a reset. */
if (zio_mode != QLA_ZIO_DISABLED || ha->zio_mode != QLA_ZIO_DISABLED) { if (zio_mode != QLA_ZIO_DISABLED || ha->zio_mode != QLA_ZIO_DISABLED) {
......
...@@ -762,7 +762,6 @@ typedef struct { ...@@ -762,7 +762,6 @@ typedef struct {
#define PD_STATE_WAIT_PORT_LOGOUT_ACK 11 #define PD_STATE_WAIT_PORT_LOGOUT_ACK 11
#define QLA_ZIO_MODE_5 (BIT_2 | BIT_0)
#define QLA_ZIO_MODE_6 (BIT_2 | BIT_1) #define QLA_ZIO_MODE_6 (BIT_2 | BIT_1)
#define QLA_ZIO_DISABLED 0 #define QLA_ZIO_DISABLED 0
#define QLA_ZIO_DEFAULT_TIMER 2 #define QLA_ZIO_DEFAULT_TIMER 2
...@@ -2238,6 +2237,7 @@ typedef struct scsi_qla_host { ...@@ -2238,6 +2237,7 @@ typedef struct scsi_qla_host {
#define DT_ISP5432 BIT_10 #define DT_ISP5432 BIT_10
#define DT_ISP_LAST (DT_ISP5432 << 1) #define DT_ISP_LAST (DT_ISP5432 << 1)
#define DT_ZIO_SUPPORTED BIT_28
#define DT_OEM_001 BIT_29 #define DT_OEM_001 BIT_29
#define DT_ISP2200A BIT_30 #define DT_ISP2200A BIT_30
#define DT_EXTENDED_IDS BIT_31 #define DT_EXTENDED_IDS BIT_31
...@@ -2260,6 +2260,7 @@ typedef struct scsi_qla_host { ...@@ -2260,6 +2260,7 @@ typedef struct scsi_qla_host {
#define IS_QLA24XX(ha) (IS_QLA2422(ha) || IS_QLA2432(ha)) #define IS_QLA24XX(ha) (IS_QLA2422(ha) || IS_QLA2432(ha))
#define IS_QLA54XX(ha) (IS_QLA5422(ha) || IS_QLA5432(ha)) #define IS_QLA54XX(ha) (IS_QLA5422(ha) || IS_QLA5432(ha))
#define IS_ZIO_SUPPORTED(ha) ((ha)->device_type & DT_ZIO_SUPPORTED)
#define IS_OEM_001(ha) ((ha)->device_type & DT_OEM_001) #define IS_OEM_001(ha) ((ha)->device_type & DT_OEM_001)
#define HAS_EXTENDED_IDS(ha) ((ha)->device_type & DT_EXTENDED_IDS) #define HAS_EXTENDED_IDS(ha) ((ha)->device_type & DT_EXTENDED_IDS)
......
...@@ -1659,6 +1659,8 @@ qla2x00_nvram_config(scsi_qla_host_t *ha) ...@@ -1659,6 +1659,8 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
~(BIT_3 | BIT_2 | BIT_1 | BIT_0); ~(BIT_3 | BIT_2 | BIT_1 | BIT_0);
ha->flags.process_response_queue = 0; ha->flags.process_response_queue = 0;
if (ha->zio_mode != QLA_ZIO_DISABLED) { if (ha->zio_mode != QLA_ZIO_DISABLED) {
ha->zio_mode = QLA_ZIO_MODE_6;
DEBUG2(printk("scsi(%ld): ZIO mode %d enabled; timer " DEBUG2(printk("scsi(%ld): ZIO mode %d enabled; timer "
"delay (%d us).\n", ha->host_no, ha->zio_mode, "delay (%d us).\n", ha->host_no, ha->zio_mode,
ha->zio_timer * 100)); ha->zio_timer * 100));
...@@ -3474,6 +3476,8 @@ qla24xx_nvram_config(scsi_qla_host_t *ha) ...@@ -3474,6 +3476,8 @@ qla24xx_nvram_config(scsi_qla_host_t *ha)
~(BIT_3 | BIT_2 | BIT_1 | BIT_0)); ~(BIT_3 | BIT_2 | BIT_1 | BIT_0));
ha->flags.process_response_queue = 0; ha->flags.process_response_queue = 0;
if (ha->zio_mode != QLA_ZIO_DISABLED) { if (ha->zio_mode != QLA_ZIO_DISABLED) {
ha->zio_mode = QLA_ZIO_MODE_6;
DEBUG2(printk("scsi(%ld): ZIO mode %d enabled; timer delay " DEBUG2(printk("scsi(%ld): ZIO mode %d enabled; timer delay "
"(%d us).\n", ha->host_no, ha->zio_mode, "(%d us).\n", ha->host_no, ha->zio_mode,
ha->zio_timer * 100)); ha->zio_timer * 100));
......
...@@ -1161,12 +1161,15 @@ qla2x00_set_isp_flags(scsi_qla_host_t *ha) ...@@ -1161,12 +1161,15 @@ qla2x00_set_isp_flags(scsi_qla_host_t *ha)
break; break;
case PCI_DEVICE_ID_QLOGIC_ISP2300: case PCI_DEVICE_ID_QLOGIC_ISP2300:
ha->device_type |= DT_ISP2300; ha->device_type |= DT_ISP2300;
ha->device_type |= DT_ZIO_SUPPORTED;
break; break;
case PCI_DEVICE_ID_QLOGIC_ISP2312: case PCI_DEVICE_ID_QLOGIC_ISP2312:
ha->device_type |= DT_ISP2312; ha->device_type |= DT_ISP2312;
ha->device_type |= DT_ZIO_SUPPORTED;
break; break;
case PCI_DEVICE_ID_QLOGIC_ISP2322: case PCI_DEVICE_ID_QLOGIC_ISP2322:
ha->device_type |= DT_ISP2322; ha->device_type |= DT_ISP2322;
ha->device_type |= DT_ZIO_SUPPORTED;
if (ha->pdev->subsystem_vendor == 0x1028 && if (ha->pdev->subsystem_vendor == 0x1028 &&
ha->pdev->subsystem_device == 0x0170) ha->pdev->subsystem_device == 0x0170)
ha->device_type |= DT_OEM_001; ha->device_type |= DT_OEM_001;
...@@ -1179,9 +1182,11 @@ qla2x00_set_isp_flags(scsi_qla_host_t *ha) ...@@ -1179,9 +1182,11 @@ qla2x00_set_isp_flags(scsi_qla_host_t *ha)
break; break;
case PCI_DEVICE_ID_QLOGIC_ISP2422: case PCI_DEVICE_ID_QLOGIC_ISP2422:
ha->device_type |= DT_ISP2422; ha->device_type |= DT_ISP2422;
ha->device_type |= DT_ZIO_SUPPORTED;
break; break;
case PCI_DEVICE_ID_QLOGIC_ISP2432: case PCI_DEVICE_ID_QLOGIC_ISP2432:
ha->device_type |= DT_ISP2432; ha->device_type |= DT_ISP2432;
ha->device_type |= DT_ZIO_SUPPORTED;
break; break;
case PCI_DEVICE_ID_QLOGIC_ISP5422: case PCI_DEVICE_ID_QLOGIC_ISP5422:
ha->device_type |= DT_ISP5422; ha->device_type |= DT_ISP5422;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment