[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<DS2PR02MB10798ECB1FF918313884D3117E22AA@DS2PR02MB10798.namprd02.prod.outlook.com>
Date: Wed, 13 Aug 2025 06:51:47 +0000
From: "Zong Jiang (QUIC)" <quic_zongjian@...cinc.com>
To: Greg KH <gregkh@...uxfoundation.org>
CC: "linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Zhiqiang Tu
(QUIC)" <quic_ztu@...cinc.com>,
"Anup Kulkarni (QUIC)"
<quic_anupkulk@...cinc.com>,
"Mukesh Savaliya (QUIC)"
<quic_msavaliy@...cinc.com>,
"Viken Dadhaniya (QUIC)"
<quic_vdadhani@...cinc.com>,
"Haixu Cui (QUIC)" <quic_haixcui@...cinc.com>
Subject: RE: [PATCH 2/2] serial: qcom-geni: Make UART port count configurable
via Kconfig
Hi Greg,
Thanks for the question!
Yes, this is indeed due to a restriction in the serial core. Specifically, the serial core requires the uart_driver->nr field to be set at registration time via uart_register_driver(). This value determines how many uart_port slots are allocated internally, it cannot be changed dynamically afterward. As a result, we need to define the maximum number of ports up front.
By making this configurable via Kconfig, platforms can tailor the driver to match their actual hardware needs, avoiding unnecessary allocation for unused ports while still complying with the serial core's expectations.
Thanks again for the feedback!
Best regards,
Zong Jiang
-----Original Message-----
From: Greg KH <gregkh@...uxfoundation.org>
Sent: Tuesday, August 12, 2025 2:30 PM
To: Zong Jiang (QUIC) <quic_zongjian@...cinc.com>
Cc: linux-serial@...r.kernel.org; linux-kernel@...r.kernel.org; Zhiqiang Tu (QUIC) <quic_ztu@...cinc.com>; Anup Kulkarni (QUIC) <quic_anupkulk@...cinc.com>; Mukesh Savaliya (QUIC) <quic_msavaliy@...cinc.com>; Viken Dadhaniya (QUIC) <quic_vdadhani@...cinc.com>
Subject: Re: [PATCH 2/2] serial: qcom-geni: Make UART port count configurable via Kconfig
On Tue, Aug 12, 2025 at 01:48:19PM +0800, Zong Jiang wrote:
> Replace the hardcoded GENI_UART_PORTS macro with a new Kconfig option
> SERIAL_QCOM_GENI_UART_PORTS to allow platforms to configure the
> maximum number of UART ports supported by the driver at build time.
>
> This improves flexibility for platforms that require more than the
> previously fixed number of UART ports, and avoids unnecessary
> allocation for unused ports.
>
> Signed-off-by: Zong Jiang <quic_zongjian@...cinc.com>
> ---
> drivers/tty/serial/Kconfig | 8 ++++++++
> drivers/tty/serial/qcom_geni_serial.c | 5 ++---
> 2 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
> index 44427415a80d..e661f5951f55 100644
> --- a/drivers/tty/serial/Kconfig
> +++ b/drivers/tty/serial/Kconfig
> @@ -928,6 +928,14 @@ config SERIAL_QCOM_GENI_CONSOLE
> Serial console driver for Qualcomm Technologies Inc's GENI based
> QUP hardware.
>
> +config SERIAL_QCOM_GENI_UART_PORTS
> + int "Maximum number of GENI UART ports"
> + depends on SERIAL_QCOM_GENI
> + default "8"
> + help
> + Set this to the maximum number of serial ports you want the driver
> + to support.
Why do you need a static number of ports at all? Why not just handle how ever many there are in the system at the moment? Or is this due to some restriction in the serial core that requires this?
thanks,
greg k-h
Powered by blists - more mailing lists