From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: thierry.bultel@linatsea.fr, linux-renesas-soc@vger.kernel.org,
paul.barker.ct@bp.renesas.com, linux-kernel@vger.kernel.org,
linux-serial@vger.kernel.org
Subject: Re: [PATCH v9 06/10] serial: sh-sci: Use private port ID
Date: Fri, 23 May 2025 11:45:34 +0200 [thread overview]
Message-ID: <CAMuHMdVPn3adKZMiLqoEz9ANNyekmB9WRFyz++49+FeEOkrSSA@mail.gmail.com> (raw)
In-Reply-To: <aC2yYDpsv7ef9IVA@shikoro>
Hi Wolfram,
On Wed, 21 May 2025 at 13:00, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> On Thu, May 15, 2025 at 04:18:21PM +0200, Thierry Bultel wrote:
> > New port types cannot be added in serial_core.h, which is shared with
> > userspace.
> > In order to support new port types, the coming new ones will have
> > BIT(7) set in the id value, and in this case, uartport->type is
> > set to PORT_GENERIC.
> > This commit therefore changes all the places where the port type is
> > read, by not relying on uartport->type but on the private
> > value stored in struct sci_port.
>
> I quite like this approach to become independent of serial_core.h by
> adding a driver-local type. Because it changes only access to the
> variables but not much the logic of this driver. Two high level comments
> I do have:
>
> - I'd go for bit 31 as the flag, though. It is extremly unlikely that we
> ever need a number in serial_core.h again, but if, it could likely be
> > 127
Actually I asked Thierry to use bit 7, so both type and regtype can
fit in the existing hole in struct sci_port.
AFAIU, there is a hard moratorium on adding new public numbers to
serial_core.h. I doubt this field has ever been used by userspace
for anything other than 8250 and derivatives. The modern way to
discover the serial port type would be to look into sysfs anyway.
> - whatever bit numer we choose, it should be hidden as a constant. My
> suggestion:
>
> #define SCI_LOCAL_PORT_FLAG BIT(x)
>
> ?
I agree that would be good to have.
Alternatively:
enum {
SCI_PORT_LOCAL = 128,
SCI_PORT_RSCI,
};
and
#define SCI_PUBLIC_PORT_ID(port) (((port) >= SCI_PORT_LOCAL) ?
PORT_GENERIC : (port))
and 128 can be changed easily when the need ever arises?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
next prev parent reply other threads:[~2025-05-23 9:45 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250515141828.43444-1-thierry.bultel.yh@bp.renesas.com>
2025-05-15 14:18 ` [PATCH v9 01/10] dt-bindings: serial: Added secondary clock for RZ/T2H RSCI Thierry Bultel
2025-05-15 15:35 ` Rob Herring (Arm)
2025-05-23 9:05 ` Geert Uytterhoeven
2025-05-15 14:18 ` [PATCH v9 02/10] dt-bindings: clock: Add cpg for the Renesas RZ/T2H SoC Thierry Bultel
2025-05-23 10:00 ` Geert Uytterhoeven
2025-05-15 14:18 ` [PATCH v9 03/10] soc: renesas: Add RZ/T2H (R9A09G077) config option Thierry Bultel
2025-05-23 10:00 ` Geert Uytterhoeven
2025-05-15 14:18 ` [PATCH v9 04/10] clk: renesas: Pass sub struct of cpg_mssr_priv to cpg_clk_register Thierry Bultel
2025-05-23 10:01 ` Geert Uytterhoeven
2025-05-15 14:18 ` [PATCH v9 05/10] clk: renesas: Add support for R9A09G077 SoC Thierry Bultel
2025-05-23 10:01 ` Geert Uytterhoeven
2025-05-15 14:18 ` [PATCH v9 06/10] serial: sh-sci: Use private port ID Thierry Bultel
2025-05-21 11:00 ` Wolfram Sang
2025-05-23 9:45 ` Geert Uytterhoeven [this message]
2025-05-23 12:21 ` Wolfram Sang
2025-05-23 12:27 ` Thierry Bultel
2025-05-23 13:15 ` Wolfram Sang
2025-05-23 9:46 ` Geert Uytterhoeven
2025-05-23 13:17 ` Wolfram Sang
2025-05-15 14:18 ` [PATCH v9 07/10] serial: sh-sci: Add support for RZ/T2H SCI Thierry Bultel
2025-05-23 9:57 ` Geert Uytterhoeven
2025-05-15 14:18 ` [PATCH v9 08/10] arm64: dts: renesas: Add initial support for renesas RZ/T2H SoC Thierry Bultel
2025-05-15 14:18 ` [PATCH v9 09/10] arm64: dts: renesas: Add initial support for renesas RZ/T2H eval board Thierry Bultel
2025-05-15 14:18 ` [PATCH v9 10/10] arm64: defconfig: Enable Renesas RZ/T2H serial SCI Thierry Bultel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMuHMdVPn3adKZMiLqoEz9ANNyekmB9WRFyz++49+FeEOkrSSA@mail.gmail.com \
--to=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=paul.barker.ct@bp.renesas.com \
--cc=thierry.bultel@linatsea.fr \
--cc=wsa+renesas@sang-engineering.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®