summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '0055-ns16550-correct-name-value-pair-parsing-for-PCI-port.patch')
-rw-r--r--0055-ns16550-correct-name-value-pair-parsing-for-PCI-port.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/0055-ns16550-correct-name-value-pair-parsing-for-PCI-port.patch b/0055-ns16550-correct-name-value-pair-parsing-for-PCI-port.patch
new file mode 100644
index 0000000..9c05f3a
--- /dev/null
+++ b/0055-ns16550-correct-name-value-pair-parsing-for-PCI-port.patch
@@ -0,0 +1,59 @@
+From 06264af090ac69a95cdadbc261cc82d964dcb568 Mon Sep 17 00:00:00 2001
+From: Jan Beulich <jbeulich@suse.com>
+Date: Fri, 31 Mar 2023 08:42:02 +0200
+Subject: [PATCH 55/61] ns16550: correct name/value pair parsing for PCI
+ port/bridge
+
+First of all these were inverted: "bridge=" caused the port coordinates
+to be established, while "port=" controlled the bridge coordinates. And
+then the error messages being identical also wasn't helpful. While
+correcting this also move both case blocks close together.
+
+Fixes: 97fd49a7e074 ("ns16550: add support for UART parameters to be specifed with name-value pairs")
+Signed-off-by: Jan Beulich <jbeulich@suse.com>
+Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
+master commit: e692b22230b411d762ac9e278a398e28df474eae
+master date: 2023-03-29 14:55:37 +0200
+---
+ xen/drivers/char/ns16550.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
+index 5dd4d723f5..3651e0c0d4 100644
+--- a/xen/drivers/char/ns16550.c
++++ b/xen/drivers/char/ns16550.c
+@@ -1536,13 +1536,6 @@ static bool __init parse_namevalue_pairs(char *str, struct ns16550 *uart)
+ break;
+
+ #ifdef CONFIG_HAS_PCI
+- case bridge_bdf:
+- if ( !parse_pci(param_value, NULL, &uart->ps_bdf[0],
+- &uart->ps_bdf[1], &uart->ps_bdf[2]) )
+- PARSE_ERR_RET("Bad port PCI coordinates\n");
+- uart->ps_bdf_enable = true;
+- break;
+-
+ case device:
+ if ( strncmp(param_value, "pci", 3) == 0 )
+ {
+@@ -1557,9 +1550,16 @@ static bool __init parse_namevalue_pairs(char *str, struct ns16550 *uart)
+ break;
+
+ case port_bdf:
++ if ( !parse_pci(param_value, NULL, &uart->ps_bdf[0],
++ &uart->ps_bdf[1], &uart->ps_bdf[2]) )
++ PARSE_ERR_RET("Bad port PCI coordinates\n");
++ uart->ps_bdf_enable = true;
++ break;
++
++ case bridge_bdf:
+ if ( !parse_pci(param_value, NULL, &uart->pb_bdf[0],
+ &uart->pb_bdf[1], &uart->pb_bdf[2]) )
+- PARSE_ERR_RET("Bad port PCI coordinates\n");
++ PARSE_ERR_RET("Bad bridge PCI coordinates\n");
+ uart->pb_bdf_enable = true;
+ break;
+ #endif
+--
+2.40.0
+