Patch "wifi: mt76: add memory barrier to SDIO queue kick" has been added to the 6.2-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    wifi: mt76: add memory barrier to SDIO queue kick

to the 6.2-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     wifi-mt76-add-memory-barrier-to-sdio-queue-kick.patch
and it can be found in the queue-6.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 852cdf2e558e119cbb5686b322fa85c2e861c304
Author: Deren Wu <deren.wu@xxxxxxxxxxxx>
Date:   Sun Jan 15 12:44:57 2023 +0800

    wifi: mt76: add memory barrier to SDIO queue kick
    
    [ Upstream commit 5f54237ad798f41cb6a503271aa9ca47188cfb9b ]
    
    Ensure the entry has been fully updated before SDIO bus worker access
    it. This patch would fix potential memory risk in both mt7663s and
    mt7921s.
    
    Fixes: 764dee47e2c1 ("mt76: sdio: move common code in mt76_sdio module")
    Signed-off-by: Deren Wu <deren.wu@xxxxxxxxxxxx>
    Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>
    Signed-off-by: Felix Fietkau <nbd@xxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/wireless/mediatek/mt76/sdio.c b/drivers/net/wireless/mediatek/mt76/sdio.c
index 228bc7d45011c..419723118ded8 100644
--- a/drivers/net/wireless/mediatek/mt76/sdio.c
+++ b/drivers/net/wireless/mediatek/mt76/sdio.c
@@ -562,6 +562,10 @@ mt76s_tx_queue_skb_raw(struct mt76_dev *dev, struct mt76_queue *q,
 
 	q->entry[q->head].buf_sz = len;
 	q->entry[q->head].skb = skb;
+
+	/* ensure the entry fully updated before bus access */
+	smp_wmb();
+
 	q->head = (q->head + 1) % q->ndesc;
 	q->queued++;
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux