From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E82A9C6FD1C for ; Fri, 24 Mar 2023 22:07:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=J8wsVsWuQNiU5l26Bk7VUpymGWtTXGRiUOr08OVOPDE=; b=DJL2XWELL71xgI 1BSWeflaVwXJkWSrGw3FbrWlxTSTlrR2onMAMHBhNkV6ov0WKXgrkQaLxgx2uvUHTukVI4Rkh+k0b 2yv5VFd+YpT3rtd/KMZI8yw0uZMlckHVU9dgI/mCjGfy79rQ6nz34jKXZzbTofrsCGryowTAcNOf6 4A5IuTvCFe4Ktq5qG8i9rzgWwKldmtQOAM2tVRklOYDHyustpwsQRULzrbVX1cKwhoIfHDEPbwsUn YsCUbK4SvRHH8gR+pTAGlFMbJezsBjByTigfyYn/6ThfAV4R/QhrPvVGoRIsqwc7sM1j/3QWnImB8 vKDUGTM7Pw7JpnLd/BCw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pfpYg-005i5p-0K; Fri, 24 Mar 2023 22:06:50 +0000 Received: from mail-oo1-f49.google.com ([209.85.161.49]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pfpYd-005i5B-0B for linux-arm-kernel@lists.infradead.org; Fri, 24 Mar 2023 22:06:48 +0000 Received: by mail-oo1-f49.google.com with SMTP id n6-20020a4abd06000000b0053b59893660so512673oop.0 for ; Fri, 24 Mar 2023 15:06:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679695605; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jgu6wWXcTcsTo5LN3ZtXGI94HoYL88NOlxBVx6Lr4x8=; b=rs7GA77le3P5nXYNraK7ndsXGc5KqmpBGSrH+IGEqDElsKtvNTvToyz+8EjC5IEFNC 0GWFBecpAz6AEk6LqenbvxVS99I+BzfbrmLjEtcAJCCPh1EKSdXfU9b3C/E3D9SQQd3e I9lR4wbSDGPOK45jjPwlyV6SgSK7uW3Mjf4pQWuU6+hN6QdcwEXXlE288LWF1OABnK9V YsLAqkIdw3WPBtW8yX4ZgrZDTX90Plig0r/2jxTUWG1v45mjvxrtcwTFrJzCxNpTTOFi m6ZoerxYppVHjH8bZEO8DU4ssyn0pDJzmTerZmz646kL05gd+H1mF3S1dAfR0wmq5wbX kfDA== X-Gm-Message-State: AO0yUKVFWGROP4KjaHjaNHb1y/wNzwTedT0yGAYnfPZhi+AR9CsyUl46 BqKXwDme8ihuXEjTQHUcmeYziHkkYQ== X-Google-Smtp-Source: AK7set+LkRQlXG/4pv+KExNl9Uhk5BFBvi0zBaNEWGI9yXsm8GdhJTfphf7IDD/+RKhTTiMVChNQFA== X-Received: by 2002:a4a:3356:0:b0:525:c83:2f94 with SMTP id q83-20020a4a3356000000b005250c832f94mr2358873ooq.4.1679695604841; Fri, 24 Mar 2023 15:06:44 -0700 (PDT) Received: from robh_at_kernel.org ([2605:ef80:80f9:92f0:b372:78c0:69c1:66d6]) by smtp.gmail.com with ESMTPSA id y45-20020a4a9830000000b0053bb063121asm768308ooi.9.2023.03.24.15.06.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 15:06:44 -0700 (PDT) Received: (nullmailer pid 64249 invoked by uid 1000); Fri, 24 Mar 2023 22:06:41 -0000 Date: Fri, 24 Mar 2023 17:06:41 -0500 From: Rob Herring To: Christian Marangi Cc: Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Krzysztof Kozlowski , Heiner Kallweit , Russell King , Gregory Clement , Sebastian Hesselbarth , Andy Gross , Bjorn Andersson , Konrad Dybcio , Pavel Machek , Lee Jones , John Crispin , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-leds@vger.kernel.org Subject: Re: [net-next PATCH v5 10/15] dt-bindings: net: ethernet-controller: Document support for LEDs node Message-ID: <20230324220641.GA54972-robh@kernel.org> References: <20230319191814.22067-1-ansuelsmth@gmail.com> <20230319191814.22067-11-ansuelsmth@gmail.com> <20230321211953.GA1544549-robh@kernel.org> <641a35b8.1c0a0220.25419.2b4d@mx.google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <641a35b8.1c0a0220.25419.2b4d@mx.google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230324_150647_110694_B693481D X-CRM114-Status: GOOD ( 44.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Mar 21, 2023 at 11:54:46PM +0100, Christian Marangi wrote: > On Tue, Mar 21, 2023 at 04:19:53PM -0500, Rob Herring wrote: > > On Sun, Mar 19, 2023 at 08:18:09PM +0100, Christian Marangi wrote: > > > Document support for LEDs node in ethernet-controller. > > > Ethernet Controller may support different LEDs that can be configured > > > for different operation like blinking on traffic event or port link. > > > > > > Also add some Documentation to describe the difference of these nodes > > > compared to PHY LEDs, since ethernet-controller LEDs are controllable > > > by the ethernet controller regs and the possible intergated PHY doesn't > > > have control on them. > > > > > > Signed-off-by: Christian Marangi > > > --- > > > .../bindings/net/ethernet-controller.yaml | 21 +++++++++++++++++++ > > > 1 file changed, 21 insertions(+) > > > > > > diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml > > > index 00be387984ac..a93673592314 100644 > > > --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml > > > +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml > > > @@ -222,6 +222,27 @@ properties: > > > required: > > > - speed > > > > > > + leds: > > > + type: object > > > + description: > > > + Describes the LEDs associated by Ethernet Controller. > > > + These LEDs are not integrated in the PHY and PHY doesn't have any > > > + control on them. Ethernet Controller regs are used to control > > > + these defined LEDs. > > > + > > > + properties: > > > + '#address-cells': > > > + const: 1 > > > + > > > + '#size-cells': > > > + const: 0 > > > + > > > + patternProperties: > > > + '^led(@[a-f0-9]+)?$': > > > + $ref: /schemas/leds/common.yaml# > > > > Are specific ethernet controllers allowed to add their own properties in > > led nodes? If so, this doesn't work. As-is, this allows any other > > properties. You need 'unevaluatedProperties: false' here to prevent > > that. But then no one can add properties. If you want to support that, > > then you need this to be a separate schema that devices can optionally > > include if they don't extend the properties, and then devices that > > extend the binding would essentially have the above with: > > > > $ref: /schemas/leds/common.yaml# > > unevaluatedProperties: false > > properties: > > a-custom-device-prop: ... > > > > > > If you wanted to define both common ethernet LED properties and > > device specific properties, then you'd need to replace leds/common.yaml > > above with the ethernet one. > > > > This is all the same reasons the DSA/switch stuff and graph bindings are > > structured the way they are. > > > > Hi Rob, thanks for the review/questions. > > The idea of all of this is to keep leds node as standard as possible. > It was asked to add unevaluatedProperties: False but I didn't understood > it was needed also for the led nodes. > > leds/common.yaml have additionalProperties set to true but I guess that > is not OK for the final schema and we need something more specific. Yes, every node needs a schema with all possible properties and then 'unevaluatedProperties: false' to not allow any other properties. > Looking at the common.yaml schema reg binding is missing so an > additional schema is needed. > > Reg is needed for ethernet LEDs and PHY but I think we should also permit > to skip that if the device actually have just one LED. (if this wouldn't > complicate the implementation. Maybe some hints from Andrew about this > decision?) > > If we decide that reg is a must, if I understood it correctly we should > create something like leds-ethernet.yaml that would reference common and > add reg binding? Is it correct? This schema should be laded in leds > directory and not in the net/ethernet. You need 'reg' in properties, but whether it is required or not just depends on putting it in 'required'. I don't have a strong opinion on that, but generally it's only use 'reg' when there's more than 1. Rob _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel