[patch 103/114] ide-iops: fix odd-length ATAPI PIO transfers

Greg KH
2009-03-14T01:59:31Z

[-- Attachment #1: ide-iops-fix-odd-length-atapi-pio-transfers.patch --]
[-- Type: text/plain, Size: 976 bytes --]

2.6.28-stable review patch. If anyone has any objections, please let us know.

------------------

From: Sergei Shtylyov <sshtylyov@ru.mvista.com>

commit a509538d4fb4f99cdf0a095213d57cc3b2347615 upstream.

Commit 9567b349f7e7dd7e2483db99ee8e4a6fe0caca38 (ide: merge ->atapi_*put_bytes
and ->ata_*put_data methods) introduced a regression WRT the odd-length ATAPI
PIO transfers -- the final word didn't get written (causing command timeouts).

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
drivers/ide/ide-iops.c | 2 ++
1 file changed, 2 insertions(+)

--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -324,6 +324,8 @@ void ide_output_data(ide_drive_t *drive,
u8 io_32bit = drive->io_32bit;
u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0;

+ len++;
+
if (io_32bit) {
unsigned long uninitialized_var(flags);