From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Par-Gunnar Hjalmdahl <pghatwork@gmail.com>
Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org,
linus.walleij@stericsson.com, Pavan Savoy <pavan_savoy@sify.com>
Subject: Re: [PATCH 1/6] This patch adds support for the ST-Ericsson CG2900
Date: Mon, 27 Sep 2010 08:15:50 -0700 [thread overview]
Message-ID: <20100927151550.GC13754@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <AANLkTin=PPfgnD5tKBPR1QXf2OeBKBH-kXtoT+s-KPhk@mail.gmail.com>
On Mon, Sep 27, 2010 at 10:16:11AM +0200, Par-Gunnar Hjalmdahl wrote:
> 2010/9/24 Mark Brown <broonie@opensource.wolfsonmicro.com>:
> > On Fri, Sep 24, 2010 at 03:46:44PM +0200, Par-Gunnar Hjalmdahl wrote:
> >> +static irqreturn_t cg2900_devices_interrupt(int irq, void *dev_id)
> >> +{
> >> + disable_irq_nosync(irq);
> >> + if (cg2900_dev_callback && cg2900_dev_callback->interrupt_cb)
> >> + cg2900_dev_callback->interrupt_cb();
> >> +
> >> + return IRQ_HANDLED;
> >> +}
> > Why is there this callback mechanism - I'd expect the users of this code
> > to just be using the standard IRQ infrastructure?
> This is our local IRQ which is handled in cg2900_uart.c by creating a work:
I can tell it's an IRQ - that's my point; the kernel has an interrupt
handling subsystem which this isn't using.
> I understand your concern that client implementing the
> cg2900_dev_callback->interrupt_cb();
> might not know realized that this is irq context which might cause problems.
No, you're misunderstanding my point. The kernel has facilities for
representing interrupt controllers which this is not using.
> If not then suggest what is expected way of handling it ? eg. moving
> workqueue down to cg2900_devices
> or other solution?
Use the standard kernel IRQ framework to report interrupts to the
clients - there's quite a few examples of using this in the drivers/mfd
code. This will make your code more idiomatic and give you access to
all the diagnostic infrastructure the kernel provides for interrupts.
prev parent reply other threads:[~2010-09-27 15:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-24 13:46 [PATCH 1/6] This patch adds support for the ST-Ericsson CG2900 Par-Gunnar Hjalmdahl
2010-09-24 14:10 ` Mark Brown
2010-09-24 14:44 ` Par-Gunnar Hjalmdahl
2010-09-27 8:16 ` Par-Gunnar Hjalmdahl
2010-09-27 15:15 ` Mark Brown [this message]
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=20100927151550.GC13754@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=linus.walleij@stericsson.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pavan_savoy@sify.com \
--cc=pghatwork@gmail.com \
/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).