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: Daniil Lunev <dlunev@google.com>,
	Asutosh Das <quic_asutoshd@quicinc.com>
Subject: Re: [PATCH v3 0/2] mmc: host: Disable auto-cmd12 during ffu
Date: Thu, 26 Oct 2023 11:38:31 +0300	[thread overview]
Message-ID: <afdada50-cdcb-4edb-a026-c872e1914e43@intel.com> (raw)
In-Reply-To: <20231025113035.1881418-1-avri.altman@wdc.com>

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.

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.

> 
> v2 -> v3:
>  - fix an issue Reported-by: kernel test robot <lkp@intel.com>
> 
> 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(+)
> 


  parent reply	other threads:[~2023-10-26  8:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-25 11:30 [PATCH v3 0/2] mmc: host: Disable auto-cmd12 during ffu Avri Altman
2023-10-25 11:30 ` [PATCH v3 1/2] mmc: core: Mark close-ended ffu in progress Avri Altman
2023-10-25 11:30 ` [PATCH v3 2/2] mmc: host: msm: Disable auto-cmd12 during ffu Avri Altman
2023-10-26  8:38 ` Adrian Hunter [this message]
2023-10-26 10:03   ` [PATCH v3 0/2] mmc: host: " Ulf Hansson
2023-10-26 10:06   ` Avri Altman
2023-10-27  9:41     ` Ulf Hansson
2023-10-27 10:54       ` 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=afdada50-cdcb-4edb-a026-c872e1914e43@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=avri.altman@wdc.com \
    --cc=dlunev@google.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=quic_asutoshd@quicinc.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