Skip to content

Commit

Permalink
drivers/serial/uart_pci_16550.c: various fixes
Browse files Browse the repository at this point in the history
various fixes for uart_pci_16550 after testing with NuttX upstream:

- use pcierr() instead of nerr()
- fix type g_pci_u16550_qemu_x3 -> g_pci_u16550_qemu_x4
- move early irq attach from u16550_bind() to pci_u16550_initialize()
  otherwise up_enable_irq() can be called more than once, which triggers
  assertion in intel64 code

Signed-off-by: p-szafonimateusz <[email protected]>
  • Loading branch information
szafonimateusz-mi authored and anjiahao1 committed Oct 8, 2024
1 parent ecc5f04 commit eea807f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/serial/uart_pci_16550.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,14 @@ static int pci_u16550_initialize(FAR struct pci_u16550_priv_s *priv,

priv->common.irq = pci_get_irq(dev);

/* Attach interrupts early to prevent unexpected isr fault */

ret = irq_attach(priv->common.irq, priv->common.ops->isr, dev);
if (ret != OK)
{
pcierr("Failed to attach irq %d\n", ret);
}

return OK;
}

Expand Down

0 comments on commit eea807f

Please sign in to comment.