Re: [PATCH] platform/chrome: cros_ec_typec: Stop altmode work before unregistering ports
From: Andrei Kuchynski
Date: Thu Oct 01 2026 - 11:47:30 EST
On Mon, Sep 28, 2026 at 12:18 PM Tzung-Bi Shih <tzungbi@xxxxxxxxxx> wrote:
>
> On Thu, Sep 17, 2026 at 04:42:09PM -0400, Myeonghun Pak wrote:
> > partner altmodes. Disabling also prevents a partner callback from
> > requeueing the work while its driver is being removed. Use the common
>
> Would the work be scheduled even if the driver is about to remove()?
>
> > diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
> > index 50a68819ceb7bbfbd888ca919d678d4c75237c26..e91bbc219c077067294935dd5602c1aec636cfa6 100644
> > --- a/drivers/platform/chrome/cros_ec_typec.c
> > +++ b/drivers/platform/chrome/cros_ec_typec.c
> > @@ -378,6 +378,7 @@ static void cros_unregister_ports(struct cros_typec_data *typec)
> > if (!typec->ports[i])
> > continue;
> >
> > + cros_typec_altmodes_stop(typec->ports[i]);
>
> Shouldn't this be called in cros_typec_unregister_port_altmodes()?
This should be called in the very beginning of cros_typec_remove_partner(),
or even in cros_typec_unregister_altmodes(). The idea is to stop the queue
when the partner no longer exists.
Partner disconnection rather than port teardown ought to trigger this.
Thanks,
Andrei