[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Problems after enabling rcv/xmit interrupts of ns16550 on OMAP5



Hi Ian,

I think I've caught the point why your patch works while mine don't.

On Jul 11, 2013, at 7:21 PM, Ian Campbell <Ian.Campbell@xxxxxxxxxx> wrote:

> ...
>     char __iomem *remapped_io_base;  /* Remapped virtual address of MMIO. */
>     /* UART with IRQ line: interrupt-driven I/O. */
>     struct irqaction irqaction;
> @@ -56,6 +60,7 @@ static struct ns16550 {
>     u32 bar;
>     u16 cr;
>     u8 bar_idx;
> +    struct dt_irq dt_irq;

Here you added a new dt_irq struct component.

> } ns16550_com[2] = { { 0 } };
> ...
> +
> +    uart->baud      = BAUD_AUTO;//115200;
> +    uart->clock_hz  = UART_CLOCK_HZ;
> +    uart->data_bits = 8;
> +    uart->parity    = PARITY_NONE;
> +    uart->stop_bits = 1;
> +    //uart->irq       = defaults->irq;

And uart->irq is no longer initialized.

> ...
> +    res = dt_device_get_irq(dev, 0, &uart->dt_irq);
> +    if ( res )
> +    {
> +        early_printk("ns16550: Unable to retrieve the IRQ\n");
> +        return res;
> +    }
> +
> +    /* Register with generic serial driver. */
> +    serial_register_uart(uart - ns16550_com, &ns16550_driver, uart);
> ...

However, in ns16550_setup_postirq() and ns16550_init_postirq(), there are 
blocks like this:

    if ( uart->irq > 0 )
    {
        /* Master interrupt enable; also keep DTR/RTS asserted. */
        ns_write_reg(uart, MCR, MCR_OUT2 | MCR_OUT2 | MCR_DTR | MCR_RTS);

        /* Enabled receive and transmit interrupts
        ns_write_reg(hart, IER, IER_ERDAI | IER_ETHREI);
    }

and this:

    if ( uart->irq > 0 )
    {
        uart->irqaction.handler = ns16550_interrupt;
        uart->irqaction.name    = "ns16550";
        uart->irqaction.dev_id  = port;
        if ( (rc = setup_dt_irq(&uart->dt_irq, &uart->irqaction)) != 0)
            printk("ERROR: Failed to allocate ns16550 DT IRQ %d\n", hart->irq);
    }

This means you have neither registered the irq nor enabled the interrupts. If I 
turned both of these two blocks into:

    if ( uart->dt_irq.irq > )
    {
        ...
    }

There is the same phenomenon that I described in previous email. And If I 
comment either of these two blocks in my patch, my implementation works.

Any ideas?

Cheers,

Baozi





_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.