From patchwork Thu Feb 18 01:50:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 45726 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 5A0C5B7CB6 for ; Thu, 18 Feb 2010 12:42:31 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754076Ab0BRBm3 (ORCPT ); Wed, 17 Feb 2010 20:42:29 -0500 Received: from hera.kernel.org ([140.211.167.34]:46699 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751801Ab0BRBm3 (ORCPT ); Wed, 17 Feb 2010 20:42:29 -0500 Received: from htj.dyndns.org (localhost [127.0.0.1]) by hera.kernel.org (8.14.3/8.14.3) with ESMTP id o1I1g0cf005354 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 18 Feb 2010 01:42:02 GMT X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.95.2 at hera.kernel.org Received: from [127.0.0.2] (htj.dyndns.org [127.0.0.2]) by htj.dyndns.org (Postfix) with ESMTPSA id 7BF451005DA3B; Thu, 18 Feb 2010 10:50:38 +0900 (KST) Message-ID: <4B7C9CEE.4080902@kernel.org> Date: Thu, 18 Feb 2010 10:50:38 +0900 From: Tejun Heo User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091130 SUSE/3.0.0-1.1.1 Thunderbird/3.0 MIME-Version: 1.0 To: =?UTF-8?B?Q2VuZ2l6IEfDvG5heQ==?= CC: Robert Hancock , linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org Subject: Re: sata_nv times out for BD-ROM iHOS104-08 References: <4B331771.3090309@kernel.org> <4B5666B4.6000804@kernel.org> <51f3faa71001191859l3c323a8ev6b7c0cced2c59e92@mail.gmail.com> <4B5A70E5.6050106@kernel.org> <4B67A149.10406@kernel.org> In-Reply-To: X-Enigmail-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_03_06,FH_DATE_PAST_20XX autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on hera.kernel.org X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (hera.kernel.org [127.0.0.1]); Thu, 18 Feb 2010 01:42:04 +0000 (UTC) Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org On 02/18/2010 01:14 AM, Cengiz Günay wrote: > 2010/2/1 Tejun Heo : > >> Can you please attach full dmesg w/ the patch applied w/o any kernel >> parameter? I'm curious where the hda warnings are coming from. Is >> generic IDE driver loaded? > > The dmesg snippet I attached last time was w/o any kernel parameters. > This time I'm attaching the full dmesg output. hda is my other DVD-RW > drive, I'm not sure what the warnings mean. ide_core is loaded, but > not the ide-generic or ide-pci-generic modules, although they are > available. Would you like me to force them to load? No, I was concerned because there were a few cases where two drivers were attached to the same controller but I don't think that's possible here. Does the attached patch make any difference? Thanks. diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index 730ef3c..d189b48 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c @@ -1070,6 +1070,7 @@ static void atapi_pio_bytes(struct ata_queued_cmd *qc) struct ata_eh_info *ehi = &dev->link->eh_info; unsigned int ireason, bc_lo, bc_hi, bytes; int i_write, do_write = (qc->tf.flags & ATA_TFLAG_WRITE) ? 1 : 0; + u8 stat; /* Abuse qc->result_tf for temp storage of intermediate TF * here to save some kernel stack usage. @@ -1099,6 +1100,21 @@ static void atapi_pio_bytes(struct ata_queued_cmd *qc) if (unlikely(__atapi_pio_bytes(qc, bytes))) goto err_out; + + /* this really should be done only after the final transfer is complete */ + stat = ata_sff_altstatus(ap); + if (stat & ATA_DRQ) { + int count; + + ata_port_printk(ap, KERN_INFO, "stat=%x after atapi_pio_bytes\n", stat); + + for (count = 0; (ap->ops->sff_check_status(ap) & ATA_DRQ) + && count < 65536; count += 2) + ioread16(ap->ioaddr.data_addr); + if (count) + ata_port_printk(ap, KERN_DEBUG, + "drained %d bytes to clear DRQ.\n", count); + } ata_sff_sync(ap); /* flush */ return;