Linux MultiMedia Card development
 help / color / mirror / Atom feed
From: Daniel Kucera <linux-mmc@danman.eu>
To: Christian Loehle <christian.loehle@arm.com>
Cc: linux-mmc@vger.kernel.org, avri.altman@wdc.com, ulf.hansson@linaro.org
Subject: Re: [PATCH] mmc-utils: implemented CMD42 locking/unlocking
Date: Tue, 21 May 2024 09:45:42 +0200	[thread overview]
Message-ID: <6091a9d09371148462a901ed04a36f0b@danman.eu> (raw)
In-Reply-To: <48d2e9b2-d423-43fe-a28c-47db381ea999@arm.com>

On 2024-05-20 11:08, Christian Loehle wrote:
> On 5/19/24 08:08, linux-mmc@danman.eu wrote:
>> ------ Tessian Warning ------
>> 
>> Be careful, the email's sending domain "@danman[.]eu" has never been 
>> seen on your company's network before today
>> 
>> This warning message will be removed if you reply to or forward this 
>> email to a recipient outside of your organization.
>> 
>> ---- Tessian Warning End ----
>> 
>> From: Daniel Kucera <linux-mmc@danman.eu>
>> 
>> Implemented locking/unlocking using CMD42 according to Micron
>> Technical Note
>> 
>> original link 
>> https://media-www.micron.com/-/media/client/global/documents/products/technical-note/sd-cards/tnsd01_enable_sd_lock_unlock_in_linux.pdf?rev=03f03a6bc0f8435fafa93a8fc8e88988
>> currently available at 
>> https://github.com/danielkucera/esp32-sdcard/blob/master/tnsd01_enable_sd_lock_unlock_in_linux.pdf
> 
> You explained it nicely in v1 why this feature is indeed more
> dangerous than a simple erase:
> https://lore.kernel.org/linux-mmc/DM6PR04MB6575AC22506EDEBB7C7E9310FCE82@DM6PR04MB6575.namprd04.prod.outlook.com/T/#m4241fce85459336e2ca4d2abbcccf6d6227e9501
> 
> Locking a card will essentially brick it for all practical purposes if
> it is removed (or the system shuts down)
> between locking and unlocking until mmcblk supports initialization of
> locked cards.
> I'd upstream that first, I had a similar patch like you mentioned, but
> didn't get around to it.

I think this is a chicken-egg problem:
If you don't have the tools to lock you cannot test correct detection 
with kernel.
If you don't have kernel supporting locked cards you cannot unlock (but 
can lock).

Regarding the potential damage: what can cause a bigger damage? Loosing 
data or loosing the medium?

But anyway, I will prepare the kernel patch shortly.

D.

      reply	other threads:[~2024-05-21  7:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-19  7:08 [PATCH] mmc-utils: implemented CMD42 locking/unlocking linux-mmc
2024-05-19 14:54 ` Avri Altman
2024-05-25 14:44   ` Avri Altman
2024-05-20  9:08 ` Christian Loehle
2024-05-21  7:45   ` Daniel Kucera [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=6091a9d09371148462a901ed04a36f0b@danman.eu \
    --to=linux-mmc@danman.eu \
    --cc=avri.altman@wdc.com \
    --cc=christian.loehle@arm.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    /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