From: Dan Williams <djbw@fb.com>
To: John Drescher <drescherjm@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>, <linux-scsi@vger.kernel.org>,
<DL-MPTFusionLinux@lsi.com>
Subject: Re: Possible mptsas regression post 3.5.0
Date: Tue, 28 Aug 2012 09:12:30 -0700 [thread overview]
Message-ID: <1346170350.12384.9.camel@localhost.localdomain> (raw)
In-Reply-To: <CAEhu1-6nKpX=tqES95AsPn-yFioS8-5+mcU1maSYh0AozVT5PA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 391 bytes --]
On Tue, 2012-08-28 at 10:03 -0400, John Drescher wrote:
> > I wonder if we are preventing scsi_device_dev_release_usercontext() from
> > making forward progress?
> >
> > ...the attached patch should confirm this or give more info otherwise.
> >
>
> [ 174.758218] scsi_remove_target[0]: reap 0:0 state: 2 reap: 1 dev_del: 1
Thanks! Does the attached patch fix the issue for you?
--
Dan
[-- Attachment #2: test-scsi-remove-target-fix.patch --]
[-- Type: text/x-patch, Size: 1983 bytes --]
scsi_remove_target: fix softlockup condition
From: Dan Williams <djbw@fb.com>
Don't restart lookup of stargets in the multi-target case, just arrange to
traverse the list once, on the assumption that new targets are always added at
the end. There is no guarantee that the target will change state in
scsi_target_reap() so we can end up spinning if we restart.
---
drivers/scsi/scsi_sysfs.c | 30 ++++++++++++++----------------
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index 093d4f6..ce5224c 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -1031,33 +1031,31 @@ static void __scsi_remove_target(struct scsi_target *starget)
void scsi_remove_target(struct device *dev)
{
struct Scsi_Host *shost = dev_to_shost(dev->parent);
- struct scsi_target *starget, *found;
+ struct scsi_target *starget, *last = NULL;
unsigned long flags;
- restart:
- found = NULL;
+ /* remove targets being careful to lookup next entry before
+ * deleting the last
+ */
spin_lock_irqsave(shost->host_lock, flags);
list_for_each_entry(starget, &shost->__targets, siblings) {
if (starget->state == STARGET_DEL)
continue;
if (starget->dev.parent == dev || &starget->dev == dev) {
- found = starget;
- found->reap_ref++;
- break;
+ /* assuming new targets arrive at the end */
+ starget->reap_ref++;
+ spin_unlock_irqrestore(shost->host_lock, flags);
+ if (last)
+ scsi_target_reap(last);
+ last = starget;
+ __scsi_remove_target(starget);
+ spin_lock_irqsave(shost->host_lock, flags);
}
}
spin_unlock_irqrestore(shost->host_lock, flags);
- if (found) {
- __scsi_remove_target(found);
- scsi_target_reap(found);
- /* in the case where @dev has multiple starget children,
- * continue removing.
- *
- * FIXME: does such a case exist?
- */
- goto restart;
- }
+ if (last)
+ scsi_target_reap(last);
}
EXPORT_SYMBOL(scsi_remove_target);
next prev parent reply other threads:[~2012-08-28 16:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-23 17:34 John Drescher
2012-08-24 19:34 ` John Drescher
2012-08-27 14:10 ` John Drescher
[not found] ` <CAD9gYJJQ+vsv12+-0e_nMtgs71Snvt4j2s48-HnwkrV2yOiwLQ@mail.gmail.com>
2012-08-27 16:13 ` John Drescher
2012-08-28 5:37 ` Dan Williams
2012-08-28 14:03 ` John Drescher
2012-08-28 16:12 ` Dan Williams [this message]
2012-08-28 16:42 ` John Drescher
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=1346170350.12384.9.camel@localhost.localdomain \
--to=djbw@fb.com \
--cc=DL-MPTFusionLinux@lsi.com \
--cc=drescherjm@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--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
Powered by JetHome