summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Scheller <d.scheller@gmx.net>2018-04-09 18:47:43 +0200
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-05-04 16:39:30 +0200
commite415eec4583349ba843495fd746fc7bbc19906f8 (patch)
tree3e824393382fdb6236d84eb14a0eed36b027e54c
parentmedia: ddbridge: improve separated MSI IRQ handling (diff)
downloadlinux-e415eec4583349ba843495fd746fc7bbc19906f8.tar.xz
linux-e415eec4583349ba843495fd746fc7bbc19906f8.zip
media: ddbridge: use spin_lock_irqsave() in output_work()
Make sure to save IRQ states before taking the dma lock, as already done in it's input_work() counterpart. Picked up from the upstream dddvb-0.9.33 release. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r--drivers/media/pci/ddbridge/ddbridge-core.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c
index cb2d9d811580..7e57f5864df3 100644
--- a/drivers/media/pci/ddbridge/ddbridge-core.c
+++ b/drivers/media/pci/ddbridge/ddbridge-core.c
@@ -2117,18 +2117,18 @@ static void output_work(struct work_struct *work)
struct ddb_dma *dma = container_of(work, struct ddb_dma, work);
struct ddb_output *output = (struct ddb_output *)dma->io;
struct ddb *dev = output->port->dev;
+ unsigned long flags;
- spin_lock(&dma->lock);
- if (!dma->running) {
- spin_unlock(&dma->lock);
- return;
- }
+ spin_lock_irqsave(&dma->lock, flags);
+ if (!dma->running)
+ goto unlock_exit;
dma->stat = ddbreadl(dev, DMA_BUFFER_CURRENT(dma));
dma->ctrl = ddbreadl(dev, DMA_BUFFER_CONTROL(dma));
if (output->redi)
output_ack_input(output, output->redi);
wake_up(&dma->wq);
- spin_unlock(&dma->lock);
+unlock_exit:
+ spin_unlock_irqrestore(&dma->lock, flags);
}
static void output_handler(void *data)