Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1394448pxb; Fri, 21 Jan 2022 17:32:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJyNbkKGOfsC2Z6SXdw8/rK2u15nPUI6+J2SOOtRQbncaFkUJFqsr3cWFdKCSR6Jp2mNgaqV X-Received: by 2002:a63:b545:: with SMTP id u5mr4683303pgo.420.1642815120420; Fri, 21 Jan 2022 17:32:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642815120; cv=none; d=google.com; s=arc-20160816; b=cRy7oaJ/20EF71TkSKs44Djvxboqf68qbqsAKASu5WYGuWIcWlh4SDQ26fciwc6Ehw hUP2AfNgtg6wJncTK8jwQkqdMOx8fkZ9PmzkUczY/Utjy57qX/82MEIFu0TAMRbLYSYz SUNxem8UtSbZbllHbRatAAjDVeQ2+amllXLidpEVMspCLVgN/CsR4KkUDd1+ZHJn0BXF 4Ert3nAgHzeEJbrgETyUOUikVGZYSMN9KY+vPVrLiWBT8yZOYMfweUySSUDFYxzTAjlv K/j0puArSzYd8OB36xheOFNwj/Y5UJtkMv97UNZ1w6/yDKAczsPKTO3yAtVemhbQHZjg z2xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=87A/tDKQS+3qI1mDmEkAtXDZaWxRClH2krUZOoDdvz0=; b=gHQMTzaJ5/+vowhec5tVfVux24uWXGHPruNuR+LUkYrlVGn1eNHszezj3x6HqY8Soo YLbmY8sjKxWMGCZMERVgwHufJJJFCPQFAJzBOezqdFhsMv5DFYWZ9cmYKntKmY5r4JAZ XNbXTLqLJWtbx6XRTmsXdAWIQYHtH166pb22h8uhXpfWuFCsIfoQw9Lmob6Z6gW7WaPG Yl48zmYB8zpxyb4uKrdb7dJQlALA9Hf3IjBaBvIOizPwWtqVe8mg23dkp43Lz7HN8ECq oXAit/L0AUSdY0Z+WmbTk3ywuMepDTbsg+Aen8IvQgyrOfqr07WznSE0RgvO1VVO2Qk0 xpuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=HXUr11Aw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q2si6971517pga.370.2022.01.21.17.31.48; Fri, 21 Jan 2022 17:32:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=HXUr11Aw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380692AbiAUNWW (ORCPT + 99 others); Fri, 21 Jan 2022 08:22:22 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:47760 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380583AbiAUNWU (ORCPT ); Fri, 21 Jan 2022 08:22:20 -0500 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=87A/tDKQS+3qI1mDmEkAtXDZaWxRClH2krUZOoDdvz0=; b=HXUr11AwYknsAaClHt8ecVzUuM g9RDS6j5MlWIUmcRhHagqgr/y5LX3BlUdfaa6eAmPSDV8ixDcm3WlGmwc0zisCpz7dgr2OsFdJROc nL538wTMsDVLDIPLkhaVuqKGFeF0++g81fMlJjfCLqfM50QkJMJvuSNkwUpf1eHA2H1U=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1nAtrr-0025Os-NJ; Fri, 21 Jan 2022 14:22:15 +0100 Date: Fri, 21 Jan 2022 14:22:15 +0100 From: Andrew Lunn To: Kai-Heng Feng Cc: hkallweit1@gmail.com, linux@armlinux.org.uk, "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] net: phy: marvell: Honor phy LED set by system firmware on a Dell hardware Message-ID: References: <20220120051929.1625791-1-kai.heng.feng@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 21, 2022 at 12:01:35PM +0800, Kai-Heng Feng wrote: > On Thu, Jan 20, 2022 at 10:26 PM Andrew Lunn wrote: > > > > On Thu, Jan 20, 2022 at 01:19:29PM +0800, Kai-Heng Feng wrote: > > > BIOS on Dell Edge Gateway 3200 already makes its own phy LED setting, so > > > instead of setting another value, keep it untouched and restore the saved > > > value on system resume. > > > > > > Introduce config_led() callback in phy_driver() to make the implemtation > > > generic. > > > > I'm also wondering if we need to take a step back here and get the > > ACPI guys involved. I don't know much about ACPI, but shouldn't it > > provide a control method to configure the PHYs LEDs? > > > > We already have the basics for defining a PHY in ACPI. See: > > > > https://www.kernel.org/doc/html/latest/firmware-guide/acpi/dsd/phy.html > > These properties seem to come from device-tree. They are similar to what DT has, but expressed in an ACPI way. DT has been used with PHY drivers for a long time, but ACPI is new. The ACPI standard also says nothing about PHYs. So Linux has defined its own properties, which we expect all ACPI machine to use. According to the ACPI maintainers, this is within the ACPI standard. Maybe at some point somebody will submit the current definitions to the standards body for approval, or maybe the standard will do something completely different, but for the moment, this is what we have, and what you should use. > > so you could extend this to include a method to configure the LEDs for > > a specific PHY. > > How to add new properties? Is it required to add new properties to > both DT and ACPI? Since all you are adding is a boolean, 'Don't touch the PHY LED configuration', it should be easy to do for both. What is interesting for Marvell PHYs is WoL, which is part of LED configuration. I've not checked, but i guess there are other PHYs which reuse LED output for a WoL interrupt. So it needs to be clearly defined if we expect the BIOS to also correctly configure WoL, or if Linux is responsible for configuring WoL, even though it means changing the LED configuration. Andrew