From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Anderson Briglia <anderson.briglia@indt.org.br>
Cc: "Linux-omap-open-source@linux.omap.com"
<linux-omap-open-source@linux.omap.com>,
linux-kernel@vger.kernel.org,
Pierre Ossman <drzeus-list@drzeus.cx>,
ext David Brownell <david-b@pacbell.net>,
Tony Lindgren <tony@atomide.com>,
"Aguiar Carlos (EXT-INdT/Manaus)" <carlos.aguiar@indt.org.br>,
"Biris Ilias (EXT-INdT/Manaus)" <Ilias.Biris@indt.org.br>
Subject: Re: [patch 5/6] [RFC] Add MMC Password Protection (lock/unlock) support V6
Date: Fri, 17 Nov 2006 16:13:14 +0000 [thread overview]
Message-ID: <20061117161314.GF28514@flint.arm.linux.org.uk> (raw)
In-Reply-To: <455DB547.5060407@indt.org.br>
On Fri, Nov 17, 2006 at 09:12:39AM -0400, Anderson Briglia wrote:
> + if (mmc_card_locked(card) && !strncmp(data, "erase", 5)) {
> + /* forced erase only works while card is locked */
> + spin_lock(&mmc_lock);
> + mmc_lock_unlock(card, NULL, MMC_LOCK_MODE_ERASE);
> + spin_unlock(&mmc_lock);
mmc_lock_unlock can sleep; holding a spinlock while sleeping is illegal
and is a serious bug. Inappropriate locking? What's this lock trying
to achieve?
I don't see any requirement for locking here - mmc_lock_unlock() claims
the host, and if that succeeds, it has exclusive access via that host to
the card. No one else will be able to talk on the bus until
mmc_lock_unlock() releases it's claim on the host. So I suspect that
whatever locking you require is already in place.
Ditto for each other instances.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
prev parent reply other threads:[~2006-11-17 16:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-17 13:12 [patch 5/6] [RFC] Add MMC Password Protection (lock/unlock) support V6 Anderson Briglia
2006-11-17 16:13 ` Russell King [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=20061117161314.GF28514@flint.arm.linux.org.uk \
--to=rmk+lkml@arm.linux.org.uk \
--cc=Ilias.Biris@indt.org.br \
--cc=anderson.briglia@indt.org.br \
--cc=carlos.aguiar@indt.org.br \
--cc=david-b@pacbell.net \
--cc=drzeus-list@drzeus.cx \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap-open-source@linux.omap.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