Skip to content

Commit

Permalink
ide: skip "VLB sync" if host uses MMIO
Browse files Browse the repository at this point in the history
* 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: Sergei Shtylyov <[email protected]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
  • Loading branch information
bzolnier committed Apr 28, 2008
1 parent 9f87abe commit 22cdd6c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions drivers/ide/ide-iops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
* 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) HWIF(drive)->INB(port);
(void) HWIF(drive)->INB(port);
(void)inb(port);
(void)inb(port);
(void)inb(port);
}

/*
Expand All @@ -255,17 +255,17 @@ static void ata_input_data(ide_drive_t *drive, struct request *rq,
if (io_32bit) {
unsigned long uninitialized_var(flags);

if (io_32bit & 2) {
if ((io_32bit & 2) && !mmio) {
local_irq_save(flags);
ata_vlb_sync(drive, io_ports->nsect_addr);
ata_vlb_sync(io_ports->nsect_addr);
}

if (mmio)
__ide_mm_insl((void __iomem *)data_addr, buf, len / 4);
else
insl(data_addr, buf, len / 4);

if (io_32bit & 2)
if ((io_32bit & 2) && !mmio)
local_irq_restore(flags);

if ((len & 3) >= 2) {
Expand Down Expand Up @@ -298,17 +298,17 @@ static void ata_output_data(ide_drive_t *drive, struct request *rq,
if (io_32bit) {
unsigned long uninitialized_var(flags);

if (io_32bit & 2) {
if ((io_32bit & 2) && !mmio) {
local_irq_save(flags);
ata_vlb_sync(drive, io_ports->nsect_addr);
ata_vlb_sync(io_ports->nsect_addr);
}

if (mmio)
__ide_mm_outsl((void __iomem *)data_addr, buf, len / 4);
else
outsl(data_addr, buf, len / 4);

if (io_32bit & 2)
if ((io_32bit & 2) && !mmio)
local_irq_restore(flags);

if ((len & 3) >= 2) {
Expand Down

0 comments on commit 22cdd6c

Please sign in to comment.