public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: typec: tps6598x: Fix fault at module removal
@ 2023-04-21 10:17 Roger Quadros
  2023-04-21 11:09 ` Heikki Krogerus
  0 siblings, 1 reply; 2+ messages in thread
From: Roger Quadros @ 2023-04-21 10:17 UTC (permalink / raw)
  To: heikki.krogerus, gregkh
  Cc: srk, r-gunasekaran, linux-usb, linux-kernel, Roger Quadros

We need to cancel the delayed workqueue if it is being used
else it will cause paging request fault during module removal.

Fixes: 0d6a119cecd7 ("usb: typec: tps6598x: Add support for polling interrupts status")
Signed-off-by: Roger Quadros <rogerq@kernel.org>
---
 drivers/usb/typec/tipd/core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
index 8b075ca82ef6..438cc40660a1 100644
--- a/drivers/usb/typec/tipd/core.c
+++ b/drivers/usb/typec/tipd/core.c
@@ -886,6 +886,9 @@ static void tps6598x_remove(struct i2c_client *client)
 {
 	struct tps6598x *tps = i2c_get_clientdata(client);
 
+	if (!client->irq)
+		cancel_delayed_work_sync(&tps->wq_poll);
+
 	tps6598x_disconnect(tps, 0);
 	typec_unregister_port(tps->port);
 	usb_role_switch_put(tps->role_sw);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] usb: typec: tps6598x: Fix fault at module removal
  2023-04-21 10:17 [PATCH] usb: typec: tps6598x: Fix fault at module removal Roger Quadros
@ 2023-04-21 11:09 ` Heikki Krogerus
  0 siblings, 0 replies; 2+ messages in thread
From: Heikki Krogerus @ 2023-04-21 11:09 UTC (permalink / raw)
  To: Roger Quadros; +Cc: gregkh, srk, r-gunasekaran, linux-usb, linux-kernel

On Fri, Apr 21, 2023 at 01:17:20PM +0300, Roger Quadros wrote:
> We need to cancel the delayed workqueue if it is being used
> else it will cause paging request fault during module removal.
> 
> Fixes: 0d6a119cecd7 ("usb: typec: tps6598x: Add support for polling interrupts status")
> Signed-off-by: Roger Quadros <rogerq@kernel.org>

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/tipd/core.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
> index 8b075ca82ef6..438cc40660a1 100644
> --- a/drivers/usb/typec/tipd/core.c
> +++ b/drivers/usb/typec/tipd/core.c
> @@ -886,6 +886,9 @@ static void tps6598x_remove(struct i2c_client *client)
>  {
>  	struct tps6598x *tps = i2c_get_clientdata(client);
>  
> +	if (!client->irq)
> +		cancel_delayed_work_sync(&tps->wq_poll);
> +
>  	tps6598x_disconnect(tps, 0);
>  	typec_unregister_port(tps->port);
>  	usb_role_switch_put(tps->role_sw);
> -- 
> 2.34.1

-- 
heikki

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-21 11:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-21 10:17 [PATCH] usb: typec: tps6598x: Fix fault at module removal Roger Quadros
2023-04-21 11:09 ` Heikki Krogerus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox