mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Renaud Barbier <Renaud.Barbier@ametek.com>,
	Barebox List <barebox@lists.infradead.org>
Subject: Re: nvme sanitize command
Date: Mon, 13 Jan 2025 16:36:02 +0100	[thread overview]
Message-ID: <54710d9d-59b7-4e75-a07a-a4f8eb0537a2@pengutronix.de> (raw)
In-Reply-To: <DM5PR07MB353242B3BFE08BF509D9E78FEC1F2@DM5PR07MB3532.namprd07.prod.outlook.com>

Hello Renaud,

On 13.01.25 16:04, Renaud Barbier wrote:
>> On 13.01.25 15:03, Renaud Barbier wrote:
>> So this is a single command that erases the whole device, but doesn't take
>> block offsets/length as arguments? Do you know what value the erased data
>> can have afterwards?
> 
> Indeed. No block offset/length as far as I can see from libnvme and nvme-cli Linux commands
> 
> I have added the erase entry point and ran the sanitize block erase command. This wiped out the whole device 
> barebox@LS1046A RDB Board:/ md -s /dev/nvme0n1
> 00000000: 00000000 00000000 00000000 00000000                ................
> 00000010: 00000000 00000000 00000000 00000000                ................
> 00000020: 00000000 00000000 00000000 00000000                ................
> 00000030: 00000000 00000000 00000000 00000000                ................
> 00000040: 00000000 00000000 00000000 00000000                ................
> 00000050: 00000000 00000000 00000000 00000000                ................
> ...
> 
> Whatever the offset I give, I get 0.

Nice, assuming that's guaranteed by the standard, we don't need
to add a new ERASE_TO_DISCARD or similar yet.

>> Isn't this what you want? Erase the whole device at once?
> Yes. My number one goal is reached.
> There maybe a requirement for pattern writing with several passes later.

For that, ioctl is the way to go IMO as described in my last mail.

>>> Unless a way can be added to set features for sanitize.
>>> At present, erase is all I need so I will add the erase entry point with the
>> sanitisation action being NVME_SANITIZE_SANACT_START_BLOCK_ERASE as
>> default.
>>
>> How about you implement erase in nvme, but check that size arguments
>> indeed describe the whole device: If it does, you do your sanitize operation
>> and if it doesn't, return -ENOSYS.
>>
>> Would that work for you?
> 
> Perfect. Thanks.

Cool. Send patches. :-)

Cheers,
Ahmad

>>
>> Cheers,
>> Ahmad
>>
>>
>>>
>>>
>>
>>
>> --
>> Pengutronix e.K.                           |                             |
>> Steuerwalder Str. 21                       |
>> https://urldefense.com/v3/__http://www.pengutronix.de/__;!!HKOSU0g!AUi
>> 6RmEZIZYR-
>> U1OlElGWJEdi0g1ZCeRGBk5zYyXFu6ifUk_2PdDAdTfmpe_cMMuA4dN5J9hJ3
>> bQtQzKggqYiqQvkqc$   |
>> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
>> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



      reply	other threads:[~2025-01-13 16:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-13 10:57 Renaud Barbier
2025-01-13 11:18 ` Ahmad Fatoum
2025-01-13 14:03   ` Renaud Barbier
2025-01-13 14:36     ` Ahmad Fatoum
2025-01-13 15:04       ` Renaud Barbier
2025-01-13 15:36         ` Ahmad Fatoum [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=54710d9d-59b7-4e75-a07a-a4f8eb0537a2@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=Renaud.Barbier@ametek.com \
    --cc=barebox@lists.infradead.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