public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: linux-ide@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	d.harrison@sutus.com, sagar.borikar@gmail.com
Subject: [PATCH 1/2] libata EH: freeze port before aborting commands
Date: Tue, 7 Apr 2009 19:22:47 -0400	[thread overview]
Message-ID: <20090407232247.GA16086@havoc.gtf.org> (raw)


commit 9c2fd3d1955572d3d1ee596b5f81c9768dde896e
Author: Jeff Garzik <jeff@garzik.org>
Date:   Tue Apr 7 19:13:15 2009 -0400

    [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 <jgarzik@redhat.com>

---
Alan, we should create ata_sff_bmdma_freeze() and use that to turn off
the PCI IDE BMDMA engine in ->freeze(), too, I think...


diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 0183131..b79cbd6 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;
 }

             reply	other threads:[~2009-04-07 23:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-07 23:22 Jeff Garzik [this message]
2009-04-07 23:23 ` [PATCH 2/2] sata_sil: disable DMA engine in ->freeze Jeff Garzik
2009-04-08  5:13   ` Sagar Borikar
2009-04-08  5:17     ` Jeff Garzik
2009-04-08  5:31       ` Sagar Borikar
2009-04-08 19:37       ` Dustin Harrison
2009-04-08 19:49         ` Jeff Garzik
2009-04-08 20:40           ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090407232247.GA16086@havoc.gtf.org \
    --to=jeff@garzik.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=d.harrison@sutus.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sagar.borikar@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox