Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2046230pxm; Fri, 4 Mar 2022 08:24:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3ial0XVR/BNPDStRZF4kP7KUUpUoCTjNxFSpeghTPASRbuTxsAIlxvrgCKIdkMzLiYU68 X-Received: by 2002:a65:57c9:0:b0:375:7489:1bac with SMTP id q9-20020a6557c9000000b0037574891bacmr34823701pgr.349.1646411089440; Fri, 04 Mar 2022 08:24:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646411089; cv=none; d=google.com; s=arc-20160816; b=c9gyOU10M4c4VKrNew/Fp3vJGkTV7VkI3lDVE2uT50MnttNWxDrfKHKz4HUdQnMZVa ibDLL+Sofkou8JmNZGv1WAK0cJTkgGAxQB1/YsrY0VcltjDLXQes/VtTEzHfVHIIyBb7 dEOKHt2CR0YUaTjQPPg8srNTZNmxO37pIq2UCaN2DK35aIGHWuave8hc90jabFyJnNOR cWvjjHqG6mYrpXlAo+9lE0bx9tLzQZ92fpli2mcDPUcyvPvQ0R1d++YjjNbKAm9oT+3o Z6m4SzwxF+iZp2omaIMRpywt8A2kQ9YnzsCpeBmx+jXBytUfoL6DDKev5XTCFYoOk2pF f5yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=j8VVUmdWtptuHytP8FUZEpFNDPm1GXbXv65BJX2pzWU=; b=gTKzZJ9ddAi3+1gBY3rElw7VgxPqqhxEL2zVWults/fRKZc8Ccb4vxvU4sCKvXLzMZ mE9PU1uSrLg0m9y84XQcgWhlFey6MODk0kUtDc6kMqtpWTnMY0CjJ0nFo50GOOdqk1e1 hPCeF1QVxpMiZpzJ2mIVRSBILGuS0BR5oJAZioLWbQkvmFpMGJPtFK9w3pezHQpZipRU O8xQ3YR+UfxB1nHlM8C9ZzjY5RwWRtaA4hzNKFCf7giRaXbZYuRNLylMv1o1EuRDNgWx NZ822KxZJA60BYm8Dn9mTb8ZnYr2iaftCY1gqbyO3WxOw4tkz6wahFvZVnlcRoinxTzX Re+A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x11-20020a17090a46cb00b001bf093c26e1si16390pjg.180.2022.03.04.08.24.31; Fri, 04 Mar 2022 08:24:49 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239696AbiCDMHQ (ORCPT + 99 others); Fri, 4 Mar 2022 07:07:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233619AbiCDMHM (ORCPT ); Fri, 4 Mar 2022 07:07:12 -0500 Received: from angie.orcam.me.uk (angie.orcam.me.uk [78.133.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EB7E61B309F; Fri, 4 Mar 2022 04:06:24 -0800 (PST) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 4950592009C; Fri, 4 Mar 2022 13:06:22 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 4313A92009B; Fri, 4 Mar 2022 12:06:22 +0000 (GMT) Date: Fri, 4 Mar 2022 12:06:22 +0000 (GMT) From: "Maciej W. Rozycki" To: Jiri Slaby cc: gregkh@linuxfoundation.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Richard Genoud , =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?= , Paul Cercueil , Tobias Klauser , Russell King , Vineet Gupta , Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Alexander Shiyan , Baruch Siach , Paul Walmsley , Palmer Dabbelt , Albert Ou , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Karol Gugala , Mateusz Holenko , Vladimir Zapolskiy , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Taichi Sugaya , Takao Orito , Liviu Dudau , Sudeep Holla , Lorenzo Pieralisi , =?UTF-8?Q?Andreas_F=C3=A4rber?= , Manivannan Sadhasivam , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Andy Gross , Bjorn Andersson , Krzysztof Kozlowski , Orson Zhai , Baolin Wang , Chunyan Zhang , Patrice Chotard , Maxime Coquelin , Alexandre Torgue , "David S. Miller" , Peter Korsgaard , Michal Simek Subject: Re: [PATCH v4] serial: make uart_console_write->putchar()'s character an unsigned char In-Reply-To: <20220303080831.21783-1-jslaby@suse.cz> Message-ID: References: <20220303080831.21783-1-jslaby@suse.cz> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,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 Thu, 3 Mar 2022, Jiri Slaby wrote: > Currently, uart_console_write->putchar's second parameter (the > character) is of type int. It makes little sense, provided uart_console_write() > accepts the input string as "const char *s" and passes its content -- the > characters -- to putchar(). So switch the character's type to unsigned > char. For: > drivers/tty/serial/dz.c | 2 +- DECstation DZ serial driver version 1.04 ttyS0 at MMIO 0x1c000000 (irq = 4, base_baud = 0) is a DZ ttyS1 at MMIO 0x1c000000 (irq = 4, base_baud = 0) is a DZ ttyS2 at MMIO 0x1c000000 (irq = 4, base_baud = 0) is a DZ ttyS3 at MMIO 0x1c000000 (irq = 4, base_baud = 0) is a DZ (I guess I ought to make it report "base_baud = 9600" though there is no programmable clock divider there and instead there is simply a 15-way rate selector for standard baud rates of up to 9600bps in addition to external clocking chosen with the 16th setting), and: > drivers/tty/serial/sb1250-duart.c | 2 +- duart0 at MMIO 0x10060100 (irq = 8, base_baud = 5000000) is a SB1250 DUART duart1 at MMIO 0x10060200 (irq = 9, base_baud = 5000000) is a SB1250 DUART (this does require some TLC though as there's a "refcount_t: saturated; leaking memory." warning issued in driver's initialisation) and: > drivers/tty/serial/zs.c | 2 +- DECstation Z85C30 serial driver version 0.10 ttyS0 at MMIO 0x1f900008 (irq = 14, base_baud = 460800) is a Z85C30 SCC ttyS1 at MMIO 0x1f900000 (irq = 14, base_baud = 460800) is a Z85C30 SCC ttyS2 at MMIO 0x1f980008 (irq = 15, base_baud = 460800) is a Z85C30 SCC ttyS3 at MMIO 0x1f980000 (irq = 15, base_baud = 460800) is a Z85C30 SCC Acked-by: Maciej W. Rozycki Tested-by: Maciej W. Rozycki However please consider my notes in the branch of discussion with David too WRT (not) changing the signedness. Myself I'll look into GCC and see why it doen't fold the truncation into the load operation. Maybe just a MIPS backend issue, such as a missing RTL pattern the lack of which prevents combine from doing its job here. Any fix will have to wait a couple of months for upstreaming though as the compiler is currently at a stage where regression fixes are accepted only for the upcoming GCC 12 release, so no general development is allowed on trunk. Thank you for working on this! Maciej