From: Andrew Morton <akpm@linux-foundation.org>
To: Adrian Hunter <adrian.hunter@nokia.com>
Cc: Tony Lindgren <tony@atomide.com>,
Madhusudhan Chikkature <madhu.cr@ti.com>,
Venkatraman S <svenkatr@ti.com>,
linux-mmc Mailing List <linux-mmc@vger.kernel.org>,
linux-omap Mailing List <linux-omap@vger.kernel.org>
Subject: Re: [PATCH] omap_hsmmc: improve interrupt synchronisation
Date: Wed, 12 May 2010 12:52:13 -0700 [thread overview]
Message-ID: <20100512125213.36631d2d.akpm@linux-foundation.org> (raw)
In-Reply-To: <4BEA5DD5.9010308@nokia.com>
On Wed, 12 May 2010 10:50:45 +0300
Adrian Hunter <adrian.hunter@nokia.com> wrote:
> >From ad2e1cd024ccf9144b6620cfe808893719db738f Mon Sep 17 00:00:00 2001
> From: Adrian Hunter <adrian.hunter@nokia.com>
> Date: Wed, 14 Apr 2010 16:26:45 +0300
> Subject: [PATCH] omap_hsmmc: improve interrupt synchronisation
>
> The following changes were needed:
> - do not use in_interrupt() because it will not work
> with threaded interrupts
>
> In addition, the following improvements were made:
> - ensure DMA is unmapped only after the final DMA interrupt
> - ensure a request is completed only after the final DMA interrupt
> - disable controller interrupts when a request is not in progress
> - remove the spin-lock protecting the start of a new request from
> an unexpected interrupt because the locking was complicated and
> a 'req_in_progress' flag suffices (since the spin-lock only defers
> the unexpected interrupts anyway)
> - instead use the spin-lock to protect the MMC interrupt handler
> from the DMA interrupt handler
> - remove the semaphore preventing DMA from being started while
> the previous DMA is still in progress - the other changes make that
> impossible, so it is now a BUG_ON condition
> - ensure the controller interrupt status is clear before exiting
> the interrrupt handler
>
> In general, these changes make the code safer but do not fix any specific
> bugs so backporting is not necessary.
>
>
> ...
>
> +static void omap_hsmmc_request_done(struct omap_hsmmc_host *host, struct mmc_request *mrq)
> +{
> + int dma_ch;
> +
> + spin_lock(&host->irq_lock);
> + host->req_in_progress = 0;
> + dma_ch = host->dma_ch;
> + spin_unlock(&host->irq_lock);
> +
> + omap_hsmmc_disable_irq(host);
> + /* Do not complete the request if DMA is still in progress */
> + if (mrq->data && host->use_dma && dma_ch != -1)
> + return;
> + host->mrq = NULL;
> + mmc_request_done(host->mmc, mrq);
> +}
Are we sure that irq_lock doesn't need to be taken in an irq-safe fashion?
send_init_stream() doesn't report an error if its busywait times out.
next prev parent reply other threads:[~2010-05-12 19:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-12 7:50 [PATCH] omap_hsmmc: improve interrupt synchronisation Adrian Hunter
2010-05-12 19:52 ` Andrew Morton [this message]
2010-05-14 7:13 ` Adrian Hunter
-- strict thread matches above, loose matches on Subject: below --
2010-04-20 11:16 Adrian Hunter
2010-04-21 12:18 ` Venkatraman S
2010-04-21 13:21 ` Adrian Hunter
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=20100512125213.36631d2d.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=adrian.hunter@nokia.com \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=madhu.cr@ti.com \
--cc=svenkatr@ti.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 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).