Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1703415pxv; Fri, 25 Jun 2021 21:15:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHucYaSdC5Hy2/SE1AmSoajD5+PJjZenob+WUredEc3ExcAbAx8V6ngDmvXMKHX8t51cDR X-Received: by 2002:a17:906:5407:: with SMTP id q7mr14708185ejo.158.1624680912126; Fri, 25 Jun 2021 21:15:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624680912; cv=none; d=google.com; s=arc-20160816; b=EjppOF1rHRG6gAmodi6JRokFGuTH5mtFzMPYK3d0XQDHN4Y4Jd4Nm688fJjcEcGaSs GTXT7I4y5A4obeP9qWJZKrxd51eyw56HsYitOPxWYdcLVkb6fo87trnPbt/rk0u1Nvsj wRiU7WLZdtSUEfkjQlWXzIR5mU+GthjqoFWW11tKkXfHuZhkLWqFSUfO4/l2SS4yJ55V YvZeCWmU3eP47vhBub06f4nPQcg9WaV6SkuYjo/w5nLcx6yZxaRUt0jBPzcDJemVt5WN hinpuhWV8MpM68uE1RsoZumvodwtMJxl1Up0IfJPFoXjoNilw+86QTdSvGYLCizpEoFy 7u5w== 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=82eLThoMQI0kSIILBGA93AxzDDhrzP3VOi2f+1YJNuc=; b=G5jiG2DV7dp3dQxHo5LQcCno+uHo9sK9h+tCzwBMzsWAGwJvAy/MVzie8IM+a4mJ5c FEdG7ZjZ5vGEpvd4F6IPjJoVtdE06QVFKtegK3idyVXWrypeHHHjA6UvHDTXOjJjpFvB i0yGTfWQJSdt9+Rq5wFPq1RBQL5Bu3d27iVhypU0AbzmHvJJyr9dsxXZYbdaajL3xmDU YL5E233NedR4dFkkjlM5ag82lGc9g40wcnoLb0frKTLi3PX+7YwpIdEFGDlpfM8FVBC9 CzaBToQ5OzstppHrT44leXgGSBZ9DRKTw42GWY5o69/NFJ+eWqjYf+cH+Ue8KvLTnLLM Lzcg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a8si7649090ejc.334.2021.06.25.21.14.47; Fri, 25 Jun 2021 21:15:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230138AbhFZEPC (ORCPT + 99 others); Sat, 26 Jun 2021 00:15:02 -0400 Received: from angie.orcam.me.uk ([78.133.224.34]:60086 "EHLO angie.orcam.me.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229906AbhFZEPB (ORCPT ); Sat, 26 Jun 2021 00:15:01 -0400 Received: by angie.orcam.me.uk (Postfix, from userid 500) id A415992009D; Sat, 26 Jun 2021 06:12:38 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 9D40F92009B; Sat, 26 Jun 2021 06:12:38 +0200 (CEST) Date: Sat, 26 Jun 2021 06:12:38 +0200 (CEST) From: "Maciej W. Rozycki" To: Greg Kroah-Hartman cc: Jiri Slaby , Thomas Bogendoerfer , linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/5] serial: core, 8250: Add a hook for extra port property reporting In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 15 Jun 2021, Greg Kroah-Hartman wrote: > > Add a hook for `uart_report_port' to let serial ports report extra > > properties beyond `irq' and `base_baud'. Use it with the 8250 backend > > to report extra baud rates supported above the base rate for ports with > > the UPF_MAGIC_MULTIPLIER property, so that people have a way to find out > > that they are supported with their system, e.g.: [...] > Ick, really? What relies on this print message? Why do we need a whole > new uart port hook for this? As I noted, perhaps too briefly, in the commit description (see the last sentence above) people need to be made aware of the extra baud rates above `base_baud' supported, or otherwise they'll have no way to figure out they can use them. Reporting tweaked `base_baud' would I think cause confusion from the inconsistency with the TIOCGSERIAL/TIOCSSERIAL ioctls (e.g. `setserial'), and the sysfs flags: $ cat /sys/class/tty/ttyS[0-2]/flags 0x10010040 0x10010040 0x90000040 $ (here from a Malta board) are IMO too obscure for anyone to figure this out (bit 16 means the two extra baud rates are supported). As explained with 1/5 we could set `base_baud' to 460800 instead and hardcode bit 15 of the divisor to 1, relying on undocumented Super I/O IC behaviour, but that would require more exhaustive verification than I am able to do with just a single board and IC type and revision. > Isn't there some other way for your specific variant to print out > another message if you really want to do something "odd" like this? There's always another way. :) How about? serial8250.0: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A serial8250.0: ttyS0 extra baud rates supported: 230400, 460800 > And you did not document what your new change did anywhere in the tree, > so people are going to be confused. We've been somewhat terse about things, but you're probably right here. Sorry about that. > I've taken the other patches here, but not this one. Thanks. I've posted an alternative printing a message like above, with some commentary. Let me know if that makes you feel more convinced. Maciej