diff mbox series

[RFC,1/3] drm/msm/dp: fold disable_irq into devm_request_irq

Message ID 20220901091527.1992208-2-dmitry.baryshkov@linaro.org
State New
Headers show
Series drm/msm/dp: several fixes for the IRQ handling | expand

Commit Message

Dmitry Baryshkov Sept. 1, 2022, 9:15 a.m. UTC
Calling disable_irq() right after devm_request_irq() is a bad practice.
it leaves a small window when the driver doesn't expect the IRQ, but the
hardware still can trigger it. Use the IRQF_NO_AUTOEN flag to prevent
the request_irq from enabling the IRQ line.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/msm/dp/dp_display.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
index bfd0aeff3f0d..3173e6962a78 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -1251,13 +1251,12 @@  int dp_display_request_irq(struct msm_dp *dp_display)
 
 	rc = devm_request_irq(&dp->pdev->dev, dp->irq,
 			dp_display_irq_handler,
-			IRQF_TRIGGER_HIGH, "dp_display_isr", dp);
+			IRQF_TRIGGER_HIGH | IRQF_NO_AUTOEN, "dp_display_isr", dp);
 	if (rc < 0) {
 		DRM_ERROR("failed to request IRQ%u: %d\n",
 				dp->irq, rc);
 		return rc;
 	}
-	disable_irq(dp->irq);
 
 	return 0;
 }