Re: [PATCH net-next 0/3] net: dsa: restore HWMON support in dsa2

2017-01-03 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: > On Tue, Jan 03, 2017 at 01:15:35PM -0500, Vivien Didelot wrote: >> The current HWMON support in DSA in embedded in the legacy code. >> Extract it to its own file and register it in the newer DSA code. > > I would really prefer not to do this

Re: [PATCH net-next 1/3] net: dsa: remove out label in dsa_switch_setup_one

2017-01-03 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: > On Tue, Jan 03, 2017 at 01:15:36PM -0500, Vivien Didelot wrote: >> The "out" label in dsa_switch_setup_one() is useless, thus remove it. > > Hi Vivien > > Missing a SOB. > > This one patch i'm happy with. Assuming we dro

[PATCH net-next 2/3] net: dsa: move HWMON support to its own file

2017-01-03 Thread Vivien Didelot
ct dsa_switch *ds); diff --git a/net/dsa/hwmon.c b/net/dsa/hwmon.c new file mode 100644 index 0000..7b3d1a9c2be2 --- /dev/null +++ b/net/dsa/hwmon.c @@ -0,0 +1,149 @@ +/* + * net/dsa/hwmon.c - HWMON subsystem support + * Copyright (c) 2014 Guenter Roeck + * Copyright (c) 2017 Vivien Didelot +

[PATCH net-next 1/3] net: dsa: remove out label in dsa_switch_setup_one

2017-01-03 Thread Vivien Didelot
The "out" label in dsa_switch_setup_one() is useless, thus remove it. --- net/dsa/dsa.c | 40 +--- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index 7899919cd9f0..89e66b623d73 100644 --- a/net/dsa/dsa.c +++ b/net

[PATCH net-next 0/3] net: dsa: restore HWMON support in dsa2

2017-01-03 Thread Vivien Didelot
The current HWMON support in DSA in embedded in the legacy code. Extract it to its own file and register it in the newer DSA code. Tested on ZII Rev B boards. Vivien Didelot (3): net: dsa: remove out label in dsa_switch_setup_one net: dsa: move HWMON support to its own file net: dsa

[PATCH net-next 3/3] net: dsa: restore HWMON support in dsa2

2017-01-03 Thread Vivien Didelot
The HWMON support was only registered in the legacy DSA code. Register it in the newer DSA code (dsa2) as well. --- net/dsa/dsa2.c | 4 1 file changed, 4 insertions(+) diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c index 5fff951a0a49..668aa2974d01 100644 --- a/net/dsa/dsa2.c +++ b/net/dsa/dsa2

[PATCH] i2c: i2c-mux-pca954x: only reset last channel on error

2016-12-16 Thread Vivien Didelot
r a negative error code or the positive number of messages executed. Only check "ret" against negative values to restore the caching. Fixes: 463e8f845cbf ("i2c: mux: pca954x: retry updating the mux selection on failure") Signed-off-by: Vivien Didelot --- drivers/i2c/muxes/i2c-

[PATCH net 1/3] net: bridge: add helper to offload ageing time

2016-12-10 Thread Vivien Didelot
it can be called under bridge lock. Signed-off-by: Vivien Didelot --- net/bridge/br_private.h | 1 + net/bridge/br_stp.c | 28 net/bridge/br_stp_if.c | 12 +++- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/net/bridge/br_private.h b/net

[PATCH net 0/3] net: bridge: fast ageing on topology change

2016-12-10 Thread Vivien Didelot
ot;8.3.5 Notifying topology changes", http://profesores.elo.utfsm.cl/~agv/elo309/doc/802.1D-1998.pdf No change since RFC: https://lkml.org/lkml/2016/10/19/828 Vivien Didelot (3): net: bridge: add helper to offload ageing time net: bridge: add helper to set topology change net: br

[PATCH net 3/3] net: bridge: shorten ageing time on topology change

2016-12-10 Thread Vivien Didelot
, http://profesores.elo.utfsm.cl/~agv/elo309/doc/802.1D-1998.pdf Signed-off-by: Vivien Didelot --- net/bridge/br_device.c | 2 +- net/bridge/br_private.h | 3 ++- net/bridge/br_stp.c | 27 +++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/

[PATCH net 2/3] net: bridge: add helper to set topology change

2016-12-10 Thread Vivien Didelot
Add a __br_set_topology_change helper to set the topology change value. This can be later extended to add actions when the topology change flag is set or cleared. Signed-off-by: Vivien Didelot --- net/bridge/br_private_stp.h | 1 + net/bridge/br_stp.c | 10 -- net/bridge

Re: [PATCH/RFC net-next] net: fec: allow "mini jumbo" frames

2016-12-10 Thread Vivien Didelot
; > Signed-off-by: Nikita Yushchenko For what it's worth, I have tested your patch on my ZII Rev B boards (see vf610-zii-dev-rev-b.dts) which have a FEC as the master net device of their DSA trees. They still work as expected. Tested-by: Vivien Didelot Thanks, Vivien

[PATCH v3 net-next v3 3/4] net: dsa: mv88e6xxx: add a soft reset operation

2016-12-05 Thread Vivien Didelot
implement these differences and introduce a mv88e6xxx_software_reset() helper to wrap it conveniently. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 72 ++-- drivers/net/dsa/mv88e6xxx/global1.c | 121 ++ drivers/net

[PATCH v3 net-next v3 2/4] net: dsa: mv88e6xxx: add helper to hardware reset

2016-12-05 Thread Vivien Didelot
Add an helper to toggle the eventual GPIO connected to the reset pin. Signed-off-by: Vivien Didelot Reviewed-by: Andrew Lunn --- drivers/net/dsa/mv88e6xxx/chip.c | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b

[PATCH v3 net-next v3 4/4] net: dsa: mv88e6xxx: add PPU operations

2016-12-05 Thread Vivien Didelot
Some Marvell chips can enable/disable the PPU on demand. This is needed to access the PHY registers when there is no indirection mechanism. Add two new ppu_enable and ppu_disable ops to describe this and finally get rid of the MV88E6XXX_FLAG_PPU* flags. Signed-off-by: Vivien Didelot

[PATCH v3 net-next v3 0/4] net: dsa: mv88e6xxx: rework reset and PPU code

2016-12-05 Thread Vivien Didelot
nges in v3: - consider 6097 as 6352 (no PPU ops and use mv88e6352_g1_reset). Changes in v2: - wait in ppu/reset ops so that ppu_polling is not needed anymore. Vivien Didelot (4): net: dsa: mv88e6xxx: add helper to disable ports net: dsa: mv88e6xxx: add helper to hardware reset net: dsa: mv88e6

[PATCH v3 net-next v3 1/4] net: dsa: mv88e6xxx: add helper to disable ports

2016-12-05 Thread Vivien Didelot
Before resetting a switch, the ports should be set to the Disabled state and the transmit queues should be drained. Add an helper to explicit that. Signed-off-by: Vivien Didelot Reviewed-by: Andrew Lunn --- drivers/net/dsa/mv88e6xxx/chip.c | 34 +++--- 1 file

Re: [PATCH v2 net-next v2 4/4] net: dsa: mv88e6xxx: add PPU operations

2016-12-05 Thread Vivien Didelot
Stefan Eichenberger writes: > Hi Vivien, > > On Mon, Dec 05, 2016 at 11:27:03AM -0500, Vivien Didelot wrote: >> @@ -3266,6 +3220,8 @@ static const struct mv88e6xxx_ops mv88e6097_ops = { >> .g1_set_cpu_port = mv88e6095_g1_set_cpu_port, >&g

[PATCH v2 net-next v2 3/4] net: dsa: mv88e6xxx: add a soft reset operation

2016-12-05 Thread Vivien Didelot
implement these differences and rename the PPU state macros to highlight the difference between 1-bit and 2-bit PPUState. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 72 ++-- drivers/net/dsa/mv88e6xxx/global1.c | 121

[PATCH v2 net-next v2 1/4] net: dsa: mv88e6xxx: add helper to disable ports

2016-12-05 Thread Vivien Didelot
Before resetting a switch, the ports should be set to the Disabled state and the transmit queues should be drained. Add an helper to explicit that. Signed-off-by: Vivien Didelot Reviewed-by: Andrew Lunn --- drivers/net/dsa/mv88e6xxx/chip.c | 34 +++--- 1 file

[PATCH v2 net-next v2 0/4] net: dsa: mv88e6xxx: rework reset and PPU code

2016-12-05 Thread Vivien Didelot
nges in v2: - wait in ppu/reset ops so that ppu_polling is not needed anymore. Vivien Didelot (4): net: dsa: mv88e6xxx: add helper to disable ports net: dsa: mv88e6xxx: add helper to hardware reset net: dsa: mv88e6xxx: add a soft reset operation net: dsa: mv88e6xxx: add PPU operations drive

[PATCH v2 net-next v2 4/4] net: dsa: mv88e6xxx: add PPU operations

2016-12-05 Thread Vivien Didelot
Some Marvell chips can enable/disable the PPU on demand. This is needed to access the PHY registers when there is no indirection mechanism. Add two new ppu_enable and ppu_disable ops to describe this and finally get rid of the MV88E6XXX_FLAG_PPU* flags. Signed-off-by: Vivien Didelot

[PATCH v2 net-next v2 2/4] net: dsa: mv88e6xxx: add helper to hardware reset

2016-12-05 Thread Vivien Didelot
Add an helper to toggle the eventual GPIO connected to the reset pin. Signed-off-by: Vivien Didelot Reviewed-by: Andrew Lunn --- drivers/net/dsa/mv88e6xxx/chip.c | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b

Re: [PATCH net-next 3/6] net: dsa: mv88e6xxx: add a software reset op

2016-12-02 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: > + /* Switch Software Reset */ > + int (*g1_reset)(struct mv88e6xxx_chip *chip); > + > > We have a collection of function pointers with port_ prefix, another > collection with stats_, and a third with ppu_, etc. And then we have > some which do not fit a s

Re: [PATCH net-next 3/6] net: dsa: mv88e6xxx: add a software reset op

2016-12-01 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> diff --git a/drivers/net/dsa/mv88e6xxx/mv88e6xxx.h >> b/drivers/net/dsa/mv88e6xxx/mv88e6xxx.h >> index ab52c37..9e51405 100644 >> --- a/drivers/net/dsa/mv88e6xxx/mv88e6xxx.h >> +++ b/drivers/net/dsa/mv88e6xxx/mv88e6xxx.h >> @@ -765,6 +765,9 @@ struct mv88e6xxx_

Re: [PATCH net-next 5/6] net: dsa: mv88e6xxx: add helper for switch ready

2016-12-01 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: > As we have seen in the past, this sort of loop is broken if we end up > sleeping for a long time. Please take the opportunity to replace it > with one of our _wait() helpers, e.g. mv88e6xxx_g1_wait() That won't work. the _wait() helpers are made to wait on self-

[PATCH net-next 4/6] net: dsa: mv88e6xxx: add a PPU polling op

2016-11-30 Thread Vivien Didelot
). Add a .ppu_polling op check this state and use it in the PPU enable/disable routines. It will also be used later in the switch reset code. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 70 +++ drivers/net/dsa/mv88e6xxx/global1.c

[PATCH net-next 6/6] net: dsa: mv88e6xxx: add PPU enable/disable ops

2016-11-30 Thread Vivien Didelot
Some Marvell chips can enable/disable the PPU on demand. This is needed to access the PHY registers when there is no indirection mechanism. Add two new ppu_enable and ppu_disable ops to describe this and finally get rid of the MV88E6XXX_FLAG_PPU* flags. Signed-off-by: Vivien Didelot

[PATCH net-next 5/6] net: dsa: mv88e6xxx: add helper for switch ready

2016-11-30 Thread Vivien Didelot
mv88e6xxx_wait_switch_ready() helper for the switch reset code. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 52 +-- drivers/net/dsa/mv88e6xxx/global1.c | 15 ++ drivers/net/dsa/mv88e6xxx/global1.h | 1 + drivers/net/dsa

[PATCH net-next 0/6] net: dsa: mv88e6xxx: rework reset and PPU code

2016-11-30 Thread Vivien Didelot
X_FLAG_PPU* flags. Vivien Didelot (6): net: dsa: mv88e6xxx: add helper to disable ports net: dsa: mv88e6xxx: add helper to hardware reset net: dsa: mv88e6xxx: add a software reset op net: dsa: mv88e6xxx: add a PPU polling op net: dsa: mv88e6xxx: add helper for switch ready net: dsa: mv88

[PATCH net-next 1/6] net: dsa: mv88e6xxx: add helper to disable ports

2016-11-30 Thread Vivien Didelot
Before resetting a switch, the ports should be set to the Disabled state and the transmit queues should be drained. Add an helper to explicit that. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 34 +++--- 1 file changed, 23 insertions(+), 11

[PATCH net-next 3/6] net: dsa: mv88e6xxx: add a software reset op

2016-11-30 Thread Vivien Didelot
implement these differences and introduce a mv88e6xxx_software_reset() helper to wrap it conveniently. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 42 --- drivers/net/dsa/mv88e6xxx/global1.c | 35

[PATCH net-next 2/6] net: dsa: mv88e6xxx: add helper to hardware reset

2016-11-30 Thread Vivien Didelot
Add an helper to toggle the eventual GPIO connected to the reset pin. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx

Re: [PATCH 2/2] net: dsa: mv88e6xxx: Add 88E6176 device tree support

2016-11-29 Thread Vivien Didelot
Hi, Uwe Kleine-König writes: > Also it seems wrong to write "marvell,mv88e6085" (only) if I know the > hardware is really a "marvell,mv88e6176". I agree. It might be complex for a user to dig into the driver in order to figure out how the switch ID is read and which compatible to choose. I've

[PATCH net-next v2 07/11] net: dsa: mv88e6xxx: add port link setter

2016-11-03 Thread Vivien Didelot
Most of the chips will have a port register control bits to force the port's link up, down, or let normal link detection occurs. Implement such operation to use it later when setting duplex, etc. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c

[PATCH net-next v2 00/11] net: dsa: mv88e6xxx: refine port operations

2016-11-03 Thread Vivien Didelot
em when needed (e.g. SPEED_MAX). Changes in v2: - Strictly use new _UNFORCED values instead of re-using _UNKNOWN ones. Vivien Didelot (11): net: dsa: mv88e6xxx: add port files net: dsa: mv88e6xxx: add port state setter net: dsa: mv88e6xxx: add port vlan map setter net: dsa: mv88e6xxx: add

[PATCH net-next v2 03/11] net: dsa: mv88e6xxx: add port vlan map setter

2016-11-03 Thread Vivien Didelot
Add a port function to access the Port Based VLAN Map register. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 14 ++ drivers/net/dsa/mv88e6xxx/port.c | 25 + drivers/net/dsa/mv88e6xxx/port.h | 2 ++ 3 files changed, 29 insertions

[PATCH net-next v2 08/11] net: dsa: mv88e6xxx: add port duplex setter

2016-11-03 Thread Vivien Didelot
Similarly to port's link, add setter to force port's half duplex, full duplex or let normal duplex detection occurs. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 17 + drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 9 + drivers/net/dsa

[PATCH net-next v2 06/11] net: dsa: mv88e6xxx: add port 802.1Q mode setter

2016-11-03 Thread Vivien Didelot
Add port functions to set the port 802.1Q mode. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 33 ++--- drivers/net/dsa/mv88e6xxx/port.c | 32 drivers/net/dsa/mv88e6xxx/port.h | 3 +++ 3 files changed, 37

[PATCH net-next v2 09/11] net: dsa: mv88e6xxx: add port's RGMII delay setter

2016-11-03 Thread Vivien Didelot
Some chips such as 88E6352 and 88E6390 can be programmed to add delays to RXCLK for IND inputs or to GTXCLK for OUTD outputs when port is in RGMII mode. Add a port function to program such delays according to the provided PHY interface mode. Signed-off-by: Vivien Didelot --- drivers/net/dsa

[PATCH net-next v2 01/11] net: dsa: mv88e6xxx: add port files

2016-11-03 Thread Vivien Didelot
The Marvell switches contains one internal SMI device per port, called "Port Registers". Depending on the model, the addresses of these devices start from 0x0, 0x8 or 0x10. Start moving Port Registers specific code to their own files. Signed-off-by: Vivien Didelot --- drivers/net/dsa

[PATCH net-next v2 11/11] net: dsa: mv88e6xxx: setup port's MAC

2016-11-03 Thread Vivien Didelot
Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 140 +-- 1 file changed, 60 insertions(+), 80 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 23c05e3..c8f824d 100644 --- a/drivers/net/dsa/m

[PATCH net-next v2 10/11] net: dsa: mv88e6xxx: add port's MAC speed setter

2016-11-03 Thread Vivien Didelot
ted ports and speeds. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 33 ++-- drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 24 +- drivers/net/dsa/mv88e6xxx/port.c | 138 ++ drivers/net/dsa/mv88e6xxx/port.h | 6 ++ 4 fi

[PATCH net-next v2 02/11] net: dsa: mv88e6xxx: add port state setter

2016-11-03 Thread Vivien Didelot
Add the port STP state setter to the port files. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 49 drivers/net/dsa/mv88e6xxx/port.c | 31 + drivers/net/dsa/mv88e6xxx/port.h | 2 ++ 3 files changed, 37

[PATCH net-next v2 05/11] net: dsa: mv88e6xxx: add port PVID accessors

2016-11-03 Thread Vivien Didelot
Add port functions to access the ports default VID. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 51 drivers/net/dsa/mv88e6xxx/port.c | 38 ++ drivers/net/dsa/mv88e6xxx/port.h | 3 +++ 3 files changed

[PATCH net-next v2 04/11] net: dsa: mv88e6xxx: add port FID accessors

2016-11-03 Thread Vivien Didelot
Add functions to port files to access the ports default FID. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 77 +++- drivers/net/dsa/mv88e6xxx/port.c | 67 ++ drivers/net/dsa/mv88e6xxx/port.h | 3 ++ 3

Re: [PATCH net-next 07/11] net: dsa: mv88e6xxx: add port link setter

2016-11-02 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: > On Wed, Nov 02, 2016 at 02:07:09AM +0100, Vivien Didelot wrote: >> Hi Andrew, >> >> Andrew Lunn writes: >> >> >> +#define LINK_UNKNOWN -1 >> >> + >> >> + /* Port's MAC link state >

Re: [PATCH net-next 08/11] net: dsa: mv88e6xxx: add port duplex setter

2016-11-01 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> int (*port_set_link)(struct mv88e6xxx_chip *chip, int port, int link); >> + >> +/* Port's MAC duplex mode >> + * >> + * Use DUPLEX_HALF or DUPLEX_FULL to force half or full duplex, or >> + * DUPLEX_UNKNOWN for normal duplex detection. >> +

Re: [PATCH net-next 07/11] net: dsa: mv88e6xxx: add port link setter

2016-11-01 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> +#define LINK_UNKNOWN-1 >> + >> +/* Port's MAC link state >> + * LINK_UNKNOWN for normal link detection, 0 to force link down, >> + * otherwise force link up. >> + */ >> +int (*port_set_link)(struct mv88e6xxx_chip *chip, int port, int

Re: [PATCH net-next 04/11] net: dsa: mv88e6xxx: add port FID accessors

2016-11-01 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> --- a/drivers/net/dsa/mv88e6xxx/port.c >> +++ b/drivers/net/dsa/mv88e6xxx/port.c >> @@ -61,6 +61,8 @@ int mv88e6xxx_port_set_state(struct mv88e6xxx_chip *chip, >> int port, u8 state) >> return 0; >> } >> >> +/* Offset 0x05: Port Control 1 */ >> + >> /*

[PATCH net-next 11/11] net: dsa: mv88e6xxx: setup port's MAC

2016-10-31 Thread Vivien Didelot
Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 138 --- 1 file changed, 58 insertions(+), 80 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 23c05e3..56d60fd 100644 --- a/drivers/net/dsa/m

[PATCH net-next 04/11] net: dsa: mv88e6xxx: add port FID accessors

2016-10-31 Thread Vivien Didelot
Add functions to port files to access the ports default FID. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 77 +++- drivers/net/dsa/mv88e6xxx/port.c | 67 ++ drivers/net/dsa/mv88e6xxx/port.h | 3 ++ 3

[PATCH net-next 02/11] net: dsa: mv88e6xxx: add port state setter

2016-10-31 Thread Vivien Didelot
Add the port STP state setter to the port files. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 49 drivers/net/dsa/mv88e6xxx/port.c | 31 + drivers/net/dsa/mv88e6xxx/port.h | 2 ++ 3 files changed, 37

[PATCH net-next 03/11] net: dsa: mv88e6xxx: add port vlan map setter

2016-10-31 Thread Vivien Didelot
Add a port function to access the Port Based VLAN Map register. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 14 ++ drivers/net/dsa/mv88e6xxx/port.c | 25 + drivers/net/dsa/mv88e6xxx/port.h | 2 ++ 3 files changed, 29 insertions

[PATCH net-next 01/11] net: dsa: mv88e6xxx: add port files

2016-10-31 Thread Vivien Didelot
The Marvell switches contains one internal SMI device per port, called "Port Registers". Depending on the model, the addresses of these devices start from 0x0, 0x8 or 0x10. Start moving Port Registers specific code to their own files. Signed-off-by: Vivien Didelot --- drivers/net/dsa

[PATCH net-next 07/11] net: dsa: mv88e6xxx: add port link setter

2016-10-31 Thread Vivien Didelot
Most of the chips will have a port register control bits to force the port's link up, down, or let normal link detection occurs. Implement such operation to use it later when setting duplex, etc. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c

[PATCH net-next 05/11] net: dsa: mv88e6xxx: add port PVID accessors

2016-10-31 Thread Vivien Didelot
Add port functions to access the ports default VID. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 51 drivers/net/dsa/mv88e6xxx/port.c | 38 ++ drivers/net/dsa/mv88e6xxx/port.h | 3 +++ 3 files changed

[PATCH net-next 08/11] net: dsa: mv88e6xxx: add port duplex setter

2016-10-31 Thread Vivien Didelot
Similarly to port's link, add setter to force port's half duplex, full duplex or let normal duplex detection occurs. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 17 + drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 7 +++ drivers/net/dsa

[PATCH net-next 09/11] net: dsa: mv88e6xxx: add port's RGMII delay setter

2016-10-31 Thread Vivien Didelot
Some chips such as 88E6352 and 88E6390 can be programmed to add delays to RXCLK for IND inputs or to GTXCLK for OUTD outputs when port is in RGMII mode. Add a port function to program such delays according to the provided PHY interface mode. Signed-off-by: Vivien Didelot --- drivers/net/dsa

[PATCH net-next 06/11] net: dsa: mv88e6xxx: add port 802.1Q mode setter

2016-10-31 Thread Vivien Didelot
Add port functions to set the port 802.1Q mode. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 33 ++--- drivers/net/dsa/mv88e6xxx/port.c | 32 drivers/net/dsa/mv88e6xxx/port.h | 3 +++ 3 files changed, 37

[PATCH net-next 10/11] net: dsa: mv88e6xxx: add port's MAC speed setter

2016-10-31 Thread Vivien Didelot
ted ports and speeds. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 33 ++-- drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 23 +- drivers/net/dsa/mv88e6xxx/port.c | 138 ++ drivers/net/dsa/mv88e6xxx/port.h | 6 ++ 4 fi

[PATCH net-next 00/11] net: dsa: mv88e6xxx: refine port operations

2016-10-31 Thread Vivien Didelot
em when needed (e.g. SPEED_MAX). Vivien Didelot (11): net: dsa: mv88e6xxx: add port files net: dsa: mv88e6xxx: add port state setter net: dsa: mv88e6xxx: add port vlan map setter net: dsa: mv88e6xxx: add port FID accessors net: dsa: mv88e6xxx: add port PVID accessors net: dsa: mv88e6xxx: add

[RFC net 1/3] net: bridge: add helper to offload ageing time

2016-10-19 Thread Vivien Didelot
it can be called under bridge lock. Signed-off-by: Vivien Didelot --- net/bridge/br_private.h | 1 + net/bridge/br_stp.c | 28 net/bridge/br_stp_if.c | 12 +++- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/net/bridge/br_private.h b/net

[RFC net 2/3] net: bridge: add helper to set topology change

2016-10-19 Thread Vivien Didelot
Add a __br_set_topology_change helper to set the topology change value. This can be later extended to add actions when the topology change flag is set or cleared. Signed-off-by: Vivien Didelot --- net/bridge/br_private_stp.h | 1 + net/bridge/br_stp.c | 10 -- net/bridge

[RFC net 3/3] net: dsa: shorten ageing time on topology change

2016-10-19 Thread Vivien Didelot
, http://profesores.elo.utfsm.cl/~agv/elo309/doc/802.1D-1998.pdf Signed-off-by: Vivien Didelot --- net/bridge/br_device.c | 2 +- net/bridge/br_private.h | 3 ++- net/bridge/br_stp.c | 27 +++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/

[RFC net 0/3] net: bridge: fast ageing on topology change

2016-10-19 Thread Vivien Didelot
ot;8.3.5 Notifying topology changes", http://profesores.elo.utfsm.cl/~agv/elo309/doc/802.1D-1998.pdf [ Feedbacks are needed, especially for the usage of the bridge lock and the defered ageing time attribute. It works fine so far but might raise concerns. ] Vivien Didelot (3): net: bridg

[PATCH net-next 09/10] net: dsa: mv88e6xxx: add set_switch_mac to ops

2016-09-29 Thread Vivien Didelot
Add a set_switch_mac chip-wide function to mv88e6xxx_ops and remove MV88E6XXX_FLAG_G2_SWITCH_MAC flags. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 28 +--- drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 8 ++-- 2 files changed, 23 insertions

[PATCH net-next 02/10] net: dsa: mv88e6xxx: abstract REG_GLOBAL2

2016-09-29 Thread Vivien Didelot
Similarly to the ports, phys, and Global SMI devices, abstract the SMI device address of the Global 2 registers in a few g2 static helpers. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/global2.c | 78 ++- drivers/net/dsa/mv88e6xxx/mv88e6xxx.h

[PATCH net-next 01/10] net: dsa: mv88e6xxx: add global1 helpers

2016-09-29 Thread Vivien Didelot
mv88e6xxx_g1_{read,write} and mv88e6xxx_g1_wait helpers in a new global1.c file. This patch finally removes _mv88e6xxx_reg_{read,write}, in favor on the appropriate helpers. No functional changes here. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/Makefile| 1 + drivers/net

[PATCH net-next 08/10] net: dsa: mv88e6xxx: add chip-wide ops

2016-09-29 Thread Vivien Didelot
Introduce a mv88e6xxx_ops structure to describe supported chip-wide functions and assign the correct variant to the chip models. For the moment, add only PHY access routines. This allows to get rid of the PHY ops structures and the usage of PHY flags. Signed-off-by: Vivien Didelot --- drivers

[PATCH net-next 07/10] net: dsa: mv88e6xxx: rename mv88e6xxx_ops

2016-09-29 Thread Vivien Didelot
need the mv88e6xxx_ops name for future chip-wide operation structure, thus rename mv88e6xxx_ops to more explicit mv88e6xxx_bus_ops. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 10 +- drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 8 2 files changed, 9

[PATCH net-next 06/10] net: dsa: mv88e6xxx: rename mv88e6xxx_vtu_stu_entry

2016-09-29 Thread Vivien Didelot
The STU (if the switch has one) is abstracted and accessed through the VTU operations and data registers. Thus rename the mv88e6xxx_vtu_stu_entry struct to mv88e6xxx_vtu_entry. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 46

[PATCH net-next 04/10] net: dsa: mv88e6xxx: expose mv88e6xxx_num_databases

2016-09-29 Thread Vivien Didelot
The mv88e6xxx_num_databases will be used by shared code, so move it inline to the header file. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 5 - drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 5 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a

[PATCH net-next 05/10] net: dsa: mv88e6xxx: add mv88e6xxx_num_ports helper

2016-09-29 Thread Vivien Didelot
Add an mv88e6xxx_num_ports helper instead of digging in the chip info structure. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 30 +++--- drivers/net/dsa/mv88e6xxx/global2.c | 8 drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 5 + 3

[PATCH net-next 10/10] net: dsa: mv88e6xxx: add eeprom ops

2016-09-29 Thread Vivien Didelot
Remove EEPROM flags in favor of new {get,set}_eeprom chip-wide functions in the mv88e6xxx_ops structure. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 34 +- drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 16 +--- 2 files changed

[PATCH net-next 00/10] net: dsa: mv88e6xxx: Global (1) cosmetics

2016-09-29 Thread Vivien Didelot
*val); int (*phy_write)(struct mv88e6xxx_chip *chip, int addr, int reg, u16 val); }; Future patchsets will add ATU/VTU ops, software reset, etc. Vivien Didelot (10): net: dsa: mv88e6xxx: add global1 helpers net: dsa: mv88e6xxx: abstract REG_GLOBAL2 net

[PATCH net-next 03/10] net: dsa: mv88e6xxx: add flags for FID registers

2016-09-29 Thread Vivien Didelot
Add flags to describe the presence of Global 1 ATU FID register (0x01) and VTU FID register (0x02), instead of checking families. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 16 +++- drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 24 2

[tip:locking/urgent] locking/hung_task: Fix typo in CONFIG_DETECT_HUNG_TASK help text

2016-09-22 Thread tip-bot for Vivien Didelot
Commit-ID: 96b03ab86d843524ec4aed7fe0ceef412c684c68 Gitweb: http://git.kernel.org/tip/96b03ab86d843524ec4aed7fe0ceef412c684c68 Author: Vivien Didelot AuthorDate: Thu, 22 Sep 2016 16:55:13 -0400 Committer: Ingo Molnar CommitDate: Fri, 23 Sep 2016 07:30:04 +0200 locking/hung_task: Fix

[PATCH net-next 0/4] net: dsa: add port fast ageing

2016-09-22 Thread Vivien Didelot
port_fast_age operation to dsa_switch_ops, to move this logic to the DSA layer and keep drivers simple. b53 and mv88e6xxx are updated accordingly. Vivien Didelot (4): net: dsa: add port STP state helper net: dsa: add port fast ageing net: dsa: b53: implement DSA port fast ageing net: dsa

[PATCH net-next 1/4] net: dsa: add port STP state helper

2016-09-22 Thread Vivien Didelot
Add a void helper to set the STP state of a port, checking first if the required routine is provided by the driver. Signed-off-by: Vivien Didelot --- net/dsa/slave.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/net/dsa/slave.c b/net/dsa/slave.c index

[PATCH net-next 3/4] net: dsa: b53: implement DSA port fast ageing

2016-09-22 Thread Vivien Didelot
Remove the fast ageing logic from b53_br_set_stp_state and implement the new DSA switch port_fast_age operation instead. Signed-off-by: Vivien Didelot --- drivers/net/dsa/b53/b53_common.c | 31 +++ 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a

[PATCH net-next 2/4] net: dsa: add port fast ageing

2016-09-22 Thread Vivien Didelot
operation to dsa_switch_ops, to move this logic to the DSA layer and keep drivers simple. Signed-off-by: Vivien Didelot --- include/net/dsa.h | 2 ++ net/dsa/slave.c | 18 ++ 2 files changed, 20 insertions(+) diff --git a/include/net/dsa.h b/include/net/dsa.h index 7556646..b122196

[PATCH] lib: debug: fix typo in DETECT_HUNG_TASK help text

2016-09-22 Thread Vivien Didelot
Fix the indefinitiley -> indefinitely typo in Kconfig.debug. Signed-off-by: Vivien Didelot --- lib/Kconfig.debug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index e2894b2..ee9e9a3 100644 --- a/lib/Kconfig.debug +++ b/

[PATCH net-next 4/4] net: dsa: mv88e6xxx: implement DSA port fast ageing

2016-09-22 Thread Vivien Didelot
Now that the DSA layer handles port fast ageing on correct STP change, simplify _mv88e6xxx_port_state and implement mv88e6xxx_port_fast_age. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 45 1 file changed, 23 insertions(+), 22

Re: [PATCH net-next] net: dsa: mv88e6xxx: handle multiple ports in ATU

2016-09-19 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: > On Mon, Sep 19, 2016 at 07:56:11PM -0400, Vivien Didelot wrote: >> An address can be loaded in the ATU with multiple ports, for instance >> when adding multiple ports to a Multicast group with "bridge mdb". >> >> The cu

Re: [PATCH net-next] net: dsa: mv88e6xxx: handle multiple ports in ATU

2016-09-19 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: > Hi Vivien > >> +do { >> +err = _mv88e6xxx_atu_getnext(chip, fid, &next); >> +if (err) >> +return err; >> + >> +if (next.state == GLOBAL_ATU_DATA_STATE_UNUSED) >> +break; >> + >> +

[PATCH net-next] net: dsa: mv88e6xxx: handle multiple ports in ATU

2016-09-19 Thread Vivien Didelot
e entry back in the ATU. Note that the required _mv88e6xxx_atu_getnext function is defined below mv88e6xxx_port_db_load_purge, so forward-declare it for the moment. The ATU code will be isolated in future patches. Fixes: 83dabd1fa84c ("net: dsa: mv88e6xxx: make switchdev DB ops generic&quo

Re: [PATCH 3/3] net-next: dsa: add new driver for qca8xxx family

2016-09-13 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> ok, i will simply substract 1 from the phy_addr inside the mdio >> callbacks. this would make the code more readable and make the DT >> binding compliant with the ePAPR spec. > > It does however need well commenting. It is setting a trap for anybody > who puts a

Re: [PATCH V3] net-next: dsa: add FIB support

2016-09-13 Thread Vivien Didelot
Hi John, John Crispin writes: > i sent an email to Jiri earlier today and he asked me to drop this > until his notification series got merged. That makes sense then. So David should ignore this for the moment. Thanks, Vivien

Re: [PATCH V3] net-next: dsa: add FIB support

2016-09-13 Thread Vivien Didelot
Hi John, John Crispin writes: > @@ -237,6 +237,7 @@ struct switchdev_obj; > struct switchdev_obj_port_fdb; > struct switchdev_obj_port_mdb; > struct switchdev_obj_port_vlan; > +struct switchdev_obj_ipv4_fib; Can you keep it ordered please (put obj_ipv4 above port_fdb). > > struct dsa_swi

Re: [PATCH net-next] net: bridge: add helper to call /sbin/bridge-stp

2016-09-09 Thread Vivien Didelot
Hi Stephen, Stephen Hemminger writes: > On Thu, 8 Sep 2016 12:50:43 -0400 > Vivien Didelot wrote: > >> If /sbin/bridge-stp is available on the system, bridge tries to execute >> it instead of the kernel implementation when starting/stopping STP. >> >> If anyt

[PATCH net-next] net: bridge: add helper to call /sbin/bridge-stp

2016-09-08 Thread Vivien Didelot
on br0: failed to start userspace STP (256) # dmesg br0: /sbin/bridge-stp exited with code 1 br0: failed to start userspace STP (256) br0: using kernel STP Signed-off-by: Vivien Didelot --- net/bridge/br_stp_if.c | 43 +++ 1 file changed

[PATCH net-next v2 1/3] net: dsa: mv88e6xxx: fix module naming

2016-09-02 Thread Vivien Didelot
Since the mv88e6xxx.c file has been renamed, the driver compiled as a module is called chip.ko instead of mv88e6xxx.ko. Fix this. Fixes: fad09c73c270 ("net: dsa: mv88e6xxx: rename single-chip support") Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/Makefile | 3 ++- 1 fi

[PATCH net-next v2 0/3] net: dsa: mv88e6xxx: isolate Global2 support

2016-09-02 Thread Vivien Didelot
ch as home routers embedding Ethernet chips without Global2 support. It is present on most recent chips, thus enable its support by default. Changes in v2: fail probe if GLOBAL2 is required but not enabled. Vivien Didelot (3): net: dsa: mv88e6xxx: fix module naming net: dsa: mv88e6xxx: move Gl

[PATCH net-next v2 3/3] net: dsa: mv88e6xxx: make global2 code optional

2016-09-02 Thread Vivien Didelot
present on most recent chips, thus enable its support by default. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/Kconfig | 11 +++ drivers/net/dsa/mv88e6xxx/Makefile | 2 +- drivers/net/dsa/mv88e6xxx/chip.c| 4 +++ drivers/net/dsa/mv88e6xxx/global2.h | 58

[PATCH net-next v2 2/3] net: dsa: mv88e6xxx: move Global2 code

2016-09-02 Thread Vivien Didelot
igned-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/Makefile| 1 + drivers/net/dsa/mv88e6xxx/chip.c | 463 + drivers/net/dsa/mv88e6xxx/global2.c | 471 ++ drivers/net/dsa/mv88e6xxx/global2.h | 30 +++ drivers/ne

Re: [PATCH net-next 3/3] net: dsa: mv88e6xxx: make global2 code optional

2016-09-02 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> I agree. Does the following snippet looks OK? >> >> >> #ifndef CONFIG_NET_DSA_MV88E6XXX_GLOBAL2 >> if (mv88e6xxx_has(chip, MV88E6XXX_FLAG_GLOBAL2)) { >> dev_err(chip->dev, "Missing support for Global 2 >> registers\n"); > >

Re: [PATCH net-next 3/3] net: dsa: mv88e6xxx: make global2 code optional

2016-09-02 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> What do you think? > > I think the probe() needs to fail with a very obvious error message > saying you need to recompile your kernel with option XYZ enabled in > order to support this switch, when the optional stuff is not > optional... I agree. Does the follo

Re: [PATCH net-next 3/3] net: dsa: mv88e6xxx: make global2 code optional

2016-09-02 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: > On Fri, Sep 02, 2016 at 08:08:19AM -0400, Vivien Didelot wrote: >> Since not every chip has a Global2 set of registers, make its support >> optional, in which case the related functions will return -EOPNOTSUPP. >> >> This also allow

[PATCH net-next 2/3] net: dsa: mv88e6xxx: move Global2 code

2016-09-02 Thread Vivien Didelot
igned-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/Makefile| 1 + drivers/net/dsa/mv88e6xxx/chip.c | 461 + drivers/net/dsa/mv88e6xxx/global2.c | 470 ++ drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 18 ++ 4 files ch

<    4   5   6   7   8   9   10   11   12   13   >