aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2023-10-03 12:30:40 +0100
committerMarc Zyngier <maz@kernel.org>2023-10-03 12:30:40 +0100
commitd4eeae1834a30db232cb536548ac430f44c7a0a2 (patch)
tree8bdf5920a39d7e93a67b0e380b5db5cc37c2397b
parent50603c0153e3d0a1c775030145e824fcad20ca29 (diff)
downloadcs-sw-d4eeae1834a30db232cb536548ac430f44c7a0a2.tar.gz
Move UART IRQ enable after USB init
We enable the UART interrupt super early, way before we can actually handle anything. That's no good. Move the enablement after the FUSB init, unless we deal with an serial upstream. Signed-off-by: Marc Zyngier <maz@kernel.org>
-rw-r--r--start.c3
-rw-r--r--vdmtool.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/start.c b/start.c
index 10c6692..8bcc75e 100644
--- a/start.c
+++ b/start.c
@@ -206,7 +206,6 @@ static void init_system(const struct hw_context *hw)
uart_set_hw_flow(hw->uart, false, false);
uart_set_fifo_enabled(hw->uart, true);
irq_set_exclusive_handler(hw->uart_irq, hw->uart_handler);
- irq_set_enabled(hw->uart_irq, true);
uart_set_irq_enables(hw->uart, true, false);
/* Interrupt when the RX FIFO is 3/4 full */
@@ -357,7 +356,9 @@ void set_upstream_ops(bool serial)
{
if (serial) {
upstream_ops = &serial1_upstream_ops;
+ irq_set_enabled(hw1.uart_irq, true);
} else {
+ irq_set_enabled(hw1.uart_irq, false);
upstream_ops = &usb_upstream_ops;
}
diff --git a/vdmtool.c b/vdmtool.c
index db415b9..a9d73bc 100644
--- a/vdmtool.c
+++ b/vdmtool.c
@@ -708,6 +708,8 @@ void m1_pd_bmc_fusb_setup(unsigned int port,
evt_disconnect(cxt);
debug_poke(cxt);
+
+ irq_set_enabled(hw->uart_irq, true);
}
static bool m1_pd_bmc_run_one(struct vdm_context *cxt)