* [PATCH] [v2] net: qcom/emac: don't try to claim clocks on ACPI systems
@ 2016-12-13 23:49 Timur Tabi
2016-12-13 23:54 ` Florian Fainelli
2016-12-17 15:23 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Timur Tabi @ 2016-12-13 23:49 UTC (permalink / raw)
To: David Miller, Florian Fainelli, netdev, Christopher Covington,
alokc
On ACPI systems, clocks are not available to drivers directly. They are
handled exclusively by ACPI and/or firmware, so there is no clock driver.
Calls to clk_get() always fail, so we should not even attempt to claim
any clocks on ACPI systems.
Signed-off-by: Timur Tabi <timur@codeaurora.org>
---
Notes:
v2: move check into functions
drivers/net/ethernet/qualcomm/emac/emac.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/ethernet/qualcomm/emac/emac.c b/drivers/net/ethernet/qualcomm/emac/emac.c
index ae32f85..422289c 100644
--- a/drivers/net/ethernet/qualcomm/emac/emac.c
+++ b/drivers/net/ethernet/qualcomm/emac/emac.c
@@ -460,6 +460,12 @@ static int emac_clks_phase1_init(struct platform_device *pdev,
{
int ret;
+ /* On ACPI platforms, clocks are controlled by firmware and/or
+ * ACPI, not by drivers.
+ */
+ if (has_acpi_companion(&pdev->dev))
+ return 0;
+
ret = emac_clks_get(pdev, adpt);
if (ret)
return ret;
@@ -485,6 +491,9 @@ static int emac_clks_phase2_init(struct platform_device *pdev,
{
int ret;
+ if (has_acpi_companion(&pdev->dev))
+ return 0;
+
ret = clk_set_rate(adpt->clk[EMAC_CLK_TX], 125000000);
if (ret)
return ret;
--
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc. Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] [v2] net: qcom/emac: don't try to claim clocks on ACPI systems
2016-12-13 23:49 [PATCH] [v2] net: qcom/emac: don't try to claim clocks on ACPI systems Timur Tabi
@ 2016-12-13 23:54 ` Florian Fainelli
2016-12-17 15:23 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2016-12-13 23:54 UTC (permalink / raw)
To: Timur Tabi, David Miller, netdev, Christopher Covington, alokc
On 12/13/2016 03:49 PM, Timur Tabi wrote:
> On ACPI systems, clocks are not available to drivers directly. They are
> handled exclusively by ACPI and/or firmware, so there is no clock driver.
> Calls to clk_get() always fail, so we should not even attempt to claim
> any clocks on ACPI systems.
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] [v2] net: qcom/emac: don't try to claim clocks on ACPI systems
2016-12-13 23:49 [PATCH] [v2] net: qcom/emac: don't try to claim clocks on ACPI systems Timur Tabi
2016-12-13 23:54 ` Florian Fainelli
@ 2016-12-17 15:23 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-12-17 15:23 UTC (permalink / raw)
To: timur; +Cc: f.fainelli, netdev, cov, alokc
From: Timur Tabi <timur@codeaurora.org>
Date: Tue, 13 Dec 2016 17:49:02 -0600
> On ACPI systems, clocks are not available to drivers directly. They are
> handled exclusively by ACPI and/or firmware, so there is no clock driver.
> Calls to clk_get() always fail, so we should not even attempt to claim
> any clocks on ACPI systems.
>
> Signed-off-by: Timur Tabi <timur@codeaurora.org>
> ---
>
> Notes:
> v2: move check into functions
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-12-17 15:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-13 23:49 [PATCH] [v2] net: qcom/emac: don't try to claim clocks on ACPI systems Timur Tabi
2016-12-13 23:54 ` Florian Fainelli
2016-12-17 15:23 ` David Miller
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).