On Thu, 2025-09-04 at 14:54 +0200, Felix Fietkau wrote: > > External email : Please do not click links or open attachments until > you have verified the sender or the content. > > > On 04.09.25 05:06, Mingyen Hsieh wrote: > > From: Ming Yen Hsieh <mingyen.hsieh@xxxxxxxxxxxx> > > > > Read dev->token_count under token_lock to prevent race conditions > > with > > concurrent token updates, ensuring accurate power management > > decisions. > > > > Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@xxxxxxxxxxxx> > > I don't understand what kind of race you're trying to solve with this > patch. Are you trying to fix entering powersave while a badly timed > tx > is started? Or are you trying to make it go to sleep more reliably > during concurrent cleanup of pending tx? > What context does this race against, and is taking the token lock > really > enough to fully close the race? > > Thanks, > > - Felix Hi Felix, I haven't seen a real race so far, but during my observation, I noticed that some functions using token_count are protected by a lock. That's why i added the protection in this patch. These are just my thoughts, and maybe i might have missed something-perhaps the protection isn't needed here. Thanks. Yen.