Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4986021pxb; Tue, 5 Oct 2021 14:54:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPEYeN9WGQA8L8mSTnWWTj614k8nqTpGeHazwDkmZyjFbGkPxz7ee03Mhpbwn4OLe24bl7 X-Received: by 2002:a17:906:1e51:: with SMTP id i17mr1327844ejj.528.1633470859159; Tue, 05 Oct 2021 14:54:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633470859; cv=none; d=google.com; s=arc-20160816; b=Nor0Fy5euSS+t5/oBuMVSUl6SSvUYYMee0sm93Tf5kRxD97Gjvqwre/YrPzJMRRgTH EoXrlBaqCSEjXrZI/8W3fW88AEKvAhTfVqd519NlMlI2uO9KQku23v5TWz5V1+HcEEQ3 x1wVD3HytWcB4OB1DP4WBBtrVP7vo8SpJv54emUAt0qDhWMVt8Ua+ypUT7b+c85qhAwe 9/x111Ua+zVof9mXoBr3cMJEjmr1xs2qE+0cvbUmuIDQrYLWg7lRW3c9I6q4hkS9/uxv ApElyf9tPD0suUlO3bDToFIPJLVmof6r6ep++a1grB86zsOUXTCIzxvekgWUapYiz4Dx jK8Q== 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=W4yT+b65bPv7vYT9mcTeeaiNF0+rs+97F+OpDRA+k/A=; b=wej6E1e08hl+BWWIsje4tQq6Rps1W7z/l0Ot28U2pvWgPrUWrT7FEdtlmBzBF4bOhP OzIIHOTFy94coKRKKc0cUfKGP5rLDfNHSF69DpvjU5k1JeL5dUK8YIsfItt6LodOrUH8 aZ0Q3g7xeFxrKu+OBb6VS3Jq52E39Yfe6gUArbhOXXVPBFBYKH2nn8QdDoJT6ayL0ygs NKIasxJlOUizHrOuc3Oml6xQ+J3iRCgulh7iRnT9iAgQ1UPOq84CWuctIL2f4GmRSeHH W02eQ2nch1rElC+3qZ0t6Dn9dPZzsgULpYEgVrSpQMiIFBUOfrNDjybDsggi/5FB7gdZ SxSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=dXUXB6dz; 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 t19si24596857edd.159.2021.10.05.14.53.53; Tue, 05 Oct 2021 14:54:19 -0700 (PDT) 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=dXUXB6dz; 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 S236700AbhJEVy1 (ORCPT + 99 others); Tue, 5 Oct 2021 17:54:27 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:50874 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229974AbhJEVyY (ORCPT ); Tue, 5 Oct 2021 17:54:24 -0400 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=W4yT+b65bPv7vYT9mcTeeaiNF0+rs+97F+OpDRA+k/A=; b=dXUXB6dzavKbocZFMhwV2yslLq NkSeyWUW3YN61BQRSA0hMc24LA2ulbDvqG4Oh8VmhUcePE8btegHq66oE0OjUiNAiBRd8MpGSe0Xh dRC61innIrLKAE0bnjdNs3oyGil6U6oKrqLaqsfIOybmBqt2sLPj2TK/CyYQh9mFUW4k=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mXsMP-009kfY-HF; Tue, 05 Oct 2021 23:52:29 +0200 Date: Tue, 5 Oct 2021 23:52:29 +0200 From: Andrew Lunn To: Marek =?iso-8859-1?Q?Beh=FAn?= Cc: Rob Herring , Pavel Machek , Jacek Anaszewski , "linux-leds@vger.kernel.org" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: lets settle the LED `function` property regarding the netdev trigger Message-ID: References: <20211001143601.5f57eb1a@thinkpad> <20211003212654.30fa43f5@thinkpad> <20211004170847.3f92ef48@thinkpad> <20211005223014.3891f041@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211005223014.3891f041@thinkpad> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > I really don't think we should be registering any LEDs in the PHY driver > if the driver does not know whether there are LEDs connected to the PHY. > > If this information is not available (via device-tree or some other > method, for example USB vendor/device table), then we can't register a > LED and let user control it. > > What if the pin is used for something different on a board? There is some danger here. Some hardware misuse LED outputs for WoL interrupts. There is even m88e1318_set_wol() which sets up LED2 for WoL. So i will need to review the PHY drivers to look out for this, and maybe add some restrictions. But i think we have little choice but to export all the LEDs a PHY supports. USB vendor/product, PCI vendor/product does not give us anything useful. How many OEMs take a lan78xx chip, created a USB dongle and shipped it using USB enumeration data: LAN78XX_USB_VENDOR_ID:LAN7800_USB_PRODUCT_ID. How many motherboards have a r8169 PCIe device using realteks PCI enumeration data? There is no useful source of information in devices like this. But what we do know is that the PHY can control X LED output pins, and we know what patterns it can blink those LED pins. So we export them, and let the user figure it out. This is the general case. If we have DT, or ACPI, or some other source, we can then refine this representation. If we have LED information, but a specific LED is missing from DT, don't export it. If the colour is available, use that in the name. If the default mode information is available, configure it that way, etc. Now, it could be we don't start with this, we just export those that do have DT. But i will want to ensure that the API/ABI we define is generic enough to support this. We need to start somewhere, get some basic support merged, and then do incremental improvements. Andrew