From: Chad Dupuis <chad.dupuis@qlogic.com>
To: jbottomley@parallels.com
Cc: giridhar.malavali@qlogic.com, chad.dupuis@qlogic.com,
andrew.vasquez@qlogic.com, linux-scsi@vger.kernel.org
Subject: [PATCH 28/42] qla2xxx: set idc version if function is first one to come.
Date: Wed, 22 Aug 2012 14:21:22 -0400 [thread overview]
Message-ID: <1345659696-3670-29-git-send-email-chad.dupuis@qlogic.com> (raw)
In-Reply-To: <1345659696-3670-1-git-send-email-chad.dupuis@qlogic.com>
From: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
---
drivers/scsi/qla2xxx/qla_dbg.c | 1 -
drivers/scsi/qla2xxx/qla_nx.c | 30 ++++++++++++++++++++++++++----
2 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index 6de4d03..279f52c 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -34,7 +34,6 @@
* | AER/EEH | 0x9011 | |
* | Virtual Port | 0xa007 | |
* | ISP82XX Specific | 0xb084 | 0xb002,0xb024 |
- * | | | 0xb082,0xb083 |
* | MultiQ | 0xc00c | |
* | Misc | 0xd010 | |
* | Target Mode | 0xe06f | |
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c
index 9fc08b8..3a05444 100644
--- a/drivers/scsi/qla2xxx/qla_nx.c
+++ b/drivers/scsi/qla2xxx/qla_nx.c
@@ -2303,6 +2303,29 @@ void qla82xx_init_flags(struct qla_hw_data *ha)
}
inline void
+qla82xx_set_idc_version(scsi_qla_host_t *vha)
+{
+ int idc_ver;
+ uint32_t drv_active;
+ struct qla_hw_data *ha = vha->hw;
+
+ drv_active = qla82xx_rd_32(ha, QLA82XX_CRB_DRV_ACTIVE);
+ if (drv_active == (QLA82XX_DRV_ACTIVE << (ha->portnum * 4))) {
+ qla82xx_wr_32(ha, QLA82XX_CRB_DRV_IDC_VERSION,
+ QLA82XX_IDC_VERSION);
+ ql_log(ql_log_info, vha, 0xb082,
+ "IDC version updated to %d\n", QLA82XX_IDC_VERSION);
+ } else {
+ idc_ver = qla82xx_rd_32(ha, QLA82XX_CRB_DRV_IDC_VERSION);
+ if (idc_ver != QLA82XX_IDC_VERSION)
+ ql_log(ql_log_info, vha, 0xb083,
+ "qla2xxx driver IDC version %d is not compatible "
+ "with IDC version %d of the other drivers\n",
+ QLA82XX_IDC_VERSION, idc_ver);
+ }
+}
+
+inline void
qla82xx_set_drv_active(scsi_qla_host_t *vha)
{
uint32_t drv_active;
@@ -2878,9 +2901,6 @@ dev_initialize:
"HW State: INITIALIZING.\n");
qla82xx_wr_32(ha, QLA82XX_CRB_DEV_STATE, QLA8XXX_DEV_INITIALIZING);
- /* Driver that sets device state to initializating sets IDC version */
- qla82xx_wr_32(ha, QLA82XX_CRB_DRV_IDC_VERSION, QLA82XX_IDC_VERSION);
-
qla82xx_idc_unlock(ha);
rval = qla82xx_start_firmware(vha);
qla82xx_idc_lock(ha);
@@ -3210,8 +3230,10 @@ qla82xx_device_state_handler(scsi_qla_host_t *vha)
int loopcount = 0;
qla82xx_idc_lock(ha);
- if (!vha->flags.init_done)
+ if (!vha->flags.init_done) {
qla82xx_set_drv_active(vha);
+ qla82xx_set_idc_version(vha);
+ }
dev_state = qla82xx_rd_32(ha, QLA82XX_CRB_DEV_STATE);
old_dev_state = dev_state;
--
1.7.7
next prev parent reply other threads:[~2012-08-22 18:38 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-22 18:20 [PATCH 00/42] qla2xxx: Patches for scsi "misc" branch Chad Dupuis
2012-08-22 18:20 ` [PATCH 01/42] qla2xxx: Bind to ISP8031 devices Chad Dupuis
2012-08-22 18:20 ` [PATCH 02/42] qla2xxx: Add I2C BSG interface Chad Dupuis
2012-08-22 18:20 ` [PATCH 03/42] qla2xxx: Add check in qla82xx_watchdog for failed hardware state Chad Dupuis
2012-08-22 18:20 ` [PATCH 04/42] qla2xxx: Fix typo in qla2xxx files Chad Dupuis
2012-08-22 18:20 ` [PATCH 05/42] qla2xxx: Display mailbox failure by default Chad Dupuis
2012-08-22 18:21 ` [PATCH 06/42] qla2xxx: Use bitmap to store loop_id's for fcports Chad Dupuis
2012-08-22 18:21 ` [PATCH 07/42] qla2xxx: Implementation of bidirectional Chad Dupuis
2012-08-22 18:21 ` [PATCH 08/42] qla2xxx: Add FW DUMP SIZE sysfs attribute Chad Dupuis
2012-08-22 18:21 ` [PATCH 09/42] qla2xxx: IDC implementation for ISP83xx Chad Dupuis
2012-08-22 18:21 ` [PATCH 10/42] qla2xxx: Implemetation of mctp Chad Dupuis
2012-09-14 16:28 ` James Bottomley
2012-08-22 18:21 ` [PATCH 11/42] qla2xxx: Add bit to identify adapters for thermal temp Chad Dupuis
2012-08-22 18:21 ` [PATCH 12/42] qla2xxx: Changes for ISP83xx loopback support Chad Dupuis
2012-08-22 18:21 ` [PATCH 13/42] qla2xxx: Don't register to legacy interrupt for ISP82xx Chad Dupuis
2012-08-22 18:21 ` [PATCH 14/42] qla2xxx: Update the driver license Chad Dupuis
2012-09-14 16:36 ` James Bottomley
2012-08-22 18:21 ` [PATCH 15/42] qla2xxx: Only enable link up on the correct interrupt event Chad Dupuis
2012-08-22 18:21 ` [PATCH 16/42] qla2xxx: Fix for continuous rescan attempts in arbitrated loop topology Chad Dupuis
2012-08-22 18:21 ` [PATCH 17/42] qla2xxx: Implement beacon support for ISP83xx Chad Dupuis
2012-08-22 18:21 ` [PATCH 18/42] qla2xxx: Fix rval may be used uninitialized in this function warning Chad Dupuis
2012-08-22 18:21 ` [PATCH 19/42] qla2xxx: Perform ROM mbx cmd access only after ISP soft-reset during f/w recovery Chad Dupuis
2012-08-22 18:21 ` [PATCH 20/42] qla2xxx: Wrong PCIe(2.5Gb/s x8) speed in the kerenel message for ISP82xx Chad Dupuis
2012-08-22 18:21 ` [PATCH 21/42] qla2xxx: Dont call nic restart firmware if it is already active and running Chad Dupuis
2012-08-22 18:21 ` [PATCH 22/42] qla2xxx: Use #defines instead of hardcoded values for intr status Chad Dupuis
2012-08-22 18:21 ` [PATCH 23/42] qla2xxx: Remove setting Scsi_host->this_id during adapter probe Chad Dupuis
2012-08-22 18:21 ` [PATCH 24/42] qla2xxx: Ensure PLOGI is sent to Fabric Management-Server upon request Chad Dupuis
2012-08-22 18:21 ` [PATCH 25/42] qla2xxx: Fail initialization if unable to load RISC code Chad Dupuis
2012-08-22 18:21 ` [PATCH 26/42] qla2xxx: Do PCI fundamental reset for ISP83xx Chad Dupuis
2012-08-22 18:21 ` [PATCH 27/42] qla2xxx: Do not restrict the number of NPIV ports " Chad Dupuis
2012-08-22 18:21 ` Chad Dupuis [this message]
2012-08-22 18:21 ` [PATCH 29/42] qla2xxx: Fix description of qla2xmaxqdepth parameter Chad Dupuis
2012-08-22 18:21 ` [PATCH 30/42] qla2xxx: Fix for handling some error conditions in loopback Chad Dupuis
2012-08-22 18:21 ` [PATCH 31/42] qla2xxx: Enclose adapter related calls in adapter check in failed state handler Chad Dupuis
2012-08-22 18:21 ` [PATCH 32/42] qla2xxx: Set Maximum Read Request Size to 4K Chad Dupuis
2012-08-22 18:21 ` [PATCH 33/42] qla2xxx: Get fcal position map should not be called for p2p topology Chad Dupuis
2012-08-22 18:21 ` [PATCH 34/42] qla2xxx: Enable fw attributes for ISP24xx and above Chad Dupuis
2012-08-22 18:21 ` [PATCH 35/42] qla2xxx: Restrict nic core reset to one function for mctp Chad Dupuis
2012-08-22 18:21 ` [PATCH 36/42] qla2xxx: Fix for legacy interrupts for ISP83xx Chad Dupuis
2012-08-22 18:21 ` [PATCH 37/42] qla2xxx: T10 DIF - ISP83xx changes Chad Dupuis
2012-08-22 18:21 ` [PATCH 38/42] qla2xxx: Fix incorrect status reporting on DIF errors Chad Dupuis
2012-08-22 18:21 ` [PATCH 39/42] qla2xxx: Don't toggle RISC interrupt bits after IRQ lines are attached Chad Dupuis
2012-08-22 18:21 ` [PATCH 40/42] qla2xxx: Allow MSI interrupt registration for ISP82xx Chad Dupuis
2012-08-22 18:21 ` [PATCH 41/42] qla2xxx: Use the right field for container_of Chad Dupuis
2012-08-22 18:21 ` [PATCH 42/42] qla2xxx: Update version number to 8.04.00.07-k Chad Dupuis
2012-09-14 17:20 ` James Bottomley
2012-09-14 17:27 ` Chad Dupuis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1345659696-3670-29-git-send-email-chad.dupuis@qlogic.com \
--to=chad.dupuis@qlogic.com \
--cc=andrew.vasquez@qlogic.com \
--cc=giridhar.malavali@qlogic.com \
--cc=jbottomley@parallels.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).