diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2009-02-11 16:08:42 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2009-02-25 15:30:23 -0500 |
commit | c55af1f5abf606118b32e3ce9c3b1bbce5236e7e (patch) | |
tree | 18d844e61896d285a595e2da6bcfcc65808d8375 /drivers/ata | |
parent | c48052cc36e02fff6a9bb3cf83c4206b9127611f (diff) |
[libata] pata_legacy: for VLB 32bit PIO don't try tricks with slop
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>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/pata_legacy.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c index 6c1d778b63a9..e3bc1b436284 100644 --- a/drivers/ata/pata_legacy.c +++ b/drivers/ata/pata_legacy.c | |||
@@ -283,9 +283,10 @@ static void pdc20230_set_piomode(struct ata_port *ap, struct ata_device *adev) | |||
283 | static unsigned int pdc_data_xfer_vlb(struct ata_device *dev, | 283 | static unsigned int pdc_data_xfer_vlb(struct ata_device *dev, |
284 | unsigned char *buf, unsigned int buflen, int rw) | 284 | unsigned char *buf, unsigned int buflen, int rw) |
285 | { | 285 | { |
286 | if (ata_id_has_dword_io(dev->id)) { | 286 | int slop = buflen & 3; |
287 | /* 32bit I/O capable *and* we need to write a whole number of dwords */ | ||
288 | if (ata_id_has_dword_io(dev->id) && (slop == 0 || slop == 3)) { | ||
287 | struct ata_port *ap = dev->link->ap; | 289 | struct ata_port *ap = dev->link->ap; |
288 | int slop = buflen & 3; | ||
289 | unsigned long flags; | 290 | unsigned long flags; |
290 | 291 | ||
291 | local_irq_save(flags); | 292 | local_irq_save(flags); |
@@ -735,7 +736,7 @@ static unsigned int vlb32_data_xfer(struct ata_device *adev, unsigned char *buf, | |||
735 | struct ata_port *ap = adev->link->ap; | 736 | struct ata_port *ap = adev->link->ap; |
736 | int slop = buflen & 3; | 737 | int slop = buflen & 3; |
737 | 738 | ||
738 | if (ata_id_has_dword_io(adev->id)) { | 739 | if (ata_id_has_dword_io(adev->id) && (slop == 0 || slop == 3)) { |
739 | if (rw == WRITE) | 740 | if (rw == WRITE) |
740 | iowrite32_rep(ap->ioaddr.data_addr, buf, buflen >> 2); | 741 | iowrite32_rep(ap->ioaddr.data_addr, buf, buflen >> 2); |
741 | else | 742 | else |