Skip to contentSkip to conversation

net: qcom/emac: don't try to claim clocks on ACPI systems

PATCH Applied Timur Tabi 3 participants 3 messages Dec 13, 2016 – Dec 17, 2016

Subsystems (3)
lore
Share & tools
lore

Timur Tabi

author
#0 lore raw

PATCH v2 1/1 net: qcom/emac: don't try to claim clocks on ACPI systems

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.

---

Notes:
v2: move check into functions

 drivers/net/ethernet/qualcomm/emac/emac.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/net/ethernet/qualcomm/emac/emac.c +9 -0
index ae32f85..422289c 100644
@@ -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;
Signature · 3 lines
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.
Reviewed-by on v2 1/1
#1 lore raw
Quoted 4 lines · Timur Tabi

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.

Signature · 1 line
Florian
maintainer Applied
#2 lore raw
In reply to Timur Tabi

From: Timur Tabi <[email protected]>
Date: Tue, 13 Dec 2016 17:49:02 -0600

Quoted 10 lines

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.

---

Notes:
v2: move check into functions

Applied, thanks.