Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1698849

Re: [PATCH net] xgene: Don't fail probe, if there is no clk resource for SGMII interfaces

From Tom Bogendoerfer <tsbogend@alpha.franken.de>
Newsgroups linux.kernel
Subject Re: [PATCH net] xgene: Don't fail probe, if there is no clk resource for SGMII interfaces
Date 2017-07-28 16:30 +0200
Message-ID <u8er8-4Rs-25@gated-at.bofh.it> (permalink)
References <u2IBA-3Pg-7@gated-at.bofh.it> <u7YcG-2T1-37@gated-at.bofh.it> <u7YFH-33c-1@gated-at.bofh.it> <u7ZLr-3JP-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Jul 27, 2017 at 03:39:58PM -0700, Laura Abbott wrote:
> I don't know the intricacies of the Mustang hardware but external
> aborts have been a symptom of missing clocks on other hardware.

you are right, it's a missing clock. For SGMII ports the driver
doesn't really use the clock source other then doing the one
devm_clk_get(), but this is enough to get the clock going.

Below patch fixes the crash and brings back the second SGMII port
(even without a clock source in device tree, I guess it uses clock
from first port).  From a correctness standpoint there should probably 
be a clk_prepare_enable(), if port is SGMII.

Could you test the patch ? If it works, I'll submit it.

Thomas.

diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
index 86058a9f3417..1d307f2def2d 100644
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
@@ -1785,9 +1785,9 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata)
 
 	xgene_enet_gpiod_get(pdata);
 
-	if (pdata->phy_mode != PHY_INTERFACE_MODE_SGMII) {
-		pdata->clk = devm_clk_get(&pdev->dev, NULL);
-		if (IS_ERR(pdata->clk)) {
+	pdata->clk = devm_clk_get(&pdev->dev, NULL);
+	if (IS_ERR(pdata->clk)) {
+		if (pdata->phy_mode != PHY_INTERFACE_MODE_SGMII) {
 			/* Abort if the clock is defined but couldn't be
 			 * retrived. Always abort if the clock is missing on
 			 * DT system as the driver can't cope with this case.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH net] xgene: Don't fail probe, if there is no clk resource  for SGMII interfaces Laura Abbott <labbott@redhat.com> - 2017-07-27 23:10 +0200
  Re: [PATCH net] xgene: Don't fail probe, if there is no clk resource  for SGMII interfaces Tom Bogendoerfer <tsbogend@alpha.franken.de> - 2017-07-27 23:40 +0200
    Re: [PATCH net] xgene: Don't fail probe, if there is no clk resource  for SGMII interfaces Laura Abbott <labbott@redhat.com> - 2017-07-28 00:50 +0200
      Re: [PATCH net] xgene: Don't fail probe, if there is no clk resource  for SGMII interfaces Tom Bogendoerfer <tsbogend@alpha.franken.de> - 2017-07-28 16:30 +0200
        Re: [PATCH net] xgene: Don't fail probe, if there is no clk resource  for SGMII interfaces Laura Abbott <labbott@redhat.com> - 2017-07-28 18:50 +0200
        Re: [PATCH net] xgene: Don't fail probe, if there is no clk resource  for SGMII interfaces Iyappan Subramanian <isubramanian@apm.com> - 2017-07-28 20:50 +0200

csiph-web