2022-06-24 18:20:18

by Prabhakar Mahadev Lad

[permalink] [raw]
Subject: [PATCH v3 0/2] mmc: renesas_sdhi: Trivial fixes

Hi All,

This patch series adds trivial fixes to renesas mmc driver.

v2->v3
* Fixed Review comments pointed by Wolfram.
* Included RB tags from Geert.

v1->v2
* Fixed review comments pointed by Geert and Wolfram.

v1: https://patchwork.kernel.org/project/linux-renesas-soc/cover/
[email protected]/

Cheers,
Prabhakar

Lad Prabhakar (2):
mmc: renesas_sdhi: Get the reset handle early in the probe
mmc: renesas_sdhi: Fix typo's

drivers/mmc/host/renesas_sdhi_core.c | 8 ++++----
drivers/mmc/host/renesas_sdhi_internal_dmac.c | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)

--
2.17.1


2022-06-24 18:20:30

by Prabhakar Mahadev Lad

[permalink] [raw]
Subject: [PATCH v3 1/2] mmc: renesas_sdhi: Get the reset handle early in the probe

In case of devm_reset_control_get_optional_exclusive() failure we returned
directly instead of jumping to the error path to roll back initialization.

This patch moves devm_reset_control_get_optional_exclusive() early in the
probe so that we have the reset handle prior to initialization of the
hardware.

Fixes: b4d86f37eacb7 ("mmc: renesas_sdhi: do hard reset if possible")
Reported-by: Pavel Machek <[email protected]>
Signed-off-by: Lad Prabhakar <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
---
drivers/mmc/host/renesas_sdhi_core.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index 4404ca1f98d8..0d258b6e1a43 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -938,6 +938,10 @@ int renesas_sdhi_probe(struct platform_device *pdev,
if (IS_ERR(priv->clk_cd))
return dev_err_probe(&pdev->dev, PTR_ERR(priv->clk_cd), "cannot get cd clock");

+ priv->rstc = devm_reset_control_get_optional_exclusive(&pdev->dev, NULL);
+ if (IS_ERR(priv->rstc))
+ return PTR_ERR(priv->rstc);
+
priv->pinctrl = devm_pinctrl_get(&pdev->dev);
if (!IS_ERR(priv->pinctrl)) {
priv->pins_default = pinctrl_lookup_state(priv->pinctrl,
@@ -1030,10 +1034,6 @@ int renesas_sdhi_probe(struct platform_device *pdev,
if (ret)
goto efree;

- priv->rstc = devm_reset_control_get_optional_exclusive(&pdev->dev, NULL);
- if (IS_ERR(priv->rstc))
- return PTR_ERR(priv->rstc);
-
ver = sd_ctrl_read16(host, CTL_VERSION);
/* GEN2_SDR104 is first known SDHI to use 32bit block count */
if (ver < SDHI_VER_GEN2_SDR104 && mmc_data->max_blk_count > U16_MAX)
--
2.17.1

2022-06-24 18:33:10

by Prabhakar Mahadev Lad

[permalink] [raw]
Subject: [PATCH v3 2/2] mmc: renesas_sdhi: Fix typo's

Fix typo's,
* difference -> different
* alignment -> aligned

While at it updated the comment to make it clear that Renesas SDHI DMAC
needs buffers to be 128-byte aligned.

Reported-by: Pavel Machek <[email protected]>
Signed-off-by: Lad Prabhakar <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
---
drivers/mmc/host/renesas_sdhi_internal_dmac.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
index 3084b15ae2cb..890aa7832baf 100644
--- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
+++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
@@ -321,7 +321,7 @@ renesas_sdhi_internal_dmac_dataend_dma(struct tmio_mmc_host *host)
}

/*
- * renesas_sdhi_internal_dmac_map() will be called with two difference
+ * renesas_sdhi_internal_dmac_map() will be called with two different
* sg pointers in two mmc_data by .pre_req(), but tmio host can have a single
* sg_ptr only. So, renesas_sdhi_internal_dmac_{un}map() should use a sg
* pointer in a mmc_data instead of host->sg_ptr.
@@ -355,7 +355,7 @@ renesas_sdhi_internal_dmac_map(struct tmio_mmc_host *host,

data->host_cookie = cookie;

- /* This DMAC cannot handle if buffer is not 128-bytes alignment */
+ /* This DMAC needs buffers to be 128-byte aligned */
if (!IS_ALIGNED(sg_dma_address(data->sg), 128)) {
renesas_sdhi_internal_dmac_unmap(host, data, cookie);
return false;
--
2.17.1

2022-06-25 08:39:09

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH v3 1/2] mmc: renesas_sdhi: Get the reset handle early in the probe

On Fri, Jun 24, 2022 at 07:14:37PM +0100, Lad Prabhakar wrote:
> In case of devm_reset_control_get_optional_exclusive() failure we returned
> directly instead of jumping to the error path to roll back initialization.
>
> This patch moves devm_reset_control_get_optional_exclusive() early in the
> probe so that we have the reset handle prior to initialization of the
> hardware.
>
> Fixes: b4d86f37eacb7 ("mmc: renesas_sdhi: do hard reset if possible")
> Reported-by: Pavel Machek <[email protected]>
> Signed-off-by: Lad Prabhakar <[email protected]>
> Reviewed-by: Geert Uytterhoeven <[email protected]>

Reviewed-by: Wolfram Sang <[email protected]>


Attachments:
(No filename) (710.00 B)
signature.asc (849.00 B)
Download all attachments

2022-06-25 08:43:34

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH v3 2/2] mmc: renesas_sdhi: Fix typo's

On Fri, Jun 24, 2022 at 07:14:38PM +0100, Lad Prabhakar wrote:
> Fix typo's,
> * difference -> different
> * alignment -> aligned
>
> While at it updated the comment to make it clear that Renesas SDHI DMAC
> needs buffers to be 128-byte aligned.
>
> Reported-by: Pavel Machek <[email protected]>
> Signed-off-by: Lad Prabhakar <[email protected]>
> Reviewed-by: Geert Uytterhoeven <[email protected]>

Reviewed-by: Wolfram Sang <[email protected]>

Thank you!


Attachments:
(No filename) (518.00 B)
signature.asc (849.00 B)
Download all attachments

2022-07-12 11:31:07

by Ulf Hansson

[permalink] [raw]
Subject: Re: [PATCH v3 0/2] mmc: renesas_sdhi: Trivial fixes

On Fri, 24 Jun 2022 at 20:14, Lad Prabhakar
<[email protected]> wrote:
>
> Hi All,
>
> This patch series adds trivial fixes to renesas mmc driver.
>
> v2->v3
> * Fixed Review comments pointed by Wolfram.
> * Included RB tags from Geert.
>
> v1->v2
> * Fixed review comments pointed by Geert and Wolfram.
>
> v1: https://patchwork.kernel.org/project/linux-renesas-soc/cover/
> [email protected]/
>
> Cheers,
> Prabhakar
>
> Lad Prabhakar (2):
> mmc: renesas_sdhi: Get the reset handle early in the probe
> mmc: renesas_sdhi: Fix typo's
>
> drivers/mmc/host/renesas_sdhi_core.c | 8 ++++----
> drivers/mmc/host/renesas_sdhi_internal_dmac.c | 4 ++--
> 2 files changed, 6 insertions(+), 6 deletions(-)
>

Applied for next, thanks!

Kind regards
Uffe