Patch "net: dsa: microchip: fix wrong register write when masking interrupt" has been added to the 6.9-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

    net: dsa: microchip: fix wrong register write when masking interrupt

to the 6.9-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:
     net-dsa-microchip-fix-wrong-register-write-when-mask.patch
and it can be found in the queue-6.9 subdirectory.

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



commit f0d36f945fe99d587709efa114525707e3265349
Author: Tristram Ha <tristram.ha@xxxxxxxxxxxxx>
Date:   Fri Jun 21 15:34:22 2024 -0700

    net: dsa: microchip: fix wrong register write when masking interrupt
    
    [ Upstream commit b1c4b4d45263241ec6c2405a8df8265d4b58e707 ]
    
    The switch global port interrupt mask, REG_SW_PORT_INT_MASK__4, is
    defined as 0x001C in ksz9477_reg.h.  The designers used 32-bit value in
    anticipation for increase of port count in future product but currently
    the maximum port count is 7 and the effective value is 0x7F in register
    0x001F.  Each port has its own interrupt mask and is defined as 0x#01F.
    It uses only 4 bits for different interrupts.
    
    The developer who implemented the current interrupt mechanism in the
    switch driver noticed there are similarities between the mechanism to
    mask port interrupts in global interrupt and individual interrupts in
    each port and so used the same code to handle these interrupts.  He
    updated the code to use the new macro REG_SW_PORT_INT_MASK__1 which is
    defined as 0x1F in ksz_common.h but he forgot to update the 32-bit write
    to 8-bit as now the mask registers are 0x1F and 0x#01F.
    
    In addition all KSZ switches other than the KSZ9897/KSZ9893 and LAN937X
    families use only 8-bit access and so this common code will eventually
    be changed to accommodate them.
    
    Fixes: e1add7dd6183 ("net: dsa: microchip: use common irq routines for girq and pirq")
    Signed-off-by: Tristram Ha <tristram.ha@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/1719009262-2948-1-git-send-email-Tristram.Ha@xxxxxxxxxxxxx
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
index 2a5861a88d0e6..e54f83a2e7d30 100644
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -2129,7 +2129,7 @@ static void ksz_irq_bus_sync_unlock(struct irq_data *d)
 	struct ksz_device *dev = kirq->dev;
 	int ret;
 
-	ret = ksz_write32(dev, kirq->reg_mask, kirq->masked);
+	ret = ksz_write8(dev, kirq->reg_mask, kirq->masked);
 	if (ret)
 		dev_err(dev->dev, "failed to change IRQ mask\n");
 




[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