lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20141225145521.GQ16916@distanz.ch>
Date:	Thu, 25 Dec 2014 15:55:21 +0100
From:	Tobias Klauser <tklauser@...tanz.ch>
To:	Kostya Belezko <bkostya@...mail.com>
Cc:	Nios2-dev <nios2-dev@...ts.rocketboards.org>,
	Vince Bridgers <vbridgers2013@...il.com>,
	netdev@...r.kernel.org
Subject: Re: [Nios2-dev] [PATCH] Altera TSE: Add missing phydev

On 2014-12-25 at 13:52:39 +0100, Tobias Klauser <tklauser@...tanz.ch> wrote:
> On 2014-12-22 at 23:37:19 +0100, Kostya Belezko <bkostya@...mail.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@...mail.com>
> 
> Please Cc: netdev@...r.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@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ