All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: jgarzik@redhat.com, linux-ide@vger.kernel.org
Subject: Re: patch "libata-sff: Fix oops for pnp devices with no ctl" causes regression
Date: Thu, 5 Jun 2008 12:31:16 +0200	[thread overview]
Message-ID: <20080605103116.GC11366@wotan.suse.de> (raw)
In-Reply-To: <20080605102129.GB11366@wotan.suse.de>

On Thu, Jun 05, 2008 at 12:21:29PM +0200, Nick Piggin wrote:
> On Thu, Jun 05, 2008 at 10:24:24AM +0100, Alan Cox wrote:
> > > And when booting with the commit applied, I instead get a whole lot of
> > > messages like this (this is the first one, copied by hand):
> > > 
> > > ata2.00: exception Emask 0x0 SAct 0x0 Serr 0x10000000 action 0x6 frozen
> > > ata2: SError: { }
> > > ata2.00: cmd c8/00:02:42:08:20/00:00:00:00:00/e0 tag 0 dma 1024 in
> > >          res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
> > > ata2.00: status: { DRDY }
> > > ata2: hard resetting link
> > > ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> > > ata2.00: configured for UDMA/133
> > > ata2: EH complete
> > 
> > Well I've been over the patch twice now and I cannot see a single point
> > at which the sequence of code that *should* be executed is any different.
> 
> If it is of any help to you, doing this:
> diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
> index 90d20c6..f6cb8d7 100644
> --- a/drivers/ata/libata-sff.c
> +++ b/drivers/ata/libata-sff.c
> @@ -1583,6 +1583,12 @@ inline unsigned int ata_sff_host_intr(struct ata_port *ap
>         if (status & ATA_BUSY)
>                 goto idle_irq;
> 
> +       /* check main status, clearing INTRQ */
> +       status = ap->ops->sff_check_status(ap);
> +       if (unlikely(status & ATA_BUSY))
> +               goto idle_irq;
> +
> +
>         /* ack bmdma irq events */
>         ap->ops->sff_irq_clear(ap);
> 
> Gets it working again...
> 
> 
> > Stick wmb();rmb(); (or similar barriers to compiler optimisation and I/O
> > fencing) at the start and end of your ata_sff_altstatus() and see what
> > happens, if it suddenly decides to behave or forcing it no inline makes
> > it behave then that would be useful info.
> 
> Will give that a try next

And doing this made no difference

diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 90d20c6..db6be15 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -249,10 +249,18 @@ u8 ata_sff_check_status(struct ata_port *ap)
  */
 static u8 ata_sff_altstatus(struct ata_port *ap)
 {
+       u8 ret;
+
+       mb();
+
        if (ap->ops->sff_check_altstatus)
-               return ap->ops->sff_check_altstatus(ap);
+               ret = ap->ops->sff_check_altstatus(ap);
+
+       ret = ioread8(ap->ioaddr.altstatus_addr);

-       return ioread8(ap->ioaddr.altstatus_addr);
+       mb();
+
+       return ret;
 }

 /**


  reply	other threads:[~2008-06-05 10:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-05  5:09 patch "libata-sff: Fix oops for pnp devices with no ctl" causes regression Nick Piggin
2008-06-05  9:24 ` Alan Cox
2008-06-05 10:05   ` Jeff Garzik
2008-06-05 10:21   ` Nick Piggin
2008-06-05 10:31     ` Nick Piggin [this message]
2008-06-05 11:19       ` Alan Cox

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=20080605103116.GC11366@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=jgarzik@redhat.com \
    --cc=linux-ide@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 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.