diff options
author | Madhuranath Iyengar <madhuranath.iyengar@qlogic.com> | 2010-07-23 06:28:24 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-28 10:06:08 -0400 |
commit | 2f0f3f4f06f7cfadebf58b70bd9e7f71d8fd96e4 (patch) | |
tree | a830ea66f0f4aca7da0e915d30dca8c1be6cfe28 /drivers/scsi | |
parent | d94d10e7277069801b4e31b40770314a8421f996 (diff) |
[SCSI] qla2xxx: Appropriately log FCP priority data messages
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_bsg.c | 36 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 7 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_sup.c | 25 |
3 files changed, 48 insertions, 20 deletions
diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c index 20eaa1c42ae2..d551ae19d4e1 100644 --- a/drivers/scsi/qla2xxx/qla_bsg.c +++ b/drivers/scsi/qla2xxx/qla_bsg.c | |||
@@ -41,13 +41,28 @@ qla24xx_fcp_prio_cfg_valid(struct qla_fcp_prio_cfg *pri_cfg, uint8_t flag) | |||
41 | int i, ret, num_valid; | 41 | int i, ret, num_valid; |
42 | uint8_t *bcode; | 42 | uint8_t *bcode; |
43 | struct qla_fcp_prio_entry *pri_entry; | 43 | struct qla_fcp_prio_entry *pri_entry; |
44 | uint32_t *bcode_val_ptr, bcode_val; | ||
44 | 45 | ||
45 | ret = 1; | 46 | ret = 1; |
46 | num_valid = 0; | 47 | num_valid = 0; |
47 | bcode = (uint8_t *)pri_cfg; | 48 | bcode = (uint8_t *)pri_cfg; |
49 | bcode_val_ptr = (uint32_t *)pri_cfg; | ||
50 | bcode_val = (uint32_t)(*bcode_val_ptr); | ||
48 | 51 | ||
49 | if (bcode[0x0] != 'H' || bcode[0x1] != 'Q' || bcode[0x2] != 'O' || | 52 | if (bcode_val == 0xFFFFFFFF) { |
50 | bcode[0x3] != 'S') { | 53 | /* No FCP Priority config data in flash */ |
54 | DEBUG2(printk(KERN_INFO | ||
55 | "%s: No FCP priority config data.\n", | ||
56 | __func__)); | ||
57 | return 0; | ||
58 | } | ||
59 | |||
60 | if (bcode[0] != 'H' || bcode[1] != 'Q' || bcode[2] != 'O' || | ||
61 | bcode[3] != 'S') { | ||
62 | /* Invalid FCP priority data header*/ | ||
63 | DEBUG2(printk(KERN_ERR | ||
64 | "%s: Invalid FCP Priority data header. bcode=0x%x\n", | ||
65 | __func__, bcode_val)); | ||
51 | return 0; | 66 | return 0; |
52 | } | 67 | } |
53 | if (flag != 1) | 68 | if (flag != 1) |
@@ -60,8 +75,18 @@ qla24xx_fcp_prio_cfg_valid(struct qla_fcp_prio_cfg *pri_cfg, uint8_t flag) | |||
60 | pri_entry++; | 75 | pri_entry++; |
61 | } | 76 | } |
62 | 77 | ||
63 | if (num_valid == 0) | 78 | if (num_valid == 0) { |
79 | /* No valid FCP priority data entries */ | ||
80 | DEBUG2(printk(KERN_ERR | ||
81 | "%s: No valid FCP Priority data entries.\n", | ||
82 | __func__)); | ||
64 | ret = 0; | 83 | ret = 0; |
84 | } else { | ||
85 | /* FCP priority data is valid */ | ||
86 | DEBUG2(printk(KERN_INFO | ||
87 | "%s: Valid FCP priority data. num entries = %d\n", | ||
88 | __func__, num_valid)); | ||
89 | } | ||
65 | 90 | ||
66 | return ret; | 91 | return ret; |
67 | } | 92 | } |
@@ -78,6 +103,11 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct fc_bsg_job *bsg_job) | |||
78 | 103 | ||
79 | bsg_job->reply->reply_payload_rcv_len = 0; | 104 | bsg_job->reply->reply_payload_rcv_len = 0; |
80 | 105 | ||
106 | if (!IS_QLA24XX_TYPE(ha) || !IS_QLA25XX(ha)) { | ||
107 | ret = -EINVAL; | ||
108 | goto exit_fcp_prio_cfg; | ||
109 | } | ||
110 | |||
81 | if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) || | 111 | if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) || |
82 | test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || | 112 | test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || |
83 | test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) { | 113 | test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) { |
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 5bc317070371..cea491bf0fc0 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -566,11 +566,8 @@ qla2x00_initialize_adapter(scsi_qla_host_t *vha) | |||
566 | } | 566 | } |
567 | } | 567 | } |
568 | 568 | ||
569 | if (IS_QLA24XX_TYPE(ha) || IS_QLA25XX(ha)) { | 569 | if (IS_QLA24XX_TYPE(ha) || IS_QLA25XX(ha)) |
570 | if (qla24xx_read_fcp_prio_cfg(vha)) | 570 | qla24xx_read_fcp_prio_cfg(vha); |
571 | qla_printk(KERN_ERR, ha, | ||
572 | "Unable to read FCP priority data.\n"); | ||
573 | } | ||
574 | 571 | ||
575 | return (rval); | 572 | return (rval); |
576 | } | 573 | } |
diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c index de92504d7585..3c5115f60739 100644 --- a/drivers/scsi/qla2xxx/qla_sup.c +++ b/drivers/scsi/qla2xxx/qla_sup.c | |||
@@ -664,6 +664,11 @@ qla2xxx_get_flt_info(scsi_qla_host_t *vha, uint32_t flt_addr) | |||
664 | struct qla_hw_data *ha = vha->hw; | 664 | struct qla_hw_data *ha = vha->hw; |
665 | struct req_que *req = ha->req_q_map[0]; | 665 | struct req_que *req = ha->req_q_map[0]; |
666 | 666 | ||
667 | def = 0; | ||
668 | if (IS_QLA25XX(ha)) | ||
669 | def = 1; | ||
670 | else if (IS_QLA81XX(ha)) | ||
671 | def = 2; | ||
667 | ha->flt_region_flt = flt_addr; | 672 | ha->flt_region_flt = flt_addr; |
668 | wptr = (uint16_t *)req->ring; | 673 | wptr = (uint16_t *)req->ring; |
669 | flt = (struct qla_flt_header *)req->ring; | 674 | flt = (struct qla_flt_header *)req->ring; |
@@ -691,6 +696,10 @@ qla2xxx_get_flt_info(scsi_qla_host_t *vha, uint32_t flt_addr) | |||
691 | goto no_flash_data; | 696 | goto no_flash_data; |
692 | } | 697 | } |
693 | 698 | ||
699 | /* Assign FCP prio region since older FLT's may not have it */ | ||
700 | ha->flt_region_fcp_prio = ha->flags.port0 ? | ||
701 | fcp_prio_cfg0[def] : fcp_prio_cfg1[def]; | ||
702 | |||
694 | loc = locations[1]; | 703 | loc = locations[1]; |
695 | cnt = le16_to_cpu(flt->length) / sizeof(struct qla_flt_region); | 704 | cnt = le16_to_cpu(flt->length) / sizeof(struct qla_flt_region); |
696 | for ( ; cnt; cnt--, region++) { | 705 | for ( ; cnt; cnt--, region++) { |
@@ -773,13 +782,6 @@ qla2xxx_get_flt_info(scsi_qla_host_t *vha, uint32_t flt_addr) | |||
773 | no_flash_data: | 782 | no_flash_data: |
774 | /* Use hardcoded defaults. */ | 783 | /* Use hardcoded defaults. */ |
775 | loc = locations[0]; | 784 | loc = locations[0]; |
776 | def = 0; | ||
777 | if (IS_QLA24XX_TYPE(ha)) | ||
778 | def = 0; | ||
779 | else if (IS_QLA25XX(ha)) | ||
780 | def = 1; | ||
781 | else if (IS_QLA81XX(ha)) | ||
782 | def = 2; | ||
783 | ha->flt_region_fw = def_fw[def]; | 785 | ha->flt_region_fw = def_fw[def]; |
784 | ha->flt_region_boot = def_boot[def]; | 786 | ha->flt_region_boot = def_boot[def]; |
785 | ha->flt_region_vpd_nvram = def_vpd_nvram[def]; | 787 | ha->flt_region_vpd_nvram = def_vpd_nvram[def]; |
@@ -790,14 +792,13 @@ no_flash_data: | |||
790 | ha->flt_region_fdt = def_fdt[def]; | 792 | ha->flt_region_fdt = def_fdt[def]; |
791 | ha->flt_region_npiv_conf = ha->flags.port0 ? | 793 | ha->flt_region_npiv_conf = ha->flags.port0 ? |
792 | def_npiv_conf0[def] : def_npiv_conf1[def]; | 794 | def_npiv_conf0[def] : def_npiv_conf1[def]; |
793 | ha->flt_region_fcp_prio = ha->flags.port0 ? | ||
794 | fcp_prio_cfg0[def] : fcp_prio_cfg1[def]; | ||
795 | done: | 795 | done: |
796 | DEBUG2(qla_printk(KERN_DEBUG, ha, "FLT[%s]: boot=0x%x fw=0x%x " | 796 | DEBUG2(qla_printk(KERN_DEBUG, ha, "FLT[%s]: boot=0x%x fw=0x%x " |
797 | "vpd_nvram=0x%x vpd=0x%x nvram=0x%x fdt=0x%x flt=0x%x " | 797 | "vpd_nvram=0x%x vpd=0x%x nvram=0x%x fdt=0x%x flt=0x%x " |
798 | "npiv=0x%x.\n", loc, ha->flt_region_boot, ha->flt_region_fw, | 798 | "npiv=0x%x. fcp_prio_cfg=0x%x\n", loc, ha->flt_region_boot, |
799 | ha->flt_region_vpd_nvram, ha->flt_region_vpd, ha->flt_region_nvram, | 799 | ha->flt_region_fw, ha->flt_region_vpd_nvram, ha->flt_region_vpd, |
800 | ha->flt_region_fdt, ha->flt_region_flt, ha->flt_region_npiv_conf)); | 800 | ha->flt_region_nvram, ha->flt_region_fdt, ha->flt_region_flt, |
801 | ha->flt_region_npiv_conf, ha->flt_region_fcp_prio)); | ||
801 | } | 802 | } |
802 | 803 | ||
803 | static void | 804 | static void |