From: Anderson Briglia <anderson.briglia@indt.org.br>
To: Anderson Briglia <anderson.briglia@indt.org.br>
Cc: Russell King <rmk+lkml@arm.linux.org.uk>,
ext David Brownell <david-b@PACBELL.NET>,
linux@arm.linux.org.uk,
"Lizardo Anderson (EXT-INdT/Manaus)"
<anderson.lizardo@indt.org.br>,
drzeus-list@drzeus.cx,
"Linux-omap-open-source@linux.omap.com"
<linux-omap-open-source@linux.omap.com>,
linux-kernel@vger.kernel.org
Subject: Re: [patch 3/5] Add MMC password protection (lock/unlock) support V3
Date: Wed, 11 Jan 2006 09:58:03 -0400 [thread overview]
Message-ID: <43C50EEB.9060501@indt.org.br> (raw)
In-Reply-To: <43C42B00.60206@indt.org.br>
Anderson Briglia wrote:
> Russell King wrote:
>
>
>>On Mon, Jan 09, 2006 at 06:16:02PM -0400, Anderson Briglia wrote:
>>
>>
>>
>>>+ dev = bus_find_device(&mmc_bus_type, NULL, NULL, mmc_match_lockable);
>>>+ if (!dev)
>>>+ goto error;
>>>+ card = dev_to_mmc_card(dev);
>>>+
>>>+ if (operation == KEY_OP_INSTANTIATE) { /* KEY_OP_INSTANTIATE */
>>>+ if (mmc_card_locked(card)) {
>>>+ ret = mmc_lock_unlock(card, key, MMC_LOCK_MODE_UNLOCK);
>>>+ mmc_remove_card(card);
>>>+ mmc_register_card(card);
>>>+ }
>>>+ else
>>>+ ret = mmc_lock_unlock(card, key, MMC_LOCK_MODE_SET_PWD);
>>>
>
>>Also, removing and re-registering a card is an offence. These
>>things are ref-counted, and mmc_remove_card() will drop the last
>>reference - so the memory associated with it will be freed. Then
>>you re-register it. Whoops.
>>
>>If you merely want to try to attach a driver, use device_attach()
>>instead.
>>
We changed the mmc_remove_card() and mmc_register_card() by device_release_driver() and
device_attach(), supposedly avoiding ref-counts issues.
Regards,
Anderson Briglia
INdT - Manaus
next prev parent reply other threads:[~2006-01-11 14:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-09 22:16 [patch 3/5] Add MMC password protection (lock/unlock) support V3 Anderson Briglia
2006-01-09 22:42 ` Russell King
2006-01-10 21:45 ` Anderson Briglia
2006-01-11 13:58 ` Anderson Briglia [this message]
2006-01-11 14:45 ` Russell King
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=43C50EEB.9060501@indt.org.br \
--to=anderson.briglia@indt.org.br \
--cc=anderson.lizardo@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=linux@arm.linux.org.uk \
--cc=rmk+lkml@arm.linux.org.uk \
/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).