RE: [PATCH v7 6/6] wifi: rtw88: sdio: add TX back-pressure and retry on page starvation
Ping-Ke Shih <[email protected]>
| Newsgroups | org.kernel.vger.linux-wireless,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
Luka Gejak <[email protected]> wrote: > Hi Ping-Ke, > > On August 25, 2026 8:36:30 AM GMT+02:00, Ping-Ke Shih <[email protected]> wrote: > > > With WRITE_ONCE() and READ_ONCE(), I think it will concurrency work > > well. Did you really encounter problems with smp_mb()? > > Not from a failure I hit, no. It came out of reading the code, and I think > it is still needed, so let me lay out the case rather than just assert it. > > The flag alone is not enough because of this order: > > producer worker > skb_queue_tail() > reads len, sees >= HIWATER > drains the queue to empty > reads the flag, still false, > so it does not wake > writes the flag true > ieee80211_stop_queue() > > The AC is now stopped with an empty queue and nobody left to wake it. That > is what the re-check under the barrier is for: once the flag is set, read > the length again, and if the worker drained it meanwhile, undo the stop. I think the key point is to "undo" the stop. pci.c doesn't have this back and forth code. Can you reference and imitate it? (I will also spend time to consider that). Ping-Ke