All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pata_bf54x: fix BMIDE status register emulation
@ 2011-12-28 15:36 Sergei Shtylyov
  2011-12-28 17:56 ` Sergei Shtylyov
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Sergei Shtylyov @ 2011-12-28 15:36 UTC (permalink / raw)
  To: linux-ide, jgarzik, sonic.zhang

The author of this driver clearly wasn't familiar with the BMIDE specification
(also known as SFF-8038i) when he implemented the bmdma_status() method: first,
the interrupt bit of the BMIDE status register corresponds to nothing else but
INTRQ signal (ATAPI_DEV_INT here); second, the error bit is only set if the
controller encounters issue doing the bus master transfers, not on the DMA burst
termination interrupts like here (moreover, setting the error bit doesn't cause
an interrupt).

(The only thing I couldn't figure out is how to flush the FIFO to memory once
the interrupt happens as required by the mentioned spec.)

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

---
The patch is against the current Linus' tree.
Sonic, if you still work in Analog Devices, please give this a try.

I looked over the driver, and it left pretty bad impression. In particular,
I highly doubt that the transfers with more than one S/G item can work. And
this is after the driver has been in the kernel for 4 years already...
Unfortunately, I have neither hardware nor much time to work on improving it...

 drivers/ata/pata_bf54x.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Index: linux-2.6/drivers/ata/pata_bf54x.c
===================================================================
--- linux-2.6.orig/drivers/ata/pata_bf54x.c
+++ linux-2.6/drivers/ata/pata_bf54x.c
@@ -1153,15 +1153,11 @@ static unsigned char bfin_bmdma_status(s
 {
 	unsigned char host_stat = 0;
 	void __iomem *base = (void __iomem *)ap->ioaddr.ctl_addr;
-	unsigned short int_status = ATAPI_GET_INT_STATUS(base);
 
-	if (ATAPI_GET_STATUS(base) & (MULTI_XFER_ON|ULTRA_XFER_ON))
+	if (ATAPI_GET_STATUS(base) & (MULTI_XFER_ON | ULTRA_XFER_ON))
 		host_stat |= ATA_DMA_ACTIVE;
-	if (int_status & (MULTI_DONE_INT|UDMAIN_DONE_INT|UDMAOUT_DONE_INT|
-		ATAPI_DEV_INT))
+	if (ATAPI_GET_INT_STATUS(base) & ATAPI_DEV_INT)
 		host_stat |= ATA_DMA_INTR;
-	if (int_status & (MULTI_TERM_INT|UDMAIN_TERM_INT|UDMAOUT_TERM_INT))
-		host_stat |= ATA_DMA_ERR|ATA_DMA_INTR;
 
 	dev_dbg(ap->dev, "ATAPI: host_stat=0x%x\n", host_stat);
 

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-01-06 16:46 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-28 15:36 [PATCH] pata_bf54x: fix BMIDE status register emulation Sergei Shtylyov
2011-12-28 17:56 ` Sergei Shtylyov
2011-12-29 11:31 ` Zhang, Sonic
2011-12-29 14:10   ` Sergei Shtylyov
2011-12-30  6:07     ` Zhang, Sonic
2011-12-30  9:59       ` Sergei Shtylyov
2011-12-30 10:27         ` Zhang, Sonic
2011-12-31  3:22 ` Zhang, Sonic
2011-12-31 15:05   ` Sergei Shtylyov
2012-01-04  6:04     ` Zhang, Sonic
2012-01-04 13:21       ` Sergei Shtylyov
2012-01-05  2:45         ` Sonic Zhang
2012-01-06 17:14       ` Sergei Shtylyov
2012-01-06 17:45 ` [PATCH v2] " Sergei Shtylyov

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.