Re: [PATCH] platform/x86: intel_chtdc_ti_pwrbtn: Fix missing IRQF_ONESHOT as only threaded handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 4/15/21 11:14 AM, zhuguangqing83@xxxxxxxxx wrote:
> From: Guangqing Zhu <zhuguangqing83@xxxxxxxxx>
> 
> 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@xxxxxxxxx>

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;
>  
> 




[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux