Re: [PATCH] ks8851: Fix deadlock with the SPI chip variant

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks, I made a v2.

I now also found another potential TX stall issue caused by improper
locking. In ks8851_tx_work we need to move

  last = skb_queue_empty(&ks->txq);

under the lock or otherwise risk a TX stall because in case the queue
was empty and has meanwhile being completely filled while we were
waiting for the lock. I need to double check this scenario first. If it
is indeed an issue then I will provide a separate patch later.

On 04.07.24 16:44, Jakub Kicinski wrote:
On Wed,  3 Jul 2024 18:00:53 +0200 Ronald Wahl wrote:
+            bool need_wake_queue;

             netif_dbg(ks, intr, ks->netdev,
                       "%s: txspace %d\n", __func__, tx_space);

             spin_lock(&ks->statelock);
             ks->tx_space = tx_space;
-            if (netif_queue_stopped(ks->netdev))
-                    netif_wake_queue(ks->netdev);
+            need_wake_queue = netif_queue_stopped(ks->netdev);
             spin_unlock(&ks->statelock);
+            if (need_wake_queue)
+                    netif_wake_queue(ks->netdev);

xmit runs in BH, this is just one way you can hit this deadlock
better fix would be to make sure statelock is always taken
using spin_lock_bh()


________________________________

Ce message, ainsi que tous les fichiers joints à ce message, peuvent contenir des informations sensibles et/ ou confidentielles ne devant pas être divulguées. Si vous n'êtes pas le destinataire de ce message (ou que vous recevez ce message par erreur), nous vous remercions de le notifier immédiatement à son expéditeur, et de détruire ce message. Toute copie, divulgation, modification, utilisation ou diffusion, non autorisée, directe ou indirecte, de tout ou partie de ce message, est strictement interdite.


This e-mail, and any document attached hereby, may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized, direct or indirect, copying, disclosure, distribution or other use of the material or parts thereof is strictly forbidden.





[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux