From patchwork Mon Mar 2 12:48:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 445104 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 791D01400EA for ; Mon, 2 Mar 2015 23:49:07 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754615AbbCBMsx (ORCPT ); Mon, 2 Mar 2015 07:48:53 -0500 Received: from mail-we0-f169.google.com ([74.125.82.169]:35067 "EHLO mail-we0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752254AbbCBMsv (ORCPT ); Mon, 2 Mar 2015 07:48:51 -0500 Received: by wevl61 with SMTP id l61so33111154wev.2 for ; Mon, 02 Mar 2015 04:48:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=T3IkR6hq1Nj0RSoCzunIYGKWJfrqArAcNN/0d46J7MM=; b=kuE5XTL6a+E2TLPCDD/uaqeTqjmXjwlo2PerWELpFjrgwhv+VFl8mx4Vh+9CivPs2A qAtHrO+fuK2MkHY9qdyRNyyN4mME+bEbtT5T9dZSHzaH50beJG+RoDES9A2OImz+NITk npXDW21x0dpWOSJj+rwH5+Ij8lsad3GxurWGZVozmv5F29kEQJK1H5vNcStZVVcFh92q xi8PeFQUYuNhZq8ChQrLaEds8LE7sLEq6kAuzWCF6Tw5UFO+pS3TSZ/NTcfMyXUAMuQE RZSN5hUvv212VNYd4H92/oatzzdSGcYGvV6LwsrBOlvg6ZzPBm1TPskTMxdG8TV4D66/ +IrQ== X-Gm-Message-State: ALoCoQnhmBDKguDAFv5VcKTPQ25TwAl7xrvxHn1Xn8Jz8ZYY3zC/AaoI//rc6PiXpOjwao1naFuz X-Received: by 10.180.108.199 with SMTP id hm7mr35107981wib.5.1425300530257; Mon, 02 Mar 2015 04:48:50 -0800 (PST) Received: from localhost.localdomain (cpc14-aztw22-2-0-cust189.18-1.cable.virginm.net. [82.45.1.190]) by mx.google.com with ESMTPSA id t9sm15910109wia.15.2015.03.02.04.48.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Mar 2015 04:48:49 -0800 (PST) From: Peter Griffin To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, maxime.coquelin@st.com, patrice.chotard@st.com, srinivas.kandagatla@gmail.com, tj@kernel.org Cc: peter.griffin@linaro.org, lee.jones@linaro.org, linux-ide@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 3/3] ahci: st: st_configure_oob must be called after IP is clocked. Date: Mon, 2 Mar 2015 12:48:39 +0000 Message-Id: <1425300519-13747-4-git-send-email-peter.griffin@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1425300519-13747-1-git-send-email-peter.griffin@linaro.org> References: <1425300519-13747-1-git-send-email-peter.griffin@linaro.org> Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org Currently the ahci_st driver will hang the system on probe, as the st_configure_oob function does some register writes before the IP is clocked. This patch moves the function call to after ahci_platform_enable_resources (which enables the IP clock), and resolves the hang. Addtionally st_ahci_configure_oob should be called in the st_ahci_resume function, so we also rectify that ensuring it is also called after the IP clock has been enabled. Signed-off-by: Peter Griffin Acked-by: Lee Jones --- drivers/ata/ahci_st.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/ata/ahci_st.c b/drivers/ata/ahci_st.c index bc971af..ea0ff00 100644 --- a/drivers/ata/ahci_st.c +++ b/drivers/ata/ahci_st.c @@ -68,8 +68,6 @@ static int st_ahci_deassert_resets(struct device *dev) } } - st_ahci_configure_oob(drv_data->hpriv->mmio); - if (drv_data->sw_rst) { err = reset_control_deassert(drv_data->sw_rst); if (err) { @@ -172,6 +170,8 @@ static int st_ahci_probe(struct platform_device *pdev) if (err) return err; + st_ahci_configure_oob(drv_data->hpriv->mmio); + err = ahci_platform_init_host(pdev, hpriv, &st_ahci_port_info, &ahci_platform_sht); if (err) { @@ -222,6 +222,8 @@ static int st_ahci_resume(struct device *dev) return err; } + st_ahci_configure_oob(drv_data->hpriv->mmio); + return ahci_platform_resume_host(dev); } #endif