lkml.org 
[lkml]   [2021]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] platform/x86: intel_chtdc_ti_pwrbtn: Fix missing IRQF_ONESHOT as only threaded handler
From
Date
Hi,

On 4/15/21 11:14 AM, zhuguangqing83@gmail.com wrote:
> From: Guangqing Zhu <zhuguangqing83@gmail.com>
>
> Coccinelle noticed:
> drivers/platform/x86/intel_chtdc_ti_pwrbtn.c:59:7-32: ERROR: Threaded IRQ
> with no primary handler requested without IRQF_ONESHOT
>
> Signed-off-by: Guangqing Zhu <zhuguangqing83@gmail.com>

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



> ---
> drivers/platform/x86/intel_chtdc_ti_pwrbtn.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/intel_chtdc_ti_pwrbtn.c b/drivers/platform/x86/intel_chtdc_ti_pwrbtn.c
> index 0df2e82dd249..9606a994af22 100644
> --- a/drivers/platform/x86/intel_chtdc_ti_pwrbtn.c
> +++ b/drivers/platform/x86/intel_chtdc_ti_pwrbtn.c
> @@ -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;
>
>

\
 
 \ /
  Last update: 2021-04-15 13:48    [W:0.046 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site