From 01beb6552707cab41bff4b8ae5b97314ded2f9f8 Mon Sep 17 00:00:00 2001 From: Qiang Zhang Date: Tue, 20 Feb 2024 12:57:52 +0800 Subject: [PATCH] dm: fix LPC UART no output issue after reboot The meaning of lpc_uart_vdev::enabled was changed from runtime enablement status of UARTs to user configuration in commit 852f10cc3. So it's incorrect to clear it in lpc_deinit() which will cause UARTs disabled after reboot. Tracked-On: #8537 Fixes: 852f10cc3 ("dm: lpc: only emulate COM ports specified in command line") Signed-off-by: Qiang Zhang --- devicemodel/hw/pci/lpc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/devicemodel/hw/pci/lpc.c b/devicemodel/hw/pci/lpc.c index 7ddd5391b..4bc5292c4 100644 --- a/devicemodel/hw/pci/lpc.c +++ b/devicemodel/hw/pci/lpc.c @@ -65,7 +65,7 @@ static struct lpc_uart_vdev { const char *opts; int iobase; int irq; - int enabled; + int enabled; /* enabled/configured by user */ } lpc_uart_vdev[LPC_UART_NUM]; static const char *lpc_uart_names[LPC_UART_NUM] = { "COM1", "COM2", "COM3", "COM4" }; @@ -185,7 +185,6 @@ lpc_deinit(struct vmctx *ctx) uart_release_backend(lpc_uart->uart, lpc_uart->opts); uart_legacy_dealloc(unit); lpc_uart->uart = NULL; - lpc_uart->enabled = 0; } } @@ -233,7 +232,6 @@ lpc_init(struct vmctx *ctx) error = register_inout(&iop); if (error) goto init_failed; - lpc_uart->enabled = 1; } return 0;