mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Walleij <linus.ml.walleij@gmail.com>
To: "Sosnowski, Maciej" <maciej.sosnowski@intel.com>
Cc: Linus Walleij <linus.walleij@stericsson.com>,
	"Williams, Dan J" <dan.j.williams@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] Add COH 901 318 DMA block driver
Date: Fri, 9 Oct 2009 11:10:16 +0200	[thread overview]
Message-ID: <63386a3d0910090210u19e20035l9e88bfc806022f4@mail.gmail.com> (raw)
In-Reply-To: <129600E5E5FB004392DDC3FB599660D7B78C93C0@irsmsx504.ger.corp.intel.com>

Then a quick comment in addition to the COH 901 318 v2...

2009/9/30 Sosnowski, Maciej <maciej.sosnowski@intel.com>:

>> +     coh901318_stop(chan);
>> +
>> +     spin_lock_irqsave(&cohc->lock, flags);
>> +
>> +     /* Clear any pending BE or TC interrupt */
>> +     if (cohc->id < 32) {
>> +             writel(1 << cohc->id, virtbase + COH901318_BE_INT_CLEAR1);
>> +             writel(1 << cohc->id, virtbase + COH901318_TC_INT_CLEAR1);
>> +     } else {
>> +             writel(1 << (cohc->id - 32), virtbase +
>> +                    COH901318_BE_INT_CLEAR2);
>> +             writel(1 << (cohc->id - 32), virtbase +
>> +                    COH901318_TC_INT_CLEAR2);
>> +     }
>> +
>> +     enable_powersave(cohc);
>
> enable_powersave() has been called in coh901318_stop() already

Yes, however an IRQ can come in between coh901318_stop() and
spin_lock_irqsave(), disabling powersave. So to avoid a possible race,
we enable it again. We cannot move coh901318_stop() after the spinlock
either, because the coh901318_stop() use the same spinlock, and then it
deadlocks. And I cannot require the lock to be held while calling
coh901318_stop() because it is an exported symbol.

Linus Walleij

      reply	other threads:[~2009-10-09  9:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-22 14:38 Linus Walleij
2009-09-22 15:33 ` Daniel Walker
2009-09-30  9:37 ` Linus Walleij
2009-09-30  9:52   ` Sosnowski, Maciej
2009-09-30 15:33   ` Dan Williams
2009-10-08 12:14     ` Linus Walleij
2009-09-30 15:38 ` Sosnowski, Maciej
2009-10-09  9:10   ` Linus Walleij [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=63386a3d0910090210u19e20035l9e88bfc806022f4@mail.gmail.com \
    --to=linus.ml.walleij@gmail.com \
    --cc=dan.j.williams@intel.com \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.sosnowski@intel.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

all inboxes | Powered by JetHome®