Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp482912imw; Fri, 8 Jul 2022 06:30:34 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v6gFhqsxDfAz/OQEgM3dQdvgL5cZC07BEBS3AxL1VXRYNTVcyYUfF7hXwG2hFf2n+bmmVb X-Received: by 2002:a17:90b:38ce:b0:1ef:c5bd:e2bd with SMTP id nn14-20020a17090b38ce00b001efc5bde2bdmr4306678pjb.149.1657287033711; Fri, 08 Jul 2022 06:30:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657287033; cv=none; d=google.com; s=arc-20160816; b=mVGKazI6w4qXBs2S3ZRSblBPOHCQCJruRI+yZk3jyvidBRviah7b6ofBXRqeE+NDvF PLNDBuRkVwmDtCsPG9YSGRDDn09bK/9+2vyYT7OCLHwGc2qWGkWmr567xaTwYvnhiE+f QIJhwfqgBQUS7zySfssLiOaO6lVbYhAhJxWPjaNmjsZd6Rm7tBYmIQ1kgS90D2I+JN+P MVIv1e66Lc6S00+TO+VDxBXAbzc3xiQzstITOPBiNS9rcwV4X7m1ZbhEcncobf/huTp5 JYZGZqdBPpC95BMcnlVwNkbWhEwhtwL0Ly7njamUP+dTKAja1flw1dmMo1X0g+tKAl7K krMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=EwmG0GIlj7BlYkltTrjkWesNxUx/y87KajxiVO5PVt8=; b=wqmpPbENsywoD2CwxgZftc2etlEtikc0NWu8UHBWmlzCQbPxGDGvksSod2j4f9youE OdHzr27x4Irv6sU8RoklQApTedvHBMaDBngMXgbmdA1runW6O7J92rysH0ZYvUt6CfoQ bkxFDIGmDcMVwcqFgjlDPqjTFF1U29E1N/Vbm5aw2jyOHv5Jy/UmK6D53r3AmJ+P1R43 iRN+GiJqzuGmrIgw6f/JZH8+CaYjzAJ/4mUuLf06dYYSlkKOyjiIGTyYfcOhoRVmX1bJ rymrECBS+hPmUzuwJNN5Hk435ingGZEnUTDMbMdoWCa6vFKRq8okCJ4wEPxJpg68BN2z UDGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dxi1rh6E; 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 oe18-20020a17090b395200b001ca64c6f839si2794031pjb.15.2022.07.08.06.30.21; Fri, 08 Jul 2022 06:30:33 -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=dxi1rh6E; 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 S237815AbiGHN01 (ORCPT + 99 others); Fri, 8 Jul 2022 09:26:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231287AbiGHN00 (ORCPT ); Fri, 8 Jul 2022 09:26:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB5802BB16; Fri, 8 Jul 2022 06:26:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8A7746278F; Fri, 8 Jul 2022 13:26:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95466C341C0; Fri, 8 Jul 2022 13:26:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657286785; bh=YeK2rKgYFw9Z5YIp50Bq4SLxx44Pw1F77wqhyYgPROk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dxi1rh6EyOB3L6/haaLSSSigqOR9JTRr6G70kpzktPFZiEaVhlJGkSQ5e7qA+O/8a +sxayvKXskGqMp/h4GVJFpXrUwPwx3+AHqrdZjDLiOJyXhNoOMiyjlwrRns8CGbNFI /kcs0rmAsjL6dV2N7+nsRpDPIru+SySEhnnQ7+TrA9CjwxIq/eu500MXmc/Km0o5tR dfZqvFXG8Yo6DvR6588IrjAenFnztf6Yh2HArLlxExS71gqVX7iuBwWWcngxwZkxj6 jYPvIPLZqHiSYMvUd1LS7gyCyLAtv/suL1mFnRETaaj+zWWEL618664p/bCubkusLK 0W9yzEQMI9taA== Received: by pali.im (Postfix) id 592A87D1; Fri, 8 Jul 2022 15:26:21 +0200 (CEST) Date: Fri, 8 Jul 2022 15:26:21 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Greg Kroah-Hartman Cc: Andy Shevchenko , Jiri Slaby , Johan Hovold , Marek =?utf-8?B?QmVow7pu?= , "open list:SERIAL DRIVERS" , Linux Kernel Mailing List Subject: Re: [PATCH 0/3] serial: Fix support for UPF_SPD_* flags Message-ID: <20220708132621.4v2es73h52aq3izn@pali> References: <20220321163055.4058-1-pali@kernel.org> <20220707084840.jvsstvyx2ul5ltb6@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 X-Spam-Status: No, score=-6.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,URIBL_BLACK 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 Friday 08 July 2022 15:07:43 Greg Kroah-Hartman wrote: > On Thu, Jul 07, 2022 at 10:48:40AM +0200, Pali Rohár wrote: > > On Friday 22 April 2022 16:28:06 Greg Kroah-Hartman wrote: > > > On Tue, Mar 22, 2022 at 04:29:08PM +0200, Andy Shevchenko wrote: > > > > On Mon, Mar 21, 2022 at 11:07 PM Pali Rohár wrote: > > > > > > > > > > Support for UPF_SPD_* flags is currently broken in more drivers for two > > > > > reasons. First one is that uart_update_timeout() function does not > > > > > > > > the uart_update_timeout() > > > > > > > > > calculate timeout for UPF_SPD_CUST flag correctly. Second reason is that > > > > > userspace termios structre is modified by most drivers after each > > > > > > > > structure > > > > > > > > ... > > > > > > > > > (error handling was ommited for simplification) > > > > > > > > omitted > > > > > > > > > After calling set_active_spd_cust_baud() function SPD custom divisor > > > > > should be active and therefore is_spd_cust_active() should return true. > > > > > > > > > > But it is not active (cfgetospeed does not return B38400) and this patch > > > > > series should fix it. I have tested it with 8250 driver. > > > > > > > > drivers > > > > > > > > > Originally Johan Hovold reported that there may be issue with these > > > > > ASYNC_SPD_FLAGS in email: > > > > > https://lore.kernel.org/linux-serial/20211007133146.28949-1-johan@kernel.org/ > > > > > > > > > > > > > > > Johan, Greg, could you please test these patches if there is not any > > > > > regression? > > > > > > > > I'm wondering why we are still supporting this ugly hack? > > > > Doesn't BOTHER work for you? > > > > > > Yes, I too do not want to add more support for these old flags. If they > > > have not been working, let's not add support for them as obviously no > > > one is using them. Let's try to remove them if at all possible. > > > > Well, it works partially. For more drivers SET method is working, but > > GET method returns incorrect value. If your userspace application is > > written in a way that does not retrieve from kernel current settings > > then it has big probability that application works. > > I do not understand, sorry, what do you mean by this? I mean that SET methods are working, GET methods not. In this case SET done via ioctl(TIOCSSERIAL) and GET via ioctl(TIOCGSERIAL). > And as you are responding to a months-old thread, I am totally lost, and > don't even know what the patch here was... > > > So, do you really want to remove support for these old flags completely? > > That would of course break above applications. > > I'm not saying remove them, I'm saying let us not add any more > dependancies on them in order to keep new applications from ever wanting > to use them. Last time you wrote to remove them. Now saying not to remove them. So I do not understand you now. > > Note that usage of BOTHER is problematic and in most cases highly > > impossible if you are using glibc libc.so. BOTHER is incompatible with > > glibc header files and so you can either include BOTHER/linux termios > > file (exclusive) OR glibc header files. > > I thought that was all fixed up in newer versions of glibc. Is that > really still the case in the latest release? In which version you though that it was fixed? Last time when I checked it (half year ago) all these issues were there still present. Now I briefly grepped glib git source code and seems that nothing was changed, no support for BOTHER and neither ABI changes. I also looked into changelong of last 3 released glibc versions there is neither no information about it. > > New version of tcsetattr and ioctl_tty manpages would have documented > > how to use BOTHER (it is currently in the manpages git). > > > > Currently the only known option how to use BOTHER is to completely > > reimplement all functions from "termios.h", provide custom "termios.h" > > header file (and not use glibc termios.h nor any file which it includes) > > and statically link this reimplementation into final application. > > > > So in most cases BOTHER is not alternative to those old SPD flags even > > for modern applications. > > Using the kernel's .h file should be easy enough here for them, right? No. Because structures and defines conflicts with glibc structures and defines. That is why (ABI incompatible) reimplementation is needed. > And again, I thought glibc was fixed, what about other libc versions? musl does not support BOTHER too. And I do not know other libc versions which are used in production. > thanks, > > greg k-h