1
0
Fork 0
alistair23-linux/drivers
Mitsuhiro Kimura 7fa2955ff7 sh_eth: Fix sleeping function called from invalid context
This resolves the following bug which can be reproduced by building the
kernel with CONFIG_DEBUG_ATOMIC_SLEEP=y and reading network statistics
while the network interface is down.

e.g.:

ifconfig eth0 down
cat /sys/class/net/eth0/statistics/tx_errors

----
[ 1238.161349] BUG: sleeping function called from invalid context at drivers/base/power/runtime.c:952
[ 1238.188279] in_atomic(): 1, irqs_disabled(): 0, pid: 1388, name: cat
[ 1238.207425] CPU: 0 PID: 1388 Comm: cat Not tainted 3.10.31-ltsi-00046-gefa0b46 #1087
[ 1238.230737] Backtrace:
[ 1238.238123] [<c0012e64>] (dump_backtrace+0x0/0x10c) from [<c0013000>] (show_stack+0x18/0x1c)
[ 1238.263499]  r6:000003b8 r5:c06160c0 r4:c0669e00 r3:00404000
[ 1238.280583] [<c0012fe8>] (show_stack+0x0/0x1c) from [<c04515a4>] (dump_stack+0x20/0x28)
[ 1238.304631] [<c0451584>] (dump_stack+0x0/0x28) from [<c004970c>] (__might_sleep+0xf8/0x118)
[ 1238.329734] [<c0049614>] (__might_sleep+0x0/0x118) from [<c02465ac>] (__pm_runtime_resume+0x38/0x90)
[ 1238.357170]  r7:d616f000 r6:c049c458 r5:00000004 r4:d6a17210
[ 1238.374251] [<c0246574>] (__pm_runtime_resume+0x0/0x90) from [<c029b1c4>] (sh_eth_get_stats+0x44/0x280)
[ 1238.402468]  r7:d616f000 r6:c049c458 r5:d5c21000 r4:d5c21000
[ 1238.419552] [<c029b180>] (sh_eth_get_stats+0x0/0x280) from [<c03ae39c>] (dev_get_stats+0x54/0x88)
[ 1238.446204]  r5:d5c21000 r4:d5ed7e08
[ 1238.456980] [<c03ae348>] (dev_get_stats+0x0/0x88) from [<c03c677c>] (netstat_show.isra.15+0x54/0x9c)
[ 1238.484413]  r6:d5c21000 r5:d5c21238 r4:00000028 r3:00000001
[ 1238.501495] [<c03c6728>] (netstat_show.isra.15+0x0/0x9c) from [<c03c69b8>] (show_tx_errors+0x18/0x1c)
[ 1238.529196]  r7:d5f945d8 r6:d5f945c0 r5:c049716c r4:c0650e7c
[ 1238.546279] [<c03c69a0>] (show_tx_errors+0x0/0x1c) from [<c023963c>] (dev_attr_show+0x24/0x50)
[ 1238.572157] [<c0239618>] (dev_attr_show+0x0/0x50) from [<c010c148>] (sysfs_read_file+0xb0/0x140)
[ 1238.598554]  r5:c049716c r4:d5c21240
[ 1238.609326] [<c010c098>] (sysfs_read_file+0x0/0x140) from [<c00b9ee4>] (vfs_read+0xb0/0x13c)
[ 1238.634679] [<c00b9e34>] (vfs_read+0x0/0x13c) from [<c00ba0ac>] (SyS_read+0x44/0x74)
[ 1238.657944]  r8:bef45bf0 r7:00000000 r6:d6ac0600 r5:00000000 r4:00000000
[ 1238.678172] [<c00ba068>] (SyS_read+0x0/0x74) from [<c000eec0>] (ret_fast_syscall+0x0/0x30)
----

Signed-off-by: Mitsuhiro Kimura <mitsuhiro.kimura.kc@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-11-29 21:16:54 -08:00
..
accessibility
acpi ACPI / PM: Ignore wakeup setting if the ACPI companion can't wake up 2014-11-20 01:24:16 +01:00
amba PM / Domains: Move dev_pm_domain_attach|detach() to pm_domain.h 2014-09-30 01:16:44 +02:00
ata ahci: fix AHCI parameters not taken into account 2014-11-04 12:56:25 -05:00
atm solos-pci: fix error return code 2014-11-23 14:29:44 -05:00
auxdisplay
base Merge branches 'pm-domains', 'pm-sleep' and 'pm-cpufreq' 2014-11-14 15:17:32 +01:00
bcma bcma: add another PCI ID of device with BCM43228 2014-10-23 14:02:06 -04:00
block zram: avoid kunmap_atomic() of a NULL pointer 2014-11-13 16:17:05 -08:00
bluetooth Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2014-10-13 11:28:42 +02:00
bus ARM: SoC driver updates for 3.18 2014-10-08 17:37:16 -04:00
cdrom
char virtio: bugfix for 3.18 2014-11-13 18:07:52 -08:00
clk clk: pxa: fix pxa27x CCCR bit usage 2014-11-17 11:25:29 -08:00
clocksource clockevent: sun4i: Fix race condition in the probe code 2014-11-19 10:43:51 +01:00
connector
cpufreq cpufreq: Avoid crash in resume on SMP without OPP 2014-11-08 02:10:04 +01:00
cpuidle Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2014-10-24 12:48:47 -07:00
crypto crypto: caam - fix missing dma unmap on error path 2014-11-06 23:10:20 +08:00
dca
devfreq PM / devfreq: exynos: Enable building exynos PPMU as module 2014-09-29 20:22:36 +09:00
dio
dma Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma 2014-11-21 16:24:27 -08:00
dma-buf dma-buf: don't open-code atomic_long_read() 2014-10-09 02:39:07 -04:00
edac e7xxx_edac: Report CE events properly 2014-10-22 22:59:00 +02:00
eisa
extcon
firewire firewire: cdev: prevent kernel stack leaking into ioctl arguments 2014-11-14 12:10:13 +01:00
firmware Merge branch 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-10-23 14:45:09 -07:00
fmc
gpio This is the bulk of GPIO changes for the v3.18 development 2014-10-09 14:58:15 -04:00
gpu gpu/radeon: Set flag to indicate broken 64-bit MSI 2014-11-24 14:12:56 +11:00
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid 2014-11-13 16:19:14 -08:00
hsi
hv
hwmon hwmon: (g762) fix call to devm_hwmon_device_register_with_groups() 2014-11-19 14:06:47 -08:00
hwspinlock
i2c i2c: core: Dispose OF IRQ mapping at client removal time 2014-11-07 19:03:18 +01:00
ide Merge branch 'for-3.18/drivers' of git://git.kernel.dk/linux-block 2014-10-18 12:12:45 -07:00
idle
iio iio: accel: bmc150: set low default thresholds 2014-11-16 20:25:00 +00:00
infiniband Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2014-11-21 16:28:45 -08:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2014-11-27 17:51:50 -08:00
iommu IOMMU Updates for Linux v3.18 2014-10-15 07:23:49 +02:00
ipack
irqchip irqchip: brcmstb-l2: Fix error handling of irq_of_parse_and_map 2014-11-26 06:28:42 +00:00
isdn isdn/gigaset: fix usb_gigaset write_cmd result race 2014-10-14 15:05:35 -04:00
leds Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds 2014-10-21 08:18:38 -07:00
lguest
macintosh powerpc: Move via-cuda symbol exports next to function definitions 2014-09-25 23:14:37 +10:00
mailbox Merge branch 'mailbox-for-linus' of git://git.linaro.org/landing-teams/working/fujitsu/integration 2014-10-21 11:21:19 -07:00
mcb
md One fix for md for 3.18. 2014-11-16 15:34:31 -08:00
media [media] sp2: sp2_init() can be static 2014-11-03 19:08:06 -02:00
memory
memstick memstick: r592: fix build warnings for !PM_SLEEP 2014-10-14 02:18:22 +02:00
message SCSI for-linus on 20141007 2014-10-07 21:29:18 -04:00
mfd mfd: twl4030-power: Fix poweroff with PM configuration enabled 2014-11-10 15:22:04 +00:00
misc cxl: Fix PSL error due to duplicate segment table entries 2014-10-28 19:52:52 +11:00
mmc mmc: core: fix card detection regression 2014-11-05 09:28:48 +01:00
mtd Three main MTD fixes for 3.18: 2014-11-02 14:45:52 -08:00
net sh_eth: Fix sleeping function called from invalid context 2014-11-29 21:16:54 -08:00
nfc Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless 2014-10-07 14:48:29 -04:00
ntb ntb: Adding split BAR support for Haswell platforms 2014-10-17 07:08:51 -04:00
nubus
of of/selftest: Fix testing when /aliases is missing 2014-11-20 15:32:49 +00:00
oprofile
parisc Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-10-13 16:23:15 +02:00
parport
pci PCI/MSI: Add device flag indicating that 64-bit MSIs don't work 2014-11-24 14:11:34 +11:00
pcmcia
phy phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly 2014-11-05 14:34:06 -08:00
pinctrl pinctrl: baytrail: show output gpio state correctly on Intel Baytrail 2014-10-28 11:16:26 +01:00
platform platform: hp_accel: Add SERIO_I8042 as a dependency since it now includes i8042.h/serio.h 2014-11-10 21:16:15 -08:00
pnp PNP: replace strnicmp with strncasecmp 2014-10-14 02:18:25 +02:00
power power supply and reset changes for the v3.18-rc 2014-11-15 15:22:51 -08:00
powercap
pps
ps3
ptp
pwm pwm: Changes for v3.18-rc1 2014-10-21 08:17:43 -07:00
rapidio
ras
regulator Merge remote-tracking branches 'regulator/fix/max1586', 'regulator/fix/max77686', 'regulator/fix/max77693', 'regulator/fix/max77802', 'regulator/fix/max8860' and 'regulator/fix/s2mpa01' into regulator-linus 2014-11-05 14:59:25 +00:00
remoteproc
reset
rpmsg
rtc drivers/rtc/rtc-bq32k.c: fix register value 2014-10-29 16:33:14 -07:00
s390 KVM: s390: virtio_ccw: remove unused variable 2014-11-03 10:43:00 +01:00
sbus
scsi SCSI fixes on 20141128 2014-11-29 10:15:31 -08:00
sfi
sh
sn
soc soc: versatile: Add terminating entry for realview_soc_of_match 2014-10-28 22:05:07 +01:00
spi Merge remote-tracking branches 'spi/fix/dw' and 'spi/fix/sirf' into spi-linus 2014-11-26 19:05:25 +00:00
spmi
ssb This is the bulk of GPIO changes for the v3.18 development 2014-10-09 14:58:15 -04:00
staging staging: r8188eu: Add new device ID for DLink GO-USB-N150 2014-11-27 08:55:01 -08:00
target target: return CONFLICT only when SA key unmatched 2014-11-02 22:04:57 -08:00
tc
thermal thermal: Exynos: Deletion of unnecessary checks before two function calls 2014-11-21 15:20:17 -04:00
thunderbolt
tty Revert "serial: of-serial: add PM suspend/resume support" 2014-11-25 12:46:39 -08:00
uio uio: Export definition of struct uio_device 2014-10-02 21:35:54 -07:00
usb usb-quirks: Add reset-resume quirk for MS Wireless Laser Mouse 6000 2014-11-24 17:01:55 -08:00
uwb
vfio IOMMU Updates for Linux v3.18 2014-10-15 07:23:49 +02:00
vhost vhost-scsi: Take configfs group dependency during VHOST_SCSI_SET_ENDPOINT 2014-10-28 13:54:16 -07:00
video Merge branch '3.18/omapdss-fixes' into 3.18/fbdev-fixes 2014-10-30 14:53:49 +02:00
virt
virtio One cc: stable commit, the rest are a series of minor cleanups which have 2014-10-18 10:25:09 -07:00
vlynq
vme
w1
watchdog watchdog: meson: remove magic value for reboot 2014-10-20 21:09:17 +02:00
xen xen/pci: Allocate memory for physdev_pci_device_add's optarr 2014-10-23 16:24:02 +01:00
zorro
Kconfig soc: ti: add Keystone Navigator QMSS driver 2014-09-24 09:49:14 -04:00
Makefile