From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Russell King <rmk@arm.linux.org.uk>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
Jeff Garzik <jeff@garzik.org>,
linux-ide@vger.kernel.org
Subject: Re: 2.6.32: Promise UDMA33 card refuses to work in UDMA mode
Date: Mon, 04 Jan 2010 20:16:44 +0300 [thread overview]
Message-ID: <4B42227C.2070600@ru.mvista.com> (raw)
In-Reply-To: <20100104161537.GC18335@flint.arm.linux.org.uk>
Hello.
Russell King wrote:
>>>That's not the problem here - with the printk's I've added, there's no
>>>way for the IO read/writes to come that fast. Slowing down the IO
>>>accesses made no difference what so ever.
>>Doing it within 400nS of command setup is suspect at the ATA level and
>>can trivially fixed.
>>Sane PCI controllers (and quite a few less than sane ones) all implement
>>an AltStatus which can be checked for busy bits with DMA running or stall
>>that access until the DMA completes (wrongly in some CMD64x cases).
>>The 20246 implements its own magic 'am I busy' flag which old IDE
>>supports and libata doesn't. So as well as the ndelay(400) fix for PIO
>>controllers it needs pdc202xx_test_irq porting over to complete the fix.
> Yes, but please use a non-buggy version of pdc202xx_test_irq() as per
> my recent patch. Testing for the DMA FIFOs being non-empty to qualify
> an interrupt is Very Bad News too.
Sorry about that -- I was the author of pdc202xx_test_irq()...
> It's interesting to note that SFF 8038 suggests an approach to dealing
> with IDE interrupts connected to a SFF compatible host interface:
> 3) Software issues the appropriate DMA transfer command to the disk device.
> 4) Engage the bus master function by writing a '1' to the Start bit in the
> Bus Master IDE Command Register for the appropriate channel.
> 5) The controller transfers data to/from memory responding to DMA requests
> from the IDE device.
> 6) at the end of the transfer the IDE device signals an interrupt .
> 7) In response to the interrupt, software resets the Start/Stop bit in the
> command register. It then reads the controller status and then the drive
> status to determine if the transfer completed successfully.
> It goes on to say that the interrupt status bit in the BM-DMA status
> register will only be set after buffered data has been transferred -
> which means reading the altstatus register to determine when the device
> has finished would give a premature indication and doesn't take any
> account of the BM-DMA buffering.
Yes.
> So I think Jeff is not right on the "must read altstatus" point.
Frankly speaking, I'm not sure why Jeff insisted on that, at least for
the DMA case...
> I would not be surprised if lots of host controllers were actually buggy
> in respect of reading any ATA device register mid-transfer - firstly a
> started UDMA operation can't be stopped before at least one word has been
> transferred, nor can it be stopped without first transferring the CRC
> bytes. That's an awful lot of logic (and overhead) to be randomly
> interacting with due to other shared devices interrupt activity.
> Reading the BM-DMA status register (or equivalent on hosts) seems to be
> the right way to tell if an interrupt is pending.
Except the BMDMA interrupt bit (generally) doesn't get set for the PIO
transfers. Anyway, the IDE core eventually reads that register for the DMA
transfers. I'm sure libata also does eventually read it; looking at the code
in ata_sff_host_intr(), it even reads the BMDMA status first, before
touching any of the IDE status registers.
MBR, Sergei
next prev parent reply other threads:[~2010-01-04 17:14 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 [this message]
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
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=4B42227C.2070600@ru.mvista.com \
--to=sshtylyov@ru.mvista.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=jeff@garzik.org \
--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.