1
0
Fork 0
alistair23-linux/drivers
Geert Uytterhoeven 02cae02a7d sh_eth: Make PHY access aware of Runtime PM to fix reboot crash
Wolfram reports that his R-Car H2-based Lager board can no longer be
rebooted in v5.11-rc1, as it crashes with an imprecise external abort.
The issue can be reproduced on other boards (e.g. Koelsch with R-Car
M2-W) too, if CONFIG_IP_PNP is disabled, and the Ethernet interface is
down at reboot time:

    Unhandled fault: imprecise external abort (0x1406) at 0x00000000
    pgd = (ptrval)
    [00000000] *pgd=422b6835, *pte=00000000, *ppte=00000000
    Internal error: : 1406 [#1] ARM
    Modules linked in:
    CPU: 0 PID: 1105 Comm: init Tainted: G        W         5.10.0-rc1-00402-ge2f016cf7751 #1048
    Hardware name: Generic R-Car Gen2 (Flattened Device Tree)
    PC is at sh_mdio_ctrl+0x44/0x60
    LR is at sh_mmd_ctrl+0x20/0x24
    ...
    Backtrace:
    [<c0451f30>] (sh_mdio_ctrl) from [<c0451fd4>] (sh_mmd_ctrl+0x20/0x24)
     r7:0000001f r6:00000020 r5:00000002 r4:c22a1dc4
    [<c0451fb4>] (sh_mmd_ctrl) from [<c044fc18>] (mdiobb_cmd+0x38/0xa8)
    [<c044fbe0>] (mdiobb_cmd) from [<c044feb8>] (mdiobb_read+0x58/0xdc)
     r9:c229f844 r8:c0c329dc r7:c221e000 r6:00000001 r5:c22a1dc4 r4:00000001
    [<c044fe60>] (mdiobb_read) from [<c044c854>] (__mdiobus_read+0x74/0xe0)
     r7:0000001f r6:00000001 r5:c221e000 r4:c221e000
    [<c044c7e0>] (__mdiobus_read) from [<c044c9d8>] (mdiobus_read+0x40/0x54)
     r7:0000001f r6:00000001 r5:c221e000 r4:c221e458
    [<c044c998>] (mdiobus_read) from [<c044d678>] (phy_read+0x1c/0x20)
     r7:ffffe000 r6:c221e470 r5:00000200 r4:c229f800
    [<c044d65c>] (phy_read) from [<c044d94c>] (kszphy_config_intr+0x44/0x80)
    [<c044d908>] (kszphy_config_intr) from [<c044694c>] (phy_disable_interrupts+0x44/0x50)
     r5:c229f800 r4:c229f800
    [<c0446908>] (phy_disable_interrupts) from [<c0449370>] (phy_shutdown+0x18/0x1c)
     r5:c229f800 r4:c229f804
    [<c0449358>] (phy_shutdown) from [<c040066c>] (device_shutdown+0x168/0x1f8)
    [<c0400504>] (device_shutdown) from [<c013de44>] (kernel_restart_prepare+0x3c/0x48)
     r9:c22d2000 r8:c0100264 r7:c0b0d034 r6:00000000 r5:4321fedc r4:00000000
    [<c013de08>] (kernel_restart_prepare) from [<c013dee0>] (kernel_restart+0x1c/0x60)
    [<c013dec4>] (kernel_restart) from [<c013e1d8>] (__do_sys_reboot+0x168/0x208)
     r5:4321fedc r4:01234567
    [<c013e070>] (__do_sys_reboot) from [<c013e2e8>] (sys_reboot+0x18/0x1c)
     r7:00000058 r6:00000000 r5:00000000 r4:00000000
    [<c013e2d0>] (sys_reboot) from [<c0100060>] (ret_fast_syscall+0x0/0x54)

As of commit e2f016cf77 ("net: phy: add a shutdown procedure"),
system reboot calls phy_disable_interrupts() during shutdown.  As this
happens unconditionally, the PHY registers may be accessed while the
device is suspended, causing undefined behavior, which may crash the
system.

Fix this by wrapping the PHY bitbang accessors in the sh_eth driver by
wrappers that take care of Runtime PM, to resume the device when needed.

Reported-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Suggested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-01-19 12:02:20 -08:00
..
accessibility speakup: fix uninitialized flush_lock 2020-12-09 15:38:13 +01:00
acpi Merge branches 'acpi-scan' and 'acpi-misc' 2021-01-08 18:15:44 +01:00
amba
android Merge branch 'exec-for-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2020-12-15 19:29:43 -08:00
ata
atm atm: idt77252: call pci_disable_device() on error path 2020-12-21 17:34:09 -08:00
auxdisplay
base Device properties framework fixes for 5.11-rc3 2021-01-08 15:45:47 -08:00
bcma
block block/rnbd-clt: avoid module unload race with close confirmation 2021-01-08 08:19:18 -07:00
bluetooth Bluetooth: btusb: Add workaround for remote-wakeup issues with Barrot 8041a02 fake CSR controllers 2020-12-07 17:01:54 +02:00
bus ARM: SoC drivers for v5.11 2020-12-16 16:38:41 -08:00
cdrom cdrom: Reset sector_size back it is not 2048. 2020-12-12 11:12:25 -07:00
char UAPI Changes: 2020-12-18 12:38:28 -08:00
clk clk: tegra30: Add hda clock default rates to clock driver 2021-01-12 14:43:53 +01:00
clocksource asm-generic: cross-architecture timer cleanup 2020-12-16 00:07:17 -08:00
connector net/connector: Add const qualifier to cb_id 2020-12-16 11:06:49 -08:00
counter counter: microchip-tcb-capture: Fix CMR value check 2020-12-03 19:40:31 +00:00
cpufreq cpufreq: intel_pstate: remove obsolete functions 2021-01-07 18:22:46 +01:00
cpuidle ARM: SoC drivers for v5.11 2020-12-16 16:38:41 -08:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2020-12-27 09:14:32 -08:00
dax libnvdimm for 5.11 2020-12-24 12:18:11 -08:00
dca
devfreq Merge branches 'pm-devfreq' and 'pm-tools' 2020-12-15 15:27:16 +01:00
dio
dma dmaengine: stm32-mdma: fix STM32_MDMA_VERY_HIGH_PRIORITY value 2021-01-04 21:27:45 +05:30
dma-buf dmabuf: fix use-after-free of dmabuf's file->f_inode 2021-01-07 13:40:30 +01:00
edac Merge branch 'akpm' (patches from Andrew) 2020-12-15 12:53:37 -08:00
eisa
extcon extcon: max77693: Fix modalias string 2020-12-11 17:18:10 +09:00
firewire
firmware EFI updates collected by Ard Biesheuvel: 2020-12-24 12:40:07 -08:00
fpga Merge 5.10-rc7 into char-misc-next 2020-12-07 10:08:14 +01:00
fsi hwmon patches for v5.11 2020-12-15 16:06:14 -08:00
gnss
gpio This is the bulk of the GPIO changes for the v5.11 kernel cycle: 2020-12-17 18:07:20 -08:00
gpu * dma-buf: fix a use-after-free 2021-01-08 10:39:18 +01:00
greybus
hid HID: logitech-hidpp: Add product ID for MX Ergo in Bluetooth mode 2021-01-14 13:27:35 +01:00
hsi HSI: core: fix a kernel-doc markup 2020-12-02 22:35:44 +01:00
hv x86/hyperv: Fix kexec panic/hang issues 2021-01-05 17:52:04 +00:00
hwmon hwmon: (amd_energy) fix allocation of hwmon_channel_info config 2021-01-08 07:31:03 -08:00
hwspinlock hwspinlock: sirf: Remove the redundant 'of_match_ptr' 2020-12-10 13:34:40 -06:00
hwtracing Char / Misc driver updates for 5.11-rc1 2020-12-15 14:10:09 -08:00
i2c i2c: mediatek: Fix apdma and i2c hand-shake timeout 2021-01-05 10:54:37 +01:00
i3c i3c/master/mipi-i3c-hci: quiet maybe-unused variable warning 2020-12-17 10:31:30 +01:00
ide SCSI fixes on 20210101 2021-01-01 12:58:07 -08:00
idle intel_idle: add SnowRidge C-state table 2020-12-30 18:25:34 +01:00
iio Staging / IIO driver patches for 5.11-rc1 2020-12-15 14:18:40 -08:00
infiniband block/rnbd-clt: Does not request pdu to rtrs-clt 2020-12-16 14:56:09 -07:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2020-12-15 16:18:23 -08:00
interconnect interconnect: imx8mq: Use icc_sync_state 2020-12-28 14:03:02 +02:00
iommu iommu/vt-d: Fix ineffective devTLB invalidation for subdevices 2021-01-07 14:38:15 +00:00
ipack
irqchip ARM: 2020-12-20 10:44:05 -08:00
isdn misdn: dsp: select CONFIG_BITREVERSE 2021-01-05 15:50:36 -08:00
leds
lightnvm lightnvm: select CONFIG_CRC32 2021-01-03 14:54:44 -07:00
macintosh macintosh/adb-iop: Send correct poll command 2020-12-07 10:48:16 +01:00
mailbox mailbox: arm_mhuv2: Add driver 2020-12-09 19:26:02 -06:00
mcb
md block-5.11-2021-01-10 2021-01-10 12:53:08 -08:00
media ARM: SoC drivers for v5.11 2020-12-16 16:38:41 -08:00
memory Merge tag 'memory-controller-drv-tegra-5.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into arm/drivers 2020-12-09 00:40:02 +01:00
memstick memstick: r592: Fix error return in r592_probe() 2020-12-04 12:27:10 +01:00
message SCSI misc on 20201216 2020-12-16 13:34:31 -08:00
mfd mfd: ab8500-debugfs: Remove extraneous seq_putc 2020-12-26 09:19:49 -08:00
misc misc: pvpanic: Check devm_ioport_map() for NULL 2021-01-07 20:28:01 +01:00
mmc MMC core: 2020-12-15 15:57:25 -08:00
most
mtd This pull request contains changes for JFFS2, UBI and UBIFS: 2020-12-17 17:46:34 -08:00
mux
net sh_eth: Make PHY access aware of Runtime PM to fix reboot crash 2021-01-19 12:02:20 -08:00
nfc nfc: s3fwrn5: Remove unused NCI prop commands 2020-12-16 13:09:35 -08:00
ntb Big fix for IDT NTB and Intel NTB LTR management support 2020-12-27 09:22:55 -08:00
nubus
nvdimm libnvdimm/label: Return -ENXIO for no slot in __blk_label_update 2020-12-16 16:53:00 -08:00
nvme nvme: remove the unused status argument from nvme_trace_bio_complete 2021-01-06 10:30:37 +01:00
nvmem
of Driver core updates for 5.11-rc1 2020-12-15 14:02:26 -08:00
opp opp: Call the missing clk_put() on error 2020-12-28 10:56:22 +05:30
oprofile
parisc
parport
pci pci-v5.11-fixes-1 2020-12-25 20:17:40 -08:00
pcmcia Merge branch 'pcmcia-next' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux 2020-12-19 12:50:10 -08:00
perf perf/imx_ddr: Add system PMU identifier for userspace 2020-12-09 14:14:02 +00:00
phy Char / Misc driver updates for 5.11-rc1 2020-12-15 14:10:09 -08:00
pinctrl A treewide cleanup of interrupt descriptor (ab)use with all sorts of racy 2020-12-24 13:50:23 -08:00
platform chrome platform changes for 5.11 2020-12-23 15:06:22 -08:00
pnp
power power: supply: Fix a typo in warning message 2020-12-13 01:00:10 +01:00
powercap Merge branches 'pm-sleep', 'pm-acpi', 'pm-domains' and 'powercap' 2020-12-15 15:26:14 +01:00
pps
ps3 powerpc/ps3: use dma_mapping_error() 2020-12-15 22:50:12 +11:00
ptp ptp: ptp_ines: prevent build when HAS_IOMEM is not set 2021-01-06 16:17:23 -08:00
pwm pwm: Changes for v5.11-rc1 2020-12-19 11:51:32 -08:00
rapidio rapidio: remove unused rio_get_asm() and rio_get_device() 2020-12-15 22:46:18 -08:00
ras
regulator Merge qcom driver fix into regulator-5.11 2021-01-04 16:23:20 +00:00
remoteproc ARM: SoC drivers for v5.11 2020-12-16 16:38:41 -08:00
reset ARM: SoC drivers for v5.11 2020-12-16 16:38:41 -08:00
rpmsg
rtc RTC for 5.11 2020-12-20 10:12:06 -08:00
s390 s390/qeth: fix L2 header access in qeth_l3_osa_features_check() 2021-01-07 18:54:06 -08:00
sbus
scsi Merge branch '5.11/scsi-postmerge' into 5.11/scsi-fixes 2021-01-04 13:27:39 -05:00
sfi
sh
siox siox: Make remove callback return void 2020-12-10 16:17:15 +01:00
slimbus slimbus: qcom: fix potential NULL dereference in qcom_slim_prg_slew() 2020-12-10 16:23:56 +01:00
soc OpenRISC updates for 5.11 2020-12-17 13:41:27 -08:00
soundwire soundwire: intel: fix another unused-function warning 2020-12-05 13:11:54 +05:30
spi spi: fix the divide by 0 error when calculating xfer waiting time 2021-01-04 14:24:58 +00:00
spmi spmi: Add driver shutdown support 2020-12-10 10:45:36 +01:00
ssb
staging staging: ION: remove some references to CONFIG_ION 2021-01-06 17:39:38 +01:00
target scsi: target: Fix XCOPY NAA identifier lookup 2021-01-11 17:06:48 -05:00
tc
tee ARM: SoC drivers for v5.11 2020-12-16 16:38:41 -08:00
thermal - Add Alder Lake support ACPI ids (Srinivas Pandruvada) 2020-12-18 12:19:37 -08:00
thunderbolt thunderbolt: Changes for v5.11 merge window 2020-12-08 13:41:45 +01:00
tty Revert "init/console: Use ttynull as a fallback when there is no console" 2021-01-08 11:02:18 -08:00
uio uio: uio_hv_generic: use devm_kzalloc() for private data alloc 2020-12-09 19:59:00 +01:00
usb usb: dwc3: gadget: Clear wait flag on dequeue 2021-01-07 14:24:35 +01:00
vdpa virtio,vdpa: features, cleanups, fixes 2020-12-24 12:06:46 -08:00
vfio ARM: 2020-12-20 10:44:05 -08:00
vhost vhost: bugfix 2021-01-05 13:30:28 -08:00
video UAPI Changes: 2020-12-18 12:38:28 -08:00
virt
virtio virtio,vdpa: features, cleanups, fixes 2020-12-24 12:06:46 -08:00
visorbus
vlynq
vme vme: switch from 'pci_' to 'dma_' API 2020-12-09 19:44:34 +01:00
w1
watchdog linux-watchdog 5.11-rc1 tag 2020-12-23 15:01:49 -08:00
xen A treewide cleanup of interrupt descriptor (ab)use with all sorts of racy 2020-12-24 13:50:23 -08:00
zorro
Kconfig
Makefile asm-generic: cross-architecture timer cleanup 2020-12-16 00:07:17 -08:00