Re: [PATCH v2 net-next v2 12/12] net: dsa: mv88e6xxx: add addressing mode to info

2016-06-14 Thread Vivien Didelot
Hi, Andrew Lunn writes: > On Tue, Jun 14, 2016 at 06:24:17PM -0400, Vivien Didelot wrote: >> Hi Andrew, >> >> Andrew Lunn writes: >> >> >> - ret = mdiobus_read_nested(bus, addr, reg); >> >> + ret = mdiobus_read_nested(bus, sw_addr + addr, reg); >> >> if (ret

Re: [PATCH v2 net-next v2 12/12] net: dsa: mv88e6xxx: add addressing mode to info

2016-06-14 Thread Vivien Didelot
Hi, Andrew Lunn writes: > On Tue, Jun 14, 2016 at 06:24:17PM -0400, Vivien Didelot wrote: >> Hi Andrew, >> >> Andrew Lunn writes: >> >> >> - ret = mdiobus_read_nested(bus, addr, reg); >> >> + ret = mdiobus_read_nested(bus, sw_addr + addr, reg); >> >> if (ret < 0) >> >> return

Re: [PATCH v2 net-next v2 12/12] net: dsa: mv88e6xxx: add addressing mode to info

2016-06-14 Thread Andrew Lunn
On Tue, Jun 14, 2016 at 06:24:17PM -0400, Vivien Didelot wrote: > Hi Andrew, > > Andrew Lunn writes: > > >> - ret = mdiobus_read_nested(bus, addr, reg); > >> + ret = mdiobus_read_nested(bus, sw_addr + addr, reg); > >>if (ret < 0) > >>return ret; > > > > If we

Re: [PATCH v2 net-next v2 12/12] net: dsa: mv88e6xxx: add addressing mode to info

2016-06-14 Thread Andrew Lunn
On Tue, Jun 14, 2016 at 06:24:17PM -0400, Vivien Didelot wrote: > Hi Andrew, > > Andrew Lunn writes: > > >> - ret = mdiobus_read_nested(bus, addr, reg); > >> + ret = mdiobus_read_nested(bus, sw_addr + addr, reg); > >>if (ret < 0) > >>return ret; > > > > If we are doing direct

Re: [PATCH v2 net-next v2 12/12] net: dsa: mv88e6xxx: add addressing mode to info

2016-06-14 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> -ret = mdiobus_read_nested(bus, addr, reg); >> +ret = mdiobus_read_nested(bus, sw_addr + addr, reg); >> if (ret < 0) >> return ret; > > If we are doing direct access, doesn't it means sw_addr is 0? > > So isn't this

Re: [PATCH v2 net-next v2 12/12] net: dsa: mv88e6xxx: add addressing mode to info

2016-06-14 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> -ret = mdiobus_read_nested(bus, addr, reg); >> +ret = mdiobus_read_nested(bus, sw_addr + addr, reg); >> if (ret < 0) >> return ret; > > If we are doing direct access, doesn't it means sw_addr is 0? > > So isn't this pointless? 6060

Re: [PATCH v2 net-next v2 12/12] net: dsa: mv88e6xxx: add addressing mode to info

2016-06-14 Thread Andrew Lunn
On Tue, Jun 14, 2016 at 02:31:53PM -0400, Vivien Didelot wrote: > When the SMI address of the switch chip on the SMI master bus is not > zero, some chips (e.g. 88E6352) use an indirect access through two SMI > Command and Data registers, while others (e.g. 88E6060) still use a > direct access. >

Re: [PATCH v2 net-next v2 12/12] net: dsa: mv88e6xxx: add addressing mode to info

2016-06-14 Thread Andrew Lunn
On Tue, Jun 14, 2016 at 02:31:53PM -0400, Vivien Didelot wrote: > When the SMI address of the switch chip on the SMI master bus is not > zero, some chips (e.g. 88E6352) use an indirect access through two SMI > Command and Data registers, while others (e.g. 88E6060) still use a > direct access. >

Re: [PATCH v2 net-next v2 12/12] net: dsa: mv88e6xxx: add addressing mode to info

2016-06-14 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> @@ -3681,7 +3681,7 @@ mv88e6xxx_smi_detect(struct device *dev, struct >> mii_bus *bus, int sw_addr, >> u16 id; >> >> ops = _smi_direct_ops; >> -if (sw_addr > 0) >> +if (sw_addr > 0 && info->flags & MV88E6XXX_FLAG_MULTI_CHIP)

Re: [PATCH v2 net-next v2 12/12] net: dsa: mv88e6xxx: add addressing mode to info

2016-06-14 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> @@ -3681,7 +3681,7 @@ mv88e6xxx_smi_detect(struct device *dev, struct >> mii_bus *bus, int sw_addr, >> u16 id; >> >> ops = _smi_direct_ops; >> -if (sw_addr > 0) >> +if (sw_addr > 0 && info->flags & MV88E6XXX_FLAG_MULTI_CHIP) >>

Re: [PATCH v2 net-next v2 12/12] net: dsa: mv88e6xxx: add addressing mode to info

2016-06-14 Thread Andrew Lunn
> @@ -3681,7 +3681,7 @@ mv88e6xxx_smi_detect(struct device *dev, struct mii_bus > *bus, int sw_addr, > u16 id; > > ops = _smi_direct_ops; > - if (sw_addr > 0) > + if (sw_addr > 0 && info->flags & MV88E6XXX_FLAG_MULTI_CHIP) > ops = _smi_indirect_ops; Hi Vivien

Re: [PATCH v2 net-next v2 12/12] net: dsa: mv88e6xxx: add addressing mode to info

2016-06-14 Thread Andrew Lunn
> @@ -3681,7 +3681,7 @@ mv88e6xxx_smi_detect(struct device *dev, struct mii_bus > *bus, int sw_addr, > u16 id; > > ops = _smi_direct_ops; > - if (sw_addr > 0) > + if (sw_addr > 0 && info->flags & MV88E6XXX_FLAG_MULTI_CHIP) > ops = _smi_indirect_ops; Hi Vivien

[PATCH v2 net-next v2 12/12] net: dsa: mv88e6xxx: add addressing mode to info

2016-06-14 Thread Vivien Didelot
When the SMI address of the switch chip on the SMI master bus is not zero, some chips (e.g. 88E6352) use an indirect access through two SMI Command and Data registers, while others (e.g. 88E6060) still use a direct access. Add a capability flag to describe chips supporting the Multi-chip

[PATCH v2 net-next v2 12/12] net: dsa: mv88e6xxx: add addressing mode to info

2016-06-14 Thread Vivien Didelot
When the SMI address of the switch chip on the SMI master bus is not zero, some chips (e.g. 88E6352) use an indirect access through two SMI Command and Data registers, while others (e.g. 88E6060) still use a direct access. Add a capability flag to describe chips supporting the Multi-chip