Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: phy: mdio-gpio: Handle phy_ignore_ta_mask

Update mdiobb_read() to read whether the PHY has a broken turn-around,
and if it does, ignore it to make the read succeeed.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Florian Fainelli and committed by
David S. Miller
ea48b2b8 ab6016e0

+5 -2
+5 -2
drivers/net/phy/mdio-bitbang.c
··· 165 165 166 166 ctrl->ops->set_mdio_dir(ctrl, 0); 167 167 168 - /* check the turnaround bit: the PHY should be driving it to zero */ 169 - if (mdiobb_get_bit(ctrl) != 0) { 168 + /* check the turnaround bit: the PHY should be driving it to zero, if this 169 + * PHY is listed in phy_ignore_ta_mask as having broken TA, skip that 170 + */ 171 + if (mdiobb_get_bit(ctrl) != 0 && 172 + !(bus->phy_ignore_ta_mask & (1 << phy))) { 170 173 /* PHY didn't drive TA low -- flush any bits it 171 174 * may be trying to send. 172 175 */