From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762346AbXFFKVh (ORCPT ); Wed, 6 Jun 2007 06:21:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759307AbXFFKVa (ORCPT ); Wed, 6 Jun 2007 06:21:30 -0400 Received: from py-out-1112.google.com ([64.233.166.182]:51833 "EHLO py-out-1112.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758645AbXFFKV3 (ORCPT ); Wed, 6 Jun 2007 06:21:29 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:from:to:cc:subject:message-id:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=XG/UaiLSKDJyVzNy6wLaaWzPRy2Lnv+68j8ik513YG/WLA7DyAtLl/f9U7Wbe3d4qXnwzgEEQtfUkmLud6uJ3woGYbMYuoaTiNuYxMswLpPWc0WINyIcCiqeWLpPsCigeRoT/My+6UcoRV3QtcV9+PV7boWRjjHDqsE5+yaEQqs= Date: Wed, 6 Jun 2007 19:21:22 +0900 From: Tejun Heo To: Jeff Garzik Cc: Mikael Pettersson , akpm@linux-foundation.org, 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: [REPOST PATCH] sata_promise: use TF interface for polling NODATA commands Message-ID: <20070606102122.GD29122@htj.dyndns.org> References: <200706052131.l55LVkYN000191@harpo.it.uu.se> <20070605215256.GT31565@havoc.gtf.org> <46665AB5.6040508@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46665AB5.6040508@gmail.com> User-Agent: Mutt/1.5.13 (2006-08-11) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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.) Thanks. drivers/ata/sata_promise.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c index 2b924a6..6dc0b01 100644 --- a/drivers/ata/sata_promise.c +++ b/drivers/ata/sata_promise.c @@ -784,9 +784,12 @@ static unsigned int pdc_qc_issue_prot(struct ata_queued_cmd *qc) 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(struct ata_queued_cmd *qc) 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_port *ap, const struct ata_taskfile *tf) 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); }