All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Chen Baozi <baozich@gmail.com>
Cc: xen-devel@lists.xen.org
Subject: Re: Problems after enabling rcv/xmit interrupts of ns16550 on OMAP5
Date: Wed, 17 Jul 2013 16:26:33 +0100	[thread overview]
Message-ID: <1374074793.26728.13.camel@kazak.uk.xensource.com> (raw)
In-Reply-To: <20130717135340.GA11426@cbz-workstation>

> > > "restoring CPSR" refers to the instruction "msr CPSR_c, <reg>" which
> > > is from "local_irq_restore". And "cpsie i" is from the call to
> > > local_irq_enable".
> > 
> > Ah right. So in both cases you will immediately take any pending
> > interrupt. I think I would continue instrumenting starting from
> > gic_interrupt() and hopefully eventually into the ns16550 interrupt
> > handler.
> > 
> 
> I went through gic_interrupt() and thought got the points cause the stuck.

Please can you clarify exactly what you mean by "stuck". Previously you
thought it was stuck in ns16550_setup_postirq when in actual fact it was
taking an interrupt. Are you sure that you are taking multiple,
potentially nested interrupts and eventually blowing the hypervisor
stack? This seems like the most likely scenario to me.

> If I change the while(...) in ns16550_interrupt() into if(...) and comment
> either "GICC[GICC_EOIR] = irq;" or "GICC[GICC_DIR] = irq;" in
> git_host_irq_end(), it won't get stuck after enabling receive and transmit
> interrupts in ns16550_setup_postirq().

By removing the writes to either EOIR or DIR you are in effect never
unmasking the interrupt, so you avoid the nest interrupt problem.

If this is the case then real issue is perhaps that for whatever reason
ns16550_interrupt is not causing the hardware to deassert its interrupt
line.

The UART on the sunxi is compatible (in DTS terms) with
"snps,dw-apb-uart", which seems to be an 8250 variant, but one which
differs enough to warrant its own compatibility string -- perhaps Xen's
ns16550 driver isn't dealing with some quirk of this device?

It seems like the driver in Linux is drivers/tty/serial/8250/8250_dw.c.
dw8250_handle_irq looks interesting...

        struct dw8250_data *d = p->private_data;
        unsigned int iir = p->serial_in(p, UART_IIR);

        if (serial8250_handle_irq(p, iir)) {
                return 1;
        } else if ((iir & UART_IIR_BUSY) == UART_IIR_BUSY) {
                /* Clear the USR and write the LCR again. */
                (void)p->serial_in(p, DW_UART_USR);
                p->serial_out(p, UART_LCR, d->last_lcr);

                return 1;
        }

        return 0;

In particular the fallback code there when the common 8250 handler
didn't deal with the issue...

Ian.

  reply	other threads:[~2013-07-17 15:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-11 10:53 Problems after enabling rcv/xmit interrupts of ns16550 on OMAP5 Chen Baozi
2013-07-11 11:21 ` Ian Campbell
2013-07-11 11:37   ` Chen Baozi
2013-07-11 12:44   ` Chen Baozi
2013-07-11 12:46     ` Ian Campbell
2013-07-11 12:54       ` Chen Baozi
2013-07-12  7:41   ` Chen Baozi
2013-07-17  8:02     ` Chen Baozi
2013-07-17  8:21       ` Ian Campbell
2013-07-17  9:01         ` Chen Baozi
2013-07-17  9:21           ` Ian Campbell
2013-07-17 13:53             ` Chen Baozi
2013-07-17 15:26               ` Ian Campbell [this message]
2013-07-17 16:05                 ` Chen Baozi
2013-07-18 11:53                   ` Ian Campbell
2013-07-18 12:44                     ` Chen Baozi
2013-07-19  8:25                       ` Chen Baozi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1374074793.26728.13.camel@kazak.uk.xensource.com \
    --to=ian.campbell@citrix.com \
    --cc=baozich@gmail.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.