All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2] mmc: block: remove non-data R1B ioctl workaround
@ 2022-11-27 17:46 Christian Löhle
  2022-11-29 12:36 ` Adrian Hunter
  2022-11-29 12:54 ` Ulf Hansson
  0 siblings, 2 replies; 3+ messages in thread
From: Christian Löhle @ 2022-11-27 17:46 UTC (permalink / raw)
  To: Avri Altman, ulf.hansson, linux-mmc, linux-kernel; +Cc: adrian.hunter

The workaround of pretending R1B non-data transfers are
data transfers in order for the busy timeout to be respected
by the host controller driver is removed. It wasn't useful
in a long time.

Initially the workaround ensured that R1B commands did not
time out by setting the data timeout to be the command timeout
in commit cb87ea28ed9e ("mmc: core: Add mmc CMD+ACMD passthrough ioctl").
This was moved inside of an if clause with idata->buf_bytes being set
in commit 4d6144de8ba2 ("mmc: core: check for zero length ioctl data").
Since the workaround is now inside of the idata->buf_bytes clause
and intended to fix R1B non-data transfers that do not have buf_bytes
set we can also remove the workaround altogether.
Since there are no data transfer invoking R1B commands this was dead
code.

Fixes: cb87ea28ed9e ("mmc: core: Add mmc CMD+ACMD passthrough ioctl")
Signed-off-by: Christian Loehle <cloehle@hyperstone.com>
---
-v2: clarified commit message, no code change
 drivers/mmc/core/block.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index db6d8a099910..20da7ed43e6d 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -514,19 +514,6 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md,
 		if (idata->ic.data_timeout_ns)
 			data.timeout_ns = idata->ic.data_timeout_ns;
 
-		if ((cmd.flags & MMC_RSP_R1B) == MMC_RSP_R1B) {
-			/*
-			 * Pretend this is a data transfer and rely on the
-			 * host driver to compute timeout.  When all host
-			 * drivers support cmd.cmd_timeout for R1B, this
-			 * can be changed to:
-			 *
-			 *     mrq.data = NULL;
-			 *     cmd.cmd_timeout = idata->ic.cmd_timeout_ms;
-			 */
-			data.timeout_ns = idata->ic.cmd_timeout_ms * 1000000;
-		}
-
 		mrq.data = &data;
 	}
 
-- 
2.37.3

Hyperstone GmbH | Reichenaustr. 39a  | 78467 Konstanz
Managing Director: Dr. Jan Peter Berns.
Commercial register of local courts: Freiburg HRB381782


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCHv2] mmc: block: remove non-data R1B ioctl workaround
  2022-11-27 17:46 [PATCHv2] mmc: block: remove non-data R1B ioctl workaround Christian Löhle
@ 2022-11-29 12:36 ` Adrian Hunter
  2022-11-29 12:54 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Adrian Hunter @ 2022-11-29 12:36 UTC (permalink / raw)
  To: Christian Löhle, Avri Altman, ulf.hansson, linux-mmc, linux-kernel

On 27/11/22 19:46, Christian Löhle wrote:
> The workaround of pretending R1B non-data transfers are
> data transfers in order for the busy timeout to be respected
> by the host controller driver is removed. It wasn't useful
> in a long time.
> 
> Initially the workaround ensured that R1B commands did not
> time out by setting the data timeout to be the command timeout
> in commit cb87ea28ed9e ("mmc: core: Add mmc CMD+ACMD passthrough ioctl").
> This was moved inside of an if clause with idata->buf_bytes being set
> in commit 4d6144de8ba2 ("mmc: core: check for zero length ioctl data").
> Since the workaround is now inside of the idata->buf_bytes clause
> and intended to fix R1B non-data transfers that do not have buf_bytes
> set we can also remove the workaround altogether.
> Since there are no data transfer invoking R1B commands this was dead
> code.
> 
> Fixes: cb87ea28ed9e ("mmc: core: Add mmc CMD+ACMD passthrough ioctl")
> Signed-off-by: Christian Loehle <cloehle@hyperstone.com>

Doesn't Fixes: 4d6144de8ba2 make more sense?

Otherwise:

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
> -v2: clarified commit message, no code change
>  drivers/mmc/core/block.c | 13 -------------
>  1 file changed, 13 deletions(-)
> 
> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
> index db6d8a099910..20da7ed43e6d 100644
> --- a/drivers/mmc/core/block.c
> +++ b/drivers/mmc/core/block.c
> @@ -514,19 +514,6 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md,
>  		if (idata->ic.data_timeout_ns)
>  			data.timeout_ns = idata->ic.data_timeout_ns;
>  
> -		if ((cmd.flags & MMC_RSP_R1B) == MMC_RSP_R1B) {
> -			/*
> -			 * Pretend this is a data transfer and rely on the
> -			 * host driver to compute timeout.  When all host
> -			 * drivers support cmd.cmd_timeout for R1B, this
> -			 * can be changed to:
> -			 *
> -			 *     mrq.data = NULL;
> -			 *     cmd.cmd_timeout = idata->ic.cmd_timeout_ms;
> -			 */
> -			data.timeout_ns = idata->ic.cmd_timeout_ms * 1000000;
> -		}
> -
>  		mrq.data = &data;
>  	}
>  


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCHv2] mmc: block: remove non-data R1B ioctl workaround
  2022-11-27 17:46 [PATCHv2] mmc: block: remove non-data R1B ioctl workaround Christian Löhle
  2022-11-29 12:36 ` Adrian Hunter
@ 2022-11-29 12:54 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2022-11-29 12:54 UTC (permalink / raw)
  To: Christian Löhle; +Cc: Avri Altman, linux-mmc, linux-kernel, adrian.hunter

On Sun, 27 Nov 2022 at 18:46, Christian Löhle <CLoehle@hyperstone.com> wrote:
>
> The workaround of pretending R1B non-data transfers are
> data transfers in order for the busy timeout to be respected
> by the host controller driver is removed. It wasn't useful
> in a long time.
>
> Initially the workaround ensured that R1B commands did not
> time out by setting the data timeout to be the command timeout
> in commit cb87ea28ed9e ("mmc: core: Add mmc CMD+ACMD passthrough ioctl").
> This was moved inside of an if clause with idata->buf_bytes being set
> in commit 4d6144de8ba2 ("mmc: core: check for zero length ioctl data").
> Since the workaround is now inside of the idata->buf_bytes clause
> and intended to fix R1B non-data transfers that do not have buf_bytes
> set we can also remove the workaround altogether.
> Since there are no data transfer invoking R1B commands this was dead
> code.
>
> Fixes: cb87ea28ed9e ("mmc: core: Add mmc CMD+ACMD passthrough ioctl")
> Signed-off-by: Christian Loehle <cloehle@hyperstone.com>

Since the code that we now remove doesn't really break anything, I
don't think we need to use a fixes tag.

So, applied for next by removing the fixes tag, thanks!

Kind regards
Uffe



> ---
> -v2: clarified commit message, no code change
>  drivers/mmc/core/block.c | 13 -------------
>  1 file changed, 13 deletions(-)
>
> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
> index db6d8a099910..20da7ed43e6d 100644
> --- a/drivers/mmc/core/block.c
> +++ b/drivers/mmc/core/block.c
> @@ -514,19 +514,6 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md,
>                 if (idata->ic.data_timeout_ns)
>                         data.timeout_ns = idata->ic.data_timeout_ns;
>
> -               if ((cmd.flags & MMC_RSP_R1B) == MMC_RSP_R1B) {
> -                       /*
> -                        * Pretend this is a data transfer and rely on the
> -                        * host driver to compute timeout.  When all host
> -                        * drivers support cmd.cmd_timeout for R1B, this
> -                        * can be changed to:
> -                        *
> -                        *     mrq.data = NULL;
> -                        *     cmd.cmd_timeout = idata->ic.cmd_timeout_ms;
> -                        */
> -                       data.timeout_ns = idata->ic.cmd_timeout_ms * 1000000;
> -               }
> -
>                 mrq.data = &data;
>         }
>
> --
> 2.37.3
>
> Hyperstone GmbH | Reichenaustr. 39a  | 78467 Konstanz
> Managing Director: Dr. Jan Peter Berns.
> Commercial register of local courts: Freiburg HRB381782
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-29 12:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-27 17:46 [PATCHv2] mmc: block: remove non-data R1B ioctl workaround Christian Löhle
2022-11-29 12:36 ` Adrian Hunter
2022-11-29 12:54 ` Ulf Hansson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.