From: Saurav Kashyap <saurav.kashyap@qlogic.com>
To: jbottomley@parallels.com
Cc: giridhar.malavali@qlogic.com, saurav.kashyap@qlogic.com,
andrew.vasquez@qlogic.com, linux-scsi@vger.kernel.org
Subject: [PATCH 14/42] qla2xxx: Track the process when the ROM_LOCK failure happens
Date: Fri, 11 Apr 2014 16:54:19 -0400 [thread overview]
Message-ID: <1397249687-32666-15-git-send-email-saurav.kashyap@qlogic.com> (raw)
In-Reply-To: <1397249687-32666-1-git-send-email-saurav.kashyap@qlogic.com>
From: Hiral Patel <hiral.patel@qlogic.com>
Signed-off-by: Hiral Patel <hiral.patel@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
---
drivers/scsi/qla2xxx/qla_nx.c | 20 ++++++++++++++------
drivers/scsi/qla2xxx/qla_nx.h | 3 ---
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c
index 3c5819a..61774bc 100644
--- a/drivers/scsi/qla2xxx/qla_nx.c
+++ b/drivers/scsi/qla2xxx/qla_nx.c
@@ -860,13 +860,14 @@ qla82xx_rom_lock(struct qla_hw_data *ha)
}
timeout++;
}
- qla82xx_wr_32(ha, QLA82XX_ROM_LOCK_ID, ROM_LOCK_DRIVER);
+ qla82xx_wr_32(ha, QLA82XX_ROM_LOCK_ID, ha->portnum);
return 0;
}
static void
qla82xx_rom_unlock(struct qla_hw_data *ha)
{
+ qla82xx_wr_32(ha, QLA82XX_ROM_LOCK_ID, 0xffffffff);
qla82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM2_UNLOCK));
}
@@ -950,6 +951,7 @@ static int
qla82xx_rom_fast_read(struct qla_hw_data *ha, int addr, int *valp)
{
int ret, loops = 0;
+ uint32_t lock_owner = 0;
scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev);
while ((qla82xx_rom_lock(ha) != 0) && (loops < 50000)) {
@@ -958,8 +960,10 @@ qla82xx_rom_fast_read(struct qla_hw_data *ha, int addr, int *valp)
loops++;
}
if (loops >= 50000) {
+ lock_owner = qla82xx_rd_32(ha, QLA82XX_ROM_LOCK_ID);
ql_log(ql_log_fatal, vha, 0x00b9,
- "Failed to acquire SEM2 lock.\n");
+ "Failed to acquire SEM2 lock, Lock Owner %u.\n",
+ lock_owner);
return -1;
}
ret = qla82xx_do_rom_fast_read(ha, addr, valp);
@@ -1057,6 +1061,7 @@ static int
ql82xx_rom_lock_d(struct qla_hw_data *ha)
{
int loops = 0;
+ uint32_t lock_owner = 0;
scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev);
while ((qla82xx_rom_lock(ha) != 0) && (loops < 50000)) {
@@ -1065,8 +1070,9 @@ ql82xx_rom_lock_d(struct qla_hw_data *ha)
loops++;
}
if (loops >= 50000) {
+ lock_owner = qla82xx_rd_32(ha, QLA82XX_ROM_LOCK_ID);
ql_log(ql_log_warn, vha, 0xb010,
- "ROM lock failed.\n");
+ "ROM lock failed, Lock Owner %u.\n", lock_owner);
return -1;
}
return 0;
@@ -2811,12 +2817,14 @@ static void
qla82xx_rom_lock_recovery(struct qla_hw_data *ha)
{
scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev);
+ uint32_t lock_owner = 0;
- if (qla82xx_rom_lock(ha))
+ if (qla82xx_rom_lock(ha)) {
+ lock_owner = qla82xx_rd_32(ha, QLA82XX_ROM_LOCK_ID);
/* Someone else is holding the lock. */
ql_log(ql_log_info, vha, 0xb022,
- "Resetting rom_lock.\n");
-
+ "Resetting rom_lock, Lock Owner %u.\n", lock_owner);
+ }
/*
* Either we got the lock, or someone
* else died while holding it.
diff --git a/drivers/scsi/qla2xxx/qla_nx.h b/drivers/scsi/qla2xxx/qla_nx.h
index d57f6fe..d978a5d 100644
--- a/drivers/scsi/qla2xxx/qla_nx.h
+++ b/drivers/scsi/qla2xxx/qla_nx.h
@@ -333,9 +333,6 @@
#define QLA82XX_ROMUSB_ROM_INSTR_OPCODE (ROMUSB_ROM + 0x0004)
#define QLA82XX_ROMUSB_GLB_CAS_RST (ROMUSB_GLB + 0x0038)
-/* Lock IDs for ROM lock */
-#define ROM_LOCK_DRIVER 0x0d417340
-
#define QLA82XX_PCI_CRB_WINDOWSIZE 0x00100000 /* all are 1MB windows */
#define QLA82XX_PCI_CRB_WINDOW(A) \
(QLA82XX_PCI_CRBSPACE + (A)*QLA82XX_PCI_CRB_WINDOWSIZE)
--
1.7.7
next prev parent reply other threads:[~2014-04-11 21:31 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-11 20:54 [PATCH 00/42] qla2xxx: 8.07.00.08-k: Updates for scsi "misc" branch Saurav Kashyap
2014-04-11 20:54 ` [PATCH 01/42] qla2xxx: Wait for reset completion without lock for ISPFX00 Saurav Kashyap
2014-04-11 20:54 ` [PATCH 02/42] qla2xxx: Do not schedule reset when one is already active when receiving an invalid status handle Saurav Kashyap
2014-04-11 20:54 ` [PATCH 03/42] qla2xxx: Correct operations for ISP27xx template types 270 and 271 Saurav Kashyap
2014-04-11 20:54 ` [PATCH 04/42] qla2xxx: Allow ISP83XX and ISP27XX both to write req_q_out register Saurav Kashyap
2014-04-11 20:54 ` [PATCH 05/42] qla2xxx: Correct ISP83xx/ISP27xx mislogic in setting out_mb in qla25xx_init_req_que() Saurav Kashyap
2014-04-11 20:54 ` [PATCH 06/42] qla2xxx: Log when device state is moved to failed state Saurav Kashyap
2014-04-11 20:54 ` [PATCH 07/42] qla2xxx: Issue abort command for outstanding commands during cleanup when only firmware is alive Saurav Kashyap
2014-04-11 20:54 ` [PATCH 08/42] qla2xxx: Add pci device id 0x2271 Saurav Kashyap
2014-04-11 20:54 ` [PATCH 09/42] qla2xxx: Allow the next firmware dump if the previous dump capture fails for ISP8044 Saurav Kashyap
2014-04-11 20:54 ` [PATCH 10/42] qla2xxx: Support of new firmware dump opcodes QLA8044_RDDFE(38), QLA8044_RDMDIO(39),QLA8044_POLLWR(40) Saurav Kashyap
2014-04-11 20:54 ` [PATCH 11/42] qla2xxx: Check for peg alive counter and clear any outstanding mailbox command Saurav Kashyap
2014-04-11 20:54 ` [PATCH 12/42] qla2xxx: Add ISP8044 serdes bsg interface Saurav Kashyap
2014-04-11 20:54 ` [PATCH 13/42] qla2xxx: Correction to ISP27xx template entry types 256 and 258 Saurav Kashyap
2014-04-11 20:54 ` Saurav Kashyap [this message]
2014-04-11 20:54 ` [PATCH 15/42] qla2xxx: Remove unnecessary delays from fw dump code path Saurav Kashyap
2014-04-11 20:54 ` [PATCH 16/42] qla2xxx: Introduce fw_dump_flag to track fw dump progress Saurav Kashyap
2014-04-11 20:54 ` [PATCH 17/42] qla2xxx: Enable fw_dump_size for ISP8044 Saurav Kashyap
2014-04-11 20:54 ` [PATCH 18/42] qla2xxx: Update entry type 270 to match spec update Saurav Kashyap
2014-04-11 20:54 ` [PATCH 19/42] qla2xxx: Change copyright year to 2014 in all the source files Saurav Kashyap
2014-04-11 20:54 ` [PATCH 20/42] qla2xxx: Decrease pci access for response queue processing for ISPFX00 Saurav Kashyap
2014-04-11 20:54 ` [PATCH 21/42] qla2xxx: Use proper log message for flash lock failed error Saurav Kashyap
2014-04-11 20:54 ` [PATCH 22/42] qla2xxx: Include <delay.h> file for msleep declartion in qla_nx2.c file Saurav Kashyap
2014-04-11 20:54 ` [PATCH 23/42] qla2xxx: Remove unnecessary printk_ratelimited from qla_nx2.c Saurav Kashyap
2014-04-11 20:54 ` [PATCH 24/42] qla2xxx: ISP8044 poll ipmdio bus timeout improvement Saurav Kashyap
2014-04-11 20:54 ` [PATCH 25/42] qla2xxx: IOCB data should be copied to I/O mem using memcpy_toio Saurav Kashyap
2014-04-11 20:54 ` [PATCH 26/42] qla2xxx: Avoid escalating the SCSI error handler if the command is not found in firmware Saurav Kashyap
2014-04-11 20:54 ` [PATCH 27/42] qla2xxx: Adjust adapter reset routine to the changes in firmware specification for ISPFx00 Saurav Kashyap
2014-04-11 20:54 ` [PATCH 28/42] qla2xxx: Clear loop_id for ports that are marked lost during fabric scanning Saurav Kashyap
2014-04-11 20:54 ` [PATCH 29/42] qla2xxx: Check the QLA8044_CRB_DRV_ACTIVE_INDEX register when we are not the owner of the reset Saurav Kashyap
2014-04-11 20:54 ` [PATCH 30/42] qla2xxx: Reduce the time we wait for a command to complete during SCSI error handling Saurav Kashyap
2014-04-11 20:54 ` [PATCH 31/42] qla2xxx: ISP27xx firmware dump template spec updates (including T274) Saurav Kashyap
2014-04-11 20:54 ` [PATCH 32/42] qla2xxx: ISP27xx queue index shadow registers Saurav Kashyap
2014-04-11 20:54 ` [PATCH 33/42] qla2xxx: Delay driver unload if there is any pending activity going on Saurav Kashyap
2014-04-11 20:54 ` [PATCH 34/42] qla2xxx: Don't check for firmware hung during the reset context for ISP82XX Saurav Kashyap
2014-04-11 20:54 ` [PATCH 35/42] qla2xxx: Fix beacon blink logic for ISP26xx/83xx Saurav Kashyap
2014-04-11 20:54 ` [PATCH 36/42] qla2xxx: Add MBC option for fast SFP data access Saurav Kashyap
2014-04-11 20:54 ` [PATCH 37/42] qla2xxx: Remove mapped vp index iterator macro dead code Saurav Kashyap
2014-04-11 20:54 ` [PATCH 38/42] qla2xxx: T10-Dif: add T10-PI support Saurav Kashyap
2014-04-11 20:54 ` [PATCH 39/42] qla2xxx: ABTS cause double free of qla_tgt_cmd + Saurav Kashyap
2014-05-23 3:00 ` Nicholas A. Bellinger
2014-05-28 18:52 ` Quinn Tran
2014-04-11 20:54 ` [PATCH 40/42] qla2xxx: Do logins from a chip reset in DPC thread instead of the error handler thread Saurav Kashyap
2014-04-11 20:54 ` [PATCH 41/42] qla2xxx: Remove wait for online from host reset handler Saurav Kashyap
2014-04-11 20:54 ` [PATCH 42/42] qla2xxx: Update the driver version to 8.07.00.08-k Saurav Kashyap
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=1397249687-32666-15-git-send-email-saurav.kashyap@qlogic.com \
--to=saurav.kashyap@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).