From: Florian Fainelli <f.fainelli@gmail.com>
To: David Miller <davem@davemloft.net>, stsp@list.ru
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
thomas.petazzoni@free-electrons.com
Subject: Re: [PATCH] mvneta: implement SGMII-based in-band link state signaling
Date: Thu, 02 Apr 2015 18:03:53 -0700 [thread overview]
Message-ID: <551DE6F9.9020903@gmail.com> (raw)
In-Reply-To: <20150402.205131.1699226515102250937.davem@davemloft.net>
On 02/04/15 17:51, David Miller wrote:
> From: Stas Sergeev <stsp@list.ru>
> Date: Tue, 31 Mar 2015 16:24:59 +0300
>
>> @@ -2590,6 +2651,7 @@ static int mvneta_mdio_probe(struct mvneta_port *pp)
>>
>> static void mvneta_mdio_remove(struct mvneta_port *pp)
>> {
>> + fixed_phy_set_link_update(pp->phy_dev, NULL);
>
> I do not see any other driver doing this on shutdown.
> Please show me why it is necessary.
The primary reason is that if you do not do that, past the point where
you call phy_disconnect(), we stop the PHY state machine, detach from
the net_device, such that it won't invoke the adjust_link callback
anymore. The fixed PHY driver, though will still keep calling the
fixed_link_update callback asking the driver whether the link parameters
need to be updated, and that will just cause a NULL pointer de-reference
phydev->attached_dev, since we are now in detached state.
I guess another way to fix that is to look for the PHY state in
fixed_mdio_read() and do nothing if it is PHY_HALTED.
>
> And if it is, all other drivers registering a fixed phy link update
> function need to be adjusted to do the same thing.
>
I think the bcmgenet driver is now doing this as a result of Petri's
latest changes, and I meant to comment on that before the patch got in.
drivers/net/dsa/bcm_sf2.c has a similar construct but does not invoke
phy_disconnect() nor can be rmmod'd, so a lesser issue.
--
Florian
next prev parent reply other threads:[~2015-04-03 1:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-31 13:24 [PATCH] mvneta: implement SGMII-based in-band link state signaling Stas Sergeev
2015-04-03 0:51 ` David Miller
2015-04-03 1:03 ` Florian Fainelli [this message]
2015-04-03 19:04 ` David Miller
2015-04-03 19:06 ` David Miller
2015-04-03 10:00 ` Stas Sergeev
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=551DE6F9.9020903@gmail.com \
--to=f.fainelli@gmail.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stsp@list.ru \
--cc=thomas.petazzoni@free-electrons.com \
/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