From patchwork Tue Oct 24 21:56:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dann frazier X-Patchwork-Id: 830051 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3yM6Y91mZYz9sPk; Wed, 25 Oct 2017 08:56:29 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1e77BP-0003fA-Po; Tue, 24 Oct 2017 21:56:23 +0000 Received: from complete.lackof.org ([198.49.126.79]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1e77BN-0003db-Q6 for kernel-team@lists.ubuntu.com; Tue, 24 Oct 2017 21:56:21 +0000 Received: from localhost (c-107-2-141-92.hsd1.co.comcast.net [107.2.141.92]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by complete.lackof.org (Postfix) with ESMTPSA id 1E97533E00A3 for ; Tue, 24 Oct 2017 15:56:19 -0600 (MDT) Date: Tue, 24 Oct 2017 15:56:18 -0600 From: dann frazier To: kernel-team@lists.ubuntu.com Subject: [PATCH][SRU Zesty] UBUNTU: SAUCE: ahci: thunderx2: stop engine fix update Message-ID: <20171024215618.wo2o6t25pfebhwnu@xps13.dannf> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170609 (1.8.3) X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on complete.lackof.org X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1724117 The current reset fix fails during continuous reboot test. The failure happens when both the on-board SATA slots are used and when one of the controllers are reset. The latest ThunderX2 firmware (3.1) enables hardware error interrupts and when the reset fix fails, we get a hang with the print: [ 14.839308] sd 1:0:0:0: [sdb] 468862128 512-byte logical blocks: (240 GB/224 GiB) [ 14.846796] sd 1:0:0:0: [sdb] 4096-byte physical blocks [ 14.852036] sd 1:0:0:0: [sdb] Write Protect is off [ 14.856843] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 14.866022] ata2.00: Enabling discard_zeroes_data *** NBU BAR Error 0x1e25c *** AddrLo 0x1d80180 AddrHi 0x0 To fix this issue, update the SATA reset fix to increase the delays between register writes. Signed-off-by: Jayachandran C [ dannf: *** There is no need to carry this forward beyond artful *** ] Signed-off-by: dann frazier --- drivers/ata/libahci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 9116bba1b07d..1d3e614bad2b 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -679,10 +679,11 @@ int ahci_stop_engine(struct ata_port *ap) MIDR_CPU_VAR_REV(0, 0), MIDR_CPU_VAR_REV(0, MIDR_REVISION_MASK))) { tmp = readl(hpriv->mmio + 0x8000); + udelay(100); writel(tmp | (1 << 26), hpriv->mmio + 0x8000); - udelay(1); + udelay(100); writel(tmp & ~(1 << 26), hpriv->mmio + 0x8000); - dev_warn(ap->host->dev, "CN99XX stop engine fix applied!\n"); + dev_warn(ap->host->dev, "CN99XX SATA reset workaround applied\n"); } #endif