From: Chen Baozi Subject: Re: Problems after enabling rcv/xmit interrupts of ns16550 on OMAP5 Date: Fri, 12 Jul 2013 15:41:42 +0800 Message-ID: References: <20130711105335.GA8938@cbz-workstation> <1373541663.5453.168.camel@hastur.hellion.org.uk> Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1373541663.5453.168.camel@hastur.hellion.org.uk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org 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 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