bcm27xx: add support for linux v5.15
[openwrt/staging/chunkeey.git] / target / linux / bcm27xx / patches-5.15 / 950-0647-bcm2835-v4l2-isp-Add-missing-lock-initialization.patch
1 From b1656894eef29ecd73ee239571c7ff3449bdedf2 Mon Sep 17 00:00:00 2001
2 From: Padmanabha Srinivasaiah <treasure4paddy@gmail.com>
3 Date: Thu, 30 Dec 2021 21:45:10 +0100
4 Subject: [PATCH] bcm2835-v4l2-isp: Add missing lock initialization
5
6 ISP device allocation is dynamic hence the locks too.
7 struct mutex queue_lock is not initialized which result in bug.
8
9 Fixing same by initializing it.
10
11 [ 29.847138] INFO: trying to register non-static key.
12 [ 29.847156] The code is fine but needs lockdep annotation, or maybe
13 [ 29.847159] you didn't initialize this object before use?
14 [ 29.847161] turning off the locking correctness validator.
15 [ 29.847167] CPU: 1 PID: 343 Comm: v4l_id Tainted: G C 5.15.11-rt24-v8+ #8
16 [ 29.847187] Hardware name: Raspberry Pi 4 Model B Rev 1.4 (DT)
17 [ 29.847194] Call trace:
18 [ 29.847197] dump_backtrace+0x0/0x1b8
19 [ 29.847227] show_stack+0x20/0x30
20 [ 29.847240] dump_stack_lvl+0x8c/0xb8
21 [ 29.847254] dump_stack+0x18/0x34
22 [ 29.847263] register_lock_class+0x494/0x4a0
23 [ 29.847278] __lock_acquire+0x80/0x1680
24 [ 29.847289] lock_acquire+0x214/0x3a0
25 [ 29.847300] mutex_lock_nested+0x70/0xc8
26 [ 29.847312] _vb2_fop_release+0x3c/0xa8 [videobuf2_v4l2]
27 [ 29.847346] vb2_fop_release+0x34/0x60 [videobuf2_v4l2]
28 [ 29.847367] v4l2_release+0xc8/0x108 [videodev]
29 [ 29.847453] __fput+0x8c/0x258
30 [ 29.847476] ____fput+0x18/0x28
31 [ 29.847487] task_work_run+0x98/0x180
32 [ 29.847502] do_notify_resume+0x228/0x3f8
33 [ 29.847515] el0_svc+0xec/0xf0
34 [ 29.847523] el0t_64_sync_handler+0x90/0xb8
35 [ 29.847531] el0t_64_sync+0x180/0x184
36
37 Signed-off-by: Padmanabha Srinivasaiah <treasure4paddy@gmail.com>
38 ---
39 drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c | 1 +
40 1 file changed, 1 insertion(+)
41
42 --- a/drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c
43 +++ b/drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c
44 @@ -1294,6 +1294,7 @@ static int register_node(struct bcm2835_
45 int ret;
46
47 mutex_init(&node->lock);
48 + mutex_init(&node->queue_lock);
49
50 node->dev = dev;
51 vfd = &node->vfd;