TencentOS-kernel/drivers
Florian Fainelli d5127b6cc2 net: phy: Check harder for errors in get_phy_id()
[ Upstream commit b2ffc75e2e990b09903f9d15ccd53bc5f3a4217c ]

Commit 02a6efcab675 ("net: phy: allow scanning busses with missing
phys") added a special condition to return -ENODEV in case -ENODEV or
-EIO was returned from the first read of the MII_PHYSID1 register.

In case the MDIO bus data line pull-up is not strong enough, the MDIO
bus controller will not flag this as a read error. This can happen when
a pluggable daughter card is not connected and weak internal pull-ups
are used (since that is the only option, otherwise the pins are
floating).

The second read of MII_PHYSID2 will be correctly flagged an error
though, but now we will return -EIO which will be treated as a hard
error, thus preventing MDIO bus scanning loops to continue succesfully.

Apply the same logic to both register reads, thus allowing the scanning
logic to proceed.

Fixes: 02a6efcab675 ("net: phy: allow scanning busses with missing phys")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
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-03-16 16:30:48 +08:00
..
accessibility Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
acpi ACPI/IORT: Fix PMCG node single ID mapping handling 2021-03-16 16:29:20 +08:00
amba Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
android Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ata libata: Use per port sync for detach 2021-03-16 16:30:39 +08:00
atm Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
auxdisplay Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
base drivers: base: Fix NULL pointer exception in __platform_driver_probe() if a driver developer is foolish 2021-03-16 16:30:13 +08:00
bcma Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
block ps3disk: use the default segment boundary 2021-03-16 16:30:01 +08:00
bluetooth Bluetooth: hci_bcm: fix freeing not-requested IRQ 2021-03-16 16:29:45 +08:00
bus bus: sunxi-rsb: Return correct data when mixing 16-bit and 8-bit reads 2021-03-16 16:25:52 +08:00
cdrom Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
char /dev/mem: Revoke mappings when a driver claims the region 2021-03-16 16:30:25 +08:00
clk clk: ast2600: Fix AHB clock divider for A1 2021-03-16 16:30:25 +08:00
clocksource clocksource: dw_apb_timer_of: Fix missing clockevent timers 2021-03-16 16:29:20 +08:00
connector Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
counter counter: 104-quad-8: Add lock guards - generic interface 2021-03-16 16:27:07 +08:00
cpufreq cpufreq: Fix up cpufreq_boost_set_sw() 2021-03-16 16:29:08 +08:00
cpuidle cpuidle: Fix three reference count leaks 2021-03-16 16:29:37 +08:00
crypto crypto: omap-sham - add proper load balancing support for multicore 2021-03-16 16:30:29 +08:00
dax device-dax: don't leak kernel memory to user space after unloading kmem 2021-03-16 16:28:19 +08:00
dca Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
devfreq PM / devfreq: Add missing locking while setting suspend_freq 2021-03-16 16:27:31 +08:00
dio Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
dma dmaengine: owl: Use correct lock in owl_dma_get_pchan() 2021-03-16 16:28:16 +08:00
dma-buf dma-buf: Fix SET_NAME ioctl uapi 2021-03-16 16:27:16 +08:00
edac EDAC/amd64: Add AMD family 17h model 60h PCI IDs 2021-03-16 16:29:46 +08:00
eisa Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
extcon extcon: adc-jack: Fix an error handling path in 'adc_jack_probe()' 2021-03-16 16:30:26 +08:00
firewire Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
firmware firmware: imx: scu: Fix possible memory leak in imx_scu_probe() 2021-03-16 16:30:20 +08:00
fpga fpga: dfl: afu: Corrected error handling levels 2021-03-16 16:30:19 +08:00
fsi Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
gnss gnss: sirf: fix error return code in sirf_probe() 2021-03-16 16:29:47 +08:00
gpio gpio: pca953x: fix handling of automatic address incrementing 2021-03-16 16:30:11 +08:00
gpu Revert "drm/amd/display: disable dcn20 abm feature for bring up" 2021-03-16 16:30:43 +08:00
greybus Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hid HID: Add quirks for Trust Panora Graphic Tablet 2021-03-16 16:30:17 +08:00
hsi Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hv Drivers: hv: vmbus: Always handle the VMBus messages on CPU0 2021-03-16 16:29:25 +08:00
hwmon hwmon: (k10temp) Add AMD family 17h model 60h PCI match 2021-03-16 16:29:46 +08:00
hwspinlock Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hwtracing coresight: tmc: Fix TMC mode read in tmc_read_prepare_etb() 2021-03-16 16:30:02 +08:00
i2c i2c: icy: Fix build with CONFIG_AMIGA_PCMCIA=n 2021-03-16 16:30:32 +08:00
i3c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ide Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
idle Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
iio iio: bmp280: fix compensation of humidity 2021-03-16 16:29:58 +08:00
infiniband RDMA/iw_cxgb4: cleanup device debugfs entries on ULD remove 2021-03-16 16:30:23 +08:00
input input: i8042 - Remove special PowerPC handling 2021-03-16 16:30:26 +08:00
interconnect Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
iommu iommu: Fix reference count leak in iommu_group_alloc. 2021-03-16 16:28:37 +08:00
ipack ipack: tpci200: fix error return code in tpci200_register() 2021-03-16 16:28:19 +08:00
irqchip irqchip/mbigen: Free msi_desc on device teardown 2021-03-16 16:26:29 +08:00
isdn Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
leds leds: core: Fix warning message when init_data 2021-03-16 16:26:37 +08:00
lightnvm Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
macintosh drivers/macintosh: Fix memleak in windfarm_pm112 driver 2021-03-16 16:29:49 +08:00
mailbox mailbox: zynqmp-ipi: Fix NULL vs IS_ERR() check in zynqmp_ipi_mbox_probe() 2021-03-16 16:30:27 +08:00
mcb Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
md bcache: fix potential deadlock problem in btree_gc_coalesce 2021-03-16 16:30:37 +08:00
media media: ov5640: fix use of destroyed mutex 2021-03-16 16:29:45 +08:00
memory Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
memstick Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
message Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
mfd mfd: stmfx: Disable IRQ in suspend to avoid spurious interrupt 2021-03-16 16:30:24 +08:00
misc misc: xilinx-sdfec: improve get_user_pages_fast() error handling 2021-03-16 16:30:25 +08:00
mmc mmc: sdhci-esdhc-imx: fix the mask for tuning start point 2021-03-16 16:29:36 +08:00
mtd mtd: rawnand: tmio: Fix the probe error path 2021-03-16 16:29:53 +08:00
mux Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
net net: phy: Check harder for errors in get_phy_id() 2021-03-16 16:30:48 +08:00
nfc NFC: st21nfca: add missed kfree_skb() in an error path 2021-03-16 16:28:49 +08:00
ntb NTB: perf: Fix race condition when run with ntb_test 2021-03-16 16:30:32 +08:00
nubus Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nvdimm libnvdimm: Out of bounds read in __nd_ioctl() 2021-03-16 16:26:40 +08:00
nvme nvme-pci: use simple suspend when a HMB is enabled 2021-03-16 16:30:35 +08:00
nvmem nvmem: qfprom: remove incorrect write support 2021-03-16 16:28:52 +08:00
of of: Fix a refcounting bug in __of_attach_node_sysfs() 2021-03-16 16:30:26 +08:00
opp Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
oprofile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
parisc Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
parport Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
pci PCI: amlogic: meson: Don't use FAST_LINK_MODE to set up link 2021-03-16 16:30:22 +08:00
pcmcia Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
perf drivers/perf: hisi: Fix wrong value for all counters enable 2021-03-16 16:30:32 +08:00
phy drivers: phy: sr-usb: do not use internal fsm for USB2 phy init 2021-03-16 16:30:18 +08:00
pinctrl pinctrl: freescale: imx: Fix an error handling path in 'imx_pinctrl_probe()' 2021-03-16 16:30:29 +08:00
platform platform/x86: asus_wmi: Reserve more space for struct bias_args 2021-03-16 16:29:37 +08:00
pnp Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
power power: supply: smb347-charger: IRQSTAT_D is volatile 2021-03-16 16:30:14 +08:00
powercap Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
pps Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ps3 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ptp Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
pwm pwm: jz4740: Enhance precision in calculation of duty cycle 2021-03-16 16:30:44 +08:00
rapidio rapidio: fix an error in get_user_pages_fast() error handling 2021-03-16 16:28:19 +08:00
ras Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
regulator regulator: qcom-rpmh: Fix typos in pm8150 and pm8150l 2021-03-16 16:29:23 +08:00
remoteproc remoteproc: qcom_q6v5_mss: map/unmap mpss segments before/after use 2021-03-16 16:29:59 +08:00
reset Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
rpmsg Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
rtc rtc: rv3028: Add missed check for devm_regmap_init_i2c() 2021-03-16 16:30:27 +08:00
s390 s390/qdio: put thinint indicator after early error 2021-03-16 16:30:10 +08:00
sbus Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
scsi scsi: ufs-bsg: Fix runtime PM imbalance on error 2021-03-16 16:30:38 +08:00
sfi Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sh Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
siox Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
slimbus slimbus: ngd: get drvdata from correct device 2021-03-16 16:30:11 +08:00
soc soc/tegra: pmc: Select GENERIC_PINCONF 2021-03-16 16:29:49 +08:00
soundwire soundwire: slave: don't init debugfs on device registration error 2021-03-16 16:30:12 +08:00
spi spi: dw: Return any value retrieved from the dma_transfer callback 2021-03-16 16:29:36 +08:00
spmi Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ssb Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
staging staging: sm750fb: add missing case while setting FB_VISUAL 2021-03-16 16:30:13 +08:00
target scsi: target: tcmu: Fix a use after free in tcmu_check_expired_queue_cmd() 2021-03-16 16:30:24 +08:00
tc Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
tee Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
thermal thermal/drivers/ti-soc-thermal: Avoid dereferencing ERR_PTR 2021-03-16 16:30:11 +08:00
thunderbolt Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
tty tty: n_gsm: Fix bogus i++ in gsm_data_kick 2021-03-16 16:30:19 +08:00
uio Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
usb usb/ehci-platform: Set PM runtime as active on resume 2021-03-16 16:30:36 +08:00
vfio vfio/mdev: Fix reference count leak in add_mdev_supported_type 2021-03-16 16:30:27 +08:00
vhost scsi: vhost: Notify TCM about the maximum sg entries supported per command 2021-03-16 16:30:04 +08:00
video backlight: lp855x: Ensure regulators are disabled on probe failure 2021-03-16 16:29:56 +08:00
virt Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
virtio Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
visorbus Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
vlynq Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
vme Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
w1 w1: omap-hdq: cleanup to add missing newline for some dev_dbg 2021-03-16 16:29:53 +08:00
watchdog watchdog: da9062: No need to ping manually before setting timeout 2021-03-16 16:30:22 +08:00
xen xen/pvcalls-back: test for errors when calling backend_connect() 2021-03-16 16:29:13 +08:00
zorro Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00