devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Griffin <peter.griffin@linaro.org>
To: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, maxime.coquelin@st.com,
	patrice.chotard@st.com, tj@kernel.org,
	srinivas.kandagatla@gmail.com
Cc: peter.griffin@linaro.org, lee.jones@linaro.org,
	devicetree@vger.kernel.org, linux-ide@vger.kernel.org
Subject: [PATCH 3/3] ahci: st: st_configure_oob must be called after IP is clocked.
Date: Tue, 31 Mar 2015 08:35:09 +0100	[thread overview]
Message-ID: <1427787309-1601-4-git-send-email-peter.griffin@linaro.org> (raw)
In-Reply-To: <1427787309-1601-1-git-send-email-peter.griffin@linaro.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 <peter.griffin@linaro.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
---
 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
-- 
1.9.1

  parent reply	other threads:[~2015-03-31  7:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-31  7:35 [PATCH RESEND 0/3] Enable ahci_st for stih407 and fix hang Peter Griffin
2015-03-31  7:35 ` [PATCH 1/3] ahci: st: Update the ahci_st DT documentation Peter Griffin
2015-03-31  7:35 ` [PATCH 2/3] ARM: DT: STi: STiH407: Add sata DT nodes Peter Griffin
2015-04-30 11:06   ` Maxime Coquelin
2015-03-31  7:35 ` Peter Griffin [this message]
2015-03-31 15:29   ` [PATCH 3/3] ahci: st: st_configure_oob must be called after IP is clocked Tejun Heo
2015-03-31 15:33     ` Maxime Coquelin
     [not found]     ` <20150331152958.GF9974-piEFEHQLUPpN0TnZuCh8vA@public.gmane.org>
2015-03-31 15:36       ` Peter Griffin
2015-03-31 15:59         ` Tejun Heo
2015-03-31 17:33           ` Peter Griffin
     [not found]   ` <1427787309-1601-4-git-send-email-peter.griffin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-04-01 16:07     ` Tejun Heo
  -- strict thread matches above, loose matches on Subject: below --
2015-03-02 12:48 [PATCH 0/3] Enable ahci_st for stih407 and fix hang Peter Griffin
2015-03-02 12:48 ` [PATCH 3/3] ahci: st: st_configure_oob must be called after IP is clocked Peter Griffin
2015-03-02 17:03   ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1427787309-1601-4-git-send-email-peter.griffin@linaro.org \
    --to=peter.griffin@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.coquelin@st.com \
    --cc=patrice.chotard@st.com \
    --cc=srinivas.kandagatla@gmail.com \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).