Re: [PATCH] serial: 8250: Clear CON_PRINTBUFFER on port re-registration

From: Fushuai Wang

Date: Fri Apr 17 2026 - 00:02:10 EST


>> ...
>> When BIOS "Serial Device" option is set to BMC, both 00:04 and 00:05 are mapped to
>> the same physical I/O port 0x3f8. And then:
>>
>> 1.00:04 is probed first and registers the console for port 0x3f8
>> 2.00:05 is detected and also needs to use port 0x3f8
>
> This is simply wrong. Do we ever support such a FW configuration?
> Why on earth are there two devices for the same resource exposed to
> the OS? It smells like a bug in BIOS.

My BIOS has this configuration option, and I also found other vendors'
BIOS with the same option, e.g.:

https://download.msi.com/archive/mnu_exe/server/S3066-S377-v1.1-BIOS-UG.pdf

Serial Device [BMC]/[S3M] Sets the Serial Device used to output bios serial log

Also, the kernel's serial8250_register_8250_port() already
handles the case where multiple devices map to the same physical
port. When serial8250_find_match_or_unused() detects that
a device with the same port already exists, the caller
(serial8250_register_8250_port()) removes the existing
port before registering the new one.

Since the kernel already supports this remove-re-add process, I
think it makes sense to fix the CON_PRINTBUFFER issue to handle
this scenario, rather than relying on BIOS to avoid such configurations.

--
Regards,
WANG