linux-stable/drivers
Florian Fainelli 7674575d8b r6040: Restore MDIO clock frequency after MAC reset
commit e3f0cc1a94 upstream.

A number of users have reported that they were not able to get the PHY
to successfully link up, especially after commit c36757eb9d ("net:
phy: consider AN_RESTART status when reading link status") where we
stopped reading just BMSR, but we also read BMCR to determine the link
status.

Andrius at NetBSD did a wonderful job at debugging the problem
and found out that the MDIO bus clock frequency would be incorrectly set
back to its default value which would prevent the MDIO bus controller
from reading PHY registers properly. Back when we only read BMSR, if we
read all 1s, we could falsely indicate a link status, though in general
there is a cable plugged in, so this went unnoticed. After a second read
of BMCR was added, a wrong read will lead to the inability to determine
a link UP condition which is when it started to be visibly broken, even
if it was long before that.

The fix consists in restoring the value of the MD_CSR register that was
set prior to the MAC reset.

Link: http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=53494
Fixes: 90f750a81a ("r6040: consolidate MAC reset to its own function")
Reported-by: Andrius V <vezhlys@gmail.com>
Reported-by: Darek Strugacz <darek.strugacz@op.pl>
Tested-by: Darek Strugacz <darek.strugacz@op.pl>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-22 11:45:33 +02:00
..
accessibility
acpi
amba
android
ata ata: sata_dwc_460ex: No need to call phy_exit() befre phy_init() 2021-09-22 11:45:29 +02:00
atm
auxdisplay
base PM: base: power: don't try to use non-existing RTC for storing data 2021-09-22 11:45:33 +02:00
bcma
block
bluetooth
bus
cdrom
char
clk
clocksource
connector
cpufreq cpufreq: powernv: Fix init_chip_info initialization in numa=off 2021-09-22 11:45:32 +02:00
cpuidle
crypto crypto: mxs-dcp - Use sg_mapping_iter to copy data 2021-09-22 11:45:27 +02:00
dax
dca
devfreq
dio
dma
dma-buf
edac
eisa
extcon
firewire
firmware
fmc
fpga
fsi
gpio
gpu gpu: drm: amd: amdgpu: amdgpu_i2c: fix possible uninitialized-variable access in amdgpu_i2c_router_select_ddc_port() 2021-09-22 11:45:30 +02:00
hid
hsi
hv
hwmon
hwspinlock
hwtracing
i2c
ide
idle
iio iio: dac: ad5624r: Fix incorrect handling of an optional regulator. 2021-09-22 11:45:27 +02:00
infiniband
input
iommu
ipack
irqchip
isdn
leds
lightnvm
macintosh
mailbox
mcb
md
media media: v4l2-dv-timings.c: fix wrong condition in two for-loops 2021-09-22 11:45:29 +02:00
memory
memstick
message
mfd
misc
mmc mmc: rtsx_pci: Fix long reads when clock is prescaled 2021-09-22 11:45:30 +02:00
mtd
mux
net r6040: Restore MDIO clock frequency after MAC reset 2021-09-22 11:45:33 +02:00
nfc
ntb
nubus
nvdimm
nvme
nvmem
of
oprofile
parisc
parport parport: remove non-zero check on count 2021-09-22 11:45:31 +02:00
pci PCI: Use pci_update_current_state() in pci_enable_device_flags() 2021-09-22 11:45:27 +02:00
pcmcia
perf
phy
pinctrl pinctrl: single: Fix error return code in pcs_parse_bits_in_pinctrl_entry() 2021-09-22 11:45:26 +02:00
platform platform/chrome: cros_ec_proto: Send command again when timeout occurs 2021-09-22 11:45:32 +02:00
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390
sbus
scsi scsi: qla2xxx: Sync queue idx with queue_pair_map idx 2021-09-22 11:45:32 +02:00
sfi
sh
sn
soc
spi
spmi
ssb
staging staging: rts5208: Fix get_ms_information() heap buffer size 2021-09-22 11:45:30 +02:00
target
tc
tee
thermal
thunderbolt
tty serial: 8250_pci: make setup_port() parameters explicitly unsigned 2021-09-22 11:45:29 +02:00
uio
usb usbip:vhci_hcd USB port can get stuck in the disabled state 2021-09-22 11:45:31 +02:00
uwb
vfio vfio: Use config not menuconfig for VFIO_NOIOMMU 2021-09-22 11:45:26 +02:00
vhost
video video: fbdev: riva: Error out if 'pixclock' equals zero 2021-09-22 11:45:28 +02:00
virt
virtio
vlynq
vme
w1
watchdog
xen
zorro
Kconfig
Makefile