From patchwork Fri Oct 9 12:53:17 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Surbhi Palande X-Patchwork-Id: 35619 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 15582B7BA7 for ; Fri, 9 Oct 2009 23:53:31 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.60) (envelope-from ) id 1MwEyK-0006jC-NU; Fri, 09 Oct 2009 13:53:24 +0100 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.60) (envelope-from ) id 1MwEyE-0006iQ-QG for kernel-team@lists.canonical.com; Fri, 09 Oct 2009 13:53:19 +0100 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1MwEyE-00035s-Kf for ; Fri, 09 Oct 2009 13:53:18 +0100 Received: from a88-112-252-196.elisa-laajakaista.fi ([88.112.252.196] helo=canonical.com) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1MwEyE-0005Rl-BF for kernel-team@lists.canonical.com; Fri, 09 Oct 2009 13:53:18 +0100 From: Surbhi Palande To: kernel-team@lists.canonical.com Subject: [PATCH] UBUNTU: SAUCE: Fixed ata error message printing when sb600 workaround is tried out Date: Fri, 9 Oct 2009 15:53:17 +0300 Message-Id: <1255092797-5019-1-git-send-email-surbhi.palande@canonical.com> X-Mailer: git-send-email 1.6.0.4 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.8 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com This patch fixes bug 444228 reported in launchpad. It prevents early erroneous printing of ata error message. It helps in a clean boot sequence. This could also be applied for a merge upstream. Kindly do consider merging this for Karmic. The following changes since commit 823da90960aa2f2442bec8cb0dc711b49f7a48ca: John Johansen (1): UBUNTU: SAUCE: AppArmor: Fix off by 2 error in getprocattr mem allocation are available in the git repository at: git://kernel.ubuntu.com/surbhi/ubuntu-karmic.git lp444228 Surbhi Palande (1): UBUNTU: SAUCE: Fixed ata error message printing when sb600 work around for a hardware bug is tried out drivers/ata/ahci.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) From 4ad8fa70a83537307bec3300c318194e7e2188cc Author: Surbhi Palande Date: Fri Oct 9 15:02:09 2009 +0300 Buglink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/444228 Soft reset fails on some ATI chips with IPMS set when PMP is enabled but SATA HDD/ODD is connected to SATA port. This is a hardware bug and a work around is to try a soft reset later at port 0. Before this work around is tried out a error message indicating that the device is not ready was flashed out too early. Fixed this, to first try the work around if possible, otherwise flash an error message. Signed-off-by: Surbhi Palande Acked-by: Stefan Bader diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 289c4f8..1af5203 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -1704,6 +1704,15 @@ static int ahci_do_softreset(struct ata_link *link, unsigned int *class, /* wait for link to become ready */ rc = ata_wait_after_reset(link, deadline, check_ready); + + /* + * Soft reset fails on some ATI chips with IPMS set when PMP + * is enabled but SATA HDD/ODD is connected to SATA port. + * A workaround shall be applied in the calling function + * and we dont want to print error message without trying first + */ + if (rc == -EIO) + return rc; if (rc == -EBUSY && hpriv->flags & AHCI_HFLAG_SRST_TOUT_IS_OFFLINE) { /* * Workaround for cases where link online status can't @@ -1789,6 +1798,14 @@ static int ahci_sb600_softreset(struct ata_link *link, unsigned int *class, "and retrying\n"); rc = ahci_do_softreset(link, class, 0, deadline, ahci_check_ready); + } else { + /* since no message was printed in ahci_do_softreset + * when ret value was -EIO and since we are not trying + * any work around, we should print the err msg here, + * (ideally we should not reach here) + */ + ata_link_printk(link, KERN_ERR, "softreset failed " + "(device not ready)\n"); } }