linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Albert Lee <albertcc@tw.ibm.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>, Doug Maxey <dwm@enoyolf.org>,
	Mark Lord <mlord@pobox.com>, Tejun Heo <htejun@gmail.com>,
	Linux IDE <linux-ide@vger.kernel.org>
Subject: [PATCH 6/7] libata: remove nIEN handling from ata_tf_load()
Date: Sat, 07 Jul 2007 15:20:24 +0800	[thread overview]
Message-ID: <468F3EB8.2050102@tw.ibm.com> (raw)
In-Reply-To: <468F3949.5050800@tw.ibm.com>

The relevant bits in the ctl register are HOB, SRST and nIEN.
 - HOB is only used by ata_tf_read().
 - For SRST, soft reset is not the duty of tf_load.
 - For nIEN, explicit irq_on()/irq_off and freeze()/thaw() are provided.

Remove the implicit nIEN handling from ata_tf_load() since EH/HSM now
calls irq_on/irq_off explicitly. vsc_intr_mask_update() also removed
since now unused.

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
---
The bitmasks used by vsc_intr_mask_update() are different to the bit masks
in vsc_irq_on() and vsc_irq_off(). I don't know which one is more correct.
Maybe we need more test and see if vsc_irq_on()/vsc_irq_off() works for
turning irq on/off for polling pio.

diff -Nrup 05_rename_thaw_lldd/drivers/ata/libata-sff.c 06_tf_load_cleanup/drivers/ata/libata-sff.c
--- 05_rename_thaw_lldd/drivers/ata/libata-sff.c	2007-07-07 10:49:04.000000000 +0800
+++ 06_tf_load_cleanup/drivers/ata/libata-sff.c	2007-07-07 10:50:10.000000000 +0800
@@ -143,11 +143,13 @@ void ata_tf_load(struct ata_port *ap, co
 	struct ata_ioports *ioaddr = &ap->ioaddr;
 	unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR;
 
-	if (tf->ctl != ap->last_ctl) {
-		iowrite8(tf->ctl, ioaddr->ctl_addr);
-		ap->last_ctl = tf->ctl;
-		ata_wait_idle(ap);
-	}
+	/*
+	 * The relevant bits in the ctl register are HOB, SRST and nIEN.
+	 * HOB is only used by ata_tf_read().
+	 * For SRST, soft reset is not the duty of tf_load.
+	 * For nIEN, explicit ->irq_on() and ->irq_off are provided.
+	 * That's why tf->ctl is ignored here.
+	 */
 
 	if (is_addr && (tf->flags & ATA_TFLAG_LBA48)) {
 		iowrite8(tf->hob_feature, ioaddr->feature_addr);
diff -Nrup 05_rename_thaw_lldd/drivers/ata/pata_scc.c 06_tf_load_cleanup/drivers/ata/pata_scc.c
--- 05_rename_thaw_lldd/drivers/ata/pata_scc.c	2007-07-07 10:49:30.000000000 +0800
+++ 06_tf_load_cleanup/drivers/ata/pata_scc.c	2007-07-07 10:50:10.000000000 +0800
@@ -271,12 +271,6 @@ static void scc_tf_load (struct ata_port
 	struct ata_ioports *ioaddr = &ap->ioaddr;
 	unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR;
 
-	if (tf->ctl != ap->last_ctl) {
-		out_be32(ioaddr->ctl_addr, tf->ctl);
-		ap->last_ctl = tf->ctl;
-		ata_wait_idle(ap);
-	}
-
 	if (is_addr && (tf->flags & ATA_TFLAG_LBA48)) {
 		out_be32(ioaddr->feature_addr, tf->hob_feature);
 		out_be32(ioaddr->nsect_addr, tf->hob_nsect);
diff -Nrup 05_rename_thaw_lldd/drivers/ata/sata_svw.c 06_tf_load_cleanup/drivers/ata/sata_svw.c
--- 05_rename_thaw_lldd/drivers/ata/sata_svw.c	2007-07-07 10:49:30.000000000 +0800
+++ 06_tf_load_cleanup/drivers/ata/sata_svw.c	2007-07-07 10:50:10.000000000 +0800
@@ -125,11 +125,6 @@ static void k2_sata_tf_load(struct ata_p
 	struct ata_ioports *ioaddr = &ap->ioaddr;
 	unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR;
 
-	if (tf->ctl != ap->last_ctl) {
-		writeb(tf->ctl, ioaddr->ctl_addr);
-		ap->last_ctl = tf->ctl;
-		ata_wait_idle(ap);
-	}
 	if (is_addr && (tf->flags & ATA_TFLAG_LBA48)) {
 		writew(tf->feature | (((u16)tf->hob_feature) << 8),
 		       ioaddr->feature_addr);
diff -Nrup 05_rename_thaw_lldd/drivers/ata/sata_vsc.c 06_tf_load_cleanup/drivers/ata/sata_vsc.c
--- 05_rename_thaw_lldd/drivers/ata/sata_vsc.c	2007-07-07 10:49:30.000000000 +0800
+++ 06_tf_load_cleanup/drivers/ata/sata_vsc.c	2007-07-07 10:50:10.000000000 +0800
@@ -137,36 +137,19 @@ static void vsc_irq_on(struct ata_port *
 }
 
 
-static void vsc_intr_mask_update(struct ata_port *ap, u8 ctl)
-{
-	void __iomem *mask_addr;
-	u8 mask;
-
-	mask_addr = ap->host->iomap[VSC_MMIO_BAR] +
-		VSC_SATA_INT_MASK_OFFSET + ap->port_no;
-	mask = readb(mask_addr);
-	if (ctl & ATA_NIEN)
-		mask |= 0x80;
-	else
-		mask &= 0x7F;
-	writeb(mask, mask_addr);
-}
-
-
 static void vsc_sata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)
 {
 	struct ata_ioports *ioaddr = &ap->ioaddr;
 	unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR;
 
 	/*
-	 * The only thing the ctl register is used for is SRST.
-	 * That is not enabled or disabled via tf_load.
-	 * However, if ATA_NIEN is changed, then we need to change the interrupt register.
+	 * The relevant bits in the ctl register are HOB, SRST and nIEN.
+	 * HOB is only used by ata_tf_read().
+	 * For SRST, soft reset is not the duty of tf_load.
+	 * For nIEN, explicit ->irq_on() and ->irq_off are provided.
+	 * That's why tf->ctl is ignored here.
 	 */
-	if ((tf->ctl & ATA_NIEN) != (ap->last_ctl & ATA_NIEN)) {
-		ap->last_ctl = tf->ctl;
-		vsc_intr_mask_update(ap, tf->ctl & ATA_NIEN);
-	}
+
 	if (is_addr && (tf->flags & ATA_TFLAG_LBA48)) {
 		writew(tf->feature | (((u16)tf->hob_feature) << 8),
 		       ioaddr->feature_addr);



  parent reply	other threads:[~2007-07-07  7:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-07  6:57 [PATCH 0/7] libata: irq_on/off restructuring (take #2) Albert Lee
2007-07-07  7:00 ` [PATCH 1/7] libata: remove irq_on from ata_bus_reset() and ata_std_postreset() Albert Lee
2007-07-12 20:12   ` Jeff Garzik
2007-07-07  7:02 ` [PATCH 2/7] sata_promise: pdc_freeze() semantic change Albert Lee
2007-10-02 15:28   ` Jeff Garzik
2007-07-07  7:05 ` [PATCH 3/7] libata: add freeze/thaw to old EH LLDDs Albert Lee
2007-07-07  7:09 ` [PATCH 4/7] libata: use freeze/thaw for polling PIO Albert Lee
2007-07-13  6:53   ` Tejun Heo
2007-07-07  7:12 ` [PATCH 5/7] libata: integrate freeze/thaw with irq_on/off Albert Lee
2007-07-13  6:51   ` Tejun Heo
2007-07-16  9:17     ` Albert Lee
2007-07-07  7:20 ` Albert Lee [this message]
2007-07-07  7:23 ` [PATCH 7/7] libata: remove ap->last_ctl Albert Lee
2007-07-13  6:58   ` 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=468F3EB8.2050102@tw.ibm.com \
    --to=albertcc@tw.ibm.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=albertl@mail.com \
    --cc=dwm@enoyolf.org \
    --cc=htejun@gmail.com \
    --cc=jeff@garzik.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=mlord@pobox.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;
as well as URLs for NNTP newsgroup(s).