From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.tipi-net.de (mail.tipi-net.de [194.13.80.246]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 786453D34A4; Wed, 1 Apr 2026 11:13:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.13.80.246 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775042030; cv=none; b=TFGiiY+f+zJA3zxqjNdjRVSX3Mko+vZnDvAhqXW7PZ9n3LBabe1CjUplYcPcwcAv/o8MSaziWSepZa4ZlHaQroF9Qoo2dVL0VaXWhL6cwfiBPD7zZPEBfW6sernan8QC29FmXUaAGsklFGWTC5IfqgqAhwG/9SK5nKlbIc+pDLI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775042030; c=relaxed/simple; bh=GsDfng+YUixHLJx4M56ebk2b5l4g8eMD2QCLAz5ciEU=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type; b=SEDDmIE0MI60K5K5oFWT9UU3Yw/Yp5I2gspfywVqhDwP8xASOdVr1rOFBE74Yeb2m7sy/PVSmIf/3ZmpR0HETaB9yZ/9yW6Y7SaGCrSLXuoY5EbGSgxDcc2rra9tyKM40VYVX7lvCQ3ICi8eDoPflWL7l0lMbj3W9+G+Gw9jt1o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de; spf=pass smtp.mailfrom=tipi-net.de; dkim=pass (2048-bit key) header.d=tipi-net.de header.i=@tipi-net.de header.b=mHv/VLVh; arc=none smtp.client-ip=194.13.80.246 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tipi-net.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tipi-net.de header.i=@tipi-net.de header.b="mHv/VLVh" Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 36137A585F; Wed, 1 Apr 2026 13:13:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim; t=1775042009; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=Q9yvKMMQnqcDALJLjGbsxYPaoRAnEzHYwPyWde/eKJo=; b=mHv/VLVhZpV198DJI0DoNipdp9DcWWViqPp7+Os/OMGOZrKbpX8ODsNCi5SFGd0Ifp3vvn VpRjw9nAMtSlAdJBURagXEy9o8/YdOsxQ8N22/iM/i2HGC3ArxPTO3I/y/sY9WRlY8Jxpa JlG7DDFXAntYtLEojsAqJn3mtmbO3HzXD4E1q35PdCFAfSB2wN5m9zfmKkzPP5D3BpOXS8 2VelQf3sto29TcXtUwVngMh2j4j5rnwKIU3LOlbkHhxTLHBkv3Gg1SDJU7txuFh53mmadd mt2III+7KcDR3Y4FZO6vYWABio58boCp0HU5kKQgl7y2K09b2Jwr8oOiLwuTgA== Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Wed, 01 Apr 2026 13:13:21 +0200 From: Nicolai Buchwitz To: Chukun Pan Cc: "David S . Miller" , Andrew Lunn , Paolo Abeni , Jakub Kicinski , Eric Dumazet , Russell King , Daniel Golle , Heiner Kallweit , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH 1/1] net: phy: realtek: Add support for PHY LEDs on RTL8221B In-Reply-To: <20260401100010.3079700-1-amadeus@jmu.edu.cn> References: <20260401100010.3079700-1-amadeus@jmu.edu.cn> Message-ID: <28961808c3aa133f74257494f5e327c6@tipi-net.de> X-Sender: nb@tipi-net.de Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Last-TLS-Session-Version: TLSv1.3 On 1.4.2026 12:00, Chukun Pan wrote: > Realtek RTL8221B Ethernet PHY supports three LED pins which are used to > indicate link status and activity. Add netdev trigger support for them. > > Signed-off-by: Chukun Pan > --- > drivers/net/phy/realtek/realtek_main.c | 146 +++++++++++++++++++++++++ > 1 file changed, 146 insertions(+) > > diff --git a/drivers/net/phy/realtek/realtek_main.c > b/drivers/net/phy/realtek/realtek_main.c > index 023e47ad605b..8a22e18e5c56 100644 > --- a/drivers/net/phy/realtek/realtek_main.c > +++ b/drivers/net/phy/realtek/realtek_main.c > @@ -150,6 +150,15 @@ > [...] > > +static int rtl822xb_led_brightness_set(struct phy_device *phydev, u8 > index, > + enum led_brightness value) > +{ > + int ret; > + > + if (index >= RTL8211x_LED_COUNT) > + return -EINVAL; > + > + /* clear HW LED setup */ > + ret = phy_write_mmd(phydev, MDIO_MMD_VEND2, > + RTL822X_VND2_LED(index), 0); > + if (ret < 0) > + return ret; > + > + /* clear HW LED blink */ > + return phy_clear_bits_mmd(phydev, MDIO_MMD_VEND2, > + RTL822X_VND2_LCR6, > + RTL822X_VND2_LED_ACT(index)); > +} This clears HW triggers but never actually turns the LED on when value != LED_OFF. Both paths do the same thing: clear link and activity config (value isn't used at all). For LED_OFF that works (no triggers = LED off), but for LED_ON the LED stays off too since there's no force-on written anywhere. Compare with bcm_phy_led_brightness_set() which explicitly switches between BCM_LED_SRC_ON and BCM_LED_SRC_OFF based on value. If the RTL8221B has a software force-on register, it needs to be programmed here. If it doesn't, brightness_set should not be implemented at all. The framework handles its absence. [...] Thanks Nicolai