RE: [PATCH] mmc: core: Use mrq.sbc in close-ended ffu

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

 



> > >       }
> > > @@ -1032,6 +1044,28 @@ static inline void
> > > mmc_blk_reset_success(struct
> > mmc_blk_data *md, int type)
> > >       md->reset_done &= ~type;
> > >  }
> > >
> > > +/* close-ended ffu */
> > > +static void mmc_blk_check_ce_ffu(struct mmc_queue_req *mq_rq) {
> > > +     struct mmc_blk_ioc_data **idata = mq_rq->drv_op_data;
> > > +
> > > +     if (mq_rq->ioc_count != 4)
> > > +             return;
> > > +
> > > +     if (idata[0]->ic.opcode != MMC_SWITCH)
> > > +             return;
> > > +
> > > +     if (MMC_EXTRACT_INDEX_FROM_ARG(idata[0]->ic.arg) !=
> > > +                     EXT_CSD_MODE_CONFIG)
> > > +             return;
> > > +
> > > +     if (idata[1]->ic.opcode == MMC_SET_BLOCK_COUNT &&
> > > +         idata[2]->ic.opcode == MMC_WRITE_MULTIPLE_BLOCK) {
> > > +             idata[1]->flags |= MMC_BLK_IOC_DROP;
> > > +             idata[2]->flags |= MMC_BLK_IOC_SBC;
> > > +     }
> >
> > Could this be more generic e.g. simply
> >
> >         for (i = 1; i < mq_rq->ioc_count; i++)
> >                 if (idata[i - 1]->ic.opcode == MMC_SET_BLOCK_COUNT &&
> >                     mmc_op_multi(idata[i + 1]->ic.opcode)) {
> I guess you meant (idata[i]
> 
> >                         idata[i - 1]->flags |= MMC_BLK_IOC_DROP;
> >                         idata[i]->flags |= MMC_BLK_IOC_SBC;
> >                 }
> >
> > with no need to check for 4 cmds, MMC_SWITCH or
> EXT_CSD_MODE_CONFIG
> Ditto
Or, I can follow your proposal.
Will send a v3.

Thanks,
Avri

> 
> Thanks,
> Avri
> >
> > > +}
> > > +
> > >  /*
> > >   * The non-block commands come back from the block layer after it
> > queued it and
> > >   * processed it with all other requests and then they get issued in
> > > this @@ -1059,6 +1093,9 @@ static void mmc_blk_issue_drv_op(struct
> > mmc_queue *mq, struct request *req)
> > >                       if (ret)
> > >                               break;
> > >               }
> > > +
> > > +             mmc_blk_check_ce_ffu(mq_rq);
> > > +
> > >               fallthrough;
> > >       case MMC_DRV_OP_IOCTL_RPMB:
> > >               idata = mq_rq->drv_op_data; diff --git
> > > a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index
> > > 6f7993803ee7..d4d10cabaa57 100644
> > > --- a/include/linux/mmc/mmc.h
> > > +++ b/include/linux/mmc/mmc.h
> > > @@ -254,6 +254,7 @@ static inline bool mmc_ready_for_data(u32
> status)
> > >   */
> > >
> > >  #define EXT_CSD_CMDQ_MODE_EN         15      /* R/W */
> > > +#define EXT_CSD_MODE_CONFIG          30      /* R/W */
> > >  #define EXT_CSD_FLUSH_CACHE          32      /* W */
> > >  #define EXT_CSD_CACHE_CTRL           33      /* R/W */
> > >  #define EXT_CSD_POWER_OFF_NOTIFICATION       34      /* R/W */





[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