All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Hancock <hancockrwd@gmail.com>
To: Russell King <rmk@arm.linux.org.uk>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>, linux-ide@vger.kernel.org
Subject: Re: 2.6.32: Promise UDMA33 card refuses to work in UDMA mode
Date: Mon, 04 Jan 2010 19:03:49 -0600	[thread overview]
Message-ID: <4B428FF5.7040702@gmail.com> (raw)
In-Reply-To: <20100104133024.GA10521@flint.arm.linux.org.uk>

On 01/04/2010 07:30 AM, Russell King wrote:
> On Mon, Jan 04, 2010 at 10:37:56AM +0000, Alan Cox wrote:
>>> 1. There is no way for the 247 to see any configuration settings;
>>>     the only thing it can see are the taskfile reads and writes, and
>>>     the timing of the DMA signals from the 246.
>>>
>>> 2. The 246 timings for MWDMA2 and UDMA0 are identical; there is no
>>>     programming difference between these two modes.  The only way the
>>>     246 can know that UDMA is selected is by looking for the SET
>>>     FEATURES command to the drive.
>>
>> The 2026x certainly snoops SET FEATURES so that would be a reasonable
>> assumption.
>>
>>> I've tried changing the set xfermode code to use a version of
>>> ata_exec_internal() which doesn't return the taskfile, but this makes no
>>> difference to the promise exploding with CRC errors with UDMA writes.
>>> Is it possible to do a similar thing with IDENTIFY?
>>
>> No because you need to know if it worked.
>>
>>> Also, is it possible to get rid of the additional identify and read native
>>> max address commands which seem to be repeated (command register writes
>>> listed):
>>
>> You can turn off Host Protected Area support for this. You could also btw
>> turn *on* host protected area for the IDE stack and see what occurs but I
>> imagine its a red herring anyway. If the snoop is failing then it is more
>> likely to be that the chip has some limitations on the taskfile snooping
>> and perhaps requires that the device register is always written or that
>> the registers are written in a specific order when writing the set
>> features command.
>>
>> Another thing to try if that fails is using a polled set features in case
>> the chip has problems in that area. We've seen a similar bug on some older
>> VIA devices.
>
> Found the problem - getting rid of the read of the alt status register
> after the command has been written fixes the UDMA CRC errors on write:
>
> @@ -676,7 +676,8 @@ void ata_sff_exec_command(struct ata_port *ap, const struct
> ata_taskfile *tf)
>          DPRINTK("ata%u: cmd 0x%X\n", ap->print_id, tf->command);
>
>          iowrite8(tf->command, ap->ioaddr.command_addr);
> -       ata_sff_pause(ap);
> +       ndelay(400);
> +//     ata_sff_pause(ap);
>   }
>   EXPORT_SYMBOL_GPL(ata_sff_exec_command);
>
>
> This rather makes sense.  The PDC20247 handles the UDMA part of the
> protocol.  It has no way to tell the PDC20246 to wait while it suspends
> UDMA, so that a normal register access can take place - the 246 ploughs
> on with the register access without any regard to the state of the 247.
>
> If the drive immediately starts the UDMA protocol after a write to the
> command register (as it probably will for the DMA WRITE command), then
> we'll be accessing the taskfile in the middle of the UDMA setup, which
> can't be good.  It's certainly a violation of the ATA specs.

I don't think it is. From ATA-8 APT:

"HDMA0: Check_Status State: This state is entered when the host has 
written a DMA command to the device; when all data for the command has 
been transferred and nIEN is set to one; or when all data for the 
command has been transferred, nIEN is cleared zero, and INTRQ has been 
asserted.

When in this state, the host shall read the device Status register. When 
entering this state from the HI4 state, the host shall wait 400 ns 
before reading the Status register. When entering this state from the 
HDMA1 state,
the host shall wait one PIO transfer cycle time before reading the 
Status register. The wait may be accomplished by reading the Alternate 
Status register and ignoring the result."

The last sentence is basically what the code in ata_sff_pause is doing..

  parent reply	other threads:[~2010-01-05  1:03 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-24 18:13 2.6.32: Promise UDMA33 card refuses to work in UDMA mode Russell King
2009-12-24 21:54 ` Russell King
2010-01-03  0:23   ` Russell King
2010-01-03  3:08     ` Robert Hancock
2010-01-03 10:05       ` Russell King
2010-01-03 11:40         ` Alan Cox
2010-01-03 22:35     ` [PATCH] Fix Promise UDMA33 IDE driver (pdc202xx_old) Russell King
2010-01-04 19:14       ` Sergei Shtylyov
2010-01-05  6:26         ` David Miller
2010-01-05 17:49           ` Russell King
2010-01-05 17:52             ` Sergei Shtylyov
2010-01-03 23:46     ` 2.6.32: Promise UDMA33 card refuses to work in UDMA mode Russell King
2010-01-04 10:37       ` Alan Cox
2010-01-04 13:30         ` Russell King
2010-01-04 15:16           ` Alan Cox
2010-01-04 15:32             ` Jeff Garzik
2010-01-04 15:44               ` Russell King
2010-01-04 15:55                 ` Alan Cox
2010-01-04 16:15                   ` Russell King
2010-01-04 16:48                     ` Jeff Garzik
2010-01-04 17:16                     ` Sergei Shtylyov
2010-01-04 15:48               ` Alan Cox
2010-01-04 15:25           ` Jeff Garzik
2010-01-04 15:42             ` Russell King
2010-01-05  2:06               ` Robert Hancock
2010-01-05 11:25                 ` Alan Cox
2010-01-05 13:00                   ` Jeff Garzik
2010-01-05 13:37                     ` Alan Cox
2010-01-05 13:11                 ` Jeff Garzik
2010-01-04 15:46             ` Alan Cox
2010-01-04 16:32               ` Jeff Garzik
2010-01-04 17:02                 ` Alan Cox
2010-01-04 17:27                   ` Jeff Garzik
2010-01-04 17:30                     ` Russell King
2010-01-04 18:03                       ` Jeff Garzik
2010-01-04 18:06                         ` Russell King
2010-01-04 18:35                           ` Jeff Garzik
2010-01-04 17:38                     ` Alan Cox
2010-01-04 18:07                       ` Jeff Garzik
2010-01-04 18:29                   ` Jeff Garzik
2010-01-04 16:31           ` Bartlomiej Zolnierkiewicz
2010-01-04 17:28             ` Russell King
2010-01-04 17:39               ` Alan Cox
2010-01-04 17:46                 ` Russell King
2010-01-04 18:20                   ` Alan Cox
2010-01-04 17:49                 ` Bartlomiej Zolnierkiewicz
2010-01-05  1:03           ` Robert Hancock [this message]
2010-01-05 10:04             ` Jeff Garzik
2010-01-05 17:44             ` Russell King
2010-01-06  0:30               ` Robert Hancock

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=4B428FF5.7040702@gmail.com \
    --to=hancockrwd@gmail.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-ide@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    /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.