diff mbox series

[v2,3/3] usb typec: mt6360: Prevent the race condition during module remove

Message ID 1598498732-25194-3-git-send-email-u0084500@gmail.com (mailing list archive)
State Superseded
Headers show
Series [v2,1/3] usb typec: mt6360: Add support for mt6360 Type-C driver | expand

Commit Message

ChiYuan Huang Aug. 27, 2020, 3:25 a.m. UTC
From: ChiYuan Huang <cy_huang@richtek.com>

Prevent the race condition from interrupt and tcpci port unregister
during module remove.

Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
---
 drivers/usb/typec/tcpm/tcpci_mt6360.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Guenter Roeck Aug. 27, 2020, 3:34 a.m. UTC | #1
On 8/26/20 8:25 PM, cy_huang wrote:
> From: ChiYuan Huang <cy_huang@richtek.com>
> 
> Prevent the race condition from interrupt and tcpci port unregister
> during module remove.
> 
> Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>

Please squash with the first patch of the series.

Thanks,
Guenter

> ---
>  drivers/usb/typec/tcpm/tcpci_mt6360.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpci_mt6360.c b/drivers/usb/typec/tcpm/tcpci_mt6360.c
> index 6a28193..a381b5d 100644
> --- a/drivers/usb/typec/tcpm/tcpci_mt6360.c
> +++ b/drivers/usb/typec/tcpm/tcpci_mt6360.c
> @@ -164,6 +164,7 @@ static int mt6360_tcpc_remove(struct platform_device *pdev)
>  {
>  	struct mt6360_tcpc_info *mti = platform_get_drvdata(pdev);
>  
> +	disable_irq(mti->irq);
>  	tcpci_unregister_port(mti->tcpci);
>  	return 0;
>  }
>
ChiYuan Huang Aug. 27, 2020, 4:53 a.m. UTC | #2
Guenter Roeck <linux@roeck-us.net> 於 2020年8月27日 週四 上午11:34寫道:
>
> On 8/26/20 8:25 PM, cy_huang wrote:
> > From: ChiYuan Huang <cy_huang@richtek.com>
> >
> > Prevent the race condition from interrupt and tcpci port unregister
> > during module remove.
> >
> > Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
>
> Please squash with the first patch of the series.
Done, squash into the first one and resend the patch. Thx.
>
> Thanks,
> Guenter
>
> > ---
> >  drivers/usb/typec/tcpm/tcpci_mt6360.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/usb/typec/tcpm/tcpci_mt6360.c b/drivers/usb/typec/tcpm/tcpci_mt6360.c
> > index 6a28193..a381b5d 100644
> > --- a/drivers/usb/typec/tcpm/tcpci_mt6360.c
> > +++ b/drivers/usb/typec/tcpm/tcpci_mt6360.c
> > @@ -164,6 +164,7 @@ static int mt6360_tcpc_remove(struct platform_device *pdev)
> >  {
> >       struct mt6360_tcpc_info *mti = platform_get_drvdata(pdev);
> >
> > +     disable_irq(mti->irq);
> >       tcpci_unregister_port(mti->tcpci);
> >       return 0;
> >  }
> >
>
diff mbox series

Patch

diff --git a/drivers/usb/typec/tcpm/tcpci_mt6360.c b/drivers/usb/typec/tcpm/tcpci_mt6360.c
index 6a28193..a381b5d 100644
--- a/drivers/usb/typec/tcpm/tcpci_mt6360.c
+++ b/drivers/usb/typec/tcpm/tcpci_mt6360.c
@@ -164,6 +164,7 @@  static int mt6360_tcpc_remove(struct platform_device *pdev)
 {
 	struct mt6360_tcpc_info *mti = platform_get_drvdata(pdev);
 
+	disable_irq(mti->irq);
 	tcpci_unregister_port(mti->tcpci);
 	return 0;
 }