Linux MultiMedia Card development
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Avri Altman <avri.altman@wdc.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	linux-mmc@vger.kernel.org
Cc: Ricky WU <ricky_wu@realtek.com>, Shawn Lin <shawn.lin@rock-chips.com>
Subject: Re: [PATCH v6 6/9] mmc: core: Add Ext memory addressing for erase
Date: Fri, 6 Sep 2024 13:06:38 +0300	[thread overview]
Message-ID: <1eb222ee-38f6-4791-849c-7c0376ee96f3@intel.com> (raw)
In-Reply-To: <20240904145256.3670679-7-avri.altman@wdc.com>

On 4/09/24 17:52, Avri Altman wrote:
> CMD22 shall precede CMD32 and CMD33 to configure 38-bit erase start
> address and 38 bit erase stop address.
> 
> Signed-off-by: Avri Altman <avri.altman@wdc.com>
> ---
>  drivers/mmc/core/core.c | 16 ++++++++++++++--
>  1 file changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 06f63fbaadfb..8d9f2c44d2a2 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -1645,8 +1645,14 @@ static int mmc_do_erase(struct mmc_card *card, sector_t from,
>  		cmd.opcode = SD_ERASE_WR_BLK_START;
>  	else
>  		cmd.opcode = MMC_ERASE_GROUP_START;
> -	cmd.arg = from;
> +	cmd.arg = from & 0xFFFFFFFF;

Not needed

>  	cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC;
> +
> +	if (mmc_card_ult_capacity(card)) {
> +		cmd.ext_addr = (from >> 32) & 0x3F;

'0x3F' not needed


> +		cmd.has_ext_addr = 1;

'true' if use bool

> +	}
> +
>  	err = mmc_wait_for_cmd(card->host, &cmd, 0);
>  	if (err) {
>  		pr_err("mmc_erase: group start error %d, "
> @@ -1660,8 +1666,14 @@ static int mmc_do_erase(struct mmc_card *card, sector_t from,
>  		cmd.opcode = SD_ERASE_WR_BLK_END;
>  	else
>  		cmd.opcode = MMC_ERASE_GROUP_END;
> -	cmd.arg = to;
> +	cmd.arg = to & 0xFFFFFFFF;

Not needed

>  	cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC;
> +
> +	if (mmc_card_ult_capacity(card)) {
> +		cmd.ext_addr = (to >> 32) & 0x3F;

'0x3F' not needed

> +		cmd.has_ext_addr = 1;

'true' if use bool

> +	}
> +
>  	err = mmc_wait_for_cmd(card->host, &cmd, 0);
>  	if (err) {
>  		pr_err("mmc_erase: group end error %d, status %#x\n",


  reply	other threads:[~2024-09-06 10:07 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-04 14:52 [PATCH v6 0/9] Add SDUC Support Avri Altman
2024-09-04 14:52 ` [PATCH v6 1/9] mmc: sd: SDUC Support Recognition Avri Altman
2024-09-06  6:39   ` Adrian Hunter
2024-09-06  8:10     ` Avri Altman
2024-09-04 14:52 ` [PATCH v6 2/9] mmc: sd: Add Extension memory addressing Avri Altman
2024-09-04 14:52 ` [PATCH v6 3/9] mmc: core: Add open-ended Ext " Avri Altman
2024-09-04 22:13   ` Christian Loehle
2024-09-05  6:12     ` Avri Altman
2024-09-05  7:25       ` Adrian Hunter
2024-09-05  8:27       ` Christian Loehle
2024-09-05  9:47         ` Avri Altman
2024-09-06  8:02   ` Adrian Hunter
2024-09-06  8:20     ` Avri Altman
2024-09-06  8:33       ` Adrian Hunter
2024-09-06 10:11         ` Avri Altman
2024-09-04 14:52 ` [PATCH v6 4/9] mmc: core: Don't use close-ended rw for SDUC Avri Altman
2024-09-04 14:52 ` [PATCH v6 5/9] mmc: core: Allow mmc erase to carry large addresses Avri Altman
2024-09-04 14:52 ` [PATCH v6 6/9] mmc: core: Add Ext memory addressing for erase Avri Altman
2024-09-06 10:06   ` Adrian Hunter [this message]
2024-09-06 10:14     ` Avri Altman
2024-09-04 14:52 ` [PATCH v6 7/9] mmc: core: Adjust ACMD22 to SDUC Avri Altman
2024-09-06 10:57   ` Adrian Hunter
2024-09-06 11:07     ` Avri Altman
2024-09-04 14:52 ` [PATCH v6 8/9] mmc: core: Disable SDUC for mmc_test Avri Altman
2024-09-06 10:10   ` Adrian Hunter
2024-09-06 10:15     ` Avri Altman
2024-09-04 14:52 ` [PATCH v6 9/9] mmc: core: Enable SDUC Avri Altman
2024-09-06 11:10 ` [PATCH v6 0/9] Add SDUC Support 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=1eb222ee-38f6-4791-849c-7c0376ee96f3@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=avri.altman@wdc.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ricky_wu@realtek.com \
    --cc=shawn.lin@rock-chips.com \
    --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