Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp820684lqo; Fri, 10 May 2024 16:58:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW0HLVtB2X3uKdM+tWPmacR9A9Yvo9P0wQEPIutyPEy15gmSMvlpPwOrHRTXN0SdvODoveegj+e7ccQpZ/ilrcJjtzprPtMpOTjifoa8w== X-Google-Smtp-Source: AGHT+IFMLQGorg900Ff9oghpRjX0g8l6SN7rl3rr1vnDacKydJ2cuJK5qMG5s1dCVja4yEO+P0Di X-Received: by 2002:a50:8d50:0:b0:572:6ae4:a9ac with SMTP id 4fb4d7f45d1cf-5734d5e35d6mr2994838a12.21.1715385533076; Fri, 10 May 2024 16:58:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715385533; cv=pass; d=google.com; s=arc-20160816; b=JIOdofLR+UHzn6Ej6A+0x/QnLVemNv+cHTN+zqFwqo/0y37nah0KfVWUuScS5snwtB TRU1XNluaczMXM8TchjF1qH3Y3YXFpZrW0ijGj+ynMjdxpdF10XY9jh8mtvEbiUz+7vv GLR4cwkq3NvoZxhkZEc6wCGqQ0MeIIPrA9FUFs5+QyaBm3ub9jGUBD/MUZdN7hjDRuI+ d3feLEUWWm7ohCxPAi4WIH3R9ZWLuMOjMorGTuYwCLXSqn8DvHJiBzfvynDwR5iJKy0L tPCDXiOIt/YjWkM/vyvkbzc+z8QCrNQHQkwpX7T06iGp8UoRrpZ4v5jVyo+9U8D+Km3i U/bQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=i6+svHzw1fQhMuQYrr1eYkC7SUY5MZbc32DdVO9kxYQ=; fh=K93O1t+AtWBRQe8hYIQLYspQ3HhJACdm7ad8sHpdOUU=; b=ho2HMw01/wMGAmd0M6Qcx1QzzqYkXdL7SS9Kzm6Ju/JupPdZMXXv49/ctyVw/Q9pka KTp80OS4NuYAhwFUY8iLMIIgFp3llkQnj5WztuP+3UKRnQDh+5wDyQNgcvOClqQoak0Z 9a1KBEmZM56kAxAZMgg/rZHE2kcHlHO9ZYwVLI2bTkHdizkLVLOecvGZoFu3HLAQH10R 7On7XPhM/cjjFBwjGZjHKx0RgJ+ehAKxKZ6KjKl27N1S/EhYbOof8YRMDwGgGcRsXRQe +jkcnxJP09QSLKRCIOrNC+5VUM7U/Z3IkWQDOOZT0fiiBhh0/Zh44S0ewOrvYwI8ZKzE 35Ig==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=iiyIfkxV; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-176312-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176312-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c2d564asi2467069a12.215.2024.05.10.16.58.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 16:58:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176312-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=iiyIfkxV; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-176312-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176312-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id CA78A1F22230 for ; Fri, 10 May 2024 23:58:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 34FBC176FCE; Fri, 10 May 2024 23:58:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="iiyIfkxV" 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 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