Hi Guenter, > -----Original Message----- > From: Guenter Roeck <groeck7@xxxxxxxxx> On Behalf Of Guenter Roeck > Sent: 2020年1月19日 23:03 > To: Jun Li <jun.li@xxxxxxx>; heikki.krogerus@xxxxxxxxxxxxxxx > Cc: gregkh@xxxxxxxxxxxxxxxxxxx; linux-usb@xxxxxxxxxxxxxxx; dl-linux-imx > <linux-imx@xxxxxxx> > Subject: Re: [PATCH] usb: typec: tcpci: mask event interrupts when remove > driver > > On 1/19/20 2:59 AM, Jun Li wrote: > > This is to prevent any possible events generated while unregister tpcm > > port. > > > > Signed-off-by: Li Jun <jun.li@xxxxxxx> > > Fixes: 74e656d6b0551 ("staging: typec: Type-C Port Controller Interface > driver (tcpci)") Thanks, I will add the stable tag. > > > --- > > drivers/usb/typec/tcpm/tcpci.c | 8 ++++++++ > > 1 file changed, 8 insertions(+) > > > > diff --git a/drivers/usb/typec/tcpm/tcpci.c > > b/drivers/usb/typec/tcpm/tcpci.c index c1f7073..3b42ef8 100644 > > --- a/drivers/usb/typec/tcpm/tcpci.c > > +++ b/drivers/usb/typec/tcpm/tcpci.c > > @@ -581,6 +581,14 @@ static int tcpci_probe(struct i2c_client *client, > > static int tcpci_remove(struct i2c_client *client) > > { > > struct tcpci_chip *chip = i2c_get_clientdata(client); > > + u16 val = 0; > > + int err; > > + > > + /* Disable chip interrupts before unregistger port */ > > + err = regmap_raw_write(chip->data.regmap, TCPC_ALERT_MASK, &val, > > + sizeof(u16)); > > I would suggest > > err = tcpci_write16(chip, TCPC_ALERT_MASK, 0); OK, this is simpler, will send out V2. Li Jun > > Guenter > > > + if (err < 0) > > + return err; > > > > tcpci_unregister_port(chip->tcpci); > > > >