linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: akpm@osdl.org, alan@lxorguk.ukuu.org.uk,
	"linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>
Cc: castet.matthieu@free.fr, B.Zolnierkiewicz@elka.pw.edu.pl,
	htejun@gmail.com, Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: + via-pata-controller-xfer-fixes.patch added to -mm tree
Date: Sat, 24 Jun 2006 18:36:56 -0400	[thread overview]
Message-ID: <449DBE88.5020809@garzik.org> (raw)
In-Reply-To: <200606242214.k5OMEHCU005963@shell0.pdx.osdl.net>

akpm@osdl.org wrote:
> The patch titled
> 
>      VIA PATA controller xfer fixes
> 
> has been added to the -mm tree.  Its filename is
> 
>      via-pata-controller-xfer-fixes.patch
> 
> See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
> out what to do about this
> 
> ------------------------------------------------------
> Subject: VIA PATA controller xfer fixes
> From: matthieu castet <castet.matthieu@free.fr>
> 
> 
> On via controller(vt8235) and pata via, some ATAPI devices (CDR-6S48) fail
> in the xfer mode initialisation.  This make the boot slow and the drive
> unsuable.
> 
> It seems the interrupt for xfer mode is done before the drive is ready, so
> the current libata code skip the interrupt.  But no new interrupt is done
> by the controller, so the xfer mode fails.
> 
> A quirk is to wait for 10 us (by step of 1 us) and see if the device
> becomes ready in the case of SETFEATURES_XFER feature.  The problem seems
> pata_via only, so the quirk is put in the pata_via interrupt handler as
> Tejun Heo request.
> 
> It won't affect working devices, as we don't wait if the device is already
> ready.  It will adds an extra ata_altstatus in order to avoid to duplicate
> ata_host_intr, but only in the case of SETFEATURES_XFER (with should happen
> only few times).
> 
> Sorry for the lack of changelog in my previous mail, I tought the old
> changelog + move it in pata via interrupt was enought.  And sorry again, I
> sent you a bad patch (I forgot a quitl refresh).

Data point #1:

Here I quote from drivers/ide generic code ide_config_drive_speed() in 
ide-iops.c:

    /*
     * Allow status to settle, then read it again.
     * A few rare drives vastly violate the 400ns spec here,
     * so we'll wait up to 10usec for a "good" status
     * rather than expensively fail things immediately.
     * This fix courtesy of Matthew Faupel & Niccolo Rigacci.
     */
    for (i = 0; i < 10; i++) {
            udelay(1);
            if (OK_STAT((stat = hwif->INB(IDE_STATUS_REG)),
			  DRIVE_READY, BUSY_STAT|DRQ_STAT|ERR_STAT)) {
                    error = 0;
                    break;
            }
    }

And there is similar logic in ide_wait_stat().  wait_drive_not_busy() in 
ide-taskfile.c waits for up to 1 ms.


Data point #2:

libata was originally based on the "highly correct" (or one version 
thereof) programming sequences found in Hale Landis's free ATADRVR 
(http://www.ata-atapi.com/).  Hale's ATADRVR, which was MS-DOS based and 
not threaded or asynchronous at all, did the following after every 
command execution (sent taskfile to hardware):

	if (device is ATAPI)
		sleep(150 ms)


Overall, I've no clue what to do on older PATA hardware, so my 
"insightful" suggestions are largely (a) follow drivers/ide code and/or 
(b) listen to any old fogies with deep historical knowledge.


       reply	other threads:[~2006-06-24 22:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200606242214.k5OMEHCU005963@shell0.pdx.osdl.net>
2006-06-24 22:36 ` Jeff Garzik [this message]
2006-06-24 22:43   ` + via-pata-controller-xfer-fixes.patch added to -mm tree Jeff Garzik
2006-06-25  9:15     ` matthieu castet
2006-06-30  7:09       ` Albert Lee
2006-06-30  7:55         ` castet.matthieu
2006-06-30  8:26           ` Albert Lee
2006-07-02  8:36             ` matthieu castet
2006-07-02 10:32               ` matthieu castet
2006-07-02 12:46                 ` Albert Lee
2006-07-02 13:06                   ` matthieu castet
2006-07-02 14:17                     ` Albert Lee
2006-06-30 10:03         ` Alan Cox
2006-07-02 13:59           ` Albert Lee
2006-06-24 23:17   ` 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=449DBE88.5020809@garzik.org \
    --to=jeff@garzik.org \
    --cc=B.Zolnierkiewicz@elka.pw.edu.pl \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=castet.matthieu@free.fr \
    --cc=htejun@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@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;
as well as URLs for NNTP newsgroup(s).