Patch "net: usb: smsc95xx: fix changing LED_SEL bit value updated from EEPROM" has been added to the 4.19-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: usb: smsc95xx: fix changing LED_SEL bit value updated from EEPROM

to the 4.19-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-usb-smsc95xx-fix-changing-led_sel-bit-value-upda.patch
and it can be found in the queue-4.19 subdirectory.

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



commit b503084f564f320f3218ed51a05b4cb1ad8fae4a
Author: Parthiban Veerasooran <Parthiban.Veerasooran@xxxxxxxxxxxxx>
Date:   Thu May 23 14:23:14 2024 +0530

    net: usb: smsc95xx: fix changing LED_SEL bit value updated from EEPROM
    
    [ Upstream commit 52a2f0608366a629d43dacd3191039c95fef74ba ]
    
    LED Select (LED_SEL) bit in the LED General Purpose IO Configuration
    register is used to determine the functionality of external LED pins
    (Speed Indicator, Link and Activity Indicator, Full Duplex Link
    Indicator). The default value for this bit is 0 when no EEPROM is
    present. If a EEPROM is present, the default value is the value of the
    LED Select bit in the Configuration Flags of the EEPROM. A USB Reset or
    Lite Reset (LRST) will cause this bit to be restored to the image value
    last loaded from EEPROM, or to be set to 0 if no EEPROM is present.
    
    While configuring the dual purpose GPIO/LED pins to LED outputs in the
    LED General Purpose IO Configuration register, the LED_SEL bit is changed
    as 0 and resulting the configured value from the EEPROM is cleared. The
    issue is fixed by using read-modify-write approach.
    
    Fixes: f293501c61c5 ("smsc95xx: configure LED outputs")
    Signed-off-by: Parthiban Veerasooran <Parthiban.Veerasooran@xxxxxxxxxxxxx>
    Reviewed-by: Simon Horman <horms@xxxxxxxxxx>
    Reviewed-by: Woojung Huh <woojung.huh@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240523085314.167650-1-Parthiban.Veerasooran@xxxxxxxxxxxxx
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index ec233d033f5cd..22c1eac73f2c4 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -1036,7 +1036,7 @@ static int smsc95xx_phy_initialize(struct usbnet *dev)
 static int smsc95xx_reset(struct usbnet *dev)
 {
 	struct smsc95xx_priv *pdata = dev->driver_priv;
-	u32 read_buf, write_buf, burst_cap;
+	u32 read_buf, burst_cap;
 	int ret = 0, timeout;
 
 	netif_dbg(dev, ifup, dev->net, "entering smsc95xx_reset\n");
@@ -1178,10 +1178,13 @@ static int smsc95xx_reset(struct usbnet *dev)
 		return ret;
 	netif_dbg(dev, ifup, dev->net, "ID_REV = 0x%08x\n", read_buf);
 
+	ret = smsc95xx_read_reg(dev, LED_GPIO_CFG, &read_buf);
+	if (ret < 0)
+		return ret;
 	/* Configure GPIO pins as LED outputs */
-	write_buf = LED_GPIO_CFG_SPD_LED | LED_GPIO_CFG_LNK_LED |
-		LED_GPIO_CFG_FDX_LED;
-	ret = smsc95xx_write_reg(dev, LED_GPIO_CFG, write_buf);
+	read_buf |= LED_GPIO_CFG_SPD_LED | LED_GPIO_CFG_LNK_LED |
+		    LED_GPIO_CFG_FDX_LED;
+	ret = smsc95xx_write_reg(dev, LED_GPIO_CFG, read_buf);
 	if (ret < 0)
 		return ret;
 




[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