linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* serial 00:06: Runtime PM usage count underflow!
@ 2024-11-16 17:07 Borislav Petkov
  2024-11-16 17:19 ` Greg Kroah-Hartman
  2024-11-18 14:14 ` Ilpo Järvinen
  0 siblings, 2 replies; 5+ messages in thread
From: Borislav Petkov @ 2024-11-16 17:07 UTC (permalink / raw)
  To: linux-serial; +Cc: Greg Kroah-Hartman, Jiri Slaby, lkml

Hi folks,

got a box here which says:

[    4.654361] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    4.660820] 00:06: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[    4.668313] printk: legacy console [ttyS0] disabled
[    4.676903] serial 00:06: Runtime PM usage count underflow!
[    4.677175] serial 00:06: disabled
[    4.677264] serial 00:06: unable to assign resources
[    4.677356] serial 00:06: probe with driver serial failed with error -16
[    4.677923] printk: legacy console [ttyS0] disabled

Any suggestions?

I'd like to use the serial cable to catch dmesg but somehow the driver doesn't
like the chip...

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: serial 00:06: Runtime PM usage count underflow!
  2024-11-16 17:07 serial 00:06: Runtime PM usage count underflow! Borislav Petkov
@ 2024-11-16 17:19 ` Greg Kroah-Hartman
  2024-11-16 17:58   ` Borislav Petkov
  2024-11-18 14:14 ` Ilpo Järvinen
  1 sibling, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2024-11-16 17:19 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: linux-serial, Jiri Slaby, lkml

On Sat, Nov 16, 2024 at 06:07:27PM +0100, Borislav Petkov wrote:
> Hi folks,
> 
> got a box here which says:
> 
> [    4.654361] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
> [    4.660820] 00:06: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
> [    4.668313] printk: legacy console [ttyS0] disabled
> [    4.676903] serial 00:06: Runtime PM usage count underflow!
> [    4.677175] serial 00:06: disabled
> [    4.677264] serial 00:06: unable to assign resources
> [    4.677356] serial 00:06: probe with driver serial failed with error -16
> [    4.677923] printk: legacy console [ttyS0] disabled
> 
> Any suggestions?

Look in the bios, that seems to be the "old" pnp serial device?  Does it
really have a serial port on the board?  Is it enabled properly?

That is odd, what's the chance that someone didn't enable it in acpi
somehow?

> I'd like to use the serial cable to catch dmesg but somehow the driver doesn't
> like the chip...

It should be the bog-standard 16550 PNP device, check the resource
settings somewhere?  Sorry I can't think of anything else at the
moment...

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: serial 00:06: Runtime PM usage count underflow!
  2024-11-16 17:19 ` Greg Kroah-Hartman
@ 2024-11-16 17:58   ` Borislav Petkov
  0 siblings, 0 replies; 5+ messages in thread
From: Borislav Petkov @ 2024-11-16 17:58 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-serial, Jiri Slaby, lkml

On Sat, Nov 16, 2024 at 06:19:36PM +0100, Greg Kroah-Hartman wrote:
> Look in the bios, that seems to be the "old" pnp serial device?  Does it
> really have a serial port on the board?

Yeah, there is a COM1 connector and I've attached a serial port brace to have
the connector on the back of the board.

> Is it enabled properly?

BIOS says:

Serial(COM) Port 0 Configuration
	Port		Enabled
	Settings	IO=3F8H, IRQ=4

It was on "Auto" before but neither setting changed anything.

I don't know how relevant this is about that same PCI device:

pnp 00:06: [dma 0 disabled]

I'll try to upgrade the BIOS, maybe it really is an ACPI f*ckup.

Thx!

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: serial 00:06: Runtime PM usage count underflow!
  2024-11-16 17:07 serial 00:06: Runtime PM usage count underflow! Borislav Petkov
  2024-11-16 17:19 ` Greg Kroah-Hartman
@ 2024-11-18 14:14 ` Ilpo Järvinen
  2024-12-10 15:17   ` Borislav Petkov
  1 sibling, 1 reply; 5+ messages in thread
From: Ilpo Järvinen @ 2024-11-18 14:14 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: linux-serial, Greg Kroah-Hartman, Jiri Slaby, lkml

[-- Attachment #1: Type: text/plain, Size: 2237 bytes --]

On Sat, 16 Nov 2024, Borislav Petkov wrote:

> Hi folks,
> 
> got a box here which says:
> 
> [    4.654361] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
> [    4.660820] 00:06: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
> [    4.668313] printk: legacy console [ttyS0] disabled
> [    4.676903] serial 00:06: Runtime PM usage count underflow!
> [    4.677175] serial 00:06: disabled
> [    4.677264] serial 00:06: unable to assign resources
> [    4.677356] serial 00:06: probe with driver serial failed with error -16
> [    4.677923] printk: legacy console [ttyS0] disabled
> 
> Any suggestions?
> 
> I'd like to use the serial cable to catch dmesg but somehow the driver doesn't
> like the chip...

I think "Runtime PM usage count underflow!" is not related to the probe 
problem you're seeing. Nonetheless, this patch might solve the underflow:

--
[PATCH 1/1] tty: serial: 8250: Fix another runtime PM usage counter underflow

The commit f9b11229b79c ("serial: 8250: Fix PM usage_count for console
handover") fixed one runtime PM usage counter balance problem that
occurs because .dev is not set during univ8250 setup preventing call to
pm_runtime_get_sync(). Later, univ8250_console_exit() will trigger the
runtime PM usage counter underflow as .dev is already set at that time.

Call pm_runtime_get_sync() to balance the RPM usage counter also in
serial8250_register_8250_port() before trying to add the port.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/tty/serial/8250/8250_core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index 5f9f06911795..68baf75bdadc 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -812,6 +812,9 @@ int serial8250_register_8250_port(const struct uart_8250_port *up)
 			uart->dl_write = up->dl_write;
 
 		if (uart->port.type != PORT_8250_CIR) {
+			if (uart_console_registered(&uart->port))
+				pm_runtime_get_sync(uart->port.dev);
+
 			if (serial8250_isa_config != NULL)
 				serial8250_isa_config(0, &uart->port,
 						&uart->capabilities);
-- 
2.39.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: serial 00:06: Runtime PM usage count underflow!
  2024-11-18 14:14 ` Ilpo Järvinen
@ 2024-12-10 15:17   ` Borislav Petkov
  0 siblings, 0 replies; 5+ messages in thread
From: Borislav Petkov @ 2024-12-10 15:17 UTC (permalink / raw)
  To: Ilpo Järvinen; +Cc: linux-serial, Greg Kroah-Hartman, Jiri Slaby, lkml

On Mon, Nov 18, 2024 at 04:14:20PM +0200, Ilpo Järvinen wrote:
> I think "Runtime PM usage count underflow!" is not related to the probe 
> problem you're seeing. Nonetheless, this patch might solve the underflow:
> 
> --
> [PATCH 1/1] tty: serial: 8250: Fix another runtime PM usage counter underflow
> 
> The commit f9b11229b79c ("serial: 8250: Fix PM usage_count for console
> handover") fixed one runtime PM usage counter balance problem that
> occurs because .dev is not set during univ8250 setup preventing call to
> pm_runtime_get_sync(). Later, univ8250_console_exit() will trigger the
> runtime PM usage counter underflow as .dev is already set at that time.
> 
> Call pm_runtime_get_sync() to balance the RPM usage counter also in
> serial8250_register_8250_port() before trying to add the port.
> 
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Reported-by: Borislav Petkov (AMD) <bp@alien8.de>
Tested-by: Borislav Petkov (AMD) <bp@alien8.de>

Thx!

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-12-10 15:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-16 17:07 serial 00:06: Runtime PM usage count underflow! Borislav Petkov
2024-11-16 17:19 ` Greg Kroah-Hartman
2024-11-16 17:58   ` Borislav Petkov
2024-11-18 14:14 ` Ilpo Järvinen
2024-12-10 15:17   ` Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).