summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@chromium.org>2020-08-21 13:19:23 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-09-26 10:12:09 +0200
commit59b2076df4fd905471a33805526d668226f3f814 (patch)
treebd19c3679e7578e54bf56824d105cd0f615f8407 /drivers/media
parent42f401e751b58ef071874779ef972187ef5dfce3 (diff)
downloadlinux-59b2076df4fd905471a33805526d668226f3f814.tar.gz
linux-59b2076df4fd905471a33805526d668226f3f814.tar.bz2
linux-59b2076df4fd905471a33805526d668226f3f814.zip
media: mtk-vcodec: make IRQs disabled upon request
The driver requests IRQs to disable them immediately. This is potentially racy, fix this by requesting the IRQs to come disabled instead using the IRQ_NOAUTOEN flag of irq_set_status_flags(). Reported-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Alexandre Courbot <acourbot@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c2
-rw-r--r--drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c
index e5733f52b5eb..d14bc208ea5e 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c
@@ -268,6 +268,7 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
}
dev->dec_irq = platform_get_irq(pdev, 0);
+ irq_set_status_flags(dev->dec_irq, IRQ_NOAUTOEN);
ret = devm_request_irq(&pdev->dev, dev->dec_irq,
mtk_vcodec_dec_irq_handler, 0, pdev->name, dev);
if (ret) {
@@ -277,7 +278,6 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
goto err_res;
}
- disable_irq(dev->dec_irq);
mutex_init(&dev->dec_mutex);
mutex_init(&dev->dev_mutex);
spin_lock_init(&dev->irqlock);
diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
index 265643e75de1..dcfa2c2d4def 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
@@ -320,6 +320,7 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
}
dev->enc_irq = platform_get_irq(pdev, 0);
+ irq_set_status_flags(dev->enc_irq, IRQ_NOAUTOEN);
ret = devm_request_irq(&pdev->dev, dev->enc_irq,
mtk_vcodec_enc_irq_handler,
0, pdev->name, dev);
@@ -330,7 +331,6 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
ret = -EINVAL;
goto err_res;
}
- disable_irq(dev->enc_irq);
if (dev->venc_pdata->has_lt_irq) {
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
@@ -342,6 +342,7 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
mtk_v4l2_debug(2, "reg[%d] base=0x%p", i, dev->reg_base[VENC_LT_SYS]);
dev->enc_lt_irq = platform_get_irq(pdev, 1);
+ irq_set_status_flags(dev->enc_lt_irq, IRQ_NOAUTOEN);
ret = devm_request_irq(&pdev->dev,
dev->enc_lt_irq,
mtk_vcodec_enc_lt_irq_handler,
@@ -353,7 +354,6 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
ret = -EINVAL;
goto err_res;
}
- disable_irq(dev->enc_lt_irq); /* VENC_LT */
}
mutex_init(&dev->enc_mutex);