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: <Zg0oyldGmxbNnSLI@smile.fi.intel.com>
Date: Wed, 3 Apr 2024 13:00:42 +0300
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Guanbing Huang <albanhuang@...look.com>
Cc: gregkh@...uxfoundation.org, rafael.j.wysocki@...el.com,
	linux-acpi@...r.kernel.org, tony@...mide.com,
	john.ogness@...utronix.de, yangyicong@...ilicon.com,
	jirislaby@...nel.org, linux-kernel@...r.kernel.org,
	linux-serial@...r.kernel.org, lvjianmin@...ngson.cn,
	albanhuang@...cent.com, tombinfan@...cent.com
Subject: Re: [PATCH v4 3/3] serial: 8250_pnp: Support configurable reg shift
 property

On Wed, Apr 03, 2024 at 03:41:30PM +0800, Guanbing Huang wrote:
> From: Guanbing Huang <albanhuang@...cent.com>
> 
> The 16550a serial port based on the ACPI table requires obtaining the
> reg-shift attribute. In the ACPI scenario, If the reg-shift property
> is not configured like in DTS, the 16550a serial driver cannot read or
> write controller registers properly during initialization.

..

>  		uart.port.mapbase = pnp_mem_start(dev, 0);
> +		uart.port.mapsize = pnp_mem_end(dev, 0) - pnp_mem_start(dev, 0);

pnp_mem_len()

..

Add a comment here to explain that

	/*
	 * The previous call may not set iotype correctly when reg-io-width
	 * property is absent and it doesn't support IO port resource.
	 */

> +	uart.port.iotype = iotype;


>  	uart.port.flags |= UPF_SKIP_TEST | UPF_BOOT_AUTOCONF;
>  	if (pnp_irq_flags(dev, 0) & IORESOURCE_IRQ_SHAREABLE)
>  		uart.port.flags |= UPF_SHARE_IRQ;
> -	uart.port.uartclk = 1843200;
> -	device_property_read_u32(&dev->dev, "clock-frequency", &uart.port.uartclk);
> -	uart.port.dev = &dev->dev;
> +	else
> +		uart.port.flags &= ~UPF_SHARE_IRQ;

This is not needed, just move

	uart.port.flags |= UPF_SKIP_TEST | UPF_BOOT_AUTOCONF;

to be before uart_read_properties().

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ