Re: [PATCH v2 1/3] gpio: mpsse: use rcu to ensure worker is torn down
From: Dan Carpenter
Date: Mon Sep 29 2025 - 04:48:51 EST
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_save() because gpio_mpsse_stop()
s/save/safe/. #CantType
regards,
dan carpenter
> frees the worker. Or kfree_rcu() inside an rcu lock or something.
>
> a14b0c5e3b0741 Mary Strodl 2025-09-23 343 }
> a14b0c5e3b0741 Mary Strodl 2025-09-23 344
> a14b0c5e3b0741 Mary Strodl 2025-09-23 345 while ((irq_enabled = atomic_read(&priv->irq_enabled)) &&
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki