From: Florian Fainelli <f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Ray Jui <rjui-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
Kamal Dasu <kdasu.kdev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org
Cc: f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
gregory.0xf0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
jchandra-dY08KVG/lbpWk0Htik3J/w@public.gmane.org,
rajeevkumar.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w@public.gmane.org
Subject: Re: [V3, 1/2] i2c: brcmstb: Add Broadcom settop SoC i2c controller driver
Date: Fri, 15 May 2015 10:59:35 -0700 [thread overview]
Message-ID: <55563407.9070409@gmail.com> (raw)
In-Reply-To: <555630DE.2090100-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
On 15/05/15 10:46, Ray Jui wrote:
[snip]
>> + ret = -ETIMEDOUT;
>> + } else {
>> + /* we are in polling mode */
>> + u32 bsc_intrp;
>> + unsigned long time_left = jiffies + timeout;
>> +
>> + do {
>> + bsc_intrp = bsc_readl(dev, iic_enable) &
>> + BSC_IIC_EN_INTRP_MASK;
>> + if (time_after(jiffies, time_left)) {
>> + ret = -ETIMEDOUT;
>> + break;
>> + }
>> + cpu_relax();
>> + } while (!bsc_intrp);
>> + brcmstb_i2c_enable_disable_irq(dev, INT_DISABLE);
>
> I had a question on this during the previous review. You said you will
> investigate but never really answer my question or add a comment in the
> code to explain it. My question was, why do you need to disable
> interrupt in the end of the polling loop? Do you use interrupt at all in
> polling mode? If so, why?
I suspect this may have to do with the special Level 2 interrupt
controller (drivers/irqchip/irq-bcm7120-l2.c) used between the Level 1
interrupt signaled to the CPU (<irq-bcm7038-l1.c or ARM GIC) and the
interrupt generation on the BSC controller side.
The L2 interrupt controller only signals interrupts, but the actual
acknowledgement of the interrupt needs to happen at the BSC controller
level, if we do not do that, I suspect the controller keep ssignaling a
pending interrupt, so we would need to clear it to move forward with
next events.
--
Florian
next prev parent reply other threads:[~2015-05-15 17:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-13 16:59 [V3, 1/2] i2c: brcmstb: Add Broadcom settop SoC i2c controller driver Kamal Dasu
[not found] ` <1431536390-9761-1-git-send-email-kdasu.kdev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-05-13 16:59 ` [V3, 2/2] dt-bindings: i2c: Add i2c-brcmstb dt bindings Kamal Dasu
2015-05-15 17:46 ` [V3, 1/2] i2c: brcmstb: Add Broadcom settop SoC i2c controller driver Ray Jui
[not found] ` <555630DE.2090100-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2015-05-15 17:59 ` Florian Fainelli [this message]
[not found] ` <55563407.9070409-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-05-19 16:25 ` Kamal Dasu
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=55563407.9070409@gmail.com \
--to=f.fainelli-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=gregory.0xf0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=jchandra-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=kdasu.kdev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=rajeevkumar.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=rjui-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.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).