From: Jeff Garzik Date: Tue, 7 Apr 2009 23:13:15 +0000 (-0400) Subject: [libata] EH: freeze port before aborting commands X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=54c38444fad6a99b4b19512f8f0055d69115e69e;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [libata] EH: freeze port before aborting commands Call the ->freeze() hook before aborting qc's, because some hardware requires special handling prior to accessing the taskfile registers (for diagnosis/analysis/reset). Most notably, hardware may wish to disable the DMA engine or interrupts in the ->freeze() hook. Signed-off-by: Jeff Garzik --- diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 79711b64054b..9159abe5211c 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -999,7 +999,9 @@ static void __ata_port_freeze(struct ata_port *ap) * ata_port_freeze - abort & freeze port * @ap: ATA port to freeze * - * Abort and freeze @ap. + * Abort and freeze @ap. The freeze operation must be called + * first, because some hardware requires special operations + * before the taskfile registers are accessible. * * LOCKING: * spin_lock_irqsave(host lock) @@ -1013,8 +1015,8 @@ int ata_port_freeze(struct ata_port *ap) WARN_ON(!ap->ops->error_handler); - nr_aborted = ata_port_abort(ap); __ata_port_freeze(ap); + nr_aborted = ata_port_abort(ap); return nr_aborted; }