ide: skip "VLB sync" if host uses MMIO

* Skip "VLB sync" in ata_{in,out}put_data() if host uses MMIO.

* Use I/O ops directly in ata_vlb_sync() an drop no longer needed
  'ide_drive_t *drive' argument.
Acked-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 9f87abe8
...@@ -227,11 +227,11 @@ static void ide_tf_read(ide_drive_t *drive, ide_task_t *task) ...@@ -227,11 +227,11 @@ static void ide_tf_read(ide_drive_t *drive, ide_task_t *task)
* of the sector count register location, with interrupts disabled * of the sector count register location, with interrupts disabled
* to ensure that the reads all happen together. * to ensure that the reads all happen together.
*/ */
static void ata_vlb_sync(ide_drive_t *drive, unsigned long port) static void ata_vlb_sync(unsigned long port)
{ {
(void) HWIF(drive)->INB(port); (void)inb(port);
(void) HWIF(drive)->INB(port); (void)inb(port);
(void) HWIF(drive)->INB(port); (void)inb(port);
} }
/* /*
...@@ -255,9 +255,9 @@ static void ata_input_data(ide_drive_t *drive, struct request *rq, ...@@ -255,9 +255,9 @@ static void ata_input_data(ide_drive_t *drive, struct request *rq,
if (io_32bit) { if (io_32bit) {
unsigned long uninitialized_var(flags); unsigned long uninitialized_var(flags);
if (io_32bit & 2) { if ((io_32bit & 2) && !mmio) {
local_irq_save(flags); local_irq_save(flags);
ata_vlb_sync(drive, io_ports->nsect_addr); ata_vlb_sync(io_ports->nsect_addr);
} }
if (mmio) if (mmio)
...@@ -265,7 +265,7 @@ static void ata_input_data(ide_drive_t *drive, struct request *rq, ...@@ -265,7 +265,7 @@ static void ata_input_data(ide_drive_t *drive, struct request *rq,
else else
insl(data_addr, buf, len / 4); insl(data_addr, buf, len / 4);
if (io_32bit & 2) if ((io_32bit & 2) && !mmio)
local_irq_restore(flags); local_irq_restore(flags);
if ((len & 3) >= 2) { if ((len & 3) >= 2) {
...@@ -298,9 +298,9 @@ static void ata_output_data(ide_drive_t *drive, struct request *rq, ...@@ -298,9 +298,9 @@ static void ata_output_data(ide_drive_t *drive, struct request *rq,
if (io_32bit) { if (io_32bit) {
unsigned long uninitialized_var(flags); unsigned long uninitialized_var(flags);
if (io_32bit & 2) { if ((io_32bit & 2) && !mmio) {
local_irq_save(flags); local_irq_save(flags);
ata_vlb_sync(drive, io_ports->nsect_addr); ata_vlb_sync(io_ports->nsect_addr);
} }
if (mmio) if (mmio)
...@@ -308,7 +308,7 @@ static void ata_output_data(ide_drive_t *drive, struct request *rq, ...@@ -308,7 +308,7 @@ static void ata_output_data(ide_drive_t *drive, struct request *rq,
else else
outsl(data_addr, buf, len / 4); outsl(data_addr, buf, len / 4);
if (io_32bit & 2) if ((io_32bit & 2) && !mmio)
local_irq_restore(flags); local_irq_restore(flags);
if ((len & 3) >= 2) { if ((len & 3) >= 2) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment