Skip to contentSkip to conversation

platform/x86: intel_chtdc_ti_pwrbtn: Fix missing IRQF_ONESHOT as only threaded handler

PATCH In review [email protected] 2 participants 2 messages Apr 15, 2021 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: intel_chtdc_ti_pwrbtn: Fix missing IRQF_ONESHOT as only threaded handler

From: Guangqing Zhu <[email protected]>

Coccinelle noticed:
drivers/platform/x86/intel_chtdc_ti_pwrbtn.c:59:7-32: ERROR: Threaded IRQ
with no primary handler requested without IRQF_ONESHOT

---
 drivers/platform/x86/intel_chtdc_ti_pwrbtn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/intel_chtdc_ti_pwrbtn.c +1 -1
index 0df2e82dd249..9606a994af22 100644
@@ -58,7 +58,7 @@ static int chtdc_ti_pwrbtn_probe(struct platform_device *pdev)
 
 	err = devm_request_threaded_irq(dev, irq, NULL,
 					chtdc_ti_pwrbtn_interrupt,
-					0, KBUILD_MODNAME, input);
+					IRQF_ONESHOT, KBUILD_MODNAME, input);
 	if (err)
 		return err;
 
Signature · 1 line
2.17.1
#1 lore raw

Hi,

Quoted 7 lines · On 4/15/21 11:14 AM, [email protected] wrote:

From: Guangqing Zhu <[email protected]>

Coccinelle noticed:
drivers/platform/x86/intel_chtdc_ti_pwrbtn.c:59:7-32: ERROR: Threaded IRQ
with no primary handler requested without IRQF_ONESHOT

So I was wondering why this driver worked at all despite the missing flag.

The reason that this still works is that the irqchip instantiated by the MFD driver for the CHT TI PMIC is using nested IRQ handling and then the request_irq error for this does not trigger.

This is still the right thing to do though.

I've tested that the driver still works after this.

Thank you for your patch, I've applied this patch to my review-hans branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Note it will show up in my review-hans branch once I've pushed my local branch there, which might take a while.

Once I've run some tests on this branch the patches there will be added to the platform-drivers-x86/for-next branch and eventually will be included in the pdx86 pull-request to Linus for the next merge-window.

Regards,

Hans

Quoted 18 lines
---
 drivers/platform/x86/intel_chtdc_ti_pwrbtn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/intel_chtdc_ti_pwrbtn.c +1 -1
index 0df2e82dd249..9606a994af22 100644
@@ -58,7 +58,7 @@ static int chtdc_ti_pwrbtn_probe(struct platform_device *pdev)
 
 	err = devm_request_threaded_irq(dev, irq, NULL,
 					chtdc_ti_pwrbtn_interrupt,
-					0, KBUILD_MODNAME, input);
+					IRQF_ONESHOT, KBUILD_MODNAME, input);
 	if (err)
 		return err;