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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DM6PR04MB657570DB58E7ABBE2C3B0449FC589@DM6PR04MB6575.namprd04.prod.outlook.com>
Date:   Thu, 6 May 2021 06:15:11 +0000
From:   Avri Altman <Avri.Altman@....com>
To:     Christian Löhle <CLoehle@...erstone.com>,
        "ulf.hansson@...aro.org" <ulf.hansson@...aro.org>,
        "adrian.hunter@...el.com" <adrian.hunter@...el.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>
CC:     "axboe@...nel.dk" <axboe@...nel.dk>,
        "zliua@...ron.com" <zliua@...ron.com>
Subject: RE: [PATCH] mmc: block: ioctl: No busywaiting of non-TRAN CMDs

> Prevent busywaiting for TRAN state indication
> after issuing a command that will not transition
> to TRAN state.
> 
> Signed-off-by: Christian Loehle <cloehle@...erstone.com>
> ---
>  drivers/mmc/core/block.c | 3 ++-
>  drivers/mmc/core/block.h | 5 +++++
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
> index 689eb9afeeed..9baf95639688 100644
> --- a/drivers/mmc/core/block.c
> +++ b/drivers/mmc/core/block.c
> @@ -593,7 +593,8 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card
> *card, struct mmc_blk_data *md,
> 
>         memcpy(&(idata->ic.response), cmd.resp, sizeof(cmd.resp));
> 
> -       if (idata->rpmb || (cmd.flags & MMC_RSP_R1B) == MMC_RSP_R1B) {
> +       if ((idata->rpmb || (cmd.flags & MMC_RSP_R1B) == MMC_RSP_R1B)
> +                       && TRAN_TRANSITION_CMD(cmd.opcode)) {
>                 /*
>                  * Ensure RPMB/R1B command has completed by polling CMD13
>                  * "Send Status".
> diff --git a/drivers/mmc/core/block.h b/drivers/mmc/core/block.h
> index 31153f656f41..51b806384ab0 100644
> --- a/drivers/mmc/core/block.h
> +++ b/drivers/mmc/core/block.h
> @@ -17,4 +17,9 @@ struct work_struct;
> 
>  void mmc_blk_mq_complete_work(struct work_struct *work);
> 
> +#define TRAN_TRANSITION_CMD(cmd) !(cmd == MMC_SEND_STATUS \
> +                                      || cmd == MMC_SEND_CID \
> +                                      || cmd == MMC_ALL_SEND_CID \
> +                                      || cmd == MMC_SEND_CSD)
> +
You might want to use a static inline here to allow type checking.
If you decide to leave it as a macro however, need to add () on each term.

Thanks,
Avri

>  #endif
> --
> 2.31.1
> 
> Hyperstone GmbH | Line-Eid-Strasse 3 | 78467 Konstanz
> Managing Directors: Dr. Jan Peter Berns.
> Commercial register of local courts: Freiburg HRB381782

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ