lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2025121711-landing-vending-e4e0@gregkh>
Date: Wed, 17 Dec 2025 15:00:28 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: Filip Jensen <dev-Felipe.Jensen@...gon.com>
Cc: jirislaby@...nel.org, linux-kernel@...r.kernel.org,
	linux-serial@...r.kernel.org,
	Jose Javier Rodriguez Barbarin <dev-josejavier.rodriguez@...gon.com>
Subject: Re: [PATCH 2/2] serial: 8250_men_mcb: Parameter for base clockrate

On Wed, Dec 10, 2025 at 05:48:04PM +0100, Filip Jensen wrote:
> A parameter is needed for allowing to change the base clockrate for
> each uart port, as this fpga units have no fixed base clock. If the
> parameter is not set or is set to 0, it will use the default value.
> Allows setting the clockrate up to 64 UARTs.
> 
> Reviewed-by: Jose Javier Rodriguez Barbarin <dev-josejavier.rodriguez@...gon.com>
> Signed-off-by: Filip Jensen <dev-Felipe.Jensen@...gon.com>
> ---
>  drivers/tty/serial/8250/8250_men_mcb.c | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_men_mcb.c b/drivers/tty/serial/8250/8250_men_mcb.c
> index 6ba7464bb2dd..01dcb9c17b0c 100644
> --- a/drivers/tty/serial/8250/8250_men_mcb.c
> +++ b/drivers/tty/serial/8250/8250_men_mcb.c
> @@ -28,6 +28,7 @@
>  #define MEN_UART3_MASK	0x04
>  #define MEN_UART4_MASK	0x08
>  
> +#define MEN_8250_MAX_SETUP		64
>  #define MEN_Z025_MAX_UARTS		4
>  #define MEN_UART_MEM_SIZE		0x10
>  #define MEM_UART_REGISTER_SIZE		0x01
> @@ -45,12 +46,18 @@ struct serial_8250_men_mcb_data {
>  	int line[MEN_Z025_MAX_UARTS];
>  	unsigned int offset[MEN_Z025_MAX_UARTS];
>  };
> +static int portindex;
> +static ulong uartclk[MEN_8250_MAX_SETUP];
> +module_param_array(uartclk, ulong, NULL, 0664);
> +MODULE_PARM_DESC(
> +	uartclk,
> +	"Base for baudrate generation for each port. E.g.: uartclk=1843200,1843200,1041666,1041666. If set to 0 it will use board's default");

This is not the 1990's, please do nto add new module parameters.  That
way lies madness and an inability to handle dynamic devices in any way.

Why can't this be found out some other way?  Device discovery?  Device
tree?  quirk for something else?  This should not be so broken that you
need to manually come up with kernel boot lines like this.  What about
fixing the hardware itself to not need this at all?

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ