Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp635500rda; Sun, 22 Oct 2023 03:25:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHoPgs0YevbYdJKKHP+Ky+y5YZdZnp6SSP/eluUcuOU9aOcwD/C9jUbUtqPwBdeG6Jeu5lz X-Received: by 2002:a05:620a:5605:b0:775:9e9d:6186 with SMTP id vu5-20020a05620a560500b007759e9d6186mr6573841qkn.18.1697970318775; Sun, 22 Oct 2023 03:25:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697970318; cv=none; d=google.com; s=arc-20160816; b=dtDypYar4G6nH12wABL/skry/Mwna9MG7qBcNYDRy4MiPf9OFWDFh2qJKKL0fU9o47 5PzFIjFQ1dXG7tJ49TkbOBmPdw7R1Su3jnohYQtFB9Gw1r7dvNinmZqUgaohNE3WDZv6 SBFjQsuFF0NDAQKay1y9kBLrujusMfcUU32BItiP25O0OPtQA1eRkz1kJQGjqHLLXC9A zNCChJw5G7edybFKf5i7SQLbsX9yHU1kckIYZ94nyrTUZsPecSoiTWcDFVqC+mXHW8NB 36d9WR8CUdBoSIYoaeedivqO/KrzuqNCjh5UmSfMnD2zAeo/LzdgmElznMIcVaoXzy4s Om4A== 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=bZ7cpbCTzcsSFQJG/s6bDn98R8mXKq0+wPXVgJoM0EI=; fh=fyRXcUeR5grRDRCSSawiPSvBCANgU6SxicU+B0+bS9c=; b=nUZqqV+RQQmhNh/nw/WGQsox9UDNwNHrdsQZn1lBkRZmou4nnQTfP5+WUEkBNCguDt WAf1wuJRleoxj12v00LwKIo/lh0m+4/LI4OCJzw5NTt2ug2rsYw4Uca3YLgsG4loNqEx jwVYlN/zi7U0+X+9G+NBr6xKnYgqnak0LGIju7ri5xnI1gTJOtDTBJO8D2KOuUZ2YZ9j nV9ACrZuKtSRjOBr9rChINHlRRw7vOr5A5ZRxTyr/ofyxfwP+0d40YHg8MHkIXBO/c26 ySgtCZ+IHnI3lRw227kuuuhK80n+vQV+dXUkc0HoUhaW/1zDR4FJ79cOvEw+OIdN/Wmg vIKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id e124-20020a636982000000b0059ff7c499c8si4538875pgc.746.2023.10.22.03.25.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 03:25:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id F0D9F8054ED4; Sun, 22 Oct 2023 03:25:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231856AbjJVKZF (ORCPT + 99 others); Sun, 22 Oct 2023 06:25:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231785AbjJVKZB (ORCPT ); Sun, 22 Oct 2023 06:25:01 -0400 Received: from mxout70.expurgate.net (mxout70.expurgate.net [194.37.255.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C2E0D61 for ; Sun, 22 Oct 2023 03:24:58 -0700 (PDT) Received: from [127.0.0.1] (helo=localhost) by relay.expurgate.net with smtp (Exim 4.92) (envelope-from ) id 1quVdX-004cA4-GA; Sun, 22 Oct 2023 12:24:47 +0200 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 1quVdW-008ki4-MM; Sun, 22 Oct 2023 12:24:46 +0200 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id 515A2240049; Sun, 22 Oct 2023 12:24:46 +0200 (CEST) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id A5935240040; Sun, 22 Oct 2023 12:24:45 +0200 (CEST) Received: from mail.dev.tdt.de (localhost [IPv6:::1]) by mail.dev.tdt.de (Postfix) with ESMTP id 6BC85213BE; Sun, 22 Oct 2023 12:24:45 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 22 Oct 2023 12:24:45 +0200 From: Florian Eckert To: Greg KH Cc: Eckert.Florian@googlemail.com, jirislaby@kernel.org, pavel@ucw.cz, lee@kernel.org, kabel@kernel.org, u.kleine-koenig@pengutronix.de, ansuelsmth@gmail.com, m.brock@vanmierlo.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-leds@vger.kernel.org Subject: Re: [PATCH v4 2/3] tty: add new helper function tty_get_tiocm In-Reply-To: <2023102115-stock-scrambled-f7d5@gregkh> References: <20231019112809.881730-1-fe@dev.tdt.de> <20231019112809.881730-3-fe@dev.tdt.de> <2023102115-stock-scrambled-f7d5@gregkh> Message-ID: <2935341a3c8d98299b1619efc8d73cad@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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email X-purgate-ID: 151534::1697970287-D369D639-371F78F9/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 (agentk.vger.email [0.0.0.0]); Sun, 22 Oct 2023 03:25:16 -0700 (PDT) On 2023-10-21 18:15, Greg KH wrote: > On Thu, Oct 19, 2023 at 01:28:08PM +0200, Florian Eckert wrote: >> The struct 'tty_struct' has a callback to read the status flags of the >> tty >> if the tty driver provides them. So fare, the data is transferred >> directly >> to userspace with the function 'tty_tiocmget'. This function cannot be >> used to evaluate the status line of the tty interface in the >> ledtrig-tty >> trigger. To make this possible, a new function must be added that does >> not immediately pass the data on to userspace. >> >> The new function 'tty_get_tiocm' only returns the status register. >> This information can then be processed further in the ledtrig-tty >> trigger. > > Writing changelogs are hard. You are including a lot of information in > here that really doesn't need to be, as you are focusing on your > specific use case, which is fine, but you are creating a generic > function. Yes, that is absolutely right. I'll try to take that into account next time, thanks for your advice. > This can be simpler, how about something like this: > > There is no in-kernel function to get the status register of a > tty device like the TIOCMGET ioctl returns to userspace. Create > a new function, tty_get_tiocm(), to obtain the status register > that other portions of the kernel can call if they need this > information, and move the existing internal tty_tiocmget() > function to use this interface. I will replace the commit message with your suggestion in the next round of the patch series. Thanks! --- Florian