]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/tx4939ide.c
ide: add ->max_sectors field to struct ide_port_info
[linux-2.6-omap-h63xx.git] / drivers / ide / tx4939ide.c
index bafb7d1a22e22a78f0c3afd5f422ba53e3f07410..97cd9e0f66f692cdc1fe76a8e8f781f7e878e730 100644 (file)
@@ -259,6 +259,12 @@ static int tx4939ide_build_dmatable(ide_drive_t *drive, struct request *rq)
                        bcount = 0x10000 - (cur_addr & 0xffff);
                        if (bcount > cur_len)
                                bcount = cur_len;
+                       /*
+                        * This workaround for zero count seems required.
+                        * (standard ide_build_dmatable do it too)
+                        */
+                       if ((bcount & 0xffff) == 0x0000)
+                               bcount = 0x8000;
                        *table++ = bcount & 0xffff;
                        *table++ = cur_addr;
                        cur_addr += bcount;
@@ -558,7 +564,7 @@ static void tx4939ide_input_data_swap(ide_drive_t *drive, struct request *rq,
 
        while (count--)
                *ptr++ = cpu_to_le16(__raw_readw((void __iomem *)port));
-       __ide_flush_dcache_range((unsigned long)buf, count * 2);
+       __ide_flush_dcache_range((unsigned long)buf, roundup(len, 2));
 }
 
 static void tx4939ide_output_data_swap(ide_drive_t *drive, struct request *rq,
@@ -572,7 +578,7 @@ static void tx4939ide_output_data_swap(ide_drive_t *drive, struct request *rq,
                __raw_writew(le16_to_cpu(*ptr), (void __iomem *)port);
                ptr++;
        }
-       __ide_flush_dcache_range((unsigned long)buf, count * 2);
+       __ide_flush_dcache_range((unsigned long)buf, roundup(len, 2));
 }
 
 static const struct ide_tp_ops tx4939ide_tp_ops = {