Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp1984352rdf; Mon, 6 Nov 2023 00:41:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IFcUoRlLS4GWdcL1gFRgIq2fw7ZjNrJKdQKTGZVtlVYibGLCJTO9bQkM2US78g/0DXB/PEy X-Received: by 2002:a25:ab32:0:b0:d9a:5220:d6b3 with SMTP id u47-20020a25ab32000000b00d9a5220d6b3mr22221530ybi.56.1699260109512; Mon, 06 Nov 2023 00:41:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699260109; cv=none; d=google.com; s=arc-20160816; b=hYYyGgJLyUObwKGxRdYTNnJyLtJFKNdPZrmMjn+Lfa0lU9bA0+beJwqtaQEII+X+S8 q2XMcfjcir4pyFXpSensp9FwNxu33Cia9oXgeizrCYZ4pW04rPcquGd57z2HIfJNtCR6 2WTUEmxC/a/Q6KO8jFXVz6Fy1ETlL+tiEijKLph/TIgKFfOL0JnXgfhbx7jCYDvVhlDN zFbAyPr9iyU/7Bp2b+oLhxm/JoWW6CZzfopwP6XXy3pNWm1moitd1xYoxlyEavFma+lO nyRDpc4KNvsRjCgHywwx2FVQNiA/DwlkgU3ZWTfCagM6t5+lJG/9ljYKShi2vTAOUBEU AG4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version; bh=Bi+ZnSvpcefO03pV9sDtP0PxOtQmIQLEcg1h+JVuEHU=; fh=Vqxj3KNuirN7Y0642ExgvxWEXmNnt+orcXA4OzDlyts=; b=o2Zh1/VpilHbi679GGcia49D9kH5XMFRzetClhkJ9aUUq97dQ8Od7TkqaDAtV2pnZl ZUyhnKiSRq7JiTgNRMI8iZME01rSs6bt7N58zIk71Ob/TFjUi1IqpgOFtF0xBdJ0Oyyh 31lLAr3xCfkSrgQCQXIarMM6xBmAkyeVQV5xnFg5FYlpdR5R6C2KiPtPv/X0bS2ILXJh TwtSpv4LyOlfk5NSixzUy7Xe8fIjMQgCGHJiF45EwNZo9kmFuz+GCq6Rd8lcMhtbxo3d ZrLg14rLBdmAkzTRN6B62GiF9rVThNzzKOWFAJCSiR2rthxmerq+rvCi+EGICHHZkqME JgSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id h5-20020a056a00170500b0068a6f6d9f7dsi7796906pfc.57.2023.11.06.00.41.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 00:41:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id EFD4180AF3C1; Mon, 6 Nov 2023 00:41:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231283AbjKFIlX (ORCPT + 99 others); Mon, 6 Nov 2023 03:41:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231428AbjKFIlI (ORCPT ); Mon, 6 Nov 2023 03:41:08 -0500 Received: from mxout70.expurgate.net (mxout70.expurgate.net [91.198.224.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA0A6D42; Mon, 6 Nov 2023 00:41:05 -0800 (PST) Received: from [127.0.0.1] (helo=localhost) by relay.expurgate.net with smtp (Exim 4.92) (envelope-from ) id 1qzvAD-00FsM4-63; Mon, 06 Nov 2023 09:40:53 +0100 Received: from [195.243.126.94] (helo=securemail.tdt.de) by relay.expurgate.net with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qzvAC-00DzxJ-1p; Mon, 06 Nov 2023 09:40:52 +0100 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id A66C3240049; Mon, 6 Nov 2023 09:40:51 +0100 (CET) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id 037C4240040; Mon, 6 Nov 2023 09:40:51 +0100 (CET) Received: from mail.dev.tdt.de (localhost [IPv6:::1]) by mail.dev.tdt.de (Postfix) with ESMTP id 8F6B02267B; Mon, 6 Nov 2023 09:40:50 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 06 Nov 2023 09:40:50 +0100 From: Florian Eckert To: m.brock@vanmierlo.com Cc: Eckert.Florian@googlemail.com, gregkh@linuxfoundation.org, jirislaby@kernel.org, pavel@ucw.cz, lee@kernel.org, kabel@kernel.org, u.kleine-koenig@pengutronix.de, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-leds@vger.kernel.org Subject: Re: [PATCH v5 2/2] leds: ledtrig-tty: add new line mode evaluation In-Reply-To: References: <20231023094205.2706812-1-fe@dev.tdt.de> <20231023094205.2706812-3-fe@dev.tdt.de> <2951fd563fc6a364d8cddfb7ec17808b@dev.tdt.de> Message-ID: <092914b1a78135f7dcd0bab40e7995af@dev.tdt.de> X-Sender: fe@dev.tdt.de User-Agent: Roundcube Webmail/1.3.17 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email X-purgate-ID: 151534::1699260052-F88EE49D-D8F789CF/0/0 X-purgate: clean X-purgate-type: clean Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 06 Nov 2023 00:41:47 -0800 (PST) On 2023-11-04 14:59, m.brock@vanmierlo.com wrote: > Florian Eckert wrote on 2023-10-30 09:15: > >>> Shouldn't the led return to the line controlled steady state? >> >> Sorry I do not understand your question. >> >>> Set an invert variable to true if state was TTY_LED_ENABLE before it >>> got set >>> to TTY_LED_BLINK >> >> No matter whether the LED is on or off beforehand. I understand that >> the >> LED is always on for the first half of the period and off for the rest >> of >> the period. I think that is correct and I don't need to make a >> distinction >> via invert here. I hope I have understood your comment correctly here. >> >>> How do interval and the frequency of ledtrig_tty_work() relate? >> >> The work is twice as long as of the interval. So the variable >> LEDTRIG_TTY_INTERVAL = 50 and the work is scheduled >> LEDTRIG_TTY_INTERVAL * 2. >> But that was also before my change. > > This explains why you don't necessarily need to invert the blink. > If E.g. both CTS and TX are configured I would expect to see the led > turn on > once CTS actives and then blink off when something is transmitted. > After that > I expect to see the led still on because CTS is still active. The evaluation starts again with the next iteration of the work. And if no data was transferred but CTS was set, the LED is enabled again but does not flash. > Now only because the work interval is 2*LEDTRIG_TTY_INTERVAL and the > blink > uses an interval of LEDTRIG_TTY_INTERVAL for both on and off the user > doesn't > notice any difference except maybe a bit of delay of the blink. That is correct > If either the work schedule was larger than 2*LEDTRIG_TTY_INTERVAL or > the on > interval would differ from the off interval the behaviour would differ > noticably. > > This is why I recommend to use an invert variable that is set to true > when > the previous state was TTY_LED_ENABLE. In the next patch round, I will save the state of the LED and evaluate whether I need to invert the LED if the state of the LED has been set to blink. > Maarten Thanks for your feedback -- Florian