diff mbox series

usb: typec: ucsi: Fix missing link removal

Message ID 20231010141749.3912016-1-heikki.krogerus@linux.intel.com (mailing list archive)
State Accepted
Commit dddb91cde52b4a57fa06a332b230fca3b11b885f
Headers show
Series usb: typec: ucsi: Fix missing link removal | expand

Commit Message

Heikki Krogerus Oct. 10, 2023, 2:17 p.m. UTC
The link between the partner device and its USB Power
Delivery instance was never removed which prevented the
device from being released. Removing the link always when
the partner is unregistered.

Fixes: b04e1747fbcc ("usb: typec: ucsi: Register USB Power Delivery Capabilities")
Reported-by: Douglas Gilbert <dgilbert@interlog.com>
Closes: https://lore.kernel.org/linux-usb/ZSUMXdw9nanHtnw2@kuha.fi.intel.com/
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/usb/typec/ucsi/ucsi.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Greg KH Oct. 11, 2023, 9:38 a.m. UTC | #1
On Tue, Oct 10, 2023 at 05:17:49PM +0300, Heikki Krogerus wrote:
> The link between the partner device and its USB Power
> Delivery instance was never removed which prevented the
> device from being released. Removing the link always when
> the partner is unregistered.
> 
> Fixes: b04e1747fbcc ("usb: typec: ucsi: Register USB Power Delivery Capabilities")
> Reported-by: Douglas Gilbert <dgilbert@interlog.com>
> Closes: https://lore.kernel.org/linux-usb/ZSUMXdw9nanHtnw2@kuha.fi.intel.com/
> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
>  drivers/usb/typec/ucsi/ucsi.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> index f3ba2997004a..c9a032a5dbd0 100644
> --- a/drivers/usb/typec/ucsi/ucsi.c
> +++ b/drivers/usb/typec/ucsi/ucsi.c
> @@ -787,6 +787,7 @@ static void ucsi_unregister_partner(struct ucsi_connector *con)
>  
>  	typec_set_mode(con->port, TYPEC_STATE_SAFE);
>  
> +	typec_partner_set_usb_power_delivery(con->partner, NULL);
>  	ucsi_unregister_partner_pdos(con);
>  	ucsi_unregister_altmodes(con, UCSI_RECIPIENT_SOP);
>  	typec_unregister_partner(con->partner);
> -- 
> 2.40.1
> 
> 

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- You have marked a patch with a "Fixes:" tag for a commit that is in an
  older released kernel, yet you do not have a cc: stable line in the
  signed-off-by area at all, which means that the patch will not be
  applied to any older kernel releases.  To properly fix this, please
  follow the documented rules in the
  Documentation/process/stable-kernel-rules.rst file for how to resolve
  this.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot
Greg KH Oct. 11, 2023, 9:39 a.m. UTC | #2
On Wed, Oct 11, 2023 at 11:38:49AM +0200, Greg Kroah-Hartman wrote:
> On Tue, Oct 10, 2023 at 05:17:49PM +0300, Heikki Krogerus wrote:
> > The link between the partner device and its USB Power
> > Delivery instance was never removed which prevented the
> > device from being released. Removing the link always when
> > the partner is unregistered.
> > 
> > Fixes: b04e1747fbcc ("usb: typec: ucsi: Register USB Power Delivery Capabilities")
> > Reported-by: Douglas Gilbert <dgilbert@interlog.com>
> > Closes: https://lore.kernel.org/linux-usb/ZSUMXdw9nanHtnw2@kuha.fi.intel.com/
> > Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> > ---
> >  drivers/usb/typec/ucsi/ucsi.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> > index f3ba2997004a..c9a032a5dbd0 100644
> > --- a/drivers/usb/typec/ucsi/ucsi.c
> > +++ b/drivers/usb/typec/ucsi/ucsi.c
> > @@ -787,6 +787,7 @@ static void ucsi_unregister_partner(struct ucsi_connector *con)
> >  
> >  	typec_set_mode(con->port, TYPEC_STATE_SAFE);
> >  
> > +	typec_partner_set_usb_power_delivery(con->partner, NULL);
> >  	ucsi_unregister_partner_pdos(con);
> >  	ucsi_unregister_altmodes(con, UCSI_RECIPIENT_SOP);
> >  	typec_unregister_partner(con->partner);
> > -- 
> > 2.40.1
> > 
> > 
> 
> Hi,
> 
> This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
> a patch that has triggered this response.  He used to manually respond
> to these common problems, but in order to save his sanity (he kept
> writing the same thing over and over, yet to different people), I was
> created.  Hopefully you will not take offence and will fix the problem
> in your patch and resubmit it so that it can be accepted into the Linux
> kernel tree.
> 
> You are receiving this message because of the following common error(s)
> as indicated below:
> 
> - You have marked a patch with a "Fixes:" tag for a commit that is in an
>   older released kernel, yet you do not have a cc: stable line in the
>   signed-off-by area at all, which means that the patch will not be
>   applied to any older kernel releases.  To properly fix this, please
>   follow the documented rules in the
>   Documentation/process/stable-kernel-rules.rst file for how to resolve
>   this.
> 
> If you wish to discuss this problem further, or you have questions about
> how to resolve this issue, please feel free to respond to this email and
> Greg will reply once he has dug out from the pending patches received
> from other developers.

Note, I've fixed this up by hand, but in the future, please be aware of
it.

thanks,

greg k-h
Heikki Krogerus Oct. 11, 2023, 10:52 a.m. UTC | #3
On Wed, Oct 11, 2023 at 11:39:20AM +0200, Greg Kroah-Hartman wrote:
> On Wed, Oct 11, 2023 at 11:38:49AM +0200, Greg Kroah-Hartman wrote:
> > On Tue, Oct 10, 2023 at 05:17:49PM +0300, Heikki Krogerus wrote:
> > > The link between the partner device and its USB Power
> > > Delivery instance was never removed which prevented the
> > > device from being released. Removing the link always when
> > > the partner is unregistered.
> > > 
> > > Fixes: b04e1747fbcc ("usb: typec: ucsi: Register USB Power Delivery Capabilities")
> > > Reported-by: Douglas Gilbert <dgilbert@interlog.com>
> > > Closes: https://lore.kernel.org/linux-usb/ZSUMXdw9nanHtnw2@kuha.fi.intel.com/
> > > Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> > > ---
> > >  drivers/usb/typec/ucsi/ucsi.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> > > index f3ba2997004a..c9a032a5dbd0 100644
> > > --- a/drivers/usb/typec/ucsi/ucsi.c
> > > +++ b/drivers/usb/typec/ucsi/ucsi.c
> > > @@ -787,6 +787,7 @@ static void ucsi_unregister_partner(struct ucsi_connector *con)
> > >  
> > >  	typec_set_mode(con->port, TYPEC_STATE_SAFE);
> > >  
> > > +	typec_partner_set_usb_power_delivery(con->partner, NULL);
> > >  	ucsi_unregister_partner_pdos(con);
> > >  	ucsi_unregister_altmodes(con, UCSI_RECIPIENT_SOP);
> > >  	typec_unregister_partner(con->partner);
> > > -- 
> > > 2.40.1
> > > 
> > > 
> > 
> > Hi,
> > 
> > This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
> > a patch that has triggered this response.  He used to manually respond
> > to these common problems, but in order to save his sanity (he kept
> > writing the same thing over and over, yet to different people), I was
> > created.  Hopefully you will not take offence and will fix the problem
> > in your patch and resubmit it so that it can be accepted into the Linux
> > kernel tree.
> > 
> > You are receiving this message because of the following common error(s)
> > as indicated below:
> > 
> > - You have marked a patch with a "Fixes:" tag for a commit that is in an
> >   older released kernel, yet you do not have a cc: stable line in the
> >   signed-off-by area at all, which means that the patch will not be
> >   applied to any older kernel releases.  To properly fix this, please
> >   follow the documented rules in the
> >   Documentation/process/stable-kernel-rules.rst file for how to resolve
> >   this.
> > 
> > If you wish to discuss this problem further, or you have questions about
> > how to resolve this issue, please feel free to respond to this email and
> > Greg will reply once he has dug out from the pending patches received
> > from other developers.
> 
> Note, I've fixed this up by hand, but in the future, please be aware of
> it.

Thank you Greg. I'll try to be more careful in the future.
diff mbox series

Patch

diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index f3ba2997004a..c9a032a5dbd0 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -787,6 +787,7 @@  static void ucsi_unregister_partner(struct ucsi_connector *con)
 
 	typec_set_mode(con->port, TYPEC_STATE_SAFE);
 
+	typec_partner_set_usb_power_delivery(con->partner, NULL);
 	ucsi_unregister_partner_pdos(con);
 	ucsi_unregister_altmodes(con, UCSI_RECIPIENT_SOP);
 	typec_unregister_partner(con->partner);