All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <felipe.balbi@nokia.com>
To: "ext hvaibhav@ti.com" <hvaibhav@ti.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"byron.bbradley@gmail.com" <byron.bbradley@gmail.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"Balbi Felipe (Nokia-MS/Helsinki)" <felipe.balbi@nokia.com>
Subject: Re: [PATCH-V2 1/3] RTC:s35390a: Add Alarm interrupt support
Date: Sat, 21 Aug 2010 17:05:41 +0300	[thread overview]
Message-ID: <20100821140541.GA31697@nokia.com> (raw)
In-Reply-To: <1282393829-7326-2-git-send-email-hvaibhav@ti.com>

Hi,

On Sat, Aug 21, 2010 at 02:30:27PM +0200, ext hvaibhav@ti.com wrote:
>+static irqreturn_t s35390a_irq_thread(int irq, void *handle)
>+{
>+	char buf[1];
>+	struct s35390a *s35390a = handle;
>+	struct i2c_client *client = s35390a->client[0];

don't you need some locking on the irq handler ? a mutex maybe ? Just 
wondering...

>@@ -261,15 +424,30 @@ static int s35390a_probe(struct i2c_client *client,
> 	if (s35390a_get_datetime(client, &tm) < 0)
> 		dev_warn(&client->dev, "clock needs to be set\n");
>
>+	if (client->irq >= 0) {
>+		err = request_threaded_irq(client->irq, NULL,
>+				s35390a_irq_thread,
>+				IRQF_TRIGGER_LOW | IRQF_ONESHOT,
>+				client->name, s35390a);
>+		if (err) {
>+			dev_err(&client->dev, "unable to request IRQ\n");
>+			goto exit_dummy;
>+		}
>+	}
>+
> 	s35390a->rtc = rtc_device_register(s35390a_driver.driver.name,
> 				&client->dev, &s35390a_rtc_ops, THIS_MODULE);
>
> 	if (IS_ERR(s35390a->rtc)) {
> 		err = PTR_ERR(s35390a->rtc);
>-		goto exit_dummy;
>+		goto exit_intr;
> 	}
>+
> 	return 0;
>
>+exit_intr:
>+	free_irq(client->irq, client);

free_irq() won't behave correctly, I believe since you're passing 
different dev_id parameters. If you look at the implementation of 
free_irq() you'll see it uses dev_id to find the correct struct 
irqaction pointer.

-- 
balbi

DefectiveByDesign.org

  reply	other threads:[~2010-08-21 14:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-21 12:30 [PATCH-V2 1/3] RTC:s35390a: Add Alarm interrupt support hvaibhav
2010-08-21 14:05 ` Felipe Balbi [this message]
2010-08-23  4:58   ` Hiremath, Vaibhav
2010-08-23  6:29     ` Felipe Balbi
2010-08-23 10:34       ` Hiremath, Vaibhav

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=20100821140541.GA31697@nokia.com \
    --to=felipe.balbi@nokia.com \
    --cc=akpm@linux-foundation.org \
    --cc=byron.bbradley@gmail.com \
    --cc=hvaibhav@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.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.