lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c0fa9fe2-7a98-4682-9ecf-aab36ec8e9ed@huawei.com>
Date: Tue, 12 Aug 2025 21:13:30 +0800
From: Jijie Shao <shaojijie@...wei.com>
To: "Russell King (Oracle)" <linux@...linux.org.uk>
CC: <shaojijie@...wei.com>, Heiko Stübner <heiko@...ech.de>,
	<davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
	<pabeni@...hat.com>, <andrew+netdev@...n.ch>, <horms@...nel.org>,
	<Frank.Sae@...or-comm.com>, <hkallweit1@...il.com>, <shenjian15@...wei.com>,
	<liuyonglong@...wei.com>, <chenhao418@...wei.com>,
	<jonathan.cameron@...wei.com>, <shameerali.kolothum.thodi@...wei.com>,
	<salil.mehta@...wei.com>, <netdev@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next 1/2] net: phy: motorcomm: Add support for PHY
 LEDs on YT8521


on 2025/8/11 23:01, Russell King (Oracle) wrote:
> On Thu, Aug 07, 2025 at 11:50:06AM +0200, Heiko Stübner wrote:
>>> +static int yt8521_led_hw_control_get(struct phy_device *phydev, u8 index,
>>> +				     unsigned long *rules)
>>> +{
>>> +	int val;
>>> +
>>> +	if (index >= YT8521_MAX_LEDS)
>>> +		return -EINVAL;
>>> +
>>> +	val = ytphy_read_ext(phydev, YT8521_LED0_CFG_REG + index);
>>> +	if (val < 0)
>>> +		return val;
>>> +
>>> +	if (val & YT8521_LED_TXACT_BLK_EN)
>>> +		set_bit(TRIGGER_NETDEV_TX, rules);
>>> +
>>> +	if (val & YT8521_LED_RXACT_BLK_EN)
>>> +		set_bit(TRIGGER_NETDEV_RX, rules);
>>> +
>>> +	if (val & YT8521_LED_FDX_ON_EN)
>>> +		set_bit(TRIGGER_NETDEV_FULL_DUPLEX, rules);
>>> +
>>> +	if (val & YT8521_LED_HDX_ON_EN)
>>> +		set_bit(TRIGGER_NETDEV_HALF_DUPLEX, rules);
>>> +
>>> +	if (val & YT8521_LED_GT_ON_EN)
>>> +		set_bit(TRIGGER_NETDEV_LINK_1000, rules);
>>> +
>>> +	if (val & YT8521_LED_HT_ON_EN)
>>> +		set_bit(TRIGGER_NETDEV_LINK_100, rules);
>>> +
>>> +	if (val & YT8521_LED_BT_ON_EN)
>>> +		set_bit(TRIGGER_NETDEV_LINK_10, rules);
> Sorry, I don't have the original to hand.
>
> Please use __set_bit() where the more expensive atomic operation that
> set_bit() gives is not necessary.

Okay, got it.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ