Skip to content

Commit 4128345

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 <marcan@marcan.st>
1 parent ba2590e commit 4128345

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

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
@@ -491,7 +491,7 @@ static int isp_fill_channel_info(struct apple_isp *isp)
491491
chan->virt =
492492
apple_isp_ipc_translate(isp, desc.iova, chan->size);
493493
chan->cursor = 0;
494-
spin_lock_init(&chan->lock);
494+
mutex_init(&chan->lock);
495495

496496
if (!chan->virt) {
497497
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)