netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	netdev@vger.kernel.org,
	Christoph Niedermaier <cniedermaier@dh-electronics.com>,
	"David S . Miller" <davem@davemloft.net>,
	NXP Linux Team <linux-imx@nxp.com>,
	Richard Leitner <richard.leitner@skidata.com>,
	Shawn Guo <shawnguo@kernel.org>, Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>
Subject: Re: [PATCH] net: fec: Fix phy_device lookup for phy_reset_after_clk_enable()
Date: Sat, 10 Oct 2020 10:45:08 +0200	[thread overview]
Message-ID: <338cdf37-2b26-84ce-fdb6-f22f756df163@denx.de> (raw)
In-Reply-To: <20201009110230.3d8693df@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>

On 10/9/20 8:02 PM, Jakub Kicinski wrote:
> On Fri, 9 Oct 2020 19:34:10 +0200 Marek Vasut wrote:
>>>>> To an untrained eye this looks pretty weird.    
>>>>
>>>> I see, I'm not quite sure how to address this comment.  
>>>
>>> If ndev->phydev sometimes is not-NULL on open, then that's a valid
>>> state to be in. Why not make sure that we're always in that state 
>>> and can depend on ndev->phydev rather than rummaging around for 
>>> the phy_device instance.  
>>
>> Nope, the problem is in probe() in this case.
> 
> In that case it would be cleaner to pass fep and phydev as arguments
> into fec_enet_clk_enable(), rather than netdev, and have only probe()
> do the necessary dance.

So correction, the problem does only happen in open(), in probe() the
phydev->drv is still NULL so the PHY reset cannot be triggered. In
open(), first the clock have to be enabled, then the reset must toggle,
then the PHY IDs can be reliably read.

I suspect reset in probe() will need another patch.

      reply	other threads:[~2020-10-10 23:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-06 20:20 [PATCH] net: fec: Fix phy_device lookup for phy_reset_after_clk_enable() Marek Vasut
2020-10-06 21:09 ` Florian Fainelli
2020-10-06 22:02   ` Marek Vasut
2020-10-09  0:46     ` Jakub Kicinski
2020-10-09  7:20       ` Marek Vasut
2020-10-09 15:15         ` Jakub Kicinski
2020-10-09 17:34           ` Marek Vasut
2020-10-09 18:02             ` Jakub Kicinski
2020-10-10  8:45               ` Marek Vasut [this message]

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=338cdf37-2b26-84ce-fdb6-f22f756df163@denx.de \
    --to=marex@denx.de \
    --cc=andrew@lunn.ch \
    --cc=cniedermaier@dh-electronics.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=netdev@vger.kernel.org \
    --cc=richard.leitner@skidata.com \
    --cc=shawnguo@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).