From patchwork Mon Dec 23 12:07:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Guinot X-Patchwork-Id: 3396561 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E0F009F169 for ; Mon, 23 Dec 2013 12:08:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D833E20672 for ; Mon, 23 Dec 2013 12:08:17 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 60DD520380 for ; Mon, 23 Dec 2013 12:08:16 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vv4Ir-0007RC-4v; Mon, 23 Dec 2013 12:08:09 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vv4Io-0006Vj-OB; Mon, 23 Dec 2013 12:08:06 +0000 Received: from vm1.sequanux.org ([188.165.36.56]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vv4Im-0006VO-5v for linux-arm-kernel@lists.infradead.org; Mon, 23 Dec 2013 12:08:04 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by vm1.sequanux.org (Postfix) with ESMTP id 8372B1080A8; Mon, 23 Dec 2013 13:07:41 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at vm1.sequanux.org Received: from vm1.sequanux.org ([127.0.0.1]) by localhost (vm1.sequanux.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w9e_2NEaAe6r; Mon, 23 Dec 2013 13:07:37 +0100 (CET) Received: from localhost (stp25-2-82-234-233-9.fbx.proxad.net [82.234.233.9]) by vm1.sequanux.org (Postfix) with ESMTPSA id 7DA741080A6; Mon, 23 Dec 2013 13:07:36 +0100 (CET) From: Simon Guinot To: Jeff Garzik , Tejun Heo Subject: [PATCH] ata: sata_mv: setting PHY speed according to SControl speed Date: Mon, 23 Dec 2013 13:07:35 +0100 Message-Id: <1387800455-30629-1-git-send-email-simon.guinot@sequanux.org> X-Mailer: git-send-email 1.8.5.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131223_070804_321153_A59EF426 X-CRM114-Status: GOOD ( 10.82 ) X-Spam-Score: -2.5 (--) Cc: Lior Amsalem , Thomas Petazzoni , Simon Guinot , Andrew Lunn , stable@vger.kernel.org, linux-ide@vger.kernel.org, Gregory Clement , Sebastian Hesselbarth , linux-arm-kernel@lists.infradead.org, Jason Cooper X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Lior Amsalem From: Lior Amsalem This patch fixes a SATA hotplug issue on the Armada 370 and Armada XP SoCs. Without it, if a disk is unplugged from a SATA port, then further hotplug notification are now longer received on this port. This should be applied to every -stable kernel supporting Armada SoCs. Signed-off-by: Lior Amsalem Signed-off-by: Nadav Haklai Signed-off-by: Simon Guinot Cc: Thomas Petazzoni Cc: Jason Cooper Cc: Andrew Lunn Cc: Gregory Clement Cc: Sebastian Hesselbarth Cc: stable@vger.kernel.org Tested-by: Andrew Lunn --- drivers/ata/sata_mv.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 56be318..89ca472 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c @@ -304,6 +304,7 @@ enum { MV5_LTMODE = 0x30, MV5_PHY_CTL = 0x0C, SATA_IFCFG = 0x050, + LP_PHY_CTL = 0x058, MV_M2_PREAMP_MASK = 0x7e0, @@ -1358,6 +1359,7 @@ static int mv_scr_write(struct ata_link *link, unsigned int sc_reg_in, u32 val) if (ofs != 0xffffffffU) { void __iomem *addr = mv_ap_base(link->ap) + ofs; + void __iomem *lp_phy_addr = mv_ap_base(link->ap) + LP_PHY_CTL; if (sc_reg_in == SCR_CONTROL) { /* * Workaround for 88SX60x1 FEr SATA#26: @@ -1374,6 +1376,14 @@ static int mv_scr_write(struct ata_link *link, unsigned int sc_reg_in, u32 val) */ if ((val & 0xf) == 1 || (readl(addr) & 0xf) == 1) val |= 0xf000; + + /* + * Setting PHY speed according to SControl speed + */ + if ((val & 0xf0) == 0x10) + writelfl(0x7, lp_phy_addr); + else + writelfl(0x227, lp_phy_addr); } writelfl(val, addr); return 0;