From: Jeff Garzik <jgarzik@pobox.com>
To: Mark Lord <liml@rtr.ca>
Cc: Tejun Heo <htejun@gmail.com>, Alan Cox <alan@lxorguk.ukuu.org.uk>,
Andrew Morton <akpm@linux-foundation.org>,
michal.k.k.piotrowski@gmail.com, bryan@arbores.ca,
linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org
Subject: Re: [PATCH] libata drain fifo on stuck DRQ HSM violation (try#2)
Date: Sat, 29 Sep 2007 02:24:16 -0400 [thread overview]
Message-ID: <46FDEF90.9050702@pobox.com> (raw)
In-Reply-To: <46FD0486.3060405@rtr.ca>
Mark Lord wrote:
> I think this original patch still applies cleanly on at least 2.6.23-rc7.
>
> Drain up to 512 words from host/bridge FIFO on stuck DRQ HSM violation,
> rather than just getting stuck there forever.
>
> Signed-off-by: Mark Lord <mlord@pobox.com>
> ---
>
> --- old/drivers/ata/libata-sff.c 2007-09-28 09:29:22.000000000 -0400
> +++ linux/drivers/ata/libata-sff.c 2007-09-28 09:39:44.000000000 -0400
> @@ -420,6 +420,28 @@
> ap->ops->irq_on(ap);
> }
>
> +static void ata_drain_fifo(struct ata_port *ap, struct ata_queued_cmd *qc)
> +{
> + u8 stat = ata_chk_status(ap);
> + /*
> + * Try to clear stuck DRQ if necessary,
> + * by reading/discarding up to two sectors worth of data.
> + */
> + if ((stat & ATA_DRQ) && (!qc || qc->dma_dir != DMA_TO_DEVICE)) {
> + unsigned int i;
> + unsigned int limit = qc ? qc->sect_size : ATA_SECT_SIZE;
> +
> + printk(KERN_WARNING "Draining up to %u words from data FIFO.\n",
> + limit);
> + for (i = 0; i < limit ; ++i) {
> + ioread16(ap->ioaddr.data_addr);
> + if (!(ata_chk_status(ap) & ATA_DRQ))
> + break;
> + }
> + printk(KERN_WARNING "Drained %u/%u words.\n", i, limit);
> + }
> +}
> +
> /**
> * ata_bmdma_drive_eh - Perform EH with given methods for BMDMA
> controller
> * @ap: port to handle error for
> @@ -476,7 +498,7 @@
> }
>
> ata_altstatus(ap);
> - ata_chk_status(ap);
> + ata_drain_fifo(ap, qc);
> ap->ops->irq_clear(ap);
>
> spin_unlock_irqrestore(ap->lock, flags);
applied, after hand-editing out the top of the message, so that it would
not be copied into the kernel changelog
next prev parent reply other threads:[~2007-09-29 6:24 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <46CFA08E.6090604@arbores.ca>
2007-08-26 23:10 ` Stardom SATA HSM violation Michal Piotrowski
2007-09-03 8:53 ` Tejun Heo
2007-09-05 16:53 ` Andrew Morton
2007-09-05 17:23 ` Mark Lord
2007-09-05 19:38 ` Andrew Morton
2007-09-05 23:03 ` Mark Lord
2007-09-07 0:58 ` Tejun Heo
2007-09-07 13:40 ` Mark Lord
2007-09-27 7:05 ` Tejun Heo
2007-09-27 18:37 ` Alan Cox
2007-09-27 23:32 ` Tejun Heo
2007-09-27 23:42 ` Jeff Garzik
2007-09-27 23:52 ` Tejun Heo
2007-09-28 3:56 ` [PATCH] libata drain fifo on stuck DRQ " Mark Lord
2007-09-28 9:48 ` Tejun Heo
2007-09-28 9:56 ` Andrew Morton
2007-09-28 10:01 ` Tejun Heo
2007-09-28 10:27 ` Alan Cox
2007-09-28 13:41 ` [PATCH] libata drain fifo on stuck DRQ HSM violation (try#2) Mark Lord
2007-09-29 6:24 ` Jeff Garzik [this message]
2007-09-29 1:05 ` [PATCH] libata drain fifo on stuck DRQ HSM violation Jeff Garzik
2007-09-29 6:28 ` Alan Cox
2007-09-29 12:34 ` Mark Lord
2007-09-28 3:52 ` Stardom SATA " Mark Lord
2007-09-06 15:00 ` Bryan Woods
2007-09-07 0:58 ` Tejun Heo
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=46FDEF90.9050702@pobox.com \
--to=jgarzik@pobox.com \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=bryan@arbores.ca \
--cc=htejun@gmail.com \
--cc=liml@rtr.ca \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.k.k.piotrowski@gmail.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 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).