Commit 40c6023031369ae5573e622ca54fa3ffe89fb865

Authored by Tejun Heo
Committed by Jeff Garzik
1 parent f1f5a807b0

libata,pata_via: revert ata_wait_idle() removal from ata_sff/via_tf_load()

Commit 978c0666 (libata: Remove excess delay in the tf_load path)
removed ata_wait_idle() from ata_sff_tf_load() and via_tf_load().
This caused obscure detection problems in sata_sil.

  https://bugzilla.kernel.org/show_bug.cgi?id=16606

The commit was pure performance optimization.  Revert it for now.

Reported-by: Dieter Plaetinck <dieter@plaetinck.be>
Reported-by: Jan Beulich <JBeulich@novell.com>
Bisected-by: gianluca <gianluca@sottospazio.it>
Cc: stable@kernel.org
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

Showing 2 changed files with 5 additions and 0 deletions Side-by-side Diff

drivers/ata/libata-sff.c
... ... @@ -418,6 +418,7 @@
418 418 if (ioaddr->ctl_addr)
419 419 iowrite8(tf->ctl, ioaddr->ctl_addr);
420 420 ap->last_ctl = tf->ctl;
  421 + ata_wait_idle(ap);
421 422 }
422 423  
423 424 if (is_addr && (tf->flags & ATA_TFLAG_LBA48)) {
... ... @@ -453,6 +454,8 @@
453 454 iowrite8(tf->device, ioaddr->device_addr);
454 455 VPRINTK("device 0x%X\n", tf->device);
455 456 }
  457 +
  458 + ata_wait_idle(ap);
456 459 }
457 460 EXPORT_SYMBOL_GPL(ata_sff_tf_load);
458 461  
drivers/ata/pata_via.c
... ... @@ -417,6 +417,8 @@
417 417 tf->lbam,
418 418 tf->lbah);
419 419 }
  420 +
  421 + ata_wait_idle(ap);
420 422 }
421 423  
422 424 static int via_port_start(struct ata_port *ap)