Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: fix RGMII-ID port setup

2019-08-13 Thread Andrew Lunn
On Tue, Aug 13, 2019 at 05:44:16PM +0200, Marek Behún wrote: > Hi Andrew, > > > We should read the switch registers. I think you can set the defaults > > using strapping pins. And in general, the driver always reads state > > from the hardware rather than caching it. > > hmm. The cmode is cached

Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: fix RGMII-ID port setup

2019-08-13 Thread Marek Behún
On Tue, 13 Aug 2019 17:44:16 +0200 Marek Behún wrote: > Hi Andrew, > > > We should read the switch registers. I think you can set the > > defaults using strapping pins. And in general, the driver always > > reads state from the hardware rather than caching it. > > hmm. The cmode is cached for

Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: fix RGMII-ID port setup

2019-08-13 Thread Marek Behún
Hi Andrew, > We should read the switch registers. I think you can set the defaults > using strapping pins. And in general, the driver always reads state > from the hardware rather than caching it. hmm. The cmode is cached for each port, though. For example mv88e6390x_port_set_cmode compares the n

Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: fix RGMII-ID port setup

2019-08-12 Thread Sergei Shtylyov
Hello! On 11.08.2019 18:08, Marek Behún wrote: The mv88e6xxx_port_setup_mac looks if one of the {link, speed, duplex} parameters is being changed from the current setting, and if not, does not do anything. This test is wrong in some situations: this method also has the mode argument, which can

Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: fix RGMII-ID port setup

2019-08-11 Thread Andrew Lunn
> what if we added a phy_mode member to struct mv88e6xxx_port, and either > set it to PHY_INTERFACE_MODE_NA in mv88e6xxx_setup, or implemented > methods for converting the switch register values to > PHY_INTERFACE_MODE_* values. We should read the switch registers. I think you can set the defaults

Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: fix RGMII-ID port setup

2019-08-11 Thread Marek Behun
On Sun, 11 Aug 2019 17:31:53 +0200 Andrew Lunn wrote: > On Sun, Aug 11, 2019 at 05:08:11PM +0200, Marek Behún wrote: > > The mv88e6xxx_port_setup_mac looks if one of the {link, speed, duplex} > > parameters is being changed from the current setting, and if not, does > > not do anything. This test

Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: fix RGMII-ID port setup

2019-08-11 Thread Andrew Lunn
On Sun, Aug 11, 2019 at 05:08:11PM +0200, Marek Behún wrote: > The mv88e6xxx_port_setup_mac looks if one of the {link, speed, duplex} > parameters is being changed from the current setting, and if not, does > not do anything. This test is wrong in some situations: this method also > has the mode ar

[PATCH net-next 1/2] net: dsa: mv88e6xxx: fix RGMII-ID port setup

2019-08-11 Thread Marek Behún
The mv88e6xxx_port_setup_mac looks if one of the {link, speed, duplex} parameters is being changed from the current setting, and if not, does not do anything. This test is wrong in some situations: this method also has the mode argument, which can also be changed. For example on Turris Omnia, the