public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>,
	Kevin Hilman <khilman@linaro.org>,
	Graeme Gregory <gg@slimlogic.co.uk>,
	linux-omap@vger.kernel.org,
	Ruslan Bilovol <ruslan.bilovol@ti.com>,
	linux-kernel@vger.kernel.org,
	Naga Venkata Srikanth V <vnv.srikanth@samsung.com>,
	Oleg_Kosheliev <oleg.kosheliev@ti.com>
Subject: Re: [PATCH 1/4] mfd: twl6030-irq: migrate to IRQ threaded handler
Date: Wed, 24 Jul 2013 13:50:11 +0100	[thread overview]
Message-ID: <20130724125011.GM26801@laptop> (raw)
In-Reply-To: <51EFC072.9070702@ti.com>

> >>+	if (ret) {
> >>+		pr_warn("%s: I2C error %d reading PIH ISR\n", __func__, ret);
> >
> >Does the user really care which function we're returning from.
> >
> >Would it be better if you replace '__func__' with the device name?
> 
> This module hasn't been converted to the device yet:(
> (I mean "interrupt-controller").
> But I'm thinking about it as the next step :) and then It will be
> absolutely reasonable change to replace pr_*() with dev_*() and
> remove __func__.

I don't mean anything as compicated as that for 'this' patch. (NB: See my
comment in subsequent patches about creating a 'struct twl6030' where
you could store 'struct dev'.) In this patch I mean litterally
replacing "%s: ", with "tw16030_irq: ". Simples. :)

> Now, the pointer on "dev" (in our case "twl-core" device) isn't passed
> in IRQ handler, so It can't be used here.
> 
> Of course it can be done, but would it make code better?
> My opinion - no.

> >>+	if (sts.bytes[2] & 0x10)
> >>+		sts.bytes[2] |= 0x08;
> >>
> >>-		for (i = 0; sts.int_sts; sts.int_sts >>= 1, i++) {
> >>-			local_irq_disable();
> >>-			if (sts.int_sts & 0x1) {
> >>-				int module_irq = twl6030_irq_base +
> >>+	for (i = 0; sts.int_sts; sts.int_sts >>= 1, i++)
> >>+		if (sts.int_sts & 0x1) {
> >
> >I'm a little confused by this. Where does sts.int_sts come from?
> 
> See my comment above, pls

Okay, that's my fault for not understanding unions properly as I've
never had to use one, but now I do, thanks.

> >>@@ -437,10 +386,13 @@ int twl6030_exit_irq(void)
> >>  {
> >>  	unregister_pm_notifier(&twl6030_irq_pm_notifier_block);
> >>
> >>-	if (twl6030_irq_base) {
> >>+	if (!twl6030_irq_base) {
> >>  		pr_err("twl6030: can't yet clean up IRQs?\n");
> >>  		return -ENOSYS;
> >>  	}
> >>+
> >>+	free_irq(twl_irq, NULL);
> >>+
> >
> >If request_threaded_irq() fails, isn't there a chance that
> >twl6030_irq_base will be allocated, but twl_irq will still be
> >undefined?
> 
> Yes. A mess is here (historically:), thanks. Will use twl_irq
> instead of twl6030_irq_base (I did it, actually, in patch [3]:).

Yes, I saw it. It would be better if you still fixed up this patch to
be correct though. Even if you break it out and add it as [PATCH 1/x].

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2013-07-24 12:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-23 16:07 [PATCH 0/4] mfd: twl6030-irq: rework and add twl6032 support Grygorii Strashko
2013-07-23 16:07 ` [PATCH 1/4] mfd: twl6030-irq: migrate to IRQ threaded handler Grygorii Strashko
2013-07-24 10:49   ` Lee Jones
2013-07-24 11:54     ` Grygorii Strashko
2013-07-24 12:50       ` Lee Jones [this message]
2013-07-24 13:17         ` Grygorii Strashko
2013-07-24 11:54   ` Lee Jones
2013-07-23 16:07 ` [PATCH 2/4] mfd: twl6030-irq: add error check when IRQs are masked initially Grygorii Strashko
2013-07-23 18:08   ` Graeme Gregory
2013-07-24 11:51     ` Grygorii Strashko
2013-07-23 16:07 ` [PATCH 3/4] mfd: twl6030-irq: convert to use linear irq_domain Grygorii Strashko
2013-07-24 11:35   ` Lee Jones
2013-07-24 13:37     ` Grygorii Strashko
2013-07-23 16:07 ` [PATCH 4/4] mfd: twl6030-irq: Add interrupt mapping table for the twl6032 Grygorii Strashko
2013-07-24 11:52   ` Lee Jones
2013-07-24 13:39     ` Grygorii Strashko

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=20130724125011.GM26801@laptop \
    --to=lee.jones@linaro.org \
    --cc=gg@slimlogic.co.uk \
    --cc=grygorii.strashko@ti.com \
    --cc=khilman@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=oleg.kosheliev@ti.com \
    --cc=ruslan.bilovol@ti.com \
    --cc=sameo@linux.intel.com \
    --cc=vnv.srikanth@samsung.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