linux/drivers/net
Christian Lamparter 19d90ece81 net: emac: fix reset timeout with AR8035 phy
This patch fixes a problem where the AR8035 PHY can't be
detected on an Cisco Meraki MR24, if the ethernet cable is
not connected on boot.

Russell Senior provided steps to reproduce the issue:
|Disconnect ethernet cable, apply power, wait until device has booted,
|plug in ethernet, check for interfaces, no eth0 is listed.
|
|This appears to be a problem during probing of the AR8035 Phy chip.
|When ethernet has no link, the phy detection fails, and eth0 is not
|created. Plugging ethernet later has no effect, because there is no
|interface as far as the kernel is concerned. The relevant part of
|the boot log looks like this:
|this is the failing case:
|
|[    0.876611] /plb/opb/emac-rgmii@ef601500: input 0 in RGMII mode
|[    0.882532] /plb/opb/ethernet@ef600c00: reset timeout
|[    0.888546] /plb/opb/ethernet@ef600c00: can't find PHY!
|and the succeeding case:
|
|[    0.876672] /plb/opb/emac-rgmii@ef601500: input 0 in RGMII mode
|[    0.883952] eth0: EMAC-0 /plb/opb/ethernet@ef600c00, MAC 00:01:..
|[    0.890822] eth0: found Atheros 8035 Gigabit Ethernet PHY (0x01)

Based on the comment and the commit message of
commit 23fbb5a87c ("emac: Fix EMAC soft reset on 460EX/GT").
This is because the AR8035 PHY doesn't provide the TX Clock,
if the ethernet cable is not attached. This causes the reset
to timeout and the PHY detection code in emac_init_phy() is
unable to detect the AR8035 PHY. As a result, the emac driver
bails out early and the user left with no ethernet.

In order to stay compatible with existing configurations, the driver
tries the current reset approach at first. Only if the first attempt
timed out, it does perform one more retry with the clock temporarily
switched to the internal source for just the duration of the reset.

LEDE-Bug: #687 <https://bugs.lede-project.org/index.php?do=details&task_id=687>

Cc: Chris Blake <chrisrblake93@gmail.com>
Reported-by: Russell Senior <russell@personaltelco.net>
Fixes: 23fbb5a87c ("emac: Fix EMAC soft reset on 460EX/GT")
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-08 10:47:21 -04:00
..
appletalk Annotate hardware config module parameters in drivers/net/appletalk/ 2017-04-20 12:02:32 +01:00
arcnet Annotate hardware config module parameters in drivers/net/arcnet/ 2017-04-20 12:02:32 +01:00
bonding net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
caif net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
can net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
cris net: cris: eth_v10: use new api ethtool_{get|set}_link_ksettings 2017-03-27 15:53:19 -07:00
dsa net: dsa: mv88e6xxx: Add missing static to stub functions 2017-05-30 14:07:53 -04:00
ethernet net: emac: fix reset timeout with AR8035 phy 2017-06-08 10:47:21 -04:00
fddi format-security: move static strings to const 2017-05-08 17:15:14 -07:00
fjes Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-03-23 16:41:27 -07:00
hamradio net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
hippi Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-05-09 15:42:31 -07:00
hyperv netvsc: make sure napi enabled before vmbus_open 2017-05-04 11:08:36 -04:00
ieee802154 ieee802154: don't select COMMON_CLK 2017-04-22 10:28:40 +02:00
ipvlan net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
irda Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-05-15 15:50:49 -07:00
phy net: phy: fix kernel-doc warnings 2017-06-05 11:28:50 -04:00
plip
ppp
slip net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
team net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
usb net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
vmxnet3 vmxnet3: ensure that adapter is in proper state during force_close 2017-05-12 12:23:52 -04:00
wan net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
wimax drivers: net: wimax: i2400m: i2400m-usb: Use time_after for time comparison 2017-05-09 09:40:33 -04:00
wireless net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
xen-netback xen-netback: fix race condition on XenBus disconnect 2017-03-12 23:44:43 -07:00
dummy.c net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
eql.c
geneve.c net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
gtp.c net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
ifb.c net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
Kconfig VSOCK: Add vsockmon device 2017-04-24 12:35:56 -04:00
LICENSE.SRC
loopback.c net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
macsec.c net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
macvlan.c net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
macvtap.c
Makefile VSOCK: Add vsockmon device 2017-04-24 12:35:56 -04:00
mdio.c
mii.c
netconsole.c
nlmon.c net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
ntb_netdev.c net: net_netdev: use new api ethtool_{get|set}_link_ksettings 2017-03-13 15:25:53 -07:00
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c sched/headers: Move task_struct::signal and task_struct::sighand types and accessors into <linux/sched/signal.h> 2017-03-03 01:43:37 +01:00
tun.c net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
veth.c net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
virtio_net.c virtio_net: lower limit on buffer size 2017-06-02 14:32:34 -04:00
vrf.c net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
vsockmon.c net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
vxlan.c net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
xen-netfront.c xen-netfront: avoid crashing on resume after a failure in talk_to_netback() 2017-05-11 21:38:50 -04:00