This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit d9f7c0bcfb03c289caf2aa68f25bf237e96fbe47
Author: husong1 <[email protected]>
AuthorDate: Wed Sep 24 11:16:27 2025 +0800

    drivers/can/ctucanfd: fix CAN startup on core1
    
    When the driver is brought up by an image that runs on another core than
    CPU0 (AMP), the interrupt of the card stays routed to CPU0 and the core
    that owns the device never receives it, so CAN does not start.  Route
    the interrupt to the CPU that initializes the device.
    
    Signed-off-by: husong1 <[email protected]>
    Signed-off-by: pangzhen1 <[email protected]>
---
 drivers/can/ctucanfd_pci.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/can/ctucanfd_pci.c b/drivers/can/ctucanfd_pci.c
index 303943fd2d8..bde1f0c002e 100644
--- a/drivers/can/ctucanfd_pci.c
+++ b/drivers/can/ctucanfd_pci.c
@@ -1740,11 +1740,17 @@ static int ctucanfd_interrupt(int irq, FAR void 
*context, FAR void *arg)
 
 static void ctucanfd_init(FAR struct ctucanfd_driver_s *priv)
 {
+  cpu_set_t cpuset;
+
   /* REVISIT: Only legacy IRQ supported in QEMU driver */
 
   priv->irq = pci_get_irq(priv->pcidev);
   irq_attach(priv->irq, ctucanfd_interrupt, priv);
 
+  CPU_ZERO(&cpuset);
+  CPU_SET(up_cpu_index(), &cpuset);
+  up_affinity_irq(priv->irq, cpuset);
+
   /* REVISIT: Enable card interrupts (not implemented in QEMU) */
 
   /* Enable interrupts */

Reply via email to