From: Matthew Wilcox <matthew@wil.cx>
To: Linas Vepstas <linas@austin.ibm.com>
Cc: linux-scsi@vger.kernel.org, linux-pci@atrey.karlin.mff.cuni.cz,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4]: PCI Error Recovery: Symbios SCSI device driver
Date: Wed, 1 Nov 2006 20:57:22 -0700 [thread overview]
Message-ID: <20061102035722.GA31830@parisc-linux.org> (raw)
In-Reply-To: <20061102011935.GZ6360@austin.ibm.com>
On Wed, Nov 01, 2006 at 07:19:37PM -0600, Linas Vepstas wrote:
> @@ -657,6 +657,10 @@ static irqreturn_t sym53c8xx_intr(int ir
> unsigned long flags;
> struct sym_hcb *np = (struct sym_hcb *)dev_id;
>
> + /* Avoid spinloop trying to handle interrupts on frozen device */
> + if (pci_channel_offline(np->s.device))
> + return IRQ_HANDLED;
> +
> if (DEBUG_FLAGS & DEBUG_TINY) printf_debug ("[");
>
> spin_lock_irqsave(np->s.host->host_lock, flags);
Just wondering ... should we really be returning HANDLED? What if the
IRQ is shared? Will the hardware de-assert the level interrupt when it
puts the device in reset (ie is this a transitory glitch?), or do we
have to cope with a screaming interrupt?
> +#define WAIT_FOR_PCI_RECOVERY 35
> + if (pci_channel_offline(np->s.device))
> + {
I prefer if () {
> +static pci_ers_result_t sym2_io_slot_reset (struct pci_dev *pdev)
> +{
> + struct sym_hcb *np = pci_get_drvdata(pdev);
> +
> + printk(KERN_INFO "%s: recovering from a PCI slot reset\n",
> + sym_name(np));
> +
> + if (pci_enable_device(pdev)) {
> + printk(KERN_ERR "%s: Unable to enable afer PCI reset\n",
> + sym_name(np));
> + return PCI_ERS_RESULT_DISCONNECT;
> + }
> +
> + pci_set_master(pdev);
> + enable_irq(pdev->irq);
Hm. If we need to call pci_set_master, then we're also going to need to
call pci_set_mwi (if appropriate) which is currently done in
sym_set_workarounds(). Except you don't have a sym_device, or a
sym_chip around at this point. Bother. Need to do some refactoring to
take care of that.
> + /* Prevent deadlock waiting on a condition that may never clear. */
> + if (unlikely(sist == 0xffff && dstat == 0xff)) {
> + if (unlikely(pci_channel_offline(np->s.device)))
> + return;
> + }
I like the first unlikely ... but I'd drop the second one. If they are
both ffff ff, I'd say it's quite likely ;-) Anyway, the first unlikely
is good enough a hint to GCC, IMO.
Thanks!
next prev parent reply other threads:[~2006-11-02 3:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-20 18:05 [PATCH]: PCI Error Recovery: Symbios SCSI device driver Linas Vepstas
2006-10-31 18:55 ` Matthew Wilcox
2006-10-31 19:24 ` James Bottomley
2006-10-31 22:26 ` Linas Vepstas
2006-10-31 23:13 ` Linas Vepstas
2006-11-02 0:07 ` [PATCH v3]: " Linas Vepstas
2006-11-02 1:19 ` [PATCH v4]: " Linas Vepstas
2006-11-02 3:57 ` Matthew Wilcox [this message]
2006-11-02 4:46 ` [PATCH]: " Grant Grundler
2006-11-02 4:56 ` Matthew Wilcox
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=20061102035722.GA31830@parisc-linux.org \
--to=matthew@wil.cx \
--cc=linas@austin.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@atrey.karlin.mff.cuni.cz \
--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