1
0
Fork 0
alistair23-linux/drivers
Cristian Ciocaltea 4b1b346219 dmaengine: owl: Use correct lock in owl_dma_get_pchan()
commit f8f482deb0 upstream.

When the kernel is built with lockdep support and the owl-dma driver is
used, the following message is shown:

[    2.496939] INFO: trying to register non-static key.
[    2.501889] the code is fine but needs lockdep annotation.
[    2.507357] turning off the locking correctness validator.
[    2.512834] CPU: 0 PID: 12 Comm: kworker/0:1 Not tainted 5.6.3+ #15
[    2.519084] Hardware name: Generic DT based system
[    2.523878] Workqueue: events_freezable mmc_rescan
[    2.528681] [<801127f0>] (unwind_backtrace) from [<8010da58>] (show_stack+0x10/0x14)
[    2.536420] [<8010da58>] (show_stack) from [<8080fbe8>] (dump_stack+0xb4/0xe0)
[    2.543645] [<8080fbe8>] (dump_stack) from [<8017efa4>] (register_lock_class+0x6f0/0x718)
[    2.551816] [<8017efa4>] (register_lock_class) from [<8017b7d0>] (__lock_acquire+0x78/0x25f0)
[    2.560330] [<8017b7d0>] (__lock_acquire) from [<8017e5e4>] (lock_acquire+0xd8/0x1f4)
[    2.568159] [<8017e5e4>] (lock_acquire) from [<80831fb0>] (_raw_spin_lock_irqsave+0x3c/0x50)
[    2.576589] [<80831fb0>] (_raw_spin_lock_irqsave) from [<8051b5fc>] (owl_dma_issue_pending+0xbc/0x120)
[    2.585884] [<8051b5fc>] (owl_dma_issue_pending) from [<80668cbc>] (owl_mmc_request+0x1b0/0x390)
[    2.594655] [<80668cbc>] (owl_mmc_request) from [<80650ce0>] (mmc_start_request+0x94/0xbc)
[    2.602906] [<80650ce0>] (mmc_start_request) from [<80650ec0>] (mmc_wait_for_req+0x64/0xd0)
[    2.611245] [<80650ec0>] (mmc_wait_for_req) from [<8065aa10>] (mmc_app_send_scr+0x10c/0x144)
[    2.619669] [<8065aa10>] (mmc_app_send_scr) from [<80659b3c>] (mmc_sd_setup_card+0x4c/0x318)
[    2.628092] [<80659b3c>] (mmc_sd_setup_card) from [<80659f0c>] (mmc_sd_init_card+0x104/0x430)
[    2.636601] [<80659f0c>] (mmc_sd_init_card) from [<8065a3e0>] (mmc_attach_sd+0xcc/0x16c)
[    2.644678] [<8065a3e0>] (mmc_attach_sd) from [<8065301c>] (mmc_rescan+0x3ac/0x40c)
[    2.652332] [<8065301c>] (mmc_rescan) from [<80143244>] (process_one_work+0x2d8/0x780)
[    2.660239] [<80143244>] (process_one_work) from [<80143730>] (worker_thread+0x44/0x598)
[    2.668323] [<80143730>] (worker_thread) from [<8014b5f8>] (kthread+0x148/0x150)
[    2.675708] [<8014b5f8>] (kthread) from [<801010b4>] (ret_from_fork+0x14/0x20)
[    2.682912] Exception stack(0xee8fdfb0 to 0xee8fdff8)
[    2.687954] dfa0:                                     00000000 00000000 00000000 00000000
[    2.696118] dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    2.704277] dfe0: 00000000 00000000 00000000 00000000 00000013 00000000

The obvious fix would be to use 'spin_lock_init()' on 'pchan->lock'
before attempting to call 'spin_lock_irqsave()' in 'owl_dma_get_pchan()'.

However, according to Manivannan Sadhasivam, 'pchan->lock' was supposed
to only protect 'pchan->vchan' while 'od->lock' does a similar job in
'owl_dma_terminate_pchan()'.

Therefore, this patch substitutes 'pchan->lock' with 'od->lock' and
removes the 'lock' attribute in 'owl_dma_pchan' struct.

Fixes: 47e20577c2 ("dmaengine: Add Actions Semi Owl family S900 DMA driver")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Acked-by: Andreas Färber <afaerber@suse.de>
Link: https://lore.kernel.org/r/c6e6cdaca252b5364bd294093673951036488cf0.1588439073.git.cristian.ciocaltea@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-27 17:46:43 +02:00
..
accessibility
acpi ACPI: EC: PM: Avoid flushing EC work when EC GPE is inactive 2020-05-27 17:46:10 +02:00
amba
android binderfs: use refcount for binder control devices too 2020-03-25 08:25:50 +01:00
ata libata: Return correct status in sata_pmp_eh_recover_pm() when ATA_DFLAG_DETACH is set 2020-04-17 10:50:22 +02:00
atm fore200e: Fix incorrect checks of NULL pointer dereference 2020-02-24 08:36:36 +01:00
auxdisplay
base component: Silence bind error on -EPROBE_DEFER 2020-05-27 17:46:31 +02:00
bcma
block virtio-blk: handle block_device_operations callbacks after hot unplug 2020-05-20 08:20:06 +02:00
bluetooth Bluetooth: btusb: Disable runtime suspend on Realtek devices 2020-02-11 04:35:09 -08:00
bus bus: sunxi-rsb: Return correct data when mixing 16-bit and 8-bit reads 2020-04-17 10:49:56 +02:00
cdrom cdrom: respect device capabilities during opening action 2020-01-04 19:18:25 +01:00
char tpm: ibmvtpm: retry on H_CLOSED in tpm_ibmvtpm_send() 2020-04-29 16:33:16 +02:00
clk clk: Unlink clock if failed to prepare or enable 2020-05-20 08:20:37 +02:00
clocksource clocksource/drivers/hyper-v: Untangle stimers and timesync from clocksources 2020-04-01 11:02:12 +02:00
connector
counter counter: 104-quad-8: Add lock guards - generic interface 2020-05-02 08:48:44 +02:00
cpufreq cpufreq: intel_pstate: Only mention the BIOS disabling turbo mode once 2020-05-20 08:20:14 +02:00
cpuidle cpuidle: teo: Avoid using "early hits" incorrectly 2020-02-05 21:22:52 +00:00
crypto crypto: caam - fix the address of the last entry of S/G 2020-05-06 08:15:07 +02:00
dax
dca
devfreq PM / devfreq: Add missing locking while setting suspend_freq 2020-05-10 10:31:34 +02:00
dio
dma dmaengine: owl: Use correct lock in owl_dma_get_pchan() 2020-05-27 17:46:43 +02:00
dma-buf dma-buf: Fix SET_NAME ioctl uapi 2020-05-06 08:15:01 +02:00
edac EDAC/synopsys: Do not print an error with back-to-back snprintf() calls 2020-03-12 13:00:31 +01:00
eisa
extcon extcon: axp288: Add wakeup support 2020-04-08 09:08:43 +02:00
firewire net: add annotations on hh->hh_len lockless accesses 2020-01-09 10:20:06 +01:00
firmware gcc-10: mark more functions __init to avoid section mismatch warnings 2020-05-20 08:20:29 +02:00
fpga fpga: dfl: pci: fix return value of cci_pci_sriov_configure 2020-04-29 16:33:22 +02:00
fsi fsi: core: Fix small accesses and unaligned offsets via sysfs 2019-12-31 16:45:09 +01:00
gnss
gpio gpio: pca953x: Fix pca953x_gpio_set_config 2020-05-20 08:20:04 +02:00
gpu drm/etnaviv: Fix a leak in submit_pin_objects() 2020-05-27 17:46:42 +02:00
greybus
hid HID: quirks: Add HID_QUIRK_NO_INIT_REPORTS quirk for Dell K12A keyboard-dock 2020-05-27 17:46:34 +02:00
hsi
hv Drivers: hv: vmbus: Fix Suspend-to-Idle for Generation-2 VM 2020-05-06 08:15:09 +02:00
hwmon hwmon: (da9052) Synchronize access with mfd 2020-05-20 08:20:26 +02:00
hwspinlock
hwtracing stm class: sys-t: Fix the use of time_after() 2020-03-25 08:25:56 +01:00
i2c i2c: mux: demux-pinctrl: Fix an error handling path in 'i2c_demux_pinctrl_probe()' 2020-05-27 17:46:18 +02:00
i3c
ide ide: serverworks: potential overflow in svwks_set_pio_mode() 2020-02-24 08:36:53 +01:00
idle
iio iio:ad7797: Use correct attribute_group 2020-05-02 08:48:44 +02:00
infiniband RDMA/iw_cxgb4: Fix incorrect function parameters 2020-05-20 08:20:26 +02:00
input Input: i8042 - add Acer Aspire 5738z to nomux list 2020-04-17 10:50:21 +02:00
interconnect interconnect: qcom: qcs404: Walk the list safely on node removal 2019-12-17 19:55:39 +01:00
iommu iommu/amd: Call domain_flush_complete() in update_domain() 2020-05-27 17:46:35 +02:00
ipack
irqchip irqchip/mbigen: Free msi_desc on device teardown 2020-04-23 10:36:20 +02:00
isdn net: use skb_queue_empty_lockless() in poll() handlers 2019-10-28 13:33:41 -07:00
leds leds: core: Fix warning message when init_data 2020-04-23 10:36:37 +02:00
lightnvm
macintosh macintosh: windfarm: fix MODINFO regression 2020-03-18 07:17:53 +01:00
mailbox mailbox: imx: Fix Tx doorbell shutdown path 2020-01-04 19:18:30 +01:00
mcb
md dm multipath: use updated MPATHF_QUEUE_IO on mapping for bio-based mpath 2020-05-06 08:15:10 +02:00
media media: ti-vpe: cal: fix a kernel oops when unloading module 2020-04-17 10:50:08 +02:00
memory memory: mtk-smi: Add PM suspend and resume ops 2020-01-17 19:48:59 +01:00
memstick
message scsi: mptfusion: Fix double fetch bug in ioctl 2020-01-23 08:22:35 +01:00
mfd mfd: intel-lpss: Use devm_ioremap_uc for MMIO 2020-05-10 10:31:30 +02:00
misc mei: me: add cedar fork device ids 2020-04-08 09:08:42 +02:00
mmc mmc: block: Fix request completion in the CQE timeout path 2020-05-20 08:20:22 +02:00
mtd mtd: Fix mtd not registered due to nvmem name collision 2020-05-27 17:46:22 +02:00
mux
net stmmac: fix pointer check after utilization in stmmac_interrupt 2020-05-27 17:46:34 +02:00
nfc NFC: fdp: Fix a signedness bug in fdp_nci_send_patch() 2020-04-01 11:01:38 +02:00
ntb
nubus
nvdimm libnvdimm: Out of bounds read in __nd_ioctl() 2020-04-23 10:36:42 +02:00
nvme nvme: fix possible hang when ns scanning fails during error recovery 2020-05-14 07:58:18 +02:00
nvmem nvmem: check for NULL reg_read and reg_write before dereferencing 2020-04-08 09:08:42 +02:00
of of: overlay: kmemleak in dup_and_fixup_symbol_prop() 2020-04-23 10:36:23 +02:00
opp opp: Free static OPPs on errors while adding them 2020-02-24 08:36:34 +01:00
oprofile
parisc
parport parport: load lowlevel driver if ports not found 2019-12-31 16:45:25 +01:00
pci PCI: Move Apex Edge TPU class quirk to fix BAR assignment 2020-05-02 08:48:50 +02:00
pcmcia
perf drivers/perf: arm_pmu_acpi: Fix incorrect checking of gicc pointer 2020-03-25 08:25:47 +01:00
phy phy: uniphier-usb3ss: Add Pro5 support 2020-04-23 10:36:33 +02:00
pinctrl pinctrl: cherryview: Add missing spinlock usage in chv_gpio_irq_handler 2020-05-20 08:20:19 +02:00
platform platform/x86: asus-nb-wmi: Do not load on Asus T100TA and T200TA 2020-05-27 17:46:35 +02:00
pnp
power power: supply: axp288_fuel_gauge: Broaden vendor check for Intel Compute Sticks. 2020-04-23 10:36:41 +02:00
powercap powercap: intel_rapl: add NULL pointer check to rapl_mmio_cpu_online() 2020-01-14 20:08:18 +01:00
pps
ps3
ptp ptp: free ptp device pin descriptors properly 2020-01-23 08:22:51 +01:00
pwm pwm: bcm2835: Dynamically allocate base 2020-04-29 16:33:02 +02:00
rapidio
ras
regulator regulator: stm32-vrefbuf: fix a possible overshoot when re-enabling 2020-03-12 13:00:29 +01:00
remoteproc remoteproc: qcom_q6v5_mss: fix a bug in q6v5_probe() 2020-05-10 10:31:25 +02:00
reset reset: uniphier: Add SCSSI reset control for each channel 2020-02-24 08:36:41 +01:00
rpmsg rpmsg: char: release allocated memory 2020-01-14 20:08:37 +01:00
rtc rtc: 88pm860x: fix possible race condition 2020-04-23 10:36:31 +02:00
s390 s390/ism: fix error return code in ism_probe() 2020-05-20 08:20:26 +02:00
sbus
scsi scsi: qla2xxx: Do not log message when reading port speed via sysfs 2020-05-27 17:46:40 +02:00
sfi
sh
siox
slimbus
soc drivers: soc: xilinx: fix firmware driver Kconfig dependency 2020-05-02 08:48:46 +02:00
soundwire soundwire: intel: fix PDI/stream mapping for Bulk 2019-12-31 16:45:11 +01:00
spi spi: spi-fsl-dspi: Replace interruptible wait queue with a simple completion 2020-04-17 10:50:05 +02:00
spmi spmi: pmic-arb: Set lockdep class for hierarchical irq domains 2020-02-19 19:53:07 +01:00
ssb
staging staging: gasket: Check the return value of gasket_get_bar_index() 2020-05-14 07:58:27 +02:00
target scsi: target: Put lun_ref at end of tmr processing 2020-05-27 17:46:40 +02:00
tc
tee tee: optee: Fix compilation issue with nommu 2020-02-05 21:22:49 +00:00
thermal thermal: brcmstb_thermal: Do not use DT coefficients 2020-03-05 16:43:50 +01:00
thunderbolt thunderbolt: Prevent crash if non-active NVMem file is read 2020-02-28 17:22:13 +01:00
tty tty: xilinx_uartps: Fix missing id assignment to the console 2020-05-14 07:58:19 +02:00
uio uio: fix a sleep-in-atomic-context bug in uio_dmem_genirq_irqcontrol() 2020-02-24 08:36:27 +01:00
usb USB: core: Fix misleading driver bug report 2020-05-27 17:46:34 +02:00
vfio vfio/type1: Fix VA->PA translation for PFNMAP VMAs in vaddr_get_pfn() 2020-05-06 08:15:14 +02:00
vhost vhost/vsock: fix packet delivery order to monitoring devices 2020-05-27 17:46:31 +02:00
video fbmem: Adjust indentation in fb_prepare_logo and fb_blank 2020-04-23 10:36:43 +02:00
virt
virtio virtio_ring: Fix mem leak with vring_new_virtqueue() 2020-03-18 07:17:55 +01:00
visorbus visorbus: fix uninitialized variable access 2020-02-24 08:36:47 +01:00
vlynq
vme vme: bridges: reduce stack usage 2020-02-24 08:36:48 +01:00
w1
watchdog watchdog: reset last_hw_keepalive time at start 2020-04-29 16:32:57 +02:00
xen xen/xenbus: ensure xenbus_map_ring_valloc() returns proper grant status 2020-05-02 08:48:57 +02:00
zorro
Kconfig
Makefile