Skip to content

Commit 84e8ae8

Browse files
marcanjannau
authored andcommitted
media: apple: isp: Use a mutex instead of a spinlock for channels
Fixes lockdep splats because we do surface stuff with this held, which takes a mutex. Signed-off-by: Hector Martin <[email protected]>
1 parent e796b92 commit 84e8ae8

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

drivers/media/platform/apple/isp/isp-drv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ struct isp_channel {
7676
void *virt;
7777
u32 doorbell;
7878
u32 cursor;
79-
spinlock_t lock;
79+
struct mutex lock;
8080
struct isp_message req;
8181
struct isp_message rsp;
8282
const struct isp_chan_ops *ops;

drivers/media/platform/apple/isp/isp-fw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ static int isp_fill_channel_info(struct apple_isp *isp)
493493
chan->virt =
494494
apple_isp_ipc_translate(isp, desc.iova, chan->size);
495495
chan->cursor = 0;
496-
spin_lock_init(&chan->lock);
496+
mutex_init(&chan->lock);
497497

498498
if (!chan->virt) {
499499
dev_err(isp->dev, "Failed to find channel buffer\n");

drivers/media/platform/apple/isp/isp-ipc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ int ipc_chan_handle(struct apple_isp *isp, struct isp_channel *chan)
138138
{
139139
int err = 0;
140140

141-
spin_lock(&chan->lock);
141+
mutex_lock(&chan->lock);
142142
while (1) {
143143
chan_read_msg(isp, chan, &chan->req);
144144
if (chan_rx_done(isp, chan)) {
@@ -150,7 +150,7 @@ int ipc_chan_handle(struct apple_isp *isp, struct isp_channel *chan)
150150
break;
151151
}
152152
}
153-
spin_unlock(&chan->lock);
153+
mutex_unlock(&chan->lock);
154154

155155
return err;
156156
}

0 commit comments

Comments
 (0)