All of lore.kernel.org
 help / color / mirror / Atom feed
From: Omar Ramirez Luna <omar.ramirez@ti.com>
To: Hari Kanigeri <h-kanigeri2@ti.com>
Cc: Hiroshi Doyu <Hiroshi.DOYU@nokia.com>,
	linux omap <linux-omap@vger.kernel.org>,
	Tony Lindgren <tony@atomide.com>,
	Ohad Ben-Cohen <ohad@wizery.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	"Guzman Lugo, Fernando" <fernando.lugo@ti.com>
Subject: Re: [PATCH 6/7] omap:mailbox-add notification support for multiple readers
Date: Thu, 28 Oct 2010 15:57:41 -0500	[thread overview]
Message-ID: <4CC9E3C5.7000208@ti.com> (raw)
In-Reply-To: <1287108808-32119-7-git-send-email-h-kanigeri2@ti.com>

Hi,

On 10/14/2010 9:13 PM, Hari Kanigeri wrote:
> @@ -252,41 +253,39 @@ static int omap_mbox_startup(struct omap_mbox *mbox)
...
> +	if (!mbox->use_count++) {
> +		ret = request_irq(mbox->irq, mbox_interrupt, IRQF_SHARED,
> +					mbox->name, mbox);
...
> @@ -296,29 +295,36 @@ fail_alloc_txq:
...
>   static void omap_mbox_fini(struct omap_mbox *mbox)
>   {
> +	if (!--mbox->use_count) {
> +		tasklet_kill(&mbox->txq->tasklet);
> +		flush_work(&mbox->rxq->work);
> +		mbox_queue_free(mbox->txq);
> +		mbox_queue_free(mbox->rxq);
> +	}
> +
> +	if (likely(mbox->ops->shutdown)) {
> +		if (!--mbox_configured) {
> +			free_irq(mbox->irq, mbox);

Above hunks will create an imbalance of free_irq, as request_irq can be 
called per registered mailbox and free_irq is only done for the last 
caller releasing the mailbox handle.

e.g.: mbox-1, mbox-N will request a shared irq on the same interrupt 
line, but only the last caller of omap_mbox_put will free its irq, 
leaving the other one there.

This can be fixed if the free is moved to be executed within the 
following block:

	if (!--mbox->use_count) {
		...
		free_irq(mbox->irq, mbox);
	}

Regards,

Omar

WARNING: multiple messages have this Message-ID (diff)
From: omar.ramirez@ti.com (Omar Ramirez Luna)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 6/7] omap:mailbox-add notification support for multiple readers
Date: Thu, 28 Oct 2010 15:57:41 -0500	[thread overview]
Message-ID: <4CC9E3C5.7000208@ti.com> (raw)
In-Reply-To: <1287108808-32119-7-git-send-email-h-kanigeri2@ti.com>

Hi,

On 10/14/2010 9:13 PM, Hari Kanigeri wrote:
> @@ -252,41 +253,39 @@ static int omap_mbox_startup(struct omap_mbox *mbox)
...
> +	if (!mbox->use_count++) {
> +		ret = request_irq(mbox->irq, mbox_interrupt, IRQF_SHARED,
> +					mbox->name, mbox);
...
> @@ -296,29 +295,36 @@ fail_alloc_txq:
...
>   static void omap_mbox_fini(struct omap_mbox *mbox)
>   {
> +	if (!--mbox->use_count) {
> +		tasklet_kill(&mbox->txq->tasklet);
> +		flush_work(&mbox->rxq->work);
> +		mbox_queue_free(mbox->txq);
> +		mbox_queue_free(mbox->rxq);
> +	}
> +
> +	if (likely(mbox->ops->shutdown)) {
> +		if (!--mbox_configured) {
> +			free_irq(mbox->irq, mbox);

Above hunks will create an imbalance of free_irq, as request_irq can be 
called per registered mailbox and free_irq is only done for the last 
caller releasing the mailbox handle.

e.g.: mbox-1, mbox-N will request a shared irq on the same interrupt 
line, but only the last caller of omap_mbox_put will free its irq, 
leaving the other one there.

This can be fixed if the free is moved to be executed within the 
following block:

	if (!--mbox->use_count) {
		...
		free_irq(mbox->irq, mbox);
	}

Regards,

Omar

  reply	other threads:[~2010-10-28 20:57 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-15  2:13 [PATCH 0/7] omap:mailbox-enhancements and fixes Hari Kanigeri
2010-10-15  2:13 ` Hari Kanigeri
2010-10-15  2:13 ` [PATCH 1/7] mailbox: change full flag per mailbox queue instead of global Hari Kanigeri
2010-10-15  2:13   ` Hari Kanigeri
2010-10-15  2:13 ` [PATCH 2/7] omap:mailbox: fix rx interrupt disable in omap4 Hari Kanigeri
2010-10-15  2:13   ` Hari Kanigeri
2010-10-15  2:13 ` [PATCH 3/7] omap:mailbox-fix checkpatch warnings Hari Kanigeri
2010-10-15  2:13   ` Hari Kanigeri
2010-10-15  2:13 ` [PATCH 4/7] omap:mailbox-send message in process context Hari Kanigeri
2010-10-15  2:13   ` Hari Kanigeri
2010-10-21 19:03   ` Sapiens, Rene
2010-10-21 19:03     ` Sapiens, Rene
2010-10-21 20:49     ` Hari Kanigeri
2010-10-21 20:49       ` Hari Kanigeri
2010-10-21 22:30       ` Sapiens, Rene
2010-10-21 22:30         ` Sapiens, Rene
2010-10-15  2:13 ` [PATCH 5/7] omap:mailbox-resolve multiple receiver problem Hari Kanigeri
2010-10-15  2:13   ` Hari Kanigeri
2010-10-28 22:18   ` Omar Ramirez Luna
2010-10-28 22:18     ` Omar Ramirez Luna
2010-10-29 12:10     ` Hari Kanigeri
2010-10-29 12:10       ` Hari Kanigeri
2010-10-15  2:13 ` [PATCH 6/7] omap:mailbox-add notification support for multiple readers Hari Kanigeri
2010-10-15  2:13   ` Hari Kanigeri
2010-10-28 20:57   ` Omar Ramirez Luna [this message]
2010-10-28 20:57     ` Omar Ramirez Luna
2010-10-29 12:05     ` Hari Kanigeri
2010-10-29 12:05       ` Hari Kanigeri
2010-10-15  2:13 ` [PATCH 7/7] omap:clocks44x-add dummy clock for mailbox Hari Kanigeri
2010-10-15  2:13   ` Hari Kanigeri
  -- strict thread matches above, loose matches on Subject: below --
2010-10-15  1:13 [PATCH 0/7] omap:mailbox-enhancements and fixes Hari Kanigeri
2010-10-15  1:13 ` [PATCH 6/7] omap:mailbox-add notification support for multiple readers Hari Kanigeri
2010-10-14  1:33 [PATCH 0/7] omap:mailbox-enhancments and fixes Hari Kanigeri
2010-10-14  1:33 ` [PATCH 6/7] omap:mailbox-add notification support for multiple readers Hari Kanigeri

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=4CC9E3C5.7000208@ti.com \
    --to=omar.ramirez@ti.com \
    --cc=Hiroshi.DOYU@nokia.com \
    --cc=fernando.lugo@ti.com \
    --cc=h-kanigeri2@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=ohad@wizery.com \
    --cc=tony@atomide.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 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.