Skip to content

Commit

Permalink
ahci: st: st_configure_oob must be called after IP is clocked.
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Peter Griffin authored and Tejun Heo committed Apr 1, 2015
1 parent 9a8340b commit 9a1e75e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/ata/ahci_st.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9a1e75e

Please sign in to comment.