From: kenneth_jia--- via <qemu-arm@nongnu.org>
To: "'qemu-arm@nongnu.org'" <qemu-arm@nongnu.org>
Cc: "'Cédric Le Goater'" <clg@redhat.com>,
"'Philippe Mathieu-Daudé'" <philmd@linaro.org>,
"'Jamin Lin'" <jamin_lin@aspeedtech.com>,
"'Andrew Jeffery'" <andrew@codeconstruct.com.au>,
"'Gavin Shan'" <gshan@redhat.com>,
"'open list:All patches CC here'" <qemu-devel@nongnu.org>
Subject: [PATCH] hw/arm/aspeed: fix connect_serial_hds_to_uarts
Date: Thu, 12 Dec 2024 13:31:48 +0000 [thread overview]
Message-ID: <5f9b0c53f1644922ba85522046e92f4c@asus.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1232 bytes --]
From 24d3badbbb9dcc0d220609a7dd30f8da5002cba7 Mon Sep 17 00:00:00 2001
From: Kenneth Jia <kenneth_jia@asus.com>
Date: Thu, 12 Dec 2024 20:42:04 +0800
Subject: [PATCH] hw/arm/aspeed: fix connect_serial_hds_to_uarts
In the loop, we need ignore the index increase when uart == uart_chosen
We should increase the index only after we allocate a serial.
Signed-off-by: Kenneth Jia <kenneth_jia@asus.com>
---
hw/arm/aspeed.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index 556498f2a0..d8cb2d1429 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -364,11 +364,11 @@ static void connect_serial_hds_to_uarts(AspeedMachineState *bmc)
int uart_chosen = bmc->uart_chosen ? bmc->uart_chosen : amc->uart_default;
aspeed_soc_uart_set_chr(s, uart_chosen, serial_hd(0));
- for (int i = 1, uart = sc->uarts_base; i < sc->uarts_num; i++, uart++) {
+ for (int i = 1, uart = sc->uarts_base; i < sc->uarts_num; uart++) {
if (uart == uart_chosen) {
continue;
}
- aspeed_soc_uart_set_chr(s, uart, serial_hd(i));
+ aspeed_soc_uart_set_chr(s, uart, serial_hd(i++));
}
}
--
2.34.1
[-- Attachment #2: Type: text/html, Size: 5507 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kenneth_jia--- via <qemu-devel@nongnu.org>
To: "'qemu-arm@nongnu.org'" <qemu-arm@nongnu.org>
Cc: "'Cédric Le Goater'" <clg@redhat.com>,
"'Philippe Mathieu-Daudé'" <philmd@linaro.org>,
"'Jamin Lin'" <jamin_lin@aspeedtech.com>,
"'Andrew Jeffery'" <andrew@codeconstruct.com.au>,
"'Gavin Shan'" <gshan@redhat.com>,
"'open list:All patches CC here'" <qemu-devel@nongnu.org>
Subject: [PATCH] hw/arm/aspeed: fix connect_serial_hds_to_uarts
Date: Thu, 12 Dec 2024 13:31:48 +0000 [thread overview]
Message-ID: <5f9b0c53f1644922ba85522046e92f4c@asus.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1232 bytes --]
From 24d3badbbb9dcc0d220609a7dd30f8da5002cba7 Mon Sep 17 00:00:00 2001
From: Kenneth Jia <kenneth_jia@asus.com>
Date: Thu, 12 Dec 2024 20:42:04 +0800
Subject: [PATCH] hw/arm/aspeed: fix connect_serial_hds_to_uarts
In the loop, we need ignore the index increase when uart == uart_chosen
We should increase the index only after we allocate a serial.
Signed-off-by: Kenneth Jia <kenneth_jia@asus.com>
---
hw/arm/aspeed.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index 556498f2a0..d8cb2d1429 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -364,11 +364,11 @@ static void connect_serial_hds_to_uarts(AspeedMachineState *bmc)
int uart_chosen = bmc->uart_chosen ? bmc->uart_chosen : amc->uart_default;
aspeed_soc_uart_set_chr(s, uart_chosen, serial_hd(0));
- for (int i = 1, uart = sc->uarts_base; i < sc->uarts_num; i++, uart++) {
+ for (int i = 1, uart = sc->uarts_base; i < sc->uarts_num; uart++) {
if (uart == uart_chosen) {
continue;
}
- aspeed_soc_uart_set_chr(s, uart, serial_hd(i));
+ aspeed_soc_uart_set_chr(s, uart, serial_hd(i++));
}
}
--
2.34.1
[-- Attachment #2: Type: text/html, Size: 5507 bytes --]
next reply other threads:[~2024-12-12 14:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-12 13:31 kenneth_jia--- via [this message]
2024-12-12 13:31 ` [PATCH] hw/arm/aspeed: fix connect_serial_hds_to_uarts kenneth_jia--- via
2024-12-13 7:19 ` Cédric Le Goater
2024-12-13 9:48 ` 答复: " kenneth_jia--- via
2024-12-13 9:56 ` Cédric Le Goater
2024-12-13 10:11 ` 答复: " kenneth_jia--- via
2024-12-13 10:11 ` kenneth_jia--- via
2024-12-13 10:47 ` Cédric Le Goater
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5f9b0c53f1644922ba85522046e92f4c@asus.com \
--to=qemu-arm@nongnu.org \
--cc=andrew@codeconstruct.com.au \
--cc=clg@redhat.com \
--cc=gshan@redhat.com \
--cc=jamin_lin@aspeedtech.com \
--cc=kenneth_jia@asus.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.