lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 22 Sep 2023 19:01:12 +0200
From:   Francesco Dolcini <francesco@...cini.it>
To:     Bean Huo <beanhuo@...pp.de>
Cc:     ulf.hansson@...aro.org, adrian.hunter@...el.com,
        beanhuo@...ron.com, jakub.kwapisz@...adex.com,
        rafael.beims@...adex.com, linux-mmc@...r.kernel.org,
        linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH v3] mmc: Add quirk MMC_QUIRK_BROKEN_CACHE_FLUSH for
 Micron eMMC Q2J54A

On Thu, Sep 21, 2023 at 10:34:26PM +0200, Bean Huo wrote:
> From: Bean Huo <beanhuo@...ron.com>
> 
> Micron MTFC4GACAJCN eMMC supports cache but requires that flush cache
> operation be allowed only after a write has occurred. Otherwise, the
> cache flush command or subsequent commands will time out.
> 
> Signed-off-by: Bean Huo <beanhuo@...ron.com>
> Co-developed-by: Rafael Beims <rafael.beims@...adex.com>
> Cc: stable@...r.kernel.org
> ---
> Changelog:
> 
> v2--v3:
>     1. Set card->written_flag in mmc_blk_mq_issue_rq().
> v1--v2:
>     1. Add Rafael's test-tag, and Co-developed-by.
>     2. Check host->card whether NULL or not in __mmc_start_request() before asserting host->card->->quirks
> ---
>  drivers/mmc/core/block.c  | 4 ++++
>  drivers/mmc/core/mmc.c    | 5 +++++
>  drivers/mmc/core/quirks.h | 7 ++++---
>  include/linux/mmc/card.h  | 2 ++
>  4 files changed, 15 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
> index 3a8f27c3e310..14d0dc7942de 100644
> --- a/drivers/mmc/core/block.c
> +++ b/drivers/mmc/core/block.c
> @@ -2387,6 +2387,10 @@ enum mmc_issued mmc_blk_mq_issue_rq(struct mmc_queue *mq, struct request *req)
>  				ret = mmc_blk_cqe_issue_rw_rq(mq, req);
>  			else
>  				ret = mmc_blk_mq_issue_rw_rq(mq, req);
> +
> +			if (host->card->quirks & MMC_QUIRK_BROKEN_CACHE_FLUSH &&
> +			    !host->card->written_flag && !ret)
> +				host->card->written_flag = true;

>From what I can see this branch is followed for both REQ_OP_READ and
REQ_OP_WRITE, and I would say we want to set this flag only for
REQ_OP_WRITE.

Am I wrong?

Francesco

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ