Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3076475rwb; Fri, 16 Dec 2022 09:45:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf7EtwE8rgoCTLk8KrR50Fwro5BpOExslmvYfIVBcb5C4RwTSP/C2fboJDGkJQhPYCof0IlF X-Received: by 2002:a05:6a21:168c:b0:ad:ee09:f433 with SMTP id np12-20020a056a21168c00b000adee09f433mr21677744pzb.54.1671212736723; Fri, 16 Dec 2022 09:45:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671212736; cv=none; d=google.com; s=arc-20160816; b=AXyIE0AzOgU2YvhFRhPNZ7Rx8CI+3BJ5ZMrxurjW3rndvMOx29io/RGQvUPpGgrX35 XagYvyFzCqm7YjCbvJsxHsa0aEUgMibcjLjvB0jUM/vMK7I0b5TPKUAR4p2kjejMYYKY MQ2zYoOheYl3XCOAUqPNdIu81q5bQSUmUj/13FDc+x0eZBuRs8oh5qtEQakvDt/z5bJA dDwSKKu2oL3UP5bkWCfJRUvu4fEYrJAP115SLB9Qtnwa5AGUDX8Ahz3CDsV0q3wQOj0G UyiCbOuro0apSJw6/RrJLlSf8Rrc1OmNs6TEjtdcZnRI7chLwaWsKF45QSNxWfAfOIHy OM7A== 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:subject:cc:to:from:date:message-id:dkim-signature; bh=Grq/lCv6X9zvhjrxtn3hukSNIqujUj2abduruIelS+M=; b=jJjE2tsN6c0jAIo3XYXRq7pTQ+6BvC7/ykM2bgtzxfr3XgUTf9ZAw91YgDyMekfy3J D1f00z+KofABs0WQ8xnTrW5ILdkTCpcvSvTuijB0/Ebh1T68NNcd7Gg9BCx9u91QAde4 c6OzllJ554K+tP4RJF3y0R87xhUTNJNIbTnRWSCuJcgwWuqrKmgXwC7rFRxpNxgJnGei LOXXyYEO3bp5nCopV9asp8kCQQ4QDDJs9D4MhH2mYNdfweqtmA+tboqb6WHqzUlHVJ+f Ob3Xs/lJVLC08tz9+ZyzkevEQJsMBAbpmmzfD/iDHovdfVNqjCU/XLheI0Y3jA6f9T0R QJ1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=csfswnzv; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u2-20020a170902b28200b00180a7ff784csi2808319plr.360.2022.12.16.09.45.28; Fri, 16 Dec 2022 09:45:36 -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=pass header.i=@gmail.com header.s=20210112 header.b=csfswnzv; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231759AbiLPRRV (ORCPT + 68 others); Fri, 16 Dec 2022 12:17:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230490AbiLPRRS (ORCPT ); Fri, 16 Dec 2022 12:17:18 -0500 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B42CF2A275; Fri, 16 Dec 2022 09:17:15 -0800 (PST) Received: by mail-wm1-x335.google.com with SMTP id p13-20020a05600c468d00b003cf8859ed1bso2289305wmo.1; Fri, 16 Dec 2022 09:17:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=Grq/lCv6X9zvhjrxtn3hukSNIqujUj2abduruIelS+M=; b=csfswnzvXRES6JVhxCweprsXbmn7xjoYqs+ltKvQBCzBf43+AVWxASz8MZ0TMedSNy cmfryseQBvFRK6oLPazykJ1COPo+z5MfAXRlIeTX899arFClrQg/GICGhiJWFH7lOM2N NBBZZJjGEorNNGtQ/mA1CXjz2ny/A8+YRYHUN51/0CsEOJQEgoXW+lV3ux8uOVlStkfn 1tT8Jxu/7BIy22iFF4rgpl8EnGqfCrzS8KE1vmzc3btZDx2ESqzMmHToc1y0bngCI/pZ dXDLBTLsvBb4cO+MXd792JoTr5Oul1f4tSqixNXsfCtuwLsUMwIDKaKB4jEUTzo95OxA HvhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Grq/lCv6X9zvhjrxtn3hukSNIqujUj2abduruIelS+M=; b=vHta+VEdefDtumz9rC6M8E5/2GfbmH9VTtY924hftWqr9vDLbKJLjGxT9zfgqb6jzc JuHAWsHYpDLJkMHGC1AM6f7vuirwAlv/Ml3azKHWLCOupo/UH3J1WV39T6f9Rc5F47y6 9vzzhdtSYtUVdh/MVLx/FBKwND9a2/xWUBmMUAR2RB53HSI+gZjT97i9YYlFSjw5zWgj IuK8aq5Q3NsPS+EGqCDA48sxIWMev1I0JQV5iKuqkLEzzHstLNbuVXxzh/pztEUtzVZk nY8ylCuGqNlzEW+enWc6VJahvO4hoYcICwX3kaWHML1ux1gyH3TjETGTUzfBJH208qtM LArg== X-Gm-Message-State: ANoB5plripN2b/REigdD4f2j6HVAZqBp7sVybhbrBlF8r3kHfOE2V87z bO78HPMWSGT0EvL+3IwXdNA= X-Received: by 2002:a05:600c:4fc8:b0:3cf:614e:b587 with SMTP id o8-20020a05600c4fc800b003cf614eb587mr26240906wmq.26.1671211034146; Fri, 16 Dec 2022 09:17:14 -0800 (PST) Received: from Ansuel-xps. (93-42-71-18.ip85.fastwebnet.it. [93.42.71.18]) by smtp.gmail.com with ESMTPSA id q9-20020a7bce89000000b003d1e34bcbb2sm3083664wmj.13.2022.12.16.09.17.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 09:17:13 -0800 (PST) Message-ID: <639ca819.7b0a0220.6b61a.9f2e@mx.google.com> X-Google-Original-Message-ID: Date: Fri, 16 Dec 2022 18:17:14 +0100 From: Christian Marangi To: "Russell King (Oracle)" 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 Subject: Re: [PATCH v7 09/11] leds: trigger: netdev: add additional hardware only triggers References: <20221214235438.30271-1-ansuelsmth@gmail.com> <20221214235438.30271-10-ansuelsmth@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 Thu, Dec 15, 2022 at 05:35:47PM +0000, Russell King (Oracle) wrote: > On Thu, Dec 15, 2022 at 12:54:36AM +0100, Christian Marangi wrote: > > Add additional hardware only triggers commonly supported by switch LEDs. > > > > Additional modes: > > link_10: LED on with link up AND speed 10mbps > > link_100: LED on with link up AND speed 100mbps > > link_1000: LED on with link up AND speed 1000mbps > > half_duplex: LED on with link up AND half_duplex mode > > full_duplex: LED on with link up AND full duplex mode > > Looking at Marvell 88e151x, I don't think this is usable there. > We have the option of supporting link_1000 on one of the LEDs, > link_100 on another, and link_10 on the other. It's rather rare > for all three leds to be wired though. On qca8k it's just anarchy. You can apply the same rule table to whatever led you want. They are all the same... OEM decide what to do (add white led, amber, green...) Most common configuration is 2 leds, one react with port 1000 and the other with port 100. But each led can be set to be powered on to any speed by enabling 10 100 and 1000 rule. Rejecting a configuration falls in the driver returning error on configure. > > This is also a PHY where "activity" mode is supported (illuminated > or blinking if any traffic is transmitted or received) but may not > support individual directional traffic in hardware. However, it > does support forcing the LED on or off, so software mode can handle > those until the user selects a combination of modes that are > supported in the hardware. > > > Additional blink interval modes: > > blink_2hz: LED blink on any even at 2Hz (250ms) > > blink_4hz: LED blink on any even at 4Hz (125ms) > > blink_8hz: LED blink on any even at 8Hz (62ms) > > This seems too restrictive. For example, Marvell 88e151x supports > none of these, but does support 42, 84, 170, 340, 670ms. > Eh this is really bad, it was an idea to support blink internal for each event but I expected other switch had something different... But the generic function is still there... Wonder if we should consider adding generic naming like SLOW, NORMAL(?), FAST. And just assign them from the driver side? Permit to have some kind of configuration while also keeping it generic enough? Just as reference... The blink mode already had a compromise since qca8k can support a way to blink differently based on the link speed. -- Ansuel