From patchwork Thu Feb 17 09:58:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 83437 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 912D2B70F0 for ; Thu, 17 Feb 2011 20:58:23 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754422Ab1BQJ6V (ORCPT ); Thu, 17 Feb 2011 04:58:21 -0500 Received: from mail-fx0-f46.google.com ([209.85.161.46]:61106 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752844Ab1BQJ6U (ORCPT ); Thu, 17 Feb 2011 04:58:20 -0500 Received: by fxm20 with SMTP id 20so2401338fxm.19 for ; Thu, 17 Feb 2011 01:58:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=qAuM1JpfldOVmCbfLZRtVW4OPO3Zpc3j1/iCr4GyEak=; b=n/rgpbGzdjtkOeKlfzzaGQJzUtKASqZDVxR78grjkS0zFuOMybDlKHt+p8UIGFN+TT V7Qi06Y+6pVXzW9+zyZPIKu/G36ecYEz3w0hOI4+gQyKONwV0db3O3V/305dmzduVhj5 58DYqclkAa9zWz6NBBbEpUoQswmy0HXoco4gQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=gKKt6mHM1J3fVtqpqucMlHOpXbe4kmSnNXvyfjrm5VkSfTKws2uF27o11I4qLc5u37 v34zXUt7A9a3juR24D6O76jVdhuIqElNvqxQsxyO1MolcDhUk8h0JxMEfH9kjZ59Y6gR h9X+sdZqk+oj7DzNr4ix03CmLGugmG7moHEOc= Received: by 10.223.83.142 with SMTP id f14mr2114084fal.0.1297936698953; Thu, 17 Feb 2011 01:58:18 -0800 (PST) Received: from htj.dyndns.org ([130.75.117.88]) by mx.google.com with ESMTPS id n7sm335548fam.11.2011.02.17.01.58.17 (version=SSLv3 cipher=OTHER); Thu, 17 Feb 2011 01:58:17 -0800 (PST) Date: Thu, 17 Feb 2011 10:58:15 +0100 From: Tejun Heo To: Steven Haigh Cc: linux-ide@vger.kernel.org Subject: Re: sata-sil drive detection issues. Message-ID: <20110217095815.GN19830@htj.dyndns.org> References: <4D5C92F4.5000906@crc.id.au> <4D5CA2B1.8020905@crc.id.au> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4D5CA2B1.8020905@crc.id.au> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org Hello, On Thu, Feb 17, 2011 at 03:23:13PM +1100, Steven Haigh wrote: > I might have acted a bit prematurely on this. After booting off the > CentOS 5.5 installation DVD, I noticed that the esata drive at the > same problem. After lots of cable swapping and testing, I have found > that the esata cable may be faulty as a direct SATA -> drive > connection works perfectly. > > I am unsure however why my previous test of plugging the esata drive > directly to the onboard SATA controller worked - however now this > also fails. > > I shall attempt to try some different eSATA cables and report back > if I manage to isolate the issue directly to the sata_sil module. It's probably dependent on timing and not completely reliable. It's rather complicated. The AC_ERR_NODEV_HINT thing is there primarily for PATA controllers so that they don't spend time trying to probe empty ports. Does the following patch resolve the problem? diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index d4e52e2..d08383f 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -1908,7 +1908,13 @@ retry: err_mask = ata_do_dev_read_id(dev, &tf, id); if (err_mask) { - if (err_mask & AC_ERR_NODEV_HINT) { + /* + * AC_ERR_NODEV_HINT is primarily used to detect empty PATA + * ports. Some SATA devices incorrectly trigger it. + * Ignore if the physical link is positively online. + */ + if ((err_mask & AC_ERR_NODEV_HINT) && + !ata_phys_link_online(ata_dev_phys_link(dev))) { ata_dev_printk(dev, KERN_DEBUG, "NODEV after polling detection\n"); return -ENOENT;