All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Reed <mdr@sgi.com>
To: linux-scsi <linux-scsi@vger.kernel.org>
Cc: Jeremy Higdon <jeremy@sgi.com>, Tony Ernst <tee@sgi.com>,
	Jes Sorensen <jes@trained-monkey.org>, Jes Sorensen <jes@sgi.com>
Subject: [PATCH 1/2] qla1280: firmware load deadlocks kdump
Date: Mon, 08 Feb 2010 15:21:52 -0600	[thread overview]
Message-ID: <4B708070.2090407@sgi.com> (raw)


The qla1280 driver calls request_firmware() holding the host_lock.  As this lock
is released during the process of loading the firmware into the board, it can be
released (and reacquired) around the call to request_firmware().  Doing so
eliminates the dump_stack() which occurs in local_bh_enable() due to holding
a spinlock.  It also corrects the deadlock which occurs attempting to capture
a kdump with kernel options "irqpoll maxcpus=1".

Signed-off-by: Michael Reed <mdr@sgi.com>


--- linux-2.6.32.5-0.1-a/drivers/scsi/qla1280.c	2009-12-02 21:51:21.000000000 -0600
+++ linux-2.6.32.5-0.1-b/drivers/scsi/qla1280.c	2010-02-04 16:23:10.831352910 -0600
@@ -1640,8 +1640,10 @@ qla1280_load_firmware_pio(struct scsi_ql
 	uint16_t mb[MAILBOX_REGISTER_COUNT], i;
 	int err;
 
+	spin_unlock_irq(ha->host->host_lock);
 	err = request_firmware(&fw, ql1280_board_tbl[ha->devnum].fwname,
 			       &ha->pdev->dev);
+	spin_lock_irq(ha->host->host_lock);
 	if (err) {
 		printk(KERN_ERR "Failed to load image \"%s\" err %d\n",
 		       ql1280_board_tbl[ha->devnum].fwname, err);
@@ -1699,8 +1701,10 @@ qla1280_load_firmware_dma(struct scsi_ql
 		return -ENOMEM;
 #endif
 
+	spin_unlock_irq(ha->host->host_lock);
 	err = request_firmware(&fw, ql1280_board_tbl[ha->devnum].fwname,
 			       &ha->pdev->dev);
+	spin_lock_irq(ha->host->host_lock);
 	if (err) {
 		printk(KERN_ERR "Failed to load image \"%s\" err %d\n",
 		       ql1280_board_tbl[ha->devnum].fwname, err);

                 reply	other threads:[~2010-02-08 21:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4B708070.2090407@sgi.com \
    --to=mdr@sgi.com \
    --cc=jeremy@sgi.com \
    --cc=jes@sgi.com \
    --cc=jes@trained-monkey.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=tee@sgi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.