Re: [PATCH v2 1/3] gpio: mpsse: use rcu to ensure worker is torn down
From: Mary Strodl
Date: Thu Oct 02 2025 - 10:36:50 EST
Hey Dan,
On Mon, Sep 29, 2025 at 11:48:46AM +0300, Dan Carpenter wrote:
> On Mon, Sep 29, 2025 at 11:46:24AM +0300, Dan Carpenter wrote:
> > a14b0c5e3b0741 Mary Strodl 2025-09-23 339 /* Make sure list consumers are finished before we tear down */
> > a14b0c5e3b0741 Mary Strodl 2025-09-23 340 synchronize_rcu();
> > a14b0c5e3b0741 Mary Strodl 2025-09-23 @341 list_for_each_entry(worker, &destructors, destroy)
> > a14b0c5e3b0741 Mary Strodl 2025-09-23 @342 gpio_mpsse_stop(worker);
> >
> > This needs to be list_for_each_entry_safe() because gpio_mpsse_stop()
> > frees the worker. Or kfree_rcu() inside an rcu lock or something.
Really good catch! The loop above this one has the same problem. Will be fixed next revision :)
Thank you!