From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (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 830A613BAFB; Fri, 10 May 2024 23:58:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715385522; cv=none; b=kLXBm7ay8y90ESwvYvQcPcfeTXUy7wdy5Qy6jXOT2uAT54DQZ1z8DQh0Z1+7LoSMxvXvAaQRUDdi4o4oKB95YEigie14zPvx5PH+k0TssUpgpd2ZX8qV/WEdPjrQq2a1fpuIbEyrbPdjHwqszQ+umuMozbPC16xqNWUIpo0+S14= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715385522; c=relaxed/simple; bh=Rw2z98v+eDfNW0peI8QlfkbvX2mMcCvJsflxNJVrbCw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mPIs1tEWXw4OxwKYT3LsATod3a0Ox4muZZ09uX7aFmfWhO5ODig/oKlUGusdfCBBKS2a+z4e4sgMfPeV8x8L+xCNaK3Q7uFvNvuMdzFQUSpcbmS9bKtuR20asB6s/Dppo17RPMEkOpTHLJIuZHnJqBwPZUYip52QXr++870Rbac= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=iiyIfkxV; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="iiyIfkxV" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=i6+svHzw1fQhMuQYrr1eYkC7SUY5MZbc32DdVO9kxYQ=; b=iiyIfkxV+5n/px3gMZflCleO1/ QzR70vMV/baXYjrTQroztf3PRQgnBmfog/ICZkBrq9razxGtW3DX56D3DH2F7j/ufKt9eP4SkFlOE 3Hhe6zWkG6chov8n9SEhjHoLiBbdG1pEQ5mld+Z3qm0SAlwS14XPTgcYd1bZ2K3R3qhc=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1s5a7x-00FAkv-9W; Sat, 11 May 2024 01:58:13 +0200 Date: Sat, 11 May 2024 01:58:13 +0200 From: Andrew Lunn To: Daniel Golle Cc: Christian Marangi , Pavel Machek , Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , William Zhang , Anand Gore , Kursad Oney , Florian Fainelli , =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= , Broadcom internal kernel review list , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Heiner Kallweit , Russell King , Jacek Anaszewski , =?iso-8859-1?Q?Fern=E1ndez?= Rojas , Sven Schwermer , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org Subject: Re: [net-next PATCH v10 3/5] net: phy: add support for PHY LEDs polarity modes Message-ID: References: <20240125203702.4552-1-ansuelsmth@gmail.com> <20240125203702.4552-4-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: > Wanting to make use of this I noticed that polarity settings are only > applied once in of_phy_led(), which is not sufficient for my use-case: > > I'm writing a LED driver for Aquantia PHYs and those PHYs reset the > polarity mode every time a PHY reset is triggered. > > I ended up writing the patch below, but I'm not sure if phy_init_hw > should take care of this or if the polarity modes should be stored in > memory allocated by the PHY driver and re-applied by the driver after > reset (eg. in .config_init). Kinda depends on taste and on how common > this behavior is in practise, so I thought the best is to reach out to > discuss. There was a similar discussion recently about WoL settings getting lost. The conclusion about that was the PHY should keep track of WoL setting. So i would say the same applies there. Please store it in a local priv structure. Andrew