Hello Yousef,
On 7/18/26 14:20, Yousef Alhouseen wrote:
Agreed. I'll use rcu_access_pointer() in v2; it expresses the final
pointer fetch more directly once unregister has quiesced the updaters.
Did you send a v2? Did I miss it?
regards
Stefan Schmidt
Thanks,
Yousef
On Mon, 06 Jul 2026 17:10:35 +0200, Miquel Raynal
<[email protected]> wrote:
Hello Yousef,
On 03/07/2026 at 04:19:42 -07, Yousef Alhouseen <[email protected]>
wrote:
Hello Miquel,
After ieee802154_unregister_hw() returns, the driver callbacks that
can replace phy->pib have been quiesced, and hwsim_del() has exclusive
ownership of the final teardown. The pointer is no longer being
fetched inside an RCU read-side critical section, so rcu_dereference()
is not appropriate there.
That's right.
rcu_dereference_protected(phy->pib, 1) expresses that there can no
longer be a concurrent updater at that point; the protection condition
is the completed unregister rather than a locally held lock. The value
is only fetched so the final object can be passed to kfree_rcu().
While I believe this is indeed true, it actually feels slightly overkill
since there is no updater anymore and, as far as I understand, the only
thing that we need here is to get the pointer value for freeing, right?
rcu_access_pointer() would also be sufficient for that limited use if
you prefer it, and I can use that spelling in a v2.
If you don't mind, I feel like rcu_access_pointer() is exactly what we
need here. It is also more understandable, even though I agree in
practice there are no differences in this case.
Thanks,
Miquèl