All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergej Bauer <sbauer@blackbox.su>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, f.fainelli@gmail.com,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Bryan Whitehead <bryan.whitehead@microchip.com>,
	UNGLinuxDriver@microchip.com,
	Simon Horman <simon.horman@netronome.com>,
	Mark Einon <mark.einon@gmail.com>,
	Madalin Bucur <madalin.bucur@oss.nxp.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Masahiro Yamada <masahiroy@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] lan743x: add virtual PHY for PHY-less devices
Date: Mon, 25 Jan 2021 13:23:25 +0300	[thread overview]
Message-ID: <2014021.cZaaFtpcjn@metabook> (raw)
In-Reply-To: <YAtebdG1Q0dxxkdC@lunn.ch>

On Saturday, January 23, 2021 2:23:25 AM MSK Andrew Lunn wrote:
> > > > @@ -1000,8 +1005,10 @@ static void lan743x_phy_close(struct
> > > > lan743x_adapter *adapter)>
> > > > 
> > > >  	struct net_device *netdev = adapter->netdev;
> > > >  	
> > > >  	phy_stop(netdev->phydev);
> > > > 
> > > > -	phy_disconnect(netdev->phydev);
> > > > -	netdev->phydev = NULL;
> > > > +	if (phy_is_pseudo_fixed_link(netdev->phydev))
> > > > +		lan743x_virtual_phy_disconnect(netdev->phydev);
> > > > +	else
> > > > +		phy_disconnect(netdev->phydev);
> > > 
> > > phy_disconnect() should work. You might want to call
> 
> There are drivers which call phy_disconnect() on a fixed_link. e.g.
> 
> https://elixir.bootlin.com/linux/v5.11-rc4/source/drivers/net/usb/lan78xx.c#
> L3555.
> 
> It could be your missing call to fixed_phy_unregister() is leaving
> behind bad state.
> 
fixed_phy_unregister() were inside of lan743x_virtual_phy_disconnect()

> > It was to make ethtool show full set of supported speeds and MII only in
> > supported ports (without TP and the no any ports in the bare card).
> 
> But fixed link does not support the full set of speed. It is fixed. It
> supports only one speed it is configured with.  And by setting it
> wrongly, you are going to allow the user to do odd things, like use
> ethtool force the link speed to a speed which is not actually
> supported.
when writing virtual phy i have used "Microchip AN2948 Configuration Registers
of LAN743x" document and the lan743x is designed only for LAN7430 either
LAN7431 as it pointed in the document and in lan743x_pcidev_tbl. which both
support speeds 10/100/1000 Mbps.


-- 
                                Regards,
                                    Sergej.





      parent reply	other threads:[~2021-01-26 19:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22 21:42 [PATCH v2] lan743x: add virtual PHY for PHY-less devices Sergej Bauer
2021-01-22 21:52 ` Florian Fainelli
2021-01-22 22:11   ` Sergej Bauer
2021-01-22 22:08 ` Andrew Lunn
2021-01-22 23:09   ` Sergej Bauer
2021-01-22 23:23     ` Andrew Lunn
2021-01-22 23:58       ` Sergej Bauer
2021-01-23  0:01         ` Florian Fainelli
2021-01-23  1:01           ` Sergej Bauer
2021-01-23  1:32             ` Andrew Lunn
2021-01-23  4:01               ` Sergej Bauer
2021-01-25  8:57               ` Sergej Bauer
2021-01-23  1:39             ` Florian Fainelli
2021-01-25  8:57               ` Sergej Bauer
2021-01-25 10:23       ` Sergej Bauer [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=2014021.cZaaFtpcjn@metabook \
    --to=sbauer@blackbox.su \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=arnd@arndb.de \
    --cc=bryan.whitehead@microchip.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=madalin.bucur@oss.nxp.com \
    --cc=mark.einon@gmail.com \
    --cc=masahiroy@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=simon.horman@netronome.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.