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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <84ad1b3070a8374ec20f06588fab9f86@dev.tdt.de>
Date: Mon, 20 Oct 2025 08:47:16 +0200
From: Florian Eckert <fe@....tdt.de>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: gregkh@...uxfoundation.org, jirislaby@...nel.org,
	kumaravel.thiagarajan@...rochip.com, pnewman@...necttech.com,
	angelogioacchino.delregno@...labora.com, peterz@...radead.org,
	yujiaoliang@...o.com, arnd@...nel.org, cang1@...e.co.uk,
	macro@...am.me.uk, schnelle@...ux.ibm.com,
	Eckert.Florian@...glemail.com, linux-kernel@...r.kernel.org,
	linux-serial@...r.kernel.org
Subject: Re: [PATCH v2] serial: 8250_pcilib: Replace deprecated PCI functions

On 2025-10-18 21:33, Andy Shevchenko wrote:
> On Tue, Sep 30, 2025 at 09:27:43AM +0200, Florian Eckert wrote:
>> When the '8250_exar' module is loaded into the kernel, a kernel trace
>> with 'WARN_ON(legacy_iomap_table[bar])' is dumped to the console,
>> because the old pci table mapping is still used in '8250_pcilib'.
>> 
>> The old function have been deprecated in commit e354bb84a4c1 ("PCI:
>> Deprecate pcim_iomap_table(), pcim_iomap_regions_request_all()").
>> 
>> The remapping already takes or must take place in the driver that 
>> calls
>> the function 'serial8250_pci_setup_port()'. The remapping should only 
>> be
>> called once via 'pcim_iomap()'. Therefore the remapping moved to the
>> caller of 'serial8250_pci_setup_port()'.
>> 
>> To replace the outdated/legacy iomap_table processing in '8250_pcilib' 
>> the
>> function signature of 'serial8250_pci_setup_port()' has been extended 
>> with
>> an already iomapped address value. So this can be used directly 
>> without
>> io mapping again.
> 
> ...
> 
>> +	if (pci_resource_flags(priv->dev, bar) & IORESOURCE_MEM) {
> 
> Dunno if this is included already in Linux Next, but here is room for
> improvement.
> 

I followed the code in the 'serial8250_pci_setup_port()' [1] function.
The same pattern is used there [2].

> 
> The problem with the above code is it (wrongly?) checks for bit and not
> for the resource type. OTOH I don't remember if 64-bit version requires
> the IORESOURCE_MEM to be set along with that.
> 

Do you mean the function 'platform_get_resource()' [3]? This is a 
platform
device function?

[1] 
https://elixir.bootlin.com/linux/v6.18-rc1/source/drivers/tty/serial/8250/8250_pcilib.c#L24
[2] 
https://elixir.bootlin.com/linux/v6.18-rc1/source/drivers/tty/serial/8250/8250_pcilib.c#L30
[3] 
https://elixir.bootlin.com/linux/v6.17.3/source/drivers/base/platform.c#L55

---
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ