Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9581558rwd; Wed, 21 Jun 2023 09:07:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ftpckEyUMWEgtoX/G9ZBzi6uJ95RSBXX0frifs3DlKd5CqMVsF1sKptPEAuLqWFvC6Fi6 X-Received: by 2002:a92:ceca:0:b0:340:7f6e:9c72 with SMTP id z10-20020a92ceca000000b003407f6e9c72mr13220395ilq.12.1687363647267; Wed, 21 Jun 2023 09:07:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687363647; cv=none; d=google.com; s=arc-20160816; b=vHxob22qxmNCm8WDMr5zJOQseJGYPUdJLLGYXkqj0fATTJnbFb2z4Yet+weIzUtbuz FFSsnA4UppmAjJY1A0HvTlA3TM5p5VDbExWN88UtKOTK7YHzYj4561wfG4WpsLln/sNj n8JXB5CDf3AOCegY/kzG0fmeA7sheWMWfW+cojAVAzVtyaHrqfbL33DoER9qpSSgxol6 PhCbbI21pyFJqzYpCwgasMbdseCSRZzvU6mbBGJVrz1t+FpUdAjPRZesu95sQaxEdFJq OvIy6rIldts+sWqKR20bmxM1aFYXq5pFP1qyg3hy50McaAN3cePDuVz1omy2ORgZEaNH 3RXA== 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=LMkTeurUJ0qbsDV0tS4T8nmhEU0Wc02YeQH4oyJYE+8=; b=m6FFRbzqkfy5Gu0qzz6qRzf0zZDqUANvWTlZyEa417oqbZjPrI+MwcCfg3H6ZgYYxG e81918l6HuLtzVfqT1z/NoksUH/ztHHn9Q5rtCLPFhBJxY7YFpoli2GabGHNLOpmBSt7 6gXkBEm+xcwbeCL3rS1MobBcmD3INDIKV4CsejIgm9I9r3qvB6DhvTtvAfK+SihQtN4u +J74flYSc+WckkNlg7yUnHZaCSPqWr3vqOD+eGo9jGe7utlY2LlVXK3haEKkZX8GY85H 9P9T7JOyJJQ8M1Bc+BzEWYGPi3v2kiGMwBZ3hZt/Vwwyx9gwKE1vMG02uwurR4Av13o0 491w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fDZ6bRNa; 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 m20-20020a17090b069400b0024e47fae466si544691pjz.180.2023.06.21.09.07.13; Wed, 21 Jun 2023 09:07: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=fDZ6bRNa; 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 S233118AbjFUPGz (ORCPT + 99 others); Wed, 21 Jun 2023 11:06:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233096AbjFUPGl (ORCPT ); Wed, 21 Jun 2023 11:06:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFBD55BAA; Wed, 21 Jun 2023 08:01:09 -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 4A8836155A; Wed, 21 Jun 2023 14:54:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC66CC433C8; Wed, 21 Jun 2023 14:54:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687359296; bh=bSDgKgIaIT7I/HAb2R0Ikz2XfAeToNBLTRIqFY41i2w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fDZ6bRNauyHwq6dzmJDZBnfL7lqHk5LlP9nPVhO2IUmRMZGfhnj1f+Q9liDfa/86s 8P4Y2TyCqe4y1hJmblPWEVbdSjYKtw9z1vkIE/oWCF/hnMxXimkcJTwG6DDAcX2763 9vyLMKbKAXgOlnitHHdntphT1vIz798ohvojXaI0astRKHidJzkuCqg4cCoMPACcXm 7tj0/D0ERra+CpIlP0FBrXL3xKBZJrVvJT0pqfKyolFredeGkNRqCp2rrJNR9n/4x9 izlHFSa30qohHUt/R4c35KTDGvAAon6+FmC87iRQALDOfA/ksWXrcLwIOh9fvHg/Tb Bwu7IYbjlbwqQ== Date: Wed, 21 Jun 2023 15:54:51 +0100 From: Lee Jones To: Christian Marangi Cc: Pavel Machek , Andrew Lunn , "David S. Miller" , Dan Carpenter , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [net-next PATCH v5 1/3] leds: trigger: netdev: add additional specific link speed mode Message-ID: <20230621145451.GA10378@google.com> References: <20230619204700.6665-1-ansuelsmth@gmail.com> <20230619204700.6665-2-ansuelsmth@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230619204700.6665-2-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 Mon, 19 Jun 2023, Christian Marangi wrote: > Add additional modes for specific link speed. Use ethtool APIs to get the > current link speed and enable the LED accordingly. Under netdev event > handler the rtnl lock is already held and is not needed to be set to > access ethtool APIs. > > This is especially useful for PHY and Switch that supports LEDs hw > control for specific link speed. (example scenario a PHY that have 2 LED > connected one green and one orange where the green is turned on with > 1000mbps speed and orange is turned on with 10mpbs speed) > > On mode set from sysfs we check if we have enabled split link speed mode > and reject enabling generic link mode to prevent wrong and redundant > configuration. > > Rework logic on the set baseline state to support these new modes to > select if we need to turn on or off the LED. > > Add additional modes: > - link_10: Turn on LED when link speed is 10mbps > - link_100: Turn on LED when link speed is 100mbps > - link_1000: Turn on LED when link speed is 1000mbps > > Signed-off-by: Christian Marangi > Reviewed-by: Andrew Lunn > --- > drivers/leds/trigger/ledtrig-netdev.c | 80 +++++++++++++++++++++++---- > include/linux/leds.h | 3 + > 2 files changed, 73 insertions(+), 10 deletions(-) Acked-by: Lee Jones -- Lee Jones [李琼斯]