diff mbox series

[v7,03/10] mmc: core: Don't use close-ended rw for SDUC

Message ID 20240908102018.3711527-4-avri.altman@wdc.com (mailing list archive)
State New
Headers show
Series Add SDUC Support | expand

Commit Message

Avri Altman Sept. 8, 2024, 10:20 a.m. UTC
The SDUC spec expects CMD22 to get squeezed between CMD23 and the
read/write command, e.g. CMD23->CMD22->CMD18 and CMD23->CMD22->CMD25.
At this early stage of adoption, we want to avoid an amid stream of
fixes & quirks of bogus hw, that tends to apply extra logic specifically
around auto-cmd12 & auto-cmd23.

Let's leave close-ended out for now, and re-consider this should those
cards become ubiquitous, if any.

Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Avri Altman <avri.altman@wdc.com>
---
 drivers/mmc/core/block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ulf Hansson Oct. 3, 2024, 3:44 p.m. UTC | #1
On Sun, 8 Sept 2024 at 12:22, Avri Altman <avri.altman@wdc.com> wrote:
>
> The SDUC spec expects CMD22 to get squeezed between CMD23 and the
> read/write command, e.g. CMD23->CMD22->CMD18 and CMD23->CMD22->CMD25.
> At this early stage of adoption, we want to avoid an amid stream of
> fixes & quirks of bogus hw, that tends to apply extra logic specifically
> around auto-cmd12 & auto-cmd23.
>
> Let's leave close-ended out for now, and re-consider this should those
> cards become ubiquitous, if any.

This makes sense to me. However, for clarity I would also state in the
commit message that it also means that BLK_FEAT_FUA will not be used
for I/O, but instead we will rely on BLK_FEAT_WRITE_CACHE.

>
> Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
> Signed-off-by: Avri Altman <avri.altman@wdc.com>
> ---
>  drivers/mmc/core/block.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
> index f58bea534004..05a7745c2a68 100644
> --- a/drivers/mmc/core/block.c
> +++ b/drivers/mmc/core/block.c
> @@ -2547,7 +2547,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
>         if (mmc_host_cmd23(card->host)) {
>                 if ((mmc_card_mmc(card) &&
>                      card->csd.mmca_vsn >= CSD_SPEC_VER_3) ||
> -                   (mmc_card_sd(card) &&
> +                   (mmc_card_sd(card) && !mmc_card_ult_capacity(card) &&
>                      card->scr.cmds & SD_SCR_CMD23_SUPPORT))
>                         md->flags |= MMC_BLK_CMD23;
>         }
> --
> 2.25.1
>
Avri Altman Oct. 3, 2024, 4:43 p.m. UTC | #2
> On Sun, 8 Sept 2024 at 12:22, Avri Altman <avri.altman@wdc.com> wrote:
> >
> > The SDUC spec expects CMD22 to get squeezed between CMD23 and the
> > read/write command, e.g. CMD23->CMD22->CMD18 and CMD23->CMD22-
> >CMD25.
> > At this early stage of adoption, we want to avoid an amid stream of
> > fixes & quirks of bogus hw, that tends to apply extra logic
> > specifically around auto-cmd12 & auto-cmd23.
> >
> > Let's leave close-ended out for now, and re-consider this should those
> > cards become ubiquitous, if any.
> 
> This makes sense to me. However, for clarity I would also state in the commit
> message that it also means that BLK_FEAT_FUA will not be used for I/O, but
> instead we will rely on BLK_FEAT_WRITE_CACHE.
Done.

Thanks,
Avri

> 
> >
> > Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
> > Signed-off-by: Avri Altman <avri.altman@wdc.com>
> > ---
> >  drivers/mmc/core/block.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index
> > f58bea534004..05a7745c2a68 100644
> > --- a/drivers/mmc/core/block.c
> > +++ b/drivers/mmc/core/block.c
> > @@ -2547,7 +2547,7 @@ static struct mmc_blk_data
> *mmc_blk_alloc_req(struct mmc_card *card,
> >         if (mmc_host_cmd23(card->host)) {
> >                 if ((mmc_card_mmc(card) &&
> >                      card->csd.mmca_vsn >= CSD_SPEC_VER_3) ||
> > -                   (mmc_card_sd(card) &&
> > +                   (mmc_card_sd(card) && !mmc_card_ult_capacity(card)
> > + &&
> >                      card->scr.cmds & SD_SCR_CMD23_SUPPORT))
> >                         md->flags |= MMC_BLK_CMD23;
> >         }
> > --
> > 2.25.1
> >
diff mbox series

Patch

diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index f58bea534004..05a7745c2a68 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -2547,7 +2547,7 @@  static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
 	if (mmc_host_cmd23(card->host)) {
 		if ((mmc_card_mmc(card) &&
 		     card->csd.mmca_vsn >= CSD_SPEC_VER_3) ||
-		    (mmc_card_sd(card) &&
+		    (mmc_card_sd(card) && !mmc_card_ult_capacity(card) &&
 		     card->scr.cmds & SD_SCR_CMD23_SUPPORT))
 			md->flags |= MMC_BLK_CMD23;
 	}