* Re: [Nios2-dev] [PATCH] Altera TSE: Add missing phydev
[not found] <BLU436-SMTP58313D55680097A2C4AAA0B6560@phx.gbl>
@ 2014-12-25 12:52 ` Tobias Klauser
2014-12-25 14:55 ` Tobias Klauser
0 siblings, 1 reply; 2+ messages in thread
From: Tobias Klauser @ 2014-12-25 12:52 UTC (permalink / raw)
To: Kostya Belezko; +Cc: Nios2-dev, Vince Bridgers, netdev
On 2014-12-22 at 23:37:19 +0100, Kostya Belezko <bkostya@hotmail.com> wrote:
> Altera network device doesn't come up after
>
> ifconfig eth0 down
> ifconfig eth0 up
>
> The reason behind is clearing priv->phydev during tse_shutdown().
> The phydev is not restored back at tse_open().
>
> Signed-off-by: Kostya Belezko <bkostya@hotmail.com>
Please Cc: netdev@vger.kernel.org for network driver patches.
> ---
> drivers/net/ethernet/altera/altera_tse_main.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c
> index 4efc435..361bf35 100644
> --- a/drivers/net/ethernet/altera/altera_tse_main.c
> +++ b/drivers/net/ethernet/altera/altera_tse_main.c
> @@ -1150,6 +1150,9 @@ static int tse_open(struct net_device *dev)
>
> spin_unlock_irqrestore(&priv->rxdma_irq_lock, flags);
>
> + if (!priv->phydev)
> + init_phy(dev);
That way the PHY will be initialized twice on first start.
IMO the proper solution would be to disconnect and NULL the phydev in
altera_tse_remove, not in tse_shutdown. There, only phy_stop should be
called.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Nios2-dev] [PATCH] Altera TSE: Add missing phydev
2014-12-25 12:52 ` [Nios2-dev] [PATCH] Altera TSE: Add missing phydev Tobias Klauser
@ 2014-12-25 14:55 ` Tobias Klauser
0 siblings, 0 replies; 2+ messages in thread
From: Tobias Klauser @ 2014-12-25 14:55 UTC (permalink / raw)
To: Kostya Belezko; +Cc: Nios2-dev, Vince Bridgers, netdev
On 2014-12-25 at 13:52:39 +0100, Tobias Klauser <tklauser@distanz.ch> wrote:
> On 2014-12-22 at 23:37:19 +0100, Kostya Belezko <bkostya@hotmail.com> wrote:
> > Altera network device doesn't come up after
> >
> > ifconfig eth0 down
> > ifconfig eth0 up
> >
> > The reason behind is clearing priv->phydev during tse_shutdown().
> > The phydev is not restored back at tse_open().
> >
> > Signed-off-by: Kostya Belezko <bkostya@hotmail.com>
>
> Please Cc: netdev@vger.kernel.org for network driver patches.
>
> > ---
> > drivers/net/ethernet/altera/altera_tse_main.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c
> > index 4efc435..361bf35 100644
> > --- a/drivers/net/ethernet/altera/altera_tse_main.c
> > +++ b/drivers/net/ethernet/altera/altera_tse_main.c
> > @@ -1150,6 +1150,9 @@ static int tse_open(struct net_device *dev)
> >
> > spin_unlock_irqrestore(&priv->rxdma_irq_lock, flags);
> >
> > + if (!priv->phydev)
> > + init_phy(dev);
>
> That way the PHY will be initialized twice on first start.
It actually won't. Sorry, I didn't read careful enough.
Still, the solution suggested below is preferable IMO and this is also
what other ethernet drivers are doing (at least those I checked).
> IMO the proper solution would be to disconnect and NULL the phydev in
> altera_tse_remove, not in tse_shutdown. There, only phy_stop should be
> called.
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-12-25 14:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <BLU436-SMTP58313D55680097A2C4AAA0B6560@phx.gbl>
2014-12-25 12:52 ` [Nios2-dev] [PATCH] Altera TSE: Add missing phydev Tobias Klauser
2014-12-25 14:55 ` Tobias Klauser
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).