]> git.baikalelectronics.ru Git - kernel.git/commit
net/fsl_pq_mdio: fix computed address for the TBI register
authorGerlando Falauto <gerlando.falauto@keymile.com>
Mon, 12 Oct 2015 07:18:41 +0000 (09:18 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 13 Oct 2015 11:29:55 +0000 (04:29 -0700)
commited2b39b52a9157d998a79a8f6d4050da6b69a54e
tree944534c1ca2359c356ae61cd04ecaf648adcb1f8
parentfaa5d545c996e16e001ae61f53ef84929307efa6
net/fsl_pq_mdio: fix computed address for the TBI register

commit 7d75200cc3852e92ee61d3b7f2b7704d447aa2b1
  "net/fsl_pq_mdio: streamline probing of MDIO nodes"

added support for different types of MDIO devices:
1) Gianfar MDIO nodes that only map the MII registers
2) Gianfar MDIO nodes that map the full MDIO register set
3) eTSEC2 MDIO nodes (which map the full MDIO register set)
4) QE MDIO nodes (which map only the MII registers)

However, the implementation for types 1 and 4 would mistakenly assume
a mapping of the full MDIO register set, thereby computing the address
for the TBI register starting from the containing structure.
The TBI register would therefore be accessed at a wrong (much bigger)
address, not giving the expected result at all.
This patch restores the correct behavior we had prior to the above one.

The consequences of this bug are apparent when trying to access a PHY
with the same address as the value contained in the initial value of
the TBI register (normally 0); in that case you'll get answers from the
internal TBI device (even though MDIO/MDC pins are actually *also*
toggling on the physical bus!).
Beware that you also need to add a fake tbi node to your device tree
with an unused address.

Notice how this fix is related to commit
e8d1f93f7a3ce34fe73ceccff504fe9bf711b635
  "powerpc: Add TBI PHY node to first MDIO bus"

which fixed the behavior in kernel 3.3, which was later broken by the
above commit on kernel 3.7.

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Cc: Timur Tabi <timur@tabi.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fsl_pq_mdio.c