Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6207273rwd; Mon, 19 Jun 2023 04:08:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6EHQnl7Hto8fYKic/Knb9tGHiebnONxI6S1aMSyfeO6wwo3tCL61PQc2pTBbYw8xel4p4f X-Received: by 2002:a05:6808:2a55:b0:39e:c4d9:dea7 with SMTP id fa21-20020a0568082a5500b0039ec4d9dea7mr652254oib.25.1687172907495; Mon, 19 Jun 2023 04:08:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687172907; cv=none; d=google.com; s=arc-20160816; b=Yj8gBFajiWhB8GoF1T9R+cs2LjfxGbf+v5Hb+E//p0pabp92wR9vV64B/iIwZP4n8H NPS+SoBnXCXAXQ+BLZFfllSHS682XOwQ2hTe20fvR3sAdPIcAxzdycIuHXGc8vudVXHA cN5hAHPrGcVC6mZwRjhSRAiYzjmn0OMSmFYEzMj1KcjTc3wqblStpCHlDjqaB93kMNP5 9Sz1b1jUEyMP/o/Cbl4xXxD+vDb5T7nKlpCRi6KpDk8q+yLVeyhnzbPgyqPOHrS+q33w VUooQVIjEyOIiMkwERlqCdOJ9YfELaUVAu5WgBKhRid/UN3Ndpuozfk+3iPz1Qd7TL/s YFhQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=3W4Km//nTbEKxVtMvZbqGru0OGGpzv2goyKNtQA1vTs=; b=X/o6+KpKSKzu6vZ775rbwXivWqbAIZWjkJrnDrwHgCM00fZgT+UxabCmX6IYS2ui7N NWApxwiybOBr4kYrwWNAPEb3Wp3FMbuyAtDo8ZZtmIctAzL3/Pf2NMpa4AQAknlENz6x IeVa5PYfFEErcwdyKbQGdr7CdV12LcdbjMi2nf/qW8s9//+UdoiEJENaYENVQ0TMwhyx tmPmPYua0Y4TmcJkE2aIdD8q4YkiCdof5VS4W1MKadNzEkg461LX+BrnxLlUN8WKOPdF k5RVtCA+fFIfzfLjv4dwO2IHcxGmJXTi9UobyfnIkZ9oVP0EqPzN81NPDYzHh4x5fC6q 4v2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VvE1YV7p; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga5-20020a17090b038500b0025943bb2873si7265435pjb.136.2023.06.19.04.08.06; Mon, 19 Jun 2023 04:08:27 -0700 (PDT) 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=pass header.i=@kernel.org header.s=k20201202 header.b=VvE1YV7p; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231176AbjFSKlD (ORCPT + 99 others); Mon, 19 Jun 2023 06:41:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232016AbjFSKkh (ORCPT ); Mon, 19 Jun 2023 06:40:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 413A2CC; Mon, 19 Jun 2023 03:40:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D2F7D60B7F; Mon, 19 Jun 2023 10:40:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 899B0C433C9; Mon, 19 Jun 2023 10:40:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687171235; bh=A32VZcKVct460PbyXiy0SEpYxkFlA+mChVgoKGC13xw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VvE1YV7pbgTDCY3xO/1Vy4uSFVfwNSfxbjzoDv5tR5bIsVAkLbrCG5odDnpBe6Vwh f5dMtO61lxlnfhjksIrUy5HSyS3G8piHZ9sD+JcjP5xsNih0CvYJNPT9VkUvTrZ7UH OpoFkuuhuV+gRMumPY1YXTX54WpuRH00qUrKTyH/D0k81qHuefhf+XReLAEu13o9QN AAn/9lKPcgLaC5nROiynVUvvjBTJ9S+oJdSg1spNJGahdul6PvRSbLnUNnvicbmMiE H0rtAZegrL64yXltbK/Rg3AeILfFBKEfej/nz8uLw+u8ZrgtvhkQbOV1XFA4hKbmtZ Hcjg3fThT0dHw== Date: Mon, 19 Jun 2023 11:40:30 +0100 From: Lee Jones To: Christian Marangi Cc: Pavel Machek , Andrew Lunn , "David S. Miller" , Yang Li , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [net-next PATCH v4 0/3] leds: trigger: netdev: add additional modes Message-ID: <20230619104030.GB1472962@google.com> References: <20230617115355.22868-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230617115355.22868-1-ansuelsmth@gmail.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Sat, 17 Jun 2023, Christian Marangi wrote: > This is a continue of [1]. It was decided to take a more gradual > approach to implement LEDs support for switch and phy starting with > basic support and then implementing the hw control part when we have all > the prereq done. > > This should be the final part for the netdev trigger. > I added net-next tag and added netdev mailing list since I was informed > that this should be merged with netdev branch. > > We collect some info around and we found a good set of modes that are > common in almost all the PHY and Switch. > > These modes are: > - Modes for dedicated link speed(10, 100, 1000 mbps). Additional mode > can be added later following this example. > - Modes for half and full duplex. > > The original idea was to add hw control only modes. > While the concept makes sense in practice it would results in lots of > additional code and extra check to make sure we are setting correct modes. > > With the suggestion from Andrew it was pointed out that using the ethtool > APIs we can actually get the current link speed and duplex and this > effectively removed the problem of having hw control only modes since we > can fallback to software. > > Since these modes are supported by software, we can skip providing an > user for this in the LED driver to support hw control for these new modes > (that will come right after this is merged) and prevent this to be another > multi subsystem series. > > For link speed and duplex we use ethtool APIs. > > To call ethtool APIs, rtnl lock is needed but this can be skipped on > handling netdev events as the lock is already held. > > [1] https://lore.kernel.org/lkml/20230216013230.22978-1-ansuelsmth@gmail.com/ > > Changes v4: > - Add net-next tag > - Add additional patch to expose hw_control via sysfs > - CC netdev mailing list > Changes v3: > - Add Andrew review tag > - Use SPEED_UNKNOWN to init link_speed > - Fix using HALF_DUPLEX as duplex init and use DUPLEX_UNKNOWN instead > Changes v2: > - Drop ACTIVITY patch as it can be handled internally in the LED driver > - Reduce duplicate code and move the link state to a dedicated helper > > Christian Marangi (3): > leds: trigger: netdev: add additional specific link speed mode > leds: trigger: netdev: add additional specific link duplex mode > leds: trigger: netdev: expose hw_control status via sysfs > > drivers/leds/trigger/ledtrig-netdev.c | 114 +++++++++++++++++++++++--- > include/linux/leds.h | 5 ++ > 2 files changed, 109 insertions(+), 10 deletions(-) Seeing as we're on -rc7 already, any reason why we shouldn't hold off and simply apply these against LEDs once v6.5 is released? -- Lee Jones [李琼斯]