Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3008487rwb; Fri, 16 Dec 2022 09:02:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf4aS1zvM5BlYawczlV8E2s5anwU/AbhhGESK2R6DUHtbB6hULs6na9uQORrYCMJViWA1XwD X-Received: by 2002:a17:907:910b:b0:7c1:1c5:c7cd with SMTP id p11-20020a170907910b00b007c101c5c7cdmr22618561ejq.5.1671210179419; Fri, 16 Dec 2022 09:02:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671210179; cv=none; d=google.com; s=arc-20160816; b=XbfaNSVwJDauqisXC/Gnu9zSk3uAGx98pIeoLJ/kBY883R718y/3IAdI9Vxb3W1Cid lGaBp8hMJuVdNWSkJUBmJhCyqIlVdNRMl/B+902t1fqzWe6QEF8LscuqJ3dq7SE/s2dK 2etU31/WvQf7pj3mgdxJQnmVrwrhbPCKie2mQVKbM5LG+p+Edgv6g2i6PZsHQQWCGE2C aNaJKsz58WMoQyHnee0Zn8hzsRXrcu2ATpN5OQbrO8yAyBb+v2qQV5IRypw1e03uvm6D iYwsrvwN0Vq67oGRUHaXulDsbyD1TlJ7M5kWCzz+kedR+SFdzJLlnyjNDBEjRUeUJriu e00g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=8951IwQXDwezIFfuE4x8rlkg+QlEDpYrWM0TEkzABwY=; b=U5gFFZ2bLUoB/Wz6016FbOf08z4QpHFX3JO61wYZlqi/2ofu3H+5w1l9jjZ8jaJSqo GUsppiNEcc9g+8WLKs/L7ZBZsbd60+nGMhr97V3B8IrpMkPvdJVcnTRaIo0G6PgwuQTq nfb7vU4ZiqvAWog6+F97HZeMUDm9muyqZRBqtEGC9n/Of00g6h42qbhcRICboV550k8T URDDBrn7v8bEq/3IPzMfksyuKIyaMBvOhwa4kgAgB/KeJrEWgM/A3YfW729oEgro5RwY prQR+j+9bli+hRy7zQjz9+ZPi15uxQts2fQXBtRbsEhS/4tQHdjEKvjM6O2FEiB/XKd+ aIjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=os1lxoQn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sa10-20020a1709076d0a00b007a7fc67c880si3278708ejc.71.2022.12.16.09.02.43; Fri, 16 Dec 2022 09:02:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=os1lxoQn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230096AbiLPQw2 (ORCPT + 68 others); Fri, 16 Dec 2022 11:52:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230462AbiLPQwR (ORCPT ); Fri, 16 Dec 2022 11:52:17 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58AE7DFAC; Fri, 16 Dec 2022 08:52:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8951IwQXDwezIFfuE4x8rlkg+QlEDpYrWM0TEkzABwY=; b=os1lxoQnJ/FgOhbm9lnOQ366gf OvE/CZFMFe9nNIuIOMEOtxWGfZOfGGL4t+1hI1vAN/jywV1dusglwtoSZRaNwQgRTNrHJqbEuN005 ivWfk78PuQIfjyycn03Ru193lpTOqCc7NbtqleOW+1L394v/S3sf6cWqT3mo+y20QCDrkeKoNDRLL WpZG9l8zCXqEayoiAO8sU0BfWAwFJKbHt8XvzGeEIsiIQ+1RCU66aBPLYd/CfbTcYlMf1cqmkD+hY geIGvFaa+Z0k3ihuPejMBYOl/rj9EsgjjdhmgOiw9pY2sSHZZd/LGYZjOqhRei48ATAzBOP+RHg15 MhYSwuow==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:35744) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1p6DwI-00089K-IK; Fri, 16 Dec 2022 16:52:02 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1p6DwE-00012J-OM; Fri, 16 Dec 2022 16:51:58 +0000 Date: Fri, 16 Dec 2022 16:51:58 +0000 From: "Russell King (Oracle)" To: Christian Marangi Cc: Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Jonathan Corbet , Pavel Machek , John Crispin , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-leds@vger.kernel.org, Tim Harvey , Alexander Stein , Rasmus Villemoes , Marek =?iso-8859-1?Q?Beh=FAn?= Subject: Re: [PATCH v7 01/11] leds: add support for hardware driven LEDs Message-ID: References: <20221214235438.30271-1-ansuelsmth@gmail.com> <20221214235438.30271-2-ansuelsmth@gmail.com> <639ca0a4.050a0220.99395.8fd3@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <639ca0a4.050a0220.99395.8fd3@mx.google.com> Sender: Russell King (Oracle) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 16, 2022 at 05:45:25PM +0100, Christian Marangi wrote: > On Thu, Dec 15, 2022 at 04:13:03PM +0000, Russell King (Oracle) wrote: > > Hi Christian, > > > > Thanks for the patch. > > > > I think Andrew's email is offline at the moment. > > > > Notice by gmail spamming me "I CAN'T SEND IT AHHHHH" > Holidy times I guess? Sadly, Andrew's email has done this a number of times - and Andrew used to be on IRC so I could prod him about it, but it seems he doesn't hang out on IRC anymore. It's been like it a few days now. > > On Thu, Dec 15, 2022 at 12:54:28AM +0100, Christian Marangi wrote: > > > @@ -188,6 +213,10 @@ int led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trig) > > > led_set_brightness(led_cdev, LED_OFF); > > > } > > > if (trig) { > > > + /* Make sure the trigger support the LED blink mode */ > > > + if (!led_trigger_is_supported(led_cdev, trig)) > > > + return -EINVAL; > > > > Shouldn't validation happen before we start taking any actions? In other > > words, before we remove the previous trigger? > > > > trigger_set first remove any trigger and set the led off. Then apply the > new trigger. So the validation is done only when a trigger is actually > applied. Think we should understand the best case here. I think this is a question that needs to be answered by the LEDs folk, as it's an interface behaviour / quality of implementation issue. > > > @@ -350,12 +381,26 @@ static inline bool led_sysfs_is_disabled(struct led_classdev *led_cdev) > > > > > > #define TRIG_NAME_MAX 50 > > > > > > +enum led_trigger_blink_supported_modes { > > > + SOFTWARE_ONLY = SOFTWARE_CONTROLLED, > > > + HARDWARE_ONLY = HARDWARE_CONTROLLED, > > > + SOFTWARE_HARDWARE = SOFTWARE_HARDWARE_CONTROLLED, > > > > I suspect all these generic names are asking for eventual namespace > > clashes. Maybe prefix them with LED_ ? > > Agree they are pretty generic so I can see why... My only concern was > making them too long... Maybe reduce them to SW or HW? LEDS_SW_ONLY... > LEDS_SW_CONTROLLED? Seems sensible to me - and as a bonus they get shorter than the above! -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!