From: Chen Baozi <baozich@gmail.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: xen-devel@lists.xen.org
Subject: Re: Problems after enabling rcv/xmit interrupts of ns16550 on OMAP5
Date: Wed, 17 Jul 2013 21:53:40 +0800 [thread overview]
Message-ID: <20130717135340.GA11426@cbz-workstation> (raw)
In-Reply-To: <1374052912.4663.70.camel@kazak.uk.xensource.com>
On Wed, Jul 17, 2013 at 10:21:52AM +0100, Ian Campbell wrote:
> On Wed, 2013-07-17 at 17:01 +0800, Chen Baozi wrote:
> > On Jul 17, 2013, at 4:21 PM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> >
> > > On Wed, 2013-07-17 at 16:02 +0800, Chen Baozi wrote:
> > >> On Jul 12, 2013, at 3:41 PM, Chen Baozi <baozich@gmail.com> wrote:
> > >>
> > >>> 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?
> > >
> > > Sorry for not replying to this, the answer was going to be "no, but I'll
> > > see if I can reproduce" -- but I never got a chance.
> > >
> > >> I inserted some codes in ns16550_setup_postirq to see what would cause
> > >> the stuck. It seems that it will stuck while restoring CPSR or "cpsie
> > >> i". But I'm not sure that these two cases are the only factors that
> > >> will lead the phenomenons.
> > >
> > > Does it get stuck or does it just immediately take another interrupt?
> >
> > No idea. It seems the UART's receive interrupt works well, because pressing "d" in the serial console could trigger dumping registers as normal. I'm going into these possibilities and trying to make it sure.
> >
> > > (Could indicate a level vs. edge misconfiguration perhaps?)
> > >
> > > Is "restoring CPSR" this from arm32/entry.S:
> > > ENTRY(return_to_hypervisor)
> > > cpsid i
> > > ldr lr, [sp, #UREGS_lr]
> > > ldr r11, [sp, #UREGS_pc]
> > > msr ELR_hyp, r11
> > > ldr r11, [sp, #UREGS_cpsr]
> > > msr SPSR_hyp, r11
> > > pop {r0-r12}
> > > add sp, #(UREGS_SP_usr - UREGS_sp); /* SP, LR, SPSR, PC */
> > > eret
> > > or elsewhere? If it is this one does changing SPSR_hyp into SPSR_cxsf change anything?
> > >
> > > The "cpsie i" is from the call to local_irq_enable in gic_interrupt() or
> >
> > "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.
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().
Baozi
next prev parent reply other threads:[~2013-07-17 13:53 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 [this message]
2013-07-17 15:26 ` Ian Campbell
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=20130717135340.GA11426@cbz-workstation \
--to=baozich@gmail.com \
--cc=Ian.Campbell@citrix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).