linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: slot-gpio: Fix debounce time to use miliseconds again
       [not found] <CGME20180928122141eucas1p2feee237ecf064b6abddeda569f356c86@eucas1p2.samsung.com>
@ 2018-09-28 12:20 ` Marek Szyprowski
  2018-09-28 13:03   ` Linus Walleij
  2018-09-28 15:45   ` Ulf Hansson
  0 siblings, 2 replies; 4+ messages in thread
From: Marek Szyprowski @ 2018-09-28 12:20 UTC (permalink / raw)
  To: linux-mmc, linux-samsung-soc
  Cc: Marek Szyprowski, Jaehoon Chung, Ulf Hansson, Shawn Lin,
	Tony Lindgren, Linus Walleij, Krzysztof Kozlowski,
	Bartlomiej Zolnierkiewicz, stable

The debounce value passed to mmc_gpiod_request_cd() function is in
microseconds, but msecs_to_jiffies() requires the value to be in
miliseconds to properly calculate the delay, so adjust the value stored
in cd_debounce_delay_ms context entry.

Fixes: 1d71926bbd59 ("mmc: core: Fix debounce time to use microseconds")
Fixes: bfd694d5e21c ("mmc: core: Add tunable delay before detecting card
after card is inserted")
Cc: stable@vger.kernel.org # v4.18+
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
This patch fixes eMMC card detection on Exynos5410-based Odroid XU board,
broken since Linux next-20180928.
---
 drivers/mmc/core/slot-gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/core/slot-gpio.c b/drivers/mmc/core/slot-gpio.c
index 2a833686784b..86803a3a04dc 100644
--- a/drivers/mmc/core/slot-gpio.c
+++ b/drivers/mmc/core/slot-gpio.c
@@ -271,7 +271,7 @@ int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id,
 	if (debounce) {
 		ret = gpiod_set_debounce(desc, debounce);
 		if (ret < 0)
-			ctx->cd_debounce_delay_ms = debounce;
+			ctx->cd_debounce_delay_ms = debounce / 1000;
 	}
 
 	if (gpio_invert)
-- 
2.17.1

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

* Re: [PATCH] mmc: slot-gpio: Fix debounce time to use miliseconds again
  2018-09-28 12:20 ` [PATCH] mmc: slot-gpio: Fix debounce time to use miliseconds again Marek Szyprowski
@ 2018-09-28 13:03   ` Linus Walleij
  2018-09-28 15:45   ` Ulf Hansson
  1 sibling, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2018-09-28 13:03 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: linux-mmc, linux-samsung-soc, Jaehoon Chung, Ulf Hansson,
	Shawn Lin, ext Tony Lindgren, Krzysztof Kozlowski,
	Bartlomiej Zolnierkiewicz, stable

On Fri, Sep 28, 2018 at 2:21 PM Marek Szyprowski
<m.szyprowski@samsung.com> wrote:

> The debounce value passed to mmc_gpiod_request_cd() function is in
> microseconds, but msecs_to_jiffies() requires the value to be in
> miliseconds to properly calculate the delay, so adjust the value stored
> in cd_debounce_delay_ms context entry.
>
> Fixes: 1d71926bbd59 ("mmc: core: Fix debounce time to use microseconds")
> Fixes: bfd694d5e21c ("mmc: core: Add tunable delay before detecting card
> after card is inserted")
> Cc: stable@vger.kernel.org # v4.18+
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

This seems correct, after some reading and scratching my head:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH] mmc: slot-gpio: Fix debounce time to use miliseconds again
  2018-09-28 12:20 ` [PATCH] mmc: slot-gpio: Fix debounce time to use miliseconds again Marek Szyprowski
  2018-09-28 13:03   ` Linus Walleij
@ 2018-09-28 15:45   ` Ulf Hansson
  2018-09-28 16:30     ` Tony Lindgren
  1 sibling, 1 reply; 4+ messages in thread
From: Ulf Hansson @ 2018-09-28 15:45 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: linux-mmc@vger.kernel.org, linux-samsung-soc, Jaehoon Chung,
	Shawn Lin, Tony Lindgren, Linus Walleij, Krzysztof Kozlowski,
	Bartlomiej Zolnierkiewicz, # 4.0+

On 28 September 2018 at 14:20, Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
> The debounce value passed to mmc_gpiod_request_cd() function is in
> microseconds, but msecs_to_jiffies() requires the value to be in
> miliseconds to properly calculate the delay, so adjust the value stored
> in cd_debounce_delay_ms context entry.
>
> Fixes: 1d71926bbd59 ("mmc: core: Fix debounce time to use microseconds")
> Fixes: bfd694d5e21c ("mmc: core: Add tunable delay before detecting card
> after card is inserted")
> Cc: stable@vger.kernel.org # v4.18+
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

Applied for fixes!

Kind regards
Uffe

> ---
> This patch fixes eMMC card detection on Exynos5410-based Odroid XU board,
> broken since Linux next-20180928.
> ---
>  drivers/mmc/core/slot-gpio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/core/slot-gpio.c b/drivers/mmc/core/slot-gpio.c
> index 2a833686784b..86803a3a04dc 100644
> --- a/drivers/mmc/core/slot-gpio.c
> +++ b/drivers/mmc/core/slot-gpio.c
> @@ -271,7 +271,7 @@ int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id,
>         if (debounce) {
>                 ret = gpiod_set_debounce(desc, debounce);
>                 if (ret < 0)
> -                       ctx->cd_debounce_delay_ms = debounce;
> +                       ctx->cd_debounce_delay_ms = debounce / 1000;
>         }
>
>         if (gpio_invert)
> --
> 2.17.1
>

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

* Re: [PATCH] mmc: slot-gpio: Fix debounce time to use miliseconds again
  2018-09-28 15:45   ` Ulf Hansson
@ 2018-09-28 16:30     ` Tony Lindgren
  0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2018-09-28 16:30 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Marek Szyprowski, linux-mmc@vger.kernel.org, linux-samsung-soc,
	Jaehoon Chung, Shawn Lin, Linus Walleij, Krzysztof Kozlowski,
	Bartlomiej Zolnierkiewicz, # 4.0+

* Ulf Hansson <ulf.hansson@linaro.org> [180928 15:50]:
> On 28 September 2018 at 14:20, Marek Szyprowski
> <m.szyprowski@samsung.com> wrote:
> > The debounce value passed to mmc_gpiod_request_cd() function is in
> > microseconds, but msecs_to_jiffies() requires the value to be in
> > miliseconds to properly calculate the delay, so adjust the value stored
> > in cd_debounce_delay_ms context entry.
> >
> > Fixes: 1d71926bbd59 ("mmc: core: Fix debounce time to use microseconds")
> > Fixes: bfd694d5e21c ("mmc: core: Add tunable delay before detecting card
> > after card is inserted")
> > Cc: stable@vger.kernel.org # v4.18+
> > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> 
> Applied for fixes!

Heh thanks for fixing it, looks like I totally missed that part :)

Tony

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

end of thread, other threads:[~2018-09-28 16:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20180928122141eucas1p2feee237ecf064b6abddeda569f356c86@eucas1p2.samsung.com>
2018-09-28 12:20 ` [PATCH] mmc: slot-gpio: Fix debounce time to use miliseconds again Marek Szyprowski
2018-09-28 13:03   ` Linus Walleij
2018-09-28 15:45   ` Ulf Hansson
2018-09-28 16:30     ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).