RE: [PATCH v3 0/2] mmc: host: Disable auto-cmd12 during ffu

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

 



> On 25/10/23 14:30, Avri Altman wrote:
> > Field Firmware Update (ffu) may use close-ended or open ended sequence.
> > Each such sequence is comprised of a write commands enclosed between 2
> > switch commands - to and from ffu mode.
> >
> > Some platforms generate auto command error interrupt when it shouldn't,
> > e.g. auto-cmd12 while in close-ended ffu sequence.  I encountered  this
> > issue while testing fwupd (github.com/fwupd/fwupd) on HP Chromebook
> x2,
> > a qualcomm based QC-7c, code name - strongbad. Instead of a quirk, make
> > sure it disable auto-cmd12 while close-ended ffu is in progress.
> 
> I think I misunderstood this because I was thinking that auto-cmd12
> was being used with an open-ended sequence, and that it wasn't
> working with FFU.  However it seems mmc-utils is using a closed-ended
> sequence.
Yes, mmc-utils, fwupd, as well as others - uses close-ended,
And unlike rpmb - it sends cmd23 as part of the ffu sequence.

> 
> It looks like the the host controller driver doesn't know that,
> because the ioctl interface does not use mrq.sbc and the
> SET_BLOCK_COUNT command is sent separately.  Then when the
> MULTI_WRITE
> command is issued, the host controller driver treats it as open-ended
> and will enable auto-cmd12 if the controller supports it.
> 
> If that is the case, it would be better to fix the ioctl handling
> and make it use mrq.sbc instead of issuing SET_BLOCK_COUNT separately.
We can do that.
On the other hand, this doesn't happen on other platforms.
Fwupd has just recently switched to close-ended, but mmc-utils is using close-ended mode for many years,
Performing ffu successfully on many different platforms.
My understanding is, that the hw should realize that cmd23 has just sent prior to cmd25 and avoid this auto-cmd12.

Going back to your proposal, we can ignore cmd23 in close-ended ffu, but eventually,
we will need to change mmc-utils and fwupd to stop send cmd23.

Please let me know if this is acceptable.

Thanks,
Avri

> 
> >
> > v2 -> v3:
> >  - fix an issue Reported-by: kernel test robot <lkp@xxxxxxxxx>
> >
> > v1->v2:
> >  - Attend Adrian's suggestions
> >
> > Avri Altman (2):
> >   mmc: core: Mark close-ended ffu in progress
> >   mmc: host: msm: Disable auto-cmd12 during ffu
> >
> >  drivers/mmc/core/block.c     | 34
> ++++++++++++++++++++++++++++++++++
> >  drivers/mmc/host/sdhci-msm.c | 24 ++++++++++++++++++++++++
> >  include/linux/mmc/host.h     |  1 +
> >  include/linux/mmc/mmc.h      |  1 +
> >  4 files changed, 60 insertions(+)
> >





[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