mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Laura Abbott <labbott@redhat.com>
To: Tom Bogendoerfer <tsbogend@alpha.franken.de>
Cc: isubramanian@apm.com, kchudgar@apm.com, qnguyen@apm.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] xgene: Don't fail probe, if there is no clk resource for SGMII interfaces
Date: Fri, 28 Jul 2017 09:42:21 -0700	[thread overview]
Message-ID: <41cdb992-8387-80db-5d48-4d16c85cb14a@redhat.com> (raw)
In-Reply-To: <20170728142318.GA20368@alpha.franken.de>

On 07/28/2017 07:23 AM, Tom Bogendoerfer wrote:
> 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.
> 


Yes, this works. You can add my Tested-by.

Thanks,
Laura

  reply	other threads:[~2017-07-28 16:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-13  8:57 Thomas Bogendoerfer
2017-07-13 16:22 ` David Miller
2017-07-27 21:03 ` Laura Abbott
2017-07-27 21:39   ` Tom Bogendoerfer
2017-07-27 22:39     ` Laura Abbott
2017-07-28 14:23       ` Tom Bogendoerfer
2017-07-28 16:42         ` Laura Abbott [this message]
2017-07-28 18:40         ` Iyappan Subramanian

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=41cdb992-8387-80db-5d48-4d16c85cb14a@redhat.com \
    --to=labbott@redhat.com \
    --cc=isubramanian@apm.com \
    --cc=kchudgar@apm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=qnguyen@apm.com \
    --cc=tsbogend@alpha.franken.de \
    /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

all inboxes | Powered by JetHome®