[PATCH net-next 09/17] net: dsa: Split up creating/destroying of DSA and CPU ports

2016-06-03 Thread Andrew Lunn
. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- rfc->v1: * Extend commit message with comment about wrong of_node_put() * Fix destroy of cpu and dsa ports. --- net/dsa/dsa.c | 86 -- net/dsa/dsa_priv.h | 3 ++ 2 files ch

[PATCH net-next 12/17] net: dsa: Make mdio bus optional

2016-06-03 Thread Andrew Lunn
The switch may want to instantiate its own MDIO bus. Only do it centrally if the switch has not already created one, and the read op is implemented. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- net/dsa/dsa.c | 24 +--- 1 file changed, 13 insertions(+), 11 del

[PATCH net-next 11/17] net: dsa: Refactor selection of tag ops into a function

2016-06-03 Thread Andrew Lunn
Replace the two switch statements with an array lookup, and store the result in the dsa tree structure. The drivers no longer need to know the selected tag protocol, so remove it from the dsa switch structure. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- rfc->v1: Rename _DSA

Re: [PATCH v3 3/7] binding: mdio-mux: Add DT binding doc for Broadcom MDIO bus mutiplexer

2016-06-03 Thread Andrew Lunn
needs to select these two > +properties as well to generate desired MDIO trascation on appropriate bus. > + nit pick: transactions Reviewed-by: Andrew Lunn <and...@lunn.ch> Andrew

[PATCH net-next 13/17] net: dsa: mv88e6xxx: Rename _phy_ to _mdio_

2016-06-03 Thread Andrew Lunn
these functions, remove some of the _ prefixes, which we are deprecating. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- drivers/net/dsa/mv88e6xxx.c | 126 ++-- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/drivers/net/dsa/mv88e6x

[PATCH net-next 17/17] net: dsa: Document new binding

2016-06-03 Thread Andrew Lunn
Add the new binding to the documentation of the existing binding. Mark the old binding as deprecated. Signed-off-by: Andrew Lunn <and...@lunn.ch> Signed-off-by: Florian Fainelli <f.faine...@gmail.com> --- Documentation/devicetree/bindings/net/dsa/dsa.txt | 278 ++

[PATCH net-next 02/17] net: dsa: mv88e6xxx: fix circular lock in PPU work

2016-06-03 Thread Andrew Lunn
From: Vivien Didelot Lock debugging shows that there is a possible circular lock in the PPU work code. Switch the lock order of smi_mutex and ppu_mutex to fix this. Here's the full trace: [4.341325]

[PATCH net-next 10/17] net: dsa: mv88e6xxx: Only support EDSA tagging

2016-06-03 Thread Andrew Lunn
The merged driver no longer offers the option to use DSA tagging. So remove the code to setup the switch to do DSA tagging and hard code the use of EDSA. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- drivers/net/dsa/mv88e6xxx.c | 8 ++-- 1 file changed, 2 insertions(+), 6 del

[PATCH net-next 07/17] net: dsa: Remove dynamic allocate of routing table

2016-06-03 Thread Andrew Lunn
With a maximum of four switches, the size of the routing table is the same as the pointer to it. Removing it makes the code simpler. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- drivers/net/dsa/mv88e6xxx.c | 3 +-- include/net/dsa.h | 9 - net/dsa/dsa.c

Re: [PATCH v3 5/7] net:mdio-mux: Add MDIO mux driver for iProc SoCs

2016-06-03 Thread Andrew Lunn
On Fri, Jun 03, 2016 at 08:56:06PM +0530, Pramod Kumar wrote: > iProc based SoCs supports the integrated mdio multiplexer which > has the bus selection as well as mdio transaction generation logic > inside. > > This mutiplexer has child buses for PCIe, SATA, USB and ETH. These multiplexer >

[PATCH net-next 05/17] net: dsa: Add a ports structure and use it in the switch structure

2016-06-03 Thread Andrew Lunn
There are going to be more per-port members added to the switch structure. So add a port structure and move the netdev into it. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- drivers/net/dsa/bcm_sf2.c | 4 ++-- drivers/net/dsa/mv88e6xxx.c | 27 --- include/net

[PATCH net-next 01/17] net: dsa: slave: chip data is optional, don't dereference NULL

2016-06-03 Thread Andrew Lunn
The new binding does not make use of dsa_chip_data, a.k.a cd. When retrieving the size of the EEPROM attached to a switch, don't assume there is a cd attached to the switch structure. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- net/dsa/slave.c | 2 +- 1 file changed, 1 insertion

[PATCH net-next 16/17] arm: dt: vf610-zii-devel-b: Make use of new DSA binding

2016-06-03 Thread Andrew Lunn
Hang the three switches of the three MDIO busses using the new DSA binding. Also, make use of the mdio-bus and explicitly list the phys on one device. This is not required, but good for testing. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- arch/arm/boot/dts/vf610-zii-dev-rev-b.dts

[PATCH net-next 06/17] net: dsa: Move port device node into port structure

2016-06-03 Thread Andrew Lunn
, this is reversed, the switches exist first, and the interconnections between the switches is derived from the individual switch bindings. Thus this chip data structure becomes unneeded. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- include/net/dsa.h | 1 + net/dsa/dsa.c | 8 n

[PATCH net-next 04/17] net: dsa: tag_{e}dsa.c: Remove dependency on platform data

2016-06-03 Thread Andrew Lunn
ure there is a valid dsa_switch for this packet. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- net/dsa/tag_dsa.c | 6 +- net/dsa/tag_edsa.c | 6 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/net/dsa/tag_dsa.c b/net/dsa/tag_dsa.c index aa780e4ac0bd..f9832f0976

[PATCH net-next 15/17] net: dsa: Add new binding implementation

2016-06-03 Thread Andrew Lunn
which can be embedded into any type of node on a bus to represent one switch device, and its links to other switches. Signed-off-by: Andrew Lunn <and...@lunn.ch> Signed-off-by: Florian Fainelli <f.faine...@gmail.com> --- drivers/net/dsa/mv88e6xxx.c | 7 + include/net/dsa.h |

[PATCH net-next 03/17] net: dsa: slave: Remove MDIO address from switch MDIO bus name

2016-06-03 Thread Andrew Lunn
the MDIO address. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- net/dsa/slave.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 135a91706755..f640a48a6ff3 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -49,8 +49,7 @

Re: [PATCH v3 RESEND 0/7] Add MDIO bus multiplexer support for iProc SoCs

2016-06-03 Thread Andrew Lunn
> Reason for resend: > -Rebased on v4.7-rc1 How do you see this getting merged? Via netdev? If so, you should be based on net-next/master, not v4.7-rc1. Andrew

[PATCH net-next 08/17] net: dsa: Copy the routing table into the switch structure

2016-06-03 Thread Andrew Lunn
The new binding will not have a chip data structure, it will place the routing directly into the switch structure. To enable backwards compatibility, copy the routing from the chip data into the switch structure. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- drivers/net/dsa/mv88e6xxx.

Re: [PATCH v3 7/7] phy: Add Northstar2 PCI Phy support

2016-06-03 Thread Andrew Lunn
t; Signed-off-by: Pramod Kumar <pramod.ku...@broadcom.com> Reviewed-by: Andrew Lunn <and...@lunn.ch> Andrew

[PATCH net-next 14/17] net: dsa: mv88e6xxx: Refactor MDIO so driver registers mdio bus

2016-06-03 Thread Andrew Lunn
Have the switch driver register its own MDIO bus. This allows for an mdio property in the device tree, with child nodes for phys, which can be referenced via phandles, etc. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- drivers/net/dsa/mv88e6xxx.

Re: [PATCH v2 2/7] DT: phy.txt: Add mdio-integrated-mux property

2016-06-02 Thread Andrew Lunn
On Thu, Jun 02, 2016 at 06:27:03PM -0500, Rob Herring wrote: > On Tue, May 31, 2016 at 07:06:36PM +0530, Pramod Kumar wrote: > > This property is used by integrated MDIO multiplexer > > which has bus selection and mdio transaction generation logic, > > integrated inside. > > > > Signed-off-by:

[PATCH] net: igb: Only dma sync frame length

2016-06-03 Thread Andrew Lunn
operations bound and reduces CPU load for TCP transmit. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- drivers/net/ethernet/intel/igb/igb_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_

[PATCHv2 net-next] net: igb: Only dma sync frame length

2016-06-03 Thread Andrew Lunn
operations bound and reduces CPU load for TCP transmit. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- v2: Christmas tree the local variables Pass size into igb_add_rx_frag() rather than repeating the endiness swap. --- drivers/net/ethernet/intel/igb/igb_main.c | 7 --- 1 file changed, 4 inse

Re: [PATCH 09/12] net: mediatek: increase watchdog_timeo

2016-06-05 Thread Andrew Lunn
On Sun, Jun 05, 2016 at 08:33:02AM +0200, John Crispin wrote: > During stress testing, after reducing the threshold value, we have seen > TX timeouts that were caused by the watchdog_timeo value being too low. > Increase the value to 5 * HZ which is a value commonly used by many other > drivers.

Re: [PATCH net-next v4 5/6] net: dsa: Initialize CPU port ethtool ops per tree

2016-06-08 Thread Andrew Lunn
e operations teardown restores the master netdev's ethtool_ops to its > original ethtool_ops pointer (typically within the Ethernet driver) > > Signed-off-by: Florian Fainelli <f.faine...@gmail.com> Reviewed-by: Andrew Lunn <and...@lunn.ch> Andrew

Re: [PATCH net-next v4 0/6] net: dsa: misc improvements

2016-06-08 Thread Andrew Lunn
On Tue, Jun 07, 2016 at 04:32:37PM -0700, Florian Fainelli wrote: > Hi all, > > This patch series builds on top of Andrew's "New DSA bind, switches as > devices" > patch set and does the following: Hi Florian Thanks for the patience with my nit picking. This is now ready to be applied.

Re: [PATCH] net: stmmac: dwmac-rk: keep PHY up for WoL

2016-06-08 Thread Andrew Lunn
On Wed, Jun 08, 2016 at 03:25:38PM -0700, Vincent Palatin wrote: > On Tue, Jun 7, 2016 at 12:23 AM, Giuseppe CAVALLARO > wrote: > > Hello > > > > On 6/3/2016 7:29 PM, Vincent Palatin wrote: > >> > >> Do not shutdown the PHY if Wake-on-Lan is enabled, else it cannot wake >

Re: [PATCH net-next v3 5/6] net: dsa: Initialize CPU port ethtool ops per tree

2016-06-07 Thread Andrew Lunn
On Tue, Jun 07, 2016 at 03:13:35PM -0700, Florian Fainelli wrote: > On 06/07/2016 02:51 PM, Andrew Lunn wrote: > >> +int dsa_cpu_port_ethtool_setup(struct dsa_switch_tree *dst, > >> + struct dsa_switch *ds) > >> +{ > >> + st

Re: [PATCH net-next v3 5/6] net: dsa: Initialize CPU port ethtool ops per tree

2016-06-07 Thread Andrew Lunn
> +int dsa_cpu_port_ethtool_setup(struct dsa_switch_tree *dst, > +struct dsa_switch *ds) > +{ > + struct net_device *master; > + struct ethtool_ops *cpu_ops; > + > + master = ds->dst->master_netdev; You pass in dst as a parameter, and then don't use it! >

Re: [PATCH net-next v3 3/6] net: dsa: Provide a slave MII bus if needed

2016-06-07 Thread Andrew Lunn
On Tue, Jun 07, 2016 at 02:06:53PM -0700, Florian Fainelli wrote: > Mimic what net/dsa/dsa.c does and provide a slave MII bus by default > which will be created if the driver implements a phy_read method. > > Signed-off-by: Florian Fainelli <f.faine...@gmail.com> Review

Re: [PATCH net-next v3 2/6] net: dsa: Initialize ds->enabled_port_mask and ds->phys_mii_mask

2016-06-07 Thread Andrew Lunn
sa_get_ports_dn(). > > Signed-off-by: Florian Fainelli <f.faine...@gmail.com> Reviewed-by: Andrew Lunn <and...@lunn.ch> Andrew

Re: [PATCH net-next v2 2/5] net: dsa: Initialize ds->enabled_port_mask and ds->phys_mii_mask

2016-06-07 Thread Andrew Lunn
On Tue, Jun 07, 2016 at 02:22:12AM +0200, Andrew Lunn wrote: > > @@ -304,6 +312,18 @@ static int dsa_ds_apply(struct dsa_switch_tree *dst, > > struct dsa_switch *ds) > > if (err < 0) > > return err; > > > > + if (!ds->slave_mii_bus

Re: [PATCH 09/12] net: mediatek: increase watchdog_timeo

2016-06-06 Thread Andrew Lunn
> Hi Andrew, > > it is waiting for the watchdog to trigger :-) TBH the 1s seems to be too > short to for the dma ring length to be flushed and i had to pick some > value and 5 is used most places. > > it really depends on the amount of packets in the queue, their length > and the mac setting.

Re: [PATCH v4 2/7] binding: Make "mdio-parent-bus" property from mandatory to optional

2016-06-06 Thread Andrew Lunn
> Signed-off-by: Pramod Kumar <pramod.ku...@broadcom.com> Reviewed-by: Andrew Lunn <and...@lunn.ch> Andrew

Re: [PATCH v4 1/7] mdio: mux: Enhanced MDIO mux framework for integrated multiplexers

2016-06-06 Thread Andrew Lunn
ism where mux driver could register a > parent bus and pass it down to framework via mdio_mux_init api. > > Signed-off-by: Pramod Kumar <pramod.ku...@broadcom.com> Reviewed-by: Andrew Lunn <and...@lunn.ch> Andrew

Re: [PATCH v4 5/7] net: mdio-mux: Add MDIO mux driver for iProc SoCs

2016-06-06 Thread Andrew Lunn
e > buses could be internal or external to SOC where PHYs are attached. > These buses could use C-45 or C-22 mdio transaction. > > Signed-off-by: Pramod Kumar <pramod.ku...@broadcom.com> Reviewed-by: Andrew Lunn <and...@lunn.ch> Andrew

Re: [PATCH v3] r8152: Add support for setting pass through MAC address on RTL8153-AD

2016-06-06 Thread Andrew Lunn
> + /* returns _AUXMAC_#AABBCCDDEEFF# */ > + status = acpi_evaluate_object(NULL, "\\_SB.AMAC", NULL, ); > + obj = (union acpi_object *)buffer.pointer; > + if (ACPI_SUCCESS(status)) { > + if (obj->type != ACPI_TYPE_BUFFER || > + obj->string.length !=

Re: [PATCH net-next v2 5/5] net: dsa: bcm_sf2: Register our slave MDIO bus

2016-06-07 Thread Andrew Lunn
On Tue, Jun 07, 2016 at 12:48:37PM -0400, Vivien Didelot wrote: > Hi Florian, Andrew, > > Vivien Didelot writes: > > > Hum reviewing that again, I see that if one of the 2 subsequent calls to > > request_irq fails, you end up with an unregistered MDIO bus. >

Re: [PATCH net-next 1/5] net: dsa: b53: Add support for Broadcom RoboSwitch

2016-06-10 Thread Andrew Lunn
> +static void b53_switch_reset_gpio(struct b53_device *dev) > +{ > + int gpio = dev->reset_gpio; > + > + if (gpio < 0) > + return; > + > + /* Reset sequence: RESET low(50ms)->high(20ms) > + */ > + gpio_set_value(gpio, 0); > + mdelay(50); > + > +

Re: [PATCH net-next 4/4] net: dsa: bcm_sf2: Add VLAN support

2016-06-10 Thread Andrew Lunn
> @@ -148,6 +155,9 @@ struct bcm_sf2_priv { > struct device_node *master_mii_dn; > struct mii_bus *slave_mii_bus; > struct mii_bus *master_mii_bus; > + > + /* Cache of programmed VLANs */ > + struct bcm_sf2_vlan

Re: [PATCH] phy: marvell: remove LED config override

2016-06-10 Thread Andrew Lunn
On Fri, Jun 10, 2016 at 07:42:52PM +0200, Clemens Gruber wrote: > Configuring the PHY LED registers for the Marvell 88E1510 and others is > not possible, because regardless of the values in marvell,reg-init, it > is later overridden in m88e1121_config_aneg with a non-standard default. > > This

Re: [PATCH net-next 4/4] net: dsa: bcm_sf2: Add VLAN support

2016-06-10 Thread Andrew Lunn
On Fri, Jun 10, 2016 at 11:47:48AM -0700, Florian Fainelli wrote: > On 06/10/2016 05:00 AM, Andrew Lunn wrote: > >> @@ -148,6 +155,9 @@ struct bcm_sf2_priv { > >>struct device_node *master_mii_dn; > >>struct mii_bus *slave_m

Re: [PATCH net-next 1/5] net: dsa: b53: Add support for Broadcom RoboSwitch

2016-06-10 Thread Andrew Lunn
> >> +static inline int b53_switch_get_reset_gpio(struct b53_device *dev) > >> +{ > >> + enum bcm47xx_board board = bcm47xx_board_get(); > >> + > >> + switch (board) { > >> + case BCM47XX_BOARD_LINKSYS_WRT300NV11: > >> + case BCM47XX_BOARD_LINKSYS_WRT310NV1: > >> + return 8; > > > >

Re: [PATCH] phy: marvell: remove LED config override

2016-06-10 Thread Andrew Lunn
> We could move that 0x30 LED configuration to .config_init instead of > .config_aneg, so that if nobody configures it with marvell,reg-init, the > behavior does not change. I'd have to create a new .config_init function > for the 1121, 1318 and 1510. > > Would you prefer that? Hi Clemens Yes,

Re: [PATCH net-next 4/8] net: dsa: mv88e6xxx: do not increment bus refcount

2016-06-10 Thread Andrew Lunn
On Fri, Jun 10, 2016 at 03:59:22PM -0400, Vivien Didelot wrote: > Hi, > > Andrew Lunn <and...@lunn.ch> writes: > > > On Wed, Jun 08, 2016 at 08:44:52PM -0400, Vivien Didelot wrote: > >> The MDIO device probe and remove functions are respectively increment

[PATCH net-next 00/17] New DSA bind, switches as devices

2016-06-03 Thread Andrew Lunn
() * Fix destroy of cpu and dsa ports. * Rename _DSA_TAG_LAST to DSA_TAG_LAST and add a comment. Andrew Lunn (16): net: dsa: slave: chip data is optional, don't dereference NULL net: dsa: slave: Remove MDIO address from switch MDIO bus name net: dsa: tag_{e}dsa.c: Remove dependency on platform

Re: [PATCH v6] r8152: Add support for setting pass through MAC address on RTL8153-AD

2016-06-11 Thread Andrew Lunn
t; --- > > Changes from v5: > > * Correct return value if hex2bin succesful but invalid ether addr > > Have things calmed down enough now that I can apply this? Hi David I think the code has reaching the level of maturity needed for acceptance. So for the code quality: Revi

Re: [PATCH] phy: marvell: fix LED configuration via marvell,reg-init

2016-06-11 Thread Andrew Lunn
d default. > > This patch moves that default configuration to .config_init to allow > setting the LED configuration through marvell,reg-init in the device > tree, which should override said default if it exists. > > Signed-off-by: Clemens Gruber <clemens.gru...@pqgruber.com> Reviewe

Re: [PATCH 1/3] net: Add MDIO bus driver for the Hisilicon FEMAC

2016-06-13 Thread Andrew Lunn
On Mon, Jun 13, 2016 at 02:07:54PM +0800, Dongpo Li wrote: > This patch adds a separate driver for the MDIO interface of the > Hisilicon Fast Ethernet MAC. > > Reviewed-by: Jiancheng Xue > Signed-off-by: Dongpo Li > --- >

Re: [PATCH v6] r8152: Add support for setting pass through MAC address on RTL8153-AD

2016-06-14 Thread Andrew Lunn
> > It is same, how to handle two network cards which tell us, that they > > have same MAC addresses. > > > > The kernel handles this just fine. In doing this patch I checked to see > what it does in that scenario. Two devices are made. systemd doesn't > rename the second device via the MAC

Re: [PATCH] net: smsc911x: If PHY doesn't have an interrupt then POLL

2016-06-14 Thread Andrew Lunn
On Tue, Jun 14, 2016 at 11:16:02AM -0500, Jeremy Linton wrote: > If the interrupt configuration isn't set and we are using the > internal phy, then we need to poll the phy to reliably detect > phy state changes. Hi Jeremy Why does the external phy not have the exact same problem? Andrew

Re: [PATCH] net: smsc911x: If PHY doesn't have an interrupt then POLL

2016-06-14 Thread Andrew Lunn
On Tue, Jun 14, 2016 at 10:49:20PM +0300, Sergei Shtylyov wrote: > On 06/14/2016 10:27 PM, Sergei Shtylyov wrote: > > >>>If the interrupt configuration isn't set and we are using the > >>>internal phy, then we need to poll the phy to reliably detect > >>>phy state changes. > >>> >

Re: Avoiding bridge flood of multicast when L2 switch is used

2016-06-14 Thread Andrew Lunn
> netdev experts, > > When there is a L2 switch underneath the network interface a flooding of > multicast at the bridge interface results in one copy of this going through > each > of the slave resulting in multiple multicast packets reaching the underlying > switch. Yes, this is something

Re: [PATCH] mdio: mux: avoid 'maybe-uninitialized' warning

2016-06-14 Thread Andrew Lunn
ointer > argument. > > Signed-off-by: Arnd Bergmann <a...@arndb.de> > Fixes: f20e6657a875 ("mdio: mux: Enhanced MDIO mux framework for integrated > multiplexers") Reviewed-by: Andrew Lunn <and...@lunn.ch> Thanks Arnd Andrew

Re: [PATCH net-next 2/9] net: dsa: Add support for parsing the old binding

2016-06-05 Thread Andrew Lunn
> How much support do we want to have for the old binding for in tree > platforms? Is the plan to migrate them all to the new binding? I think there are three cases to consider. 1) There are some old boards using setup.c files which have a platform device, platform data, etc. I've never used

Re: [PATCH net-next v2 5/5] net: dsa: bcm_sf2: Register our slave MDIO bus

2016-06-06 Thread Andrew Lunn
es a > bit. > > Signed-off-by: Florian Fainelli <f.faine...@gmail.com> Reviewed-by: Andrew Lunn <and...@lunn.ch> Andrew

Re: [PATCH net-next v2 2/5] net: dsa: Initialize ds->enabled_port_mask and ds->phys_mii_mask

2016-06-06 Thread Andrew Lunn
> @@ -304,6 +312,18 @@ static int dsa_ds_apply(struct dsa_switch_tree *dst, > struct dsa_switch *ds) > if (err < 0) > return err; > > + if (!ds->slave_mii_bus && ds->drv->phy_read) { > + ds->slave_mii_bus = devm_mdiobus_alloc(ds->dev); > + if

Re: [PATCH net-next v2 4/5] net: dsa: Initialize CPU port ethtool ops per tree

2016-06-06 Thread Andrew Lunn
On Mon, Jun 06, 2016 at 04:14:54PM -0700, Florian Fainelli wrote: > Now that we can properly support multiple distinct trees in the system, > using a global variable: dsa_cpu_port_ethtool_ops is getting clobbered > as soon as the second switch tree gets probed, and we don't want that. > > We need

Re: [PATCH net-next 7/9] net: dsa: Initialize CPU port ethtool ops per tree

2016-06-05 Thread Andrew Lunn
On Sun, Jun 05, 2016 at 03:29:01PM -0700, Florian Fainelli wrote: > Le 04/06/2016 13:38, Andrew Lunn a écrit : > >> index e8386157de30..938262010524 100644 > >> --- a/net/dsa/dsa2.c > >> +++ b/net/dsa/dsa2.c > >> @@ -346,7 +346,7 @@ static int dsa_ds_apply(st

Re: [PATCH net-next v2 5/5] net: dsa: bcm_sf2: Register our slave MDIO bus

2016-06-07 Thread Andrew Lunn
> > With the legacy interface it is tricky. When would you call such a > > remove/tairdown function when using the old binding? > > That'd go in dsa_switch_destroy I guess, but it just covers the case > where the whole DSA code is unloaded... I don't think that helps you. It should not be

Re: [PATCH net-next 7/8] net: dsa: mv88e6xxx: explicit compatible devices

2016-06-08 Thread Andrew Lunn
On Wed, Jun 08, 2016 at 08:44:55PM -0400, Vivien Didelot wrote: > Thanks to the new device probing, we can explicit the exact switch model > in the device tree. > > Name the driver "mv88e6xxx" and list all its compatible supported chips. No. This goes against the usual way of doing device tree

Re: [PATCH net-next 1/8] net: dsa: mv88e6xxx: fix style issues

2016-06-08 Thread Andrew Lunn
amily(ps) || mv88e6xxx_6351_family(ps) || > [...] > + reg |= PORT_CONTROL_EGRESS_ADD_TAG; > > total: 0 errors, 3 warnings, 2 checks, 3805 lines checked > > Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> Reviewed-by: Andrew Lunn <and...@lunn.ch> Andrew

Re: [PATCH net-next 8/8] net: dsa: mv88e6xxx: fail on mismatching probe

2016-06-08 Thread Andrew Lunn
On Wed, Jun 08, 2016 at 08:44:56PM -0400, Vivien Didelot wrote: > Now that we have access at probe time to the chip info described in the > device tree, check if the probed device matches the device node, > otherwise warn the user and fail. What good is this? So what if the device tree says a

Re: [PATCH net-next 5/8] net: dsa: mv88e6xxx: add switch register helpers

2016-06-08 Thread Andrew Lunn
On Wed, Jun 08, 2016 at 08:44:53PM -0400, Vivien Didelot wrote: > Extract the allocation and registration code related to the dsa_switch > structure in a mv88e6xxx_register_switch helper function. > > For symmetry in the code, add a mv88e6xxx_unregister_switch function. You say what you are

Re: [PATCH net-next 3/8] net: dsa: mv88e6xxx: use already declared variables

2016-06-08 Thread Andrew Lunn
On Wed, Jun 08, 2016 at 08:44:51PM -0400, Vivien Didelot wrote: > In the MDIO probing function, dev is already assigned to >dev > and np is already assigned to mdiodev->dev.of_node, so use them. > > Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com>

Re: [PATCH net-next 2/8] net: dsa: mv88e6xxx: remove redundant assignments

2016-06-08 Thread Andrew Lunn
e. > > Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> Reviewed-by: Andrew Lunn <and...@lunn.ch> Andrew

Re: [PATCH net-next 4/8] net: dsa: mv88e6xxx: do not increment bus refcount

2016-06-08 Thread Andrew Lunn
On Wed, Jun 08, 2016 at 08:44:52PM -0400, Vivien Didelot wrote: > The MDIO device probe and remove functions are respectively incrementing > and decrementing the bus refcount themselves. Since these bus level > actions are out of the device scope, remove them. I agree with the patch. But have you

Re: [RFC v2 2/2] NET: PHY: lantiq: add LED configuration support

2016-05-28 Thread Andrew Lunn
> Do you know for which PHY I could implement this? I only have access to > the documentation for the Lantiq / Intel PHYs. Maybe actually implementing them is too far. But you could take a look at available datasheets and thing about how you would implement the binding. A quick search found:

Re: [RFC v2 1/2] NET: PHY: adds driver for Lantiq PHY11G

2016-05-28 Thread Andrew Lunn
On Sat, May 28, 2016 at 06:59:00PM +0200, Hauke Mehrtens wrote: Hi Hauke > + /** > + * In most cases only one LED is connected to this phy, so > + * configure them all to constant on and plue mode. LED3 is pulse not plue? > + * only available in some packages, let it in its

Re: [RFC v2 2/2] NET: PHY: lantiq: add LED configuration support

2016-05-28 Thread Andrew Lunn
On Sat, May 28, 2016 at 06:59:01PM +0200, Hauke Mehrtens wrote: > This makes it possible to configure the behavior of the LEDs connected > to a PHY. The LEDs are controlled by the chip, this makes it possible > to configure the behavior when the hardware should activate and > deactivate the LEDs.

Re: [PATCH 5/7] net:mdio-mux: Add MDIO mux driver for iProc SoCs

2016-05-30 Thread Andrew Lunn
On Mon, May 30, 2016 at 12:40:49PM +0530, Pramod Kumar wrote: > iProc based SoCs supports the integrated mdio multiplexer which > has the bus selection as well as mdio transaction generation logic > inside. Hi Pramod Great to see you using the existing MDIO framework. Thanks. > +static int

Re: [PATCH 3/7] binding: mdio-mux: Add DT binding doc for Broadcom MDIO bus mutiplexer

2016-05-30 Thread Andrew Lunn
On Mon, May 30, 2016 at 12:40:47PM +0530, Pramod Kumar wrote: > Add DT binding doc for Broadcom MDIO bus mutiplexer driver. > > Signed-off-by: Pramod Kumar > --- > .../bindings/net/brcm,mdio-mux-iproc.txt | 64 > ++ > 1 file changed, 64

Re: [PATCH] net: stmmac: Fix incorrect memcpy source memory

2016-05-25 Thread Andrew Lunn
o the new_bus->irq instead, so fix this. > > Signed-off-by: Marek Vasut <ma...@denx.de> > Cc: David S. Miller <da...@davemloft.net> > Cc: Giuseppe Cavallaro <peppe.cavall...@st.com> > Cc: Alexandre Torgue <alexandre.tor...@st.com> Reviewed-by: Andrew Lunn <and...@lunn.ch> Andrew

Re: usbnet: smsc95xx: fix link detection for disabled autonegotiation

2016-05-25 Thread Andrew Lunn
On Thu, May 26, 2016 at 04:06:47AM +0200, Christoph Fritz wrote: > To detect link status up/down for connections where autonegotiation is > explicitly disabled, we don't get an irq but need to poll the status > register for link up/down detection. > This patch adds a workqueue to poll for link

Re: [RFC PATCH 14/16] net: dsa: Add new binding implementation

2016-05-27 Thread Andrew Lunn
On Fri, May 27, 2016 at 04:39:05PM -0400, Vivien Didelot wrote: > > Hi Andrew, Florian, > > Here again, I'd suggested an implicit namespace for functions taking a > dsa_switch_tree structure as first argument, i.e. dsa_tree_do_foo(). Using tree actually makes things worse, since tree is never

Re: [RFC PATCH 09/16] dsa: dsa: Split up creating/destroying of DSA and CPU ports

2016-05-27 Thread Andrew Lunn
On Fri, May 27, 2016 at 03:25:47PM -0400, Vivien Didelot wrote: > Hi Andrew, Florian, > > I suggest to use this RFC to agree on a consistent and robust API for > the DSA layer. Some functions have non-intuitive names or signatures. Nope. What is important is getting this patchset accepted and

Re: [RFC PATCH 11/16] net: dsa: Refactor selection of tag ops into a function

2016-05-27 Thread Andrew Lunn
On Fri, May 27, 2016 at 03:35:57PM -0400, Vivien Didelot wrote: > Hi Andrew, > > Andrew Lunn <and...@lunn.ch> writes: > > > @@ -26,6 +26,7 @@ enum dsa_tag_protocol { > > DSA_TAG_PROTO_TRAILER, > > DSA_TAG_PROTO_EDSA, > > DSA_TAG_PROTO_BRCM, &

Re: [RFC PATCH 09/16] dsa: dsa: Split up creating/destroying of DSA and CPU ports

2016-05-27 Thread Andrew Lunn
> dsa_cpu_dsa_setups is not really meaningful and doesn't add much > value. I would disagree. Quoting Documentation/CodingStyle Chapter 6: Functions Functions should be short and sweet, and do just one thing. They should fit on one or two screenfuls of text (the ISO/ANSI

Re: [RFC PATCH 09/16] dsa: dsa: Split up creating/destroying of DSA and CPU ports

2016-05-27 Thread Andrew Lunn
On Fri, May 27, 2016 at 10:33:49AM -0400, Vivien Didelot wrote: > Hi Andrew, > > Andrew Lunn <and...@lunn.ch> writes: > > > -static void dsa_switch_destroy(struct dsa_switch *ds) > > +void dsa_cpu_dsa_destroy(struct device_node *port_dn) > > { > > - s

Re: [RFC PATCH 12/16] dsa: Make mdio bus optional

2016-05-27 Thread Andrew Lunn
On Fri, May 27, 2016 at 10:55:45AM -0400, Vivien Didelot wrote: > Hi Andrew, > > Andrew Lunn <and...@lunn.ch> writes: > > > - mdiobus_unregister(ds->slave_mii_bus); > > + if (ds->slave_mii_bus && ds->drv->phy_read) > > + md

Re: [PATCH v2 3/5] drivers: net: phy: Add MDIO driver

2016-05-31 Thread Andrew Lunn
On Tue, May 31, 2016 at 05:10:38PM -0700, Iyappan Subramanian wrote: > +static int xgene_mdio_reset(struct xgene_mdio_pdata *pdata) > +{ > + int ret; > + > + if (pdata->mdio_id == XGENE_MDIO_RGMII) { > + if (pdata->dev->of_node) { > +

Re: FWD: [PATCH v2] Marvell phy: add fiber status check for some components

2016-06-02 Thread Andrew Lunn
On Fri, May 27, 2016 at 11:23:22AM +0200, Charles-Antoine Couret wrote: > > Hello, > I'm sorry to repost that, but after one month, I need a answer to continue to > imrpove my patch in the right direction. :) Hi Charles-Aontine Florian and I had a quick discussion. We think going with the

Re: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-02 Thread Andrew Lunn
> > > > > + pr_info("r8152: Using system auxiliary MAC address"); > > > > It would be great to write also mac address into that pr_info And since there could be multiple r8152 in the system, it would be good to indicate which of them is having its MAC changed. So netdev_info() or

Re: [PATCH v2] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-02 Thread Andrew Lunn
> > And you want to check this for all Dell devices? Please be model > > specific, I doubt a bunch of Dell servers wants to run this code... > > > > Tracking model specific is really going to turn into a giant list never > ending list. > To drill down more specifically, I can match on chassis

[RFC PATCH 02/16] net: dsa: mv88e6xxx: fix circular lock in PPU work

2016-05-26 Thread Andrew Lunn
From: Vivien Didelot Lock debugging shows that there is a possible circular lock in the PPU work code. Switch the lock order of smi_mutex and ppu_mutex to fix this. Here's the full trace: [4.341325]

[RFC PATCH 14/16] net: dsa: Add new binding implementation

2016-05-26 Thread Andrew Lunn
which can be embedded into any type of node on a bus to represent one switch device, and its links to other switches. Signed-off-by: Andrew Lunn <and...@lunn.ch> Signed-off-by: Florian Fainelli <f.faine...@gmail.com> --- drivers/net/dsa/mv88e6xxx.c | 7 + include/net/dsa.h |

[RFC PATCH 13/16] net: dsa: mv88e6xxx: Refactor MDIO so driver registers mdio bus

2016-05-26 Thread Andrew Lunn
Have the switch driver register its own MDIO bus. This allows for an mdio property in the device tree, with child nodes for phys, which can be referenced via phandles, etc. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- drivers/net/dsa/mv88e6xxx.c

[RFC PATCH 12/16] dsa: Make mdio bus optional

2016-05-26 Thread Andrew Lunn
The switch may want to instantiate its own MDIO bus. Only do it centrally if the switch has not already created one, and the read op is implemented. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- net/dsa/dsa.c | 24 +--- 1 file changed, 13 insertions(+), 11 del

[RFC PATCH 11/16] net: dsa: Refactor selection of tag ops into a function

2016-05-26 Thread Andrew Lunn
Replace the two switch statements with an array lookup, and store the result in the dsa tree structure. The drivers no longer need to know the selected tag protocol, so remove it from the dsa switch structure. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- include/net/dsa.h | 8 +

[RFC PATCH 10/16] net: dsa: mv88e6xxx: Only support EDSA tagging

2016-05-26 Thread Andrew Lunn
The merged driver no longer offers the option to use DSA tagging. So remove the code to setup the switch to do DSA tagging and hard code the use of EDSA. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- drivers/net/dsa/mv88e6xxx.c | 8 ++-- 1 file changed, 2 insertions(+), 6 del

[RFC PATCH 04/16] dsa: tag_{e}dsa.c: Remove dependency on platform data

2016-05-26 Thread Andrew Lunn
ure there is a valid dsa_switch for this packet. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- net/dsa/tag_dsa.c | 6 +- net/dsa/tag_edsa.c | 6 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/net/dsa/tag_dsa.c b/net/dsa/tag_dsa.c index aa780e4ac0bd..f9832f0976

[RFC PATCH 06/16] dsa: Move port device node into port structure

2016-05-26 Thread Andrew Lunn
, this is reversed, the switches exist first, and the interconnections between the switches is derived from the individual switch bindings. Thus this chip data structure becomes unneeded. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- include/net/dsa.h | 1 + net/dsa/dsa.c | 8 n

[RFC PATCH 08/16] dsa: Copy the routing table into the switch structure

2016-05-26 Thread Andrew Lunn
The new binding will not have a chip data structure, it will place the routing directly into the switch structure. To enable backwards compatibility, copy the routing from the chip data into the switch structure. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- drivers/net/dsa/mv88e6xxx.

[RFC PATCH 03/16] dsa: slave: Remove MDIO address from switch MDIO bus name

2016-05-26 Thread Andrew Lunn
the MDIO address. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- net/dsa/slave.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 135a91706755..f640a48a6ff3 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -49,8 +49,7 @

[RFC PATCH 07/16] dsa: Remove dynamic allocate of routing table

2016-05-26 Thread Andrew Lunn
With a maximum of four switches, the size of the routing table is the same as the pointer to it. Removing it makes the code simpler. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- drivers/net/dsa/mv88e6xxx.c | 3 +-- include/net/dsa.h | 10 +- net/dsa/dsa.c

[RFC PATCH 00/16] New DSA bind, switches as devices

2016-05-26 Thread Andrew Lunn
John Crispin and Bryan Whitehead are interesting in implementing DSA drivers, hence i have CC: you. Comments welcome. Thanks go to Florian and Vivien for reviewing, testing and bug fixing these patches. Andrew Lunn (15): dsa: slave: chip data is optional, don't dereference NULL dsa: slave

[RFC PATCH 16/16] dsa: Document new binding

2016-05-26 Thread Andrew Lunn
Add the new binding to the documentation of the existing binding. Mark the old binding as deprecated. Signed-off-by: Andrew Lunn <and...@lunn.ch> Signed-off-by: Florian Fainelli <f.faine...@gmail.com> --- Documentation/devicetree/bindings/net/dsa/dsa.txt | 278 ++

[RFC PATCH 15/16] arm: dt: vf610-zii-devel-b: Make use of new DSA binding

2016-05-26 Thread Andrew Lunn
Hang the three switches of the three MDIO busses using the new DSA binding. Also, make use of the mdio-bus and explicitly list the phys on one device. This is not required, but good for testing. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- arch/arm/boot/dts/vf610-zii-dev-rev-b.dts

[RFC PATCH 05/16] dsa: Add a ports structure and use it in the switch structure

2016-05-26 Thread Andrew Lunn
There are going to be more per-port members added to the switch structure. So add a port structure and move the netdev into it. Signed-off-by: Andrew Lunn <and...@lunn.ch> --- drivers/net/dsa/bcm_sf2.c | 4 ++-- drivers/net/dsa/mv88e6xxx.c | 27 --- include/net

<    1   2   3   4   5   6   7   8   9   10   >