linux/drivers
H. Nikolaus Schaller 28a994fad9 Input: twl6040-vibra - fix atomic schedule panic
commit c6f39257c9 ("mfd: twl6040: Use regmap for register cache")

did remove the private cache for the vibra control registers and replaced
access within twl6040_get_vibralr_status() by calls to regmap. This is OK,
as long as twl6040_get_vibralr_status() uses already cached values or is
not called from interrupt context. But we call this in vibra_play() for
checking that the vibrator is not configured for audio mode.

The result is a "BUG: scheduling while atomic" if the first use of the
twl6040 is a vibra effect, because the first fetch is by reading the
twl6040 registers through (blocking) i2c and not from the cache.

As soon as the regmap has cached the status, further calls are fine.

The solution is to move the condition to the work() function which
runs in context that can block.

The original code returns -EBUSY, but the return value of ->play()
functions is ignored anyways. Hence, we do not loose functionality
by not returning an error but just reporting the issue to INFO loglevel.

Tested-on: Pyra (omap5) prototype
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-04-25 14:06:38 -07:00
..
accessibility
acpi ACPICA: Revert "Parser: Fix for SuperName method invocation" 2016-03-08 22:58:38 +01:00
amba
android
ata
atm
auxdisplay
base device property: fwnode->secondary may contain ERR_PTR(-ENODEV) 2016-03-09 01:07:43 +01:00
bcma
block
bluetooth
bus
cdrom
char
clk
clocksource
connector
cpufreq
cpuidle
crypto
dca
devfreq
dio
dma dmaengine: at_xdmac: fix residue computation 2016-03-10 16:32:36 +05:30
dma-buf
edac EDAC, sb_edac: Fix logic when computing DIMM sizes on Xeon Phi 2016-03-07 19:07:40 +01:00
eisa
extcon
firewire
firmware
fmc
fpga
gpio
gpu Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux 2016-03-11 16:19:23 -08:00
hid
hsi
hv
hwmon
hwspinlock
hwtracing
i2c
ide
idle
iio
infiniband
input Input: twl6040-vibra - fix atomic schedule panic 2016-04-25 14:06:38 -07:00
iommu
ipack
irqchip
isdn
leds
lguest
lightnvm
macintosh
mailbox
mcb
md
media [media] media-device: map new functions into old types for legacy API 2016-03-10 15:10:59 -03:00
memory
memstick
message
mfd
misc powerpc fixes for 4.5 #4 2016-03-06 11:08:06 -08:00
mmc
mtd Late MTD fix for v4.5: 2016-03-11 16:34:18 -08:00
net ppp: release rtnl mutex when interface creation fails 2016-03-07 16:11:31 -05:00
nfc
ntb
nubus
nvdimm
nvme
nvmem
of
oprofile
parisc
parport
pci PCI updates for v4.5: 2016-03-09 13:28:27 -08:00
pcmcia
perf
phy
pinctrl
platform
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390
sbus
scsi
sfi
sh
sn
soc
spi Merge remote-tracking branch 'spi/fix/rockchip' into spi-linus 2016-03-10 10:42:24 +07:00
spmi
ssb
staging media fixes for v4.5-rc7 2016-03-05 12:32:34 -08:00
target target: Drop incorrect ABORT_TASK put for completed commands 2016-03-05 20:24:47 -08:00
tc
thermal
thunderbolt
tty
uio
usb
uwb
vfio
vhost
video
virt
virtio
vlynq
vme
w1
watchdog
xen
zorro
Kconfig
Makefile