Re: [PATCH] platform/chrome: cros_ec_typec: Stop altmode work before unregistering ports

From: Myeonghun Pak

Date: Fri Oct 02 2026 - 15:57:39 EST


Thanks for the feedback. I've moved the work quiescing into
cros_typec_unregister_altmodes() so partner disconnects are covered too.

Pending partner work can still queue responses during driver removal,
so the port work stays disabled until that completes, then is reset and
re-enabled for reconnection. Final port teardown now uses
cancel_work_sync().

I'll send v2 with these changes.

2026년 10월 1일 (목) 오전 11:40, Andrei Kuchynski <akuchynski@xxxxxxxxxxxx>님이 작성:
>
> 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