RE: [PATCH v6 1/9] mmc: sd: SDUC Support Recognition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > @@ -841,8 +847,11 @@ int mmc_sd_get_cid(struct mmc_host *host, u32 ocr,
> u32 *cid, u32 *rocr)
> >        * block-addressed SDHC cards.
> >        */
> >       err = mmc_send_if_cond(host, ocr);
> > -     if (!err)
> > +     if (!err) {
> >               ocr |= SD_OCR_CCS;
> > +             /* Set HO2T as well - SDUC card won't respond otherwise */
> > +             ocr |= SD_OCR_2T;
> 
> Wouldn't that be better to leave for the last patch.
Done.

> 
> > +     }
> >
> >       /*
> >        * If the host supports one of UHS-I modes, request the card @@
> > -887,7 +896,7 @@ int mmc_sd_get_cid(struct mmc_host *host, u32 ocr, u32
> *cid, u32 *rocr)
> >       return err;
> >  }
> >
> > -int mmc_sd_get_csd(struct mmc_card *card)
> > +int mmc_sd_get_csd(struct mmc_card *card, bool is_sduc)
> >  {
> >       int err;
> >
> > @@ -898,7 +907,7 @@ int mmc_sd_get_csd(struct mmc_card *card)
> >       if (err)
> >               return err;
> >
> > -     err = mmc_decode_csd(card);
> > +     err = mmc_decode_csd(card, is_sduc);
> >       if (err)
> >               return err;
> >
> > @@ -1453,7 +1462,7 @@ static int mmc_sd_init_card(struct mmc_host *host,
> u32 ocr,
> >       }
> >
> >       if (!oldcard) {
> > -             err = mmc_sd_get_csd(card);
> > +             err = mmc_sd_get_csd(card, false);
> >               if (err)
> >                       goto free_card;
> >
> 
> Also need to prevent Host Software Queue from enabling for SDUC.  Something
> like:
> 
> diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index
> 8d77a49357aa..769cd8b9f49c 100644
> --- a/drivers/mmc/core/sd.c
> +++ b/drivers/mmc/core/sd.c
> @@ -1578,7 +1578,7 @@ static int mmc_sd_init_card(struct mmc_host *host,
> u32 ocr,
>                         goto free_card;
>         }
> 
> -       if (host->cqe_ops && !host->cqe_enabled) {
> +       if (!mmc_card_ult_capacity(card) && host->cqe_ops &&
> + !host->cqe_enabled) {
>                 err = host->cqe_ops->cqe_enable(host, card);
>                 if (!err) {
>                         host->cqe_enabled = true;
Yeah. I was just thinking about it the other day,
And wouldn't be able to find where we read the PERFORMANCE_ENHANCE SD_STATUS b[335:331].
Will add it.  Thanks.

Thanks,
Avri

> 
> Ideally try to get testing / feedback from HSQ users though.
> 
> 
> > diff --git a/drivers/mmc/core/sd.h b/drivers/mmc/core/sd.h index
> > fe6dd46927a4..7e8beface2ca 100644
> > --- a/drivers/mmc/core/sd.h
> > +++ b/drivers/mmc/core/sd.h
> > @@ -10,7 +10,7 @@ struct mmc_host;
> >  struct mmc_card;
> >
> >  int mmc_sd_get_cid(struct mmc_host *host, u32 ocr, u32 *cid, u32
> > *rocr); -int mmc_sd_get_csd(struct mmc_card *card);
> > +int mmc_sd_get_csd(struct mmc_card *card, bool is_sduc);
> >  void mmc_decode_cid(struct mmc_card *card);  int
> > mmc_sd_setup_card(struct mmc_host *host, struct mmc_card *card,
> >       bool reinit);
> > diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index
> > 4fb247fde5c0..9566837c9848 100644
> > --- a/drivers/mmc/core/sdio.c
> > +++ b/drivers/mmc/core/sdio.c
> > @@ -769,7 +769,7 @@ static int mmc_sdio_init_card(struct mmc_host *host,
> u32 ocr,
> >        * Read CSD, before selecting the card
> >        */
> >       if (!oldcard && mmc_card_sd_combo(card)) {
> > -             err = mmc_sd_get_csd(card);
> > +             err = mmc_sd_get_csd(card, false);
> >               if (err)
> >                       goto remove;
> >
> > diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index
> > f34407cc2788..f39bce322365 100644
> > --- a/include/linux/mmc/card.h
> > +++ b/include/linux/mmc/card.h
> > @@ -35,7 +35,7 @@ struct mmc_csd {
> >       unsigned int            wp_grp_size;
> >       unsigned int            read_blkbits;
> >       unsigned int            write_blkbits;
> > -     unsigned int            capacity;
> > +     sector_t                capacity;
> >       unsigned int            read_partial:1,
> >                               read_misalign:1,
> >                               write_partial:1, diff --git
> > a/include/linux/mmc/sd.h b/include/linux/mmc/sd.h index
> > 6727576a8755..865cc0ca8543 100644
> > --- a/include/linux/mmc/sd.h
> > +++ b/include/linux/mmc/sd.h
> > @@ -36,6 +36,7 @@
> >  /* OCR bit definitions */
> >  #define SD_OCR_S18R          (1 << 24)    /* 1.8V switching request */
> >  #define SD_ROCR_S18A         SD_OCR_S18R  /* 1.8V switching accepted by
> card */
> > +#define SD_OCR_2T            (1 << 27)    /* HO2T/CO2T - SDUC support */
> >  #define SD_OCR_XPC           (1 << 28)    /* SDXC power control */
> >  #define SD_OCR_CCS           (1 << 30)    /* Card Capacity Status */
> >





[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux