linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch for 2.6.29? 3/4] pata_legacy: for VLB 32bit PIO don't try tricks with slop
@ 2009-02-11 21:08 akpm
  2009-02-11 21:15 ` Jeff Garzik
  2009-02-25 20:31 ` Jeff Garzik
  0 siblings, 2 replies; 3+ messages in thread
From: akpm @ 2009-02-11 21:08 UTC (permalink / raw)
  To: jeff; +Cc: linux-ide, akpm, alan

From: Alan Cox <alan@lxorguk.ukuu.org.uk>

These devices are generally used with ATA anyway and it seems that some
ATAPI will need us to issue the right number of words.  Therefore as we
can't switch mid burst on VLB devices we should only use 32bit I/O for
suitable block sizes.


Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/ata/pata_legacy.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff -puN drivers/ata/pata_legacy.c~pata_legacy-for-vlb-32bit-pio-dont-try-tricks-with-slop drivers/ata/pata_legacy.c
--- a/drivers/ata/pata_legacy.c~pata_legacy-for-vlb-32bit-pio-dont-try-tricks-with-slop
+++ a/drivers/ata/pata_legacy.c
@@ -283,9 +283,10 @@ static void pdc20230_set_piomode(struct 
 static unsigned int pdc_data_xfer_vlb(struct ata_device *dev,
 			unsigned char *buf, unsigned int buflen, int rw)
 {
-	if (ata_id_has_dword_io(dev->id)) {
+	int slop = buflen & 3;
+	/* 32bit I/O capable *and* we need to write a whole number of dwords */
+	if (ata_id_has_dword_io(dev->id) && (slop == 0 || slop == 3)) {
 		struct ata_port *ap = dev->link->ap;
-		int slop = buflen & 3;
 		unsigned long flags;
 
 		local_irq_save(flags);
@@ -735,7 +736,7 @@ static unsigned int vlb32_data_xfer(stru
 	struct ata_port *ap = adev->link->ap;
 	int slop = buflen & 3;
 
-	if (ata_id_has_dword_io(adev->id)) {
+	if (ata_id_has_dword_io(adev->id) && (slop == 0 || slop == 3)) {
 		if (rw == WRITE)
 			iowrite32_rep(ap->ioaddr.data_addr, buf, buflen >> 2);
 		else
_

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

* Re: [patch for 2.6.29? 3/4] pata_legacy: for VLB 32bit PIO don't try tricks with slop
  2009-02-11 21:08 [patch for 2.6.29? 3/4] pata_legacy: for VLB 32bit PIO don't try tricks with slop akpm
@ 2009-02-11 21:15 ` Jeff Garzik
  2009-02-25 20:31 ` Jeff Garzik
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2009-02-11 21:15 UTC (permalink / raw)
  To: akpm; +Cc: linux-ide, alan

akpm@linux-foundation.org wrote:
> From: Alan Cox <alan@lxorguk.ukuu.org.uk>
> 
> These devices are generally used with ATA anyway and it seems that some
> ATAPI will need us to issue the right number of words.  Therefore as we
> can't switch mid burst on VLB devices we should only use 32bit I/O for
> suitable block sizes.
> 
> 
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Pinged Alan on 2/2, no response.

This was not signed-off-by by Alan, which is unlike him.  Also, there 
were no comments about testing.

So it seemed to me a test patch that I should hold onto, and waiting for 
Alan's and others' comments first.

	Jeff





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

* Re: [patch for 2.6.29? 3/4] pata_legacy: for VLB 32bit PIO don't try tricks with slop
  2009-02-11 21:08 [patch for 2.6.29? 3/4] pata_legacy: for VLB 32bit PIO don't try tricks with slop akpm
  2009-02-11 21:15 ` Jeff Garzik
@ 2009-02-25 20:31 ` Jeff Garzik
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2009-02-25 20:31 UTC (permalink / raw)
  To: akpm; +Cc: linux-ide, alan

akpm@linux-foundation.org wrote:
> From: Alan Cox <alan@lxorguk.ukuu.org.uk>
> 
> These devices are generally used with ATA anyway and it seems that some
> ATAPI will need us to issue the right number of words.  Therefore as we
> can't switch mid burst on VLB devices we should only use 32bit I/O for
> suitable block sizes.
> 
> 
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
> 
>  drivers/ata/pata_legacy.c |    7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

applied

These two haven't much testing, but I can't in good conscience let them 
slip to 2.6.30 either...  Let's get them in.

	Jeff





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

end of thread, other threads:[~2009-02-25 20:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-11 21:08 [patch for 2.6.29? 3/4] pata_legacy: for VLB 32bit PIO don't try tricks with slop akpm
2009-02-11 21:15 ` Jeff Garzik
2009-02-25 20:31 ` Jeff Garzik

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).