login
Header Space

 
 

Re: [PATCH] libata: Add MMIO support to pata_sil680

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Alan Cox <alan@...>
Cc: Guennadi Liakhovetski <g.liakhovetski@...>, Tim Ellis <tim@...>, <linux-kernel@...>, <jeff@...>
Date: Friday, February 15, 2008 - 5:45 pm

On Fri, 2008-02-15 at 15:53 +0000, Alan Cox wrote:

The dbdma start is mostly harmless (things don't get posted for -that-
long), though I suppose it's worth fixing. Would reading back dmactl do
in that case or do you foresee any kind of side effect ? (Maybe only
doing it for MMIO ?)

As for SRST, I'm not totally confident how safe it is to read back
there while doing the reset sequence, so I'm tempted to really only
do it for MMIO and use altstat rather than ctl/stat (the later tends
to have side effects which we don't want here).

What do you think ?

The main problem from here is that I don't know whether we are using
MMIO or PIO from libata-core. Maybe I can add a host flag indicate
that such flushing is needed ?

In the meantime, Guennadi, can you check if that patch helps for you
(to see if that is indeed the problem):


diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 004dae4..1451a52 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3461,10 +3461,13 @@ static int ata_bus_softreset(struct ata_port *ap, unsigned int devmask,
 
 	/* software reset.  causes dev0 to be selected */
 	iowrite8(ap->ctl, ioaddr->ctl_addr);
+	ioread16(ioaddr->nsect_addr);
 	udelay(20);	/* FIXME: flush */
 	iowrite8(ap->ctl | ATA_SRST, ioaddr->ctl_addr);
+	ioread16(ioaddr->nsect_addr);
 	udelay(20);	/* FIXME: flush */
 	iowrite8(ap->ctl, ioaddr->ctl_addr);
+	ioread16(ioaddr->nsect_addr);
 
 	/* wait a while before checking status */
 	ata_wait_after_reset(ap, deadline);
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 60cd4b1..81d5828 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -273,6 +273,7 @@ void ata_bmdma_start(struct ata_queued_cmd *qc)
 	 * FIXME: The posting of this write means I/O starts are
 	 * unneccessarily delayed for MMIO
 	 */
+	ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_CMD);
 }
 
 /**

Cheers,
Ben.


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] libata: Add MMIO support to pata_sil680, Tim Ellis, (Tue Feb 12, 11:58 am)
Re: [PATCH] libata: Add MMIO support to pata_sil680, Benjamin Herrenschmidt, (Tue Feb 12, 5:02 pm)
Re: [PATCH] libata: Add MMIO support to pata_sil680, Guennadi Liakhovetski, (Fri Feb 15, 11:52 am)
Re: [PATCH] libata: Add MMIO support to pata_sil680, Benjamin Herrenschmidt, (Fri Feb 15, 5:36 pm)
Re: [PATCH] libata: Add MMIO support to pata_sil680, Alan Cox, (Fri Feb 15, 11:53 am)
Re: [PATCH] libata: Add MMIO support to pata_sil680, Benjamin Herrenschmidt, (Fri Feb 15, 5:45 pm)
Re: [PATCH] libata: Add MMIO support to pata_sil680, Tim Ellis, (Fri Feb 15, 7:56 pm)
Re: [PATCH] libata: Add MMIO support to pata_sil680, Jeff Garzik, (Mon Feb 25, 6:57 pm)
Re: [PATCH] libata: Add MMIO support to pata_sil680, Benjamin Herrenschmidt, (Mon Feb 25, 8:58 pm)
[PATCH] Work around breakage introduced in pata_sil680 by sw..., Guennadi Liakhovetski, (Tue Mar 25, 7:31 pm)
Re: [PATCH] Work around breakage introduced in pata_sil680 b..., Benjamin Herrenschmidt, (Wed Mar 26, 4:20 am)
Re: [PATCH] libata: Add MMIO support to pata_sil680, Guennadi Liakhovetski, (Mon Feb 25, 7:06 pm)
Re: [PATCH] libata: Add MMIO support to pata_sil680, Benjamin Herrenschmidt, (Fri Feb 15, 6:55 pm)
speck-geostationary