lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZymxvLMkkktRoCXZ@google.com>
Date: Mon, 4 Nov 2024 21:48:44 -0800
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: "Peng Fan (OSS)" <peng.fan@....nxp.com>
Cc: Peng Fan <peng.fan@....com>, Frank Li <Frank.Li@....com>,
	Jacky Bai <ping.bai@....com>, Jason Liu <jason.hui.liu@....com>,
	"open list:INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN)..." <linux-input@...r.kernel.org>,
	open list <linux-kernel@...r.kernel.org>,
	Christophe JAILLET <christophe.jaillet@...adoo.fr>
Subject: Re: [PATCH V2] Input: bbnsm_pwrkey - add remove hook

Hi Peng,

On Mon, Nov 04, 2024 at 11:15:51AM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@....com>
> 
> Without remove hook to clear wake irq, there will be kernel dump when
> doing module test.
> "bbnsm_pwrkey 44440000.bbnsm:pwrkey: wake irq already initialized"
> 
> Add remove hook to clear wake irq and set wakeup to false.
> 
> Fixes: 40e40fdfec3f ("Input: bbnsm_pwrkey - add bbnsm power key support")
> Cc: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> Signed-off-by: Peng Fan <peng.fan@....com>
> ---
> 
> V2:
>  Per Christophe JAILLET
>   Use remove, not remove_new
>   Drop checking bbnsm pointer in remove
> 
>  drivers/input/misc/nxp-bbnsm-pwrkey.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/input/misc/nxp-bbnsm-pwrkey.c b/drivers/input/misc/nxp-bbnsm-pwrkey.c
> index eb4173f9c820..f0bf119309dd 100644
> --- a/drivers/input/misc/nxp-bbnsm-pwrkey.c
> +++ b/drivers/input/misc/nxp-bbnsm-pwrkey.c
> @@ -187,6 +187,16 @@ static int bbnsm_pwrkey_probe(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static void bbnsm_pwrkey_remove(struct platform_device *pdev)
> +{
> +	struct bbnsm_pwrkey *bbnsm = platform_get_drvdata(pdev);
> +
> +	dev_pm_clear_wake_irq(&pdev->dev);

I wonder, could we have this done in the driver core instead of
individual drivers?

> +	device_init_wakeup(&pdev->dev, false);
> +
> +	input_unregister_device(bbnsm->input);

No need to call unregister here, it should happen automatically.

Thanks.

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ