public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Jeff Garzik <jeff@garzik.org>
Cc: Tejun Heo <htejun@gmail.com>, Mikael Pettersson <mikpe@it.uu.se>,
	david@dgreaves.com, jean.luc.coulon@gmail.com, jgarzik@pobox.com,
	michal.k.k.piotrowski@gmail.com, torvalds@linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [REPOST PATCH] sata_promise: use TF interface for polling NODATA commands
Date: Thu, 7 Jun 2007 08:45:15 -0700	[thread overview]
Message-ID: <20070607084515.668ae621.akpm@linux-foundation.org> (raw)
In-Reply-To: <20070607151717.GA6653@havoc.gtf.org>

On Thu, 7 Jun 2007 11:17:17 -0400 Jeff Garzik <jeff@garzik.org> wrote:

> On Wed, Jun 06, 2007 at 07:21:22PM +0900, Tejun Heo wrote:
> > sata_promise uses two different command modes - packet and TF.  Packet
> > mode is intelligent low-overhead mode while TF is the same old
> > taskfile interface.  As with other advanced interface (ahci/sil24),
> > ATA_TFLAG_POLLING has no effect in packet mode.  However, PIO commands
> > are issued using TF interface in polling mode, so pdc_interrupt()
> > considers interrupts spurious if ATA_TFLAG_POLLING is set.
> > 
> > This is broken for polling NODATA commands because command is issued
> > using packet mode but the interrupt handler ignores it due to
> > ATA_TFLAG_POLLING.  Fix pdc_qc_issue_prot() such that ATA/ATAPI NODATA
> > commands are issued using TF interface if ATA_TFLAG_POLLING is set.
> > 
> > This patch fixes detection failure introduced by polling SETXFERMODE.
> > 
> > Signed-off-by: Tejun Heo <htejun@gmail.com>
> > ---
> > David, please verify this patch.  Mikael, does this look okay?  Please
> > push this upstream after David and Mikael's ack.
> > 
> > (This repost is identical to the previous posting but it's now on the
> >  correct thread.)
> 
> Acked-by: Jeff Garzik <jeff@garzik.org>
> 
> Tejun, would you mind pushing this upstream to Linus/Andrew?
> 
> I'm travelling this week, and my home firewall doesn't like me.
> It is probably easier for you than me.
> 

I added the below to my next batch:


From: Tejun Heo <htejun@gmail.com>

sata_promise uses two different command modes - packet and TF.  Packet mode
is intelligent low-overhead mode while TF is the same old taskfile
interface.  As with other advanced interface (ahci/sil24),
ATA_TFLAG_POLLING has no effect in packet mode.  However, PIO commands are
issued using TF interface in polling mode, so pdc_interrupt() considers
interrupts spurious if ATA_TFLAG_POLLING is set.

This is broken for polling NODATA commands because command is issued using
packet mode but the interrupt handler ignores it due to ATA_TFLAG_POLLING. 
Fix pdc_qc_issue_prot() such that ATA/ATAPI NODATA commands are issued
using TF interface if ATA_TFLAG_POLLING is set.

This patch fixes detection failure introduced by polling SETXFERMODE.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Acked-by: Mikael Pettersson <mikpe@it.uu.se>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/ata/sata_promise.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff -puN drivers/ata/sata_promise.c~sata_promise-use-tf-interface-for-polling-nodata-commands drivers/ata/sata_promise.c
--- a/drivers/ata/sata_promise.c~sata_promise-use-tf-interface-for-polling-nodata-commands
+++ a/drivers/ata/sata_promise.c
@@ -784,9 +784,12 @@ static unsigned int pdc_qc_issue_prot(st
 		if (qc->dev->flags & ATA_DFLAG_CDB_INTR)
 			break;
 		/*FALLTHROUGH*/
+	case ATA_PROT_NODATA:
+		if (qc->tf.flags & ATA_TFLAG_POLLING)
+			break;
+		/*FALLTHROUGH*/
 	case ATA_PROT_ATAPI_DMA:
 	case ATA_PROT_DMA:
-	case ATA_PROT_NODATA:
 		pdc_packet_start(qc);
 		return 0;
 
@@ -800,7 +803,7 @@ static unsigned int pdc_qc_issue_prot(st
 static void pdc_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf)
 {
 	WARN_ON (tf->protocol == ATA_PROT_DMA ||
-		 tf->protocol == ATA_PROT_NODATA);
+		 tf->protocol == ATA_PROT_ATAPI_DMA);
 	ata_tf_load(ap, tf);
 }
 
@@ -808,7 +811,7 @@ static void pdc_tf_load_mmio(struct ata_
 static void pdc_exec_command_mmio(struct ata_port *ap, const struct ata_taskfile *tf)
 {
 	WARN_ON (tf->protocol == ATA_PROT_DMA ||
-		 tf->protocol == ATA_PROT_NODATA);
+		 tf->protocol == ATA_PROT_ATAPI_DMA);
 	ata_exec_command(ap, tf);
 }
 
_


  reply	other threads:[~2007-06-07 15:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-05 21:31 Linux 2.6.22-rc4 - sata_promise regression since -rc3 Mikael Pettersson
2007-06-05 21:52 ` Jeff Garzik
2007-06-05 23:37   ` walt
2007-06-06  6:56   ` Tejun Heo
2007-06-06 10:21     ` [REPOST PATCH] sata_promise: use TF interface for polling NODATA commands Tejun Heo
2007-06-06 15:42       ` walt
2007-06-06 16:05       ` Jeff Garzik
2007-06-06 16:34         ` Alan Cox
2007-06-07 17:20         ` Chuck Ebbert
2007-06-07 17:25           ` Jeff Garzik
2007-06-07 17:30             ` Jeff Garzik
2007-06-07 15:17       ` Jeff Garzik
2007-06-07 15:45         ` Andrew Morton [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-06-06 11:11 Mikael Pettersson

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=20070607084515.668ae621.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=david@dgreaves.com \
    --cc=htejun@gmail.com \
    --cc=jean.luc.coulon@gmail.com \
    --cc=jeff@garzik.org \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.k.k.piotrowski@gmail.com \
    --cc=mikpe@it.uu.se \
    --cc=torvalds@linux-foundation.org \
    /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