linux-stable/drivers
Stephen Boyd 3c5445ce3a cpufreq: OPP: Avoid sleeping while atomic
We allocate the cpufreq table after calling rcu_read_lock(),
which disables preemption. This causes scheduling while atomic
warnings. Use GFP_ATOMIC instead of GFP_KERNEL and update for
kcalloc while we're here.

BUG: sleeping function called from invalid context at mm/slub.c:1246
in_atomic(): 0, irqs_disabled(): 0, pid: 80, name: modprobe
5 locks held by modprobe/80:
 #0:  (&dev->mutex){......}, at: [<c050d484>] __driver_attach+0x48/0x98
 #1:  (&dev->mutex){......}, at: [<c050d494>] __driver_attach+0x58/0x98
 #2:  (subsys mutex#5){+.+.+.}, at: [<c050c114>] subsys_interface_register+0x38/0xc8
 #3:  (cpufreq_rwsem){.+.+.+}, at: [<c05a9c8c>] __cpufreq_add_dev.isra.22+0x84/0x92c
 #4:  (rcu_read_lock){......}, at: [<c05ab24c>] dev_pm_opp_init_cpufreq_table+0x18/0x10c
Preemption disabled at:[<  (null)>]   (null)

CPU: 2 PID: 80 Comm: modprobe Not tainted 3.16.0-rc3-next-20140701-00035-g286857f216aa-dirty #217
[<c0214da8>] (unwind_backtrace) from [<c02123f8>] (show_stack+0x10/0x14)
[<c02123f8>] (show_stack) from [<c070141c>] (dump_stack+0x70/0xbc)
[<c070141c>] (dump_stack) from [<c02f4cb0>] (__kmalloc+0x124/0x250)
[<c02f4cb0>] (__kmalloc) from [<c05ab270>] (dev_pm_opp_init_cpufreq_table+0x3c/0x10c)
[<c05ab270>] (dev_pm_opp_init_cpufreq_table) from [<bf000508>] (cpufreq_init+0x48/0x378 [cpufreq_generic])
[<bf000508>] (cpufreq_init [cpufreq_generic]) from [<c05a9e08>] (__cpufreq_add_dev.isra.22+0x200/0x92c)
[<c05a9e08>] (__cpufreq_add_dev.isra.22) from [<c050c160>] (subsys_interface_register+0x84/0xc8)
[<c050c160>] (subsys_interface_register) from [<c05a9494>] (cpufreq_register_driver+0x108/0x2d8)
[<c05a9494>] (cpufreq_register_driver) from [<bf000888>] (generic_cpufreq_probe+0x50/0x74 [cpufreq_generic])
[<bf000888>] (generic_cpufreq_probe [cpufreq_generic]) from [<c050e994>] (platform_drv_probe+0x18/0x48)
[<c050e994>] (platform_drv_probe) from [<c050d1f4>] (driver_probe_device+0x128/0x370)
[<c050d1f4>] (driver_probe_device) from [<c050d4d0>] (__driver_attach+0x94/0x98)
[<c050d4d0>] (__driver_attach) from [<c050b778>] (bus_for_each_dev+0x54/0x88)
[<c050b778>] (bus_for_each_dev) from [<c050c894>] (bus_add_driver+0xe8/0x204)
[<c050c894>] (bus_add_driver) from [<c050dd48>] (driver_register+0x78/0xf4)
[<c050dd48>] (driver_register) from [<c0208870>] (do_one_initcall+0xac/0x1d8)
[<c0208870>] (do_one_initcall) from [<c028b6b4>] (load_module+0x190c/0x21e8)
[<c028b6b4>] (load_module) from [<c028c034>] (SyS_init_module+0xa4/0x110)
[<c028c034>] (SyS_init_module) from [<c020f0c0>] (ret_fast_syscall+0x0/0x48)

Fixes: a0dd7b7965 (PM / OPP: Move cpufreq specific OPP functions out of generic OPP library)
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: 3.16+ <stable@vger.kernel.org> # 3.16+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-08-07 00:23:23 +02:00
..
accessibility
acpi ACPI / video: Add use_native_backlight quirk for HP ProBook 4540s 2014-07-16 14:16:30 +02:00
amba
ata ahci_xgene: fix the dma state machine lockup for the IDENTIFY DEVICE PIO mode command. 2014-07-08 11:46:05 -04:00
atm atm: fore200e.c: Cleaning up uninitialized variables 2014-06-02 17:11:03 -07:00
auxdisplay
base platform_get_irq: Revert to platform_get_resource if of_irq_get fails 2014-07-11 18:06:36 -07:00
bcma
block zram: revalidate disk after capacity change 2014-07-03 09:21:53 -07:00
bluetooth Bluetooth: Ignore H5 non-link packets in non-active state 2014-06-23 18:22:48 +02:00
bus bus/arm-cci: add dependency on OF && CPU_V7 2014-06-17 17:09:35 +02:00
cdrom Merge branch 'for-linus' of git://git.kernel.dk/linux-block 2014-06-11 08:41:17 -07:00
char Fix a BUG splat found by trinity. 2014-07-18 20:26:46 -10:00
clk This batch of fixes is for a handful of clock drivers from Allwinner, 2014-07-13 12:21:04 -07:00
clocksource clocksource: exynos_mct: Register the timer for stable udelay 2014-07-05 06:40:23 +09:00
connector Char / misc driver patches for 3.16-rc1 2014-06-03 08:06:56 -07:00
cpufreq cpufreq: OPP: Avoid sleeping while atomic 2014-08-07 00:23:23 +02:00
cpuidle cpuidle: mvebu: Fix the name of the states 2014-06-18 21:54:46 +02:00
crypto crypto: caam - fix memleak in caam_jr module 2014-07-10 16:59:13 +08:00
dca
devfreq
dio
dma Update imx-sdma cyclic handling to report residue 2014-07-01 12:23:42 +05:30
edac PCI changes for the v3.16 merge window: 2014-06-02 12:15:19 -07:00
eisa
extcon
firewire IEEE 1394 (FireWire) subsystem fix: The 1394 drivers cannot and are not supposed 2014-07-14 17:17:53 -07:00
firmware efi: fdt: Do not report an error during boot if UEFI is not available 2014-07-10 11:02:48 +01:00
fmc
gpio gpio: mcp23s08: Eliminates redundant checking. 2014-07-05 01:14:06 +02:00
gpu Merge tag 'drm-intel-fixes-2014-07-18' of git://anongit.freedesktop.org/drm-intel 2014-07-19 16:48:38 +10:00
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid 2014-07-07 13:13:03 -07:00
hsi hsi: omap_ssi_port: use normal module refcounting 2014-06-05 00:59:05 +02:00
hv Drivers: hv: hv_fcopy: fix a race condition for SMP guest 2014-07-17 18:43:10 -07:00
hwmon hwmon: (adt7470) Fix writes to temperature limit registers 2014-07-16 21:18:47 -07:00
hwspinlock
i2c i2c: sun6i-p2wi: Remove duplicate inclusion of module.h 2014-06-27 14:39:36 +02:00
ide
idle
iio iio: mma8452: Use correct acceleration units. 2014-07-12 13:18:55 +01:00
infiniband Merge branches 'cxgb4' and 'mlx5' into for-next 2014-07-16 23:14:42 -07:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2014-06-09 18:46:02 -07:00
iommu iommu/fsl: Fix the error condition during iommu group 2014-07-07 10:30:02 +02:00
ipack
irqchip irqchip: gic: Fix core ID calculation when topology is read from DT 2014-07-18 13:13:41 +00:00
isdn net: ppp: don't call sk_chk_filter twice 2014-07-14 16:15:12 -07:00
leds Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds 2014-06-12 13:08:09 -07:00
lguest
macintosh powerpc/macintosh/smu.c: Fix closing brace followed by if 2014-06-24 12:43:15 +10:00
mailbox
mcb
md Fix the dm-thinp and dm-cache targets to disallow changing the data 2014-07-18 06:25:05 -10:00
media Merge branch 'topic/omap3isp' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2014-06-12 23:04:28 -07:00
memory
memstick drivers/memstick/host/rtsx_pci_ms.c: add cancel_work when remove driver 2014-06-23 16:47:44 -07:00
message
mfd mfd: ab8500: Fix dt irq mapping 2014-06-26 13:34:15 +01:00
misc ARM: SoC fixes for 3.16 2014-06-25 12:19:01 -07:00
mmc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-06-12 14:27:40 -07:00
mtd Two UBI fastmap-related fixes for v3.16: 2014-07-18 06:23:34 -10:00
net InfiniBand/RDMA fixes for 3.16 2014-07-18 20:39:34 -10:00
nfc
ntb
nubus kernel/printk: use symbolic defines for console loglevels 2014-06-04 16:54:17 -07:00
of Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-07-15 08:42:52 -07:00
oprofile
parisc
parport parport: convert use of typedef ctl_table to struct ctl_table 2014-06-06 16:08:15 -07:00
pci PCI: Fix unaligned access in AF transaction pending test 2014-06-17 15:40:13 -06:00
pcmcia
phy USB fixes for 3.16-rc5 2014-07-12 14:13:10 -07:00
pinctrl pinctrl: berlin: fix an error code in berlin_pinctrl_probe() 2014-07-05 01:15:35 +02:00
platform Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86 2014-06-10 16:58:32 -07:00
pnp Merge branches 'pnp', 'powercap', 'pm-runtime' and 'pm-opp' 2014-06-03 23:13:00 +02:00
power ACPI and power management updates for 3.16-rc1 2014-06-04 08:57:16 -07:00
powercap
pps
ps3
ptp ptp: ptp_pch depends on x86_32 2014-06-17 15:43:48 -07:00
pwm pwm: Changes for v3.16-rc1 2014-06-11 14:06:55 -07:00
rapidio rapidio/tsi721: use pci_enable_msix_exact() instead of pci_enable_msix() 2014-06-06 16:08:13 -07:00
regulator Merge remote-tracking branches 'regulator/fix/bcm590xx', 'regulator/fix/palmas' and 'regulator/fix/tps65218' into regulator-linus 2014-06-28 14:01:04 +01:00
remoteproc remoteproc: da8xx: don't select CMA on no-MMU 2014-06-17 17:09:36 +02:00
reset ARM: SoC driver changes 2014-06-02 16:35:49 -07:00
rpmsg
rtc drivers/rtc/rtc-puv3.c: remove "&dev->" for typo issue MIME-Version: 1.0 2014-06-20 08:22:39 +08:00
s390 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2014-06-21 06:47:01 -10:00
sbus
scsi SCSI for-linus on 20140705 2014-07-06 12:08:30 -07:00
sfi
sh SH Driver Update for v3.16 2014-06-06 11:44:09 -07:00
sn
soc
spi Merge remote-tracking branches 'spi/fix/pxa2xx', 'spi/fix/qup' and 'spi/fix/sh-sci' into spi-linus 2014-06-28 14:01:23 +01:00
spmi
ssb
staging Second set of IIO fixes for the 3.16 cycle. 2014-06-29 09:43:23 -07:00
target iscsi-target: fix iscsit_del_np deadlock on unload 2014-06-27 23:23:35 -07:00
tc TC: Handle device_register() errors. 2014-06-26 10:48:23 +01:00
thermal thermal: ti-soc-thermal: ti-bandgap.c: Cleaning up wrong address is checked 2014-07-01 09:52:35 +08:00
tty serial: imx: Fix build breakage 2014-07-11 17:43:13 -07:00
uio Revert "uio: fix vma io range check in mmap" 2014-06-17 16:07:08 -07:00
usb usb: Check if port status is equal to RxDetect 2014-07-17 17:14:01 -07:00
uwb
vfio A handful of VFIO bug fixes for v3.16 2014-06-07 20:12:15 -07:00
vhost vhost-scsi: don't open-code kvfree 2014-06-23 09:22:48 +03:00
video fb: adv7393: add missing semicolon 2014-07-01 13:18:38 +03:00
virt
virtio
vlynq
vme
w1 w1: mxc_w1: Fix incorrect "presence" status 2014-06-19 17:51:46 -07:00
watchdog Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2014-06-21 06:47:01 -10:00
xen Fixes: 2014-07-17 08:02:35 -10:00
zorro
Kconfig
Makefile Char / misc driver patches for 3.16-rc1 2014-06-03 08:06:56 -07:00