{"id":817727,"url":"http://patchwork.ozlabs.org/api/patches/817727/?format=json","web_url":"http://patchwork.ozlabs.org/project/ubuntu-kernel/patch/20170922214651.23816-2-dann.frazier@canonical.com/","project":{"id":15,"url":"http://patchwork.ozlabs.org/api/projects/15/?format=json","name":"Ubuntu Kernel","link_name":"ubuntu-kernel","list_id":"kernel-team.lists.ubuntu.com","list_email":"kernel-team@lists.ubuntu.com","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170922214651.23816-2-dann.frazier@canonical.com>","list_archive_url":null,"date":"2017-09-22T21:46:50","name":"[1/2,Artful] UBUNTU: SAUCE: ahci: thunderx2: Fix for errata that affects stop engine","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"c5103fe1d28a6bcd2900e17c5944c13000ae1e5d","submitter":{"id":9337,"url":"http://patchwork.ozlabs.org/api/people/9337/?format=json","name":"dann frazier","email":"dann.frazier@canonical.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/ubuntu-kernel/patch/20170922214651.23816-2-dann.frazier@canonical.com/mbox/","series":[{"id":4714,"url":"http://patchwork.ozlabs.org/api/series/4714/?format=json","web_url":"http://patchwork.ozlabs.org/project/ubuntu-kernel/list/?series=4714","date":"2017-09-22T21:46:49","name":"Workaround SATA issue w/ early thunderx2 silicon","version":1,"mbox":"http://patchwork.ozlabs.org/series/4714/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/817727/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/817727/checks/","tags":{},"related":[],"headers":{"Return-Path":"<kernel-team-bounces@lists.ubuntu.com>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com\n\t(client-ip=91.189.94.19; helo=huckleberry.canonical.com;\n\tenvelope-from=kernel-team-bounces@lists.ubuntu.com;\n\treceiver=<UNKNOWN>)","Received":["from huckleberry.canonical.com (huckleberry.canonical.com\n\t[91.189.94.19])\n\tby ozlabs.org (Postfix) with ESMTP id 3xzRsD5QCWz9t3C;\n\tSat, 23 Sep 2017 07:47:12 +1000 (AEST)","from localhost ([127.0.0.1] helo=huckleberry.canonical.com)\n\tby huckleberry.canonical.com with esmtp (Exim 4.86_2)\n\t(envelope-from <kernel-team-bounces@lists.ubuntu.com>)\n\tid 1dvVmq-0006EQ-OQ; Fri, 22 Sep 2017 21:47:04 +0000","from complete.lackof.org ([198.49.126.79])\n\tby huckleberry.canonical.com with esmtps\n\t(TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2)\n\t(envelope-from <dannf@dannf.org>) id 1dvVmm-00067q-85\n\tfor kernel-team@lists.ubuntu.com; Fri, 22 Sep 2017 21:47:00 +0000","from localhost (c-107-2-141-92.hsd1.co.comcast.net [107.2.141.92])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (Client did not present a certificate)\n\tby complete.lackof.org (Postfix) with ESMTPSA id 985F433E01D1\n\tfor <kernel-team@lists.ubuntu.com>;\n\tFri, 22 Sep 2017 15:46:57 -0600 (MDT)"],"From":"dann frazier <dann.frazier@canonical.com>","To":"kernel-team@lists.ubuntu.com","Subject":"[PATCH 1/2][Artful] UBUNTU: SAUCE: ahci: thunderx2: Fix for errata\n\tthat affects stop engine","Date":"Fri, 22 Sep 2017 15:46:50 -0600","Message-Id":"<20170922214651.23816-2-dann.frazier@canonical.com>","X-Mailer":"git-send-email 2.14.1","In-Reply-To":"<20170922214651.23816-1-dann.frazier@canonical.com>","References":"<20170922214651.23816-1-dann.frazier@canonical.com>","X-Spam-Status":"No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY\n\tautolearn=unavailable version=3.3.2","X-Spam-Checker-Version":"SpamAssassin 3.3.2 (2011-06-06) on\n\tcomplete.lackof.org","X-BeenThere":"kernel-team@lists.ubuntu.com","X-Mailman-Version":"2.1.20","Precedence":"list","List-Id":"Kernel team discussions <kernel-team.lists.ubuntu.com>","List-Unsubscribe":"<https://lists.ubuntu.com/mailman/options/kernel-team>,\n\t<mailto:kernel-team-request@lists.ubuntu.com?subject=unsubscribe>","List-Archive":"<https://lists.ubuntu.com/archives/kernel-team>","List-Post":"<mailto:kernel-team@lists.ubuntu.com>","List-Help":"<mailto:kernel-team-request@lists.ubuntu.com?subject=help>","List-Subscribe":"<https://lists.ubuntu.com/mailman/listinfo/kernel-team>,\n\t<mailto:kernel-team-request@lists.ubuntu.com?subject=subscribe>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"kernel-team-bounces@lists.ubuntu.com","Sender":"\"kernel-team\" <kernel-team-bounces@lists.ubuntu.com>"},"content":"From: Jayachandran C <jnair@caviumnetworks.com>\n\nBugLink: https://bugs.launchpad.net/bugs/1719031\n\nApply workaround for this errata:\n  Synopsis: Resetting PxCMD.ST may hang the SATA device\n\n  Description: An internal ping-pong buffer state is not reset\n  correctly for an PxCMD.ST=0 command for a SATA channel. This\n  may cause the SATA interface to hang when a PxCMD.ST=0 command\n  is received.\n\n  Workaround: A SATA_BIU_CORE_ENABLE.sw_init_bsi must be asserted\n  by the driver whenever the PxCMD.ST needs to be de-asserted. This\n  will reset both the ports. So, it may not always work in a 2\n  channel SATA system.\n\n  Resolution: Fix in B0.\n\nAdd the code to ahci_stop_engine() to do this. It is not easy to\nstop the other \"port\" since it is associated with a different AHCI\ninterface. Please note that with this fix, SATA reset does not\nhang any more, but it can cause failures on the other interface\nif that is in active use.\n\nUnfortunately, we have nothing other the the CPU ID to check if the\nSATA block has this issue.\n\nSigned-off-by: Jayachandran C <jnair@caviumnetworks.com>\n[ dannf: *** There is no need to carry this forward beyond artful *** ]\nSigned-off-by: dann frazier <dann.frazier@canonical.com>\n---\n drivers/ata/libahci.c | 14 ++++++++++++++\n 1 file changed, 14 insertions(+)","diff":"diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c\nindex 3e286d86ab42..22eacef13bab 100644\n--- a/drivers/ata/libahci.c\n+++ b/drivers/ata/libahci.c\n@@ -669,6 +669,20 @@ int ahci_stop_engine(struct ata_port *ap)\n \ttmp &= ~PORT_CMD_START;\n \twritel(tmp, port_mmio + PORT_CMD);\n \n+#ifdef CONFIG_ARM64\n+\t/* Rev Ax of Cavium CN99XX needs a hack for port stop */\n+\tif (MIDR_IS_CPU_MODEL_RANGE(read_cpuid_id(),\n+\t\t\tMIDR_CPU_MODEL(ARM_CPU_IMP_BRCM, BRCM_CPU_PART_VULCAN),\n+\t\t\tMIDR_CPU_VAR_REV(0, 0),\n+\t\t\tMIDR_CPU_VAR_REV(0, MIDR_REVISION_MASK))) {\n+\t\ttmp = readl(hpriv->mmio + 0x8000);\n+\t\twritel(tmp | (1 << 26), hpriv->mmio + 0x8000);\n+\t\tudelay(1);\n+\t\twritel(tmp & ~(1 << 26), hpriv->mmio + 0x8000);\n+\t\tdev_warn(ap->host->dev, \"CN99XX stop engine fix applied!\\n\");\n+\t}\n+#endif\n+\n \t/* wait for engine to stop. This could be as long as 500 msec */\n \ttmp = ata_wait_register(ap, port_mmio + PORT_CMD,\n \t\t\t\tPORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1, 500);\n","prefixes":["1/2","Artful"]}