All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFC] mmc: host: renesas_sdhi: Refactor of_device_id.data
@ 2021-06-25  7:55 Yoshihiro Shimoda
  2021-06-25 11:20 ` Geert Uytterhoeven
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Yoshihiro Shimoda @ 2021-06-25  7:55 UTC (permalink / raw)
  To: ulf.hansson, wsa+renesas; +Cc: linux-mmc, linux-renesas-soc, Yoshihiro Shimoda

Refactor of_device_id.data to avoid increasing numbers of
sdhi_quirks_match[] entry when we add other stable SoCs like
r8a779m*.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 - We discussed/reviewed sdhi support for r8a779m* [1] before.
 - I marked RFC on this patch because:
 -- should I make step-by-step patches to ease review?
 -- should I rename the current renesas_sdhi_of_data (e.g. renesas_sdhi_param)?
    (renesas_sdhi_of_data and renesas_sdhi_of_data_with_quirks seem strange
     a little?)
 - I tested this patch on r8a77951 (ES3.0), r8a77960 (ES1.0)
   and r8a77965.

 [1]
 https://lore.kernel.org/linux-renesas-soc/TY2PR01MB36927B0CCE7C557A3115E481D8079@TY2PR01MB3692.jpnprd01.prod.outlook.com/

 drivers/mmc/host/renesas_sdhi.h               |  5 ++
 drivers/mmc/host/renesas_sdhi_core.c          | 42 ++--------
 drivers/mmc/host/renesas_sdhi_internal_dmac.c | 78 ++++++++++++++++++-
 drivers/mmc/host/renesas_sdhi_sys_dmac.c      | 24 +++++-
 4 files changed, 105 insertions(+), 44 deletions(-)

diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h
index 53eded81a53e..7ef480d56211 100644
--- a/drivers/mmc/host/renesas_sdhi.h
+++ b/drivers/mmc/host/renesas_sdhi.h
@@ -42,6 +42,11 @@ struct renesas_sdhi_quirks {
 	const u8 (*hs400_calib_table)[SDHI_CALIB_TABLE_MAX];
 };
 
+struct renesas_sdhi_of_data_with_quirks {
+	const struct renesas_sdhi_of_data *of_data;
+	const struct renesas_sdhi_quirks *quirks;
+};
+
 struct tmio_mmc_dma {
 	enum dma_slave_buswidth dma_buswidth;
 	bool (*filter)(struct dma_chan *chan, void *arg);
diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index e49ca0f7fe9a..fbb506be6229 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -312,20 +312,6 @@ static const u8 r8a7796_es13_calib_table[2][SDHI_CALIB_TABLE_MAX] = {
 	 12, 17, 18, 18, 18, 18, 18, 18, 18, 19, 20, 21, 22, 23, 25, 25 }
 };
 
-static const u8 r8a77965_calib_table[2][SDHI_CALIB_TABLE_MAX] = {
-	{ 1,  2,  6,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 15, 15, 16,
-	 17, 18, 19, 20, 21, 22, 23, 24, 25, 25, 26, 27, 28, 29, 30, 31 },
-	{ 2,  3,  4,  4,  5,  6,  7,  9, 10, 11, 12, 13, 14, 15, 16, 17,
-	 17, 17, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31, 31, 31, 31 }
-};
-
-static const u8 r8a77990_calib_table[2][SDHI_CALIB_TABLE_MAX] = {
-	{ 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-	  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0 },
-	{ 0,  0,  0,  1,  2,  3,  3,  4,  4,  4,  5,  5,  6,  8,  9, 10,
-	 11, 12, 13, 15, 16, 17, 17, 18, 18, 19, 20, 22, 24, 25, 26, 26 }
-};
-
 static inline u32 sd_scc_read32(struct tmio_mmc_host *host,
 				struct renesas_sdhi *priv, int addr)
 {
@@ -909,29 +895,12 @@ static const struct renesas_sdhi_quirks sdhi_quirks_nohs400 = {
 	.hs400_disabled = true,
 };
 
-static const struct renesas_sdhi_quirks sdhi_quirks_bad_taps1357 = {
-	.hs400_bad_taps = BIT(1) | BIT(3) | BIT(5) | BIT(7),
-};
-
-static const struct renesas_sdhi_quirks sdhi_quirks_bad_taps2367 = {
-	.hs400_bad_taps = BIT(2) | BIT(3) | BIT(6) | BIT(7),
-};
-
 static const struct renesas_sdhi_quirks sdhi_quirks_r8a7796_es13 = {
 	.hs400_4taps = true,
 	.hs400_bad_taps = BIT(2) | BIT(3) | BIT(6) | BIT(7),
 	.hs400_calib_table = r8a7796_es13_calib_table,
 };
 
-static const struct renesas_sdhi_quirks sdhi_quirks_r8a77965 = {
-	.hs400_bad_taps = BIT(2) | BIT(3) | BIT(6) | BIT(7),
-	.hs400_calib_table = r8a77965_calib_table,
-};
-
-static const struct renesas_sdhi_quirks sdhi_quirks_r8a77990 = {
-	.hs400_calib_table = r8a77990_calib_table,
-};
-
 /*
  * Note for r8a7796 / r8a774a1: we can't distinguish ES1.1 and 1.2 as of now.
  * So, we want to treat them equally and only have a match for ES1.2 to enforce
@@ -941,13 +910,8 @@ static const struct soc_device_attribute sdhi_quirks_match[]  = {
 	{ .soc_id = "r8a774a1", .revision = "ES1.[012]", .data = &sdhi_quirks_4tap_nohs400 },
 	{ .soc_id = "r8a7795", .revision = "ES1.*", .data = &sdhi_quirks_4tap_nohs400 },
 	{ .soc_id = "r8a7795", .revision = "ES2.0", .data = &sdhi_quirks_4tap },
-	{ .soc_id = "r8a7795", .revision = "ES3.*", .data = &sdhi_quirks_bad_taps2367 },
 	{ .soc_id = "r8a7796", .revision = "ES1.[012]", .data = &sdhi_quirks_4tap_nohs400 },
 	{ .soc_id = "r8a7796", .revision = "ES1.*", .data = &sdhi_quirks_r8a7796_es13 },
-	{ .soc_id = "r8a77961", .data = &sdhi_quirks_bad_taps1357 },
-	{ .soc_id = "r8a77965", .data = &sdhi_quirks_r8a77965 },
-	{ .soc_id = "r8a77980", .data = &sdhi_quirks_nohs400 },
-	{ .soc_id = "r8a77990", .data = &sdhi_quirks_r8a77990 },
 	{ /* Sentinel. */ },
 };
 
@@ -957,6 +921,7 @@ int renesas_sdhi_probe(struct platform_device *pdev,
 	struct tmio_mmc_data *mmd = pdev->dev.platform_data;
 	const struct renesas_sdhi_quirks *quirks = NULL;
 	const struct renesas_sdhi_of_data *of_data;
+	const struct renesas_sdhi_of_data_with_quirks *of_data_quirks;
 	const struct soc_device_attribute *attr;
 	struct tmio_mmc_data *mmc_data;
 	struct tmio_mmc_dma *dma_priv;
@@ -966,11 +931,14 @@ int renesas_sdhi_probe(struct platform_device *pdev,
 	struct resource *res;
 	u16 ver;
 
-	of_data = of_device_get_match_data(&pdev->dev);
+	of_data_quirks = of_device_get_match_data(&pdev->dev);
+	of_data = of_data_quirks->of_data;
 
 	attr = soc_device_match(sdhi_quirks_match);
 	if (attr)
 		quirks = attr->data;
+	else
+		quirks = of_data_quirks->quirks;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res)
diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
index e8f4863d8f1a..c4bd602dd8cf 100644
--- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
+++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
@@ -92,7 +92,7 @@ static struct renesas_sdhi_scc rcar_gen3_scc_taps[] = {
 	},
 };
 
-static const struct renesas_sdhi_of_data of_rza2_compatible = {
+static const struct renesas_sdhi_of_data of_data_rza2 = {
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_CLK_ACTUAL |
 			  TMIO_MMC_HAVE_CBSY,
 	.tmio_ocr_mask	= MMC_VDD_32_33,
@@ -107,7 +107,11 @@ static const struct renesas_sdhi_of_data of_rza2_compatible = {
 	.max_segs	= 1,
 };
 
-static const struct renesas_sdhi_of_data of_rcar_gen3_compatible = {
+static const struct renesas_sdhi_of_data_with_quirks of_rza2_compatible = {
+	.of_data	= &of_data_rza2,
+};
+
+static const struct renesas_sdhi_of_data of_data_rcar_gen3 = {
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_CLK_ACTUAL |
 			  TMIO_MMC_HAVE_CBSY | TMIO_MMC_MIN_RCAR2,
 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
@@ -122,11 +126,79 @@ static const struct renesas_sdhi_of_data of_rcar_gen3_compatible = {
 	.max_segs	= 1,
 };
 
+static const struct renesas_sdhi_quirks sdhi_quirks_nohs400 = {
+	.hs400_disabled = true,
+};
+
+static const struct renesas_sdhi_quirks sdhi_quirks_bad_taps1357 = {
+	.hs400_bad_taps = BIT(1) | BIT(3) | BIT(5) | BIT(7),
+};
+
+static const struct renesas_sdhi_quirks sdhi_quirks_bad_taps2367 = {
+	.hs400_bad_taps = BIT(2) | BIT(3) | BIT(6) | BIT(7),
+};
+
+static const u8 r8a77965_calib_table[2][SDHI_CALIB_TABLE_MAX] = {
+	{ 1,  2,  6,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 15, 15, 16,
+	 17, 18, 19, 20, 21, 22, 23, 24, 25, 25, 26, 27, 28, 29, 30, 31 },
+	{ 2,  3,  4,  4,  5,  6,  7,  9, 10, 11, 12, 13, 14, 15, 16, 17,
+	 17, 17, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31, 31, 31, 31 }
+};
+
+static const u8 r8a77990_calib_table[2][SDHI_CALIB_TABLE_MAX] = {
+	{ 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+	  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0 },
+	{ 0,  0,  0,  1,  2,  3,  3,  4,  4,  4,  5,  5,  6,  8,  9, 10,
+	 11, 12, 13, 15, 16, 17, 17, 18, 18, 19, 20, 22, 24, 25, 26, 26 }
+};
+
+static const struct renesas_sdhi_quirks sdhi_quirks_r8a77965 = {
+	.hs400_bad_taps = BIT(2) | BIT(3) | BIT(6) | BIT(7),
+	.hs400_calib_table = r8a77965_calib_table,
+};
+
+static const struct renesas_sdhi_quirks sdhi_quirks_r8a77990 = {
+	.hs400_calib_table = r8a77990_calib_table,
+};
+
+static const struct renesas_sdhi_of_data_with_quirks of_r8a7795_compatible = {
+	.of_data	= &of_data_rcar_gen3,
+	.quirks		= &sdhi_quirks_bad_taps2367,
+};
+
+static const struct renesas_sdhi_of_data_with_quirks of_r8a77961_compatible = {
+	.of_data	= &of_data_rcar_gen3,
+	.quirks		= &sdhi_quirks_bad_taps1357,
+};
+
+static const struct renesas_sdhi_of_data_with_quirks of_r8a77965_compatible = {
+	.of_data	= &of_data_rcar_gen3,
+	.quirks		= &sdhi_quirks_r8a77965,
+};
+
+static const struct renesas_sdhi_of_data_with_quirks of_r8a77980_compatible = {
+	.of_data	= &of_data_rcar_gen3,
+	.quirks		= &sdhi_quirks_nohs400,
+};
+
+static const struct renesas_sdhi_of_data_with_quirks of_r8a77990_compatible = {
+	.of_data	= &of_data_rcar_gen3,
+	.quirks		= &sdhi_quirks_r8a77990,
+};
+
+static const struct renesas_sdhi_of_data_with_quirks of_rcar_gen3_compatible = {
+	.of_data	= &of_data_rcar_gen3,
+};
+
 static const struct of_device_id renesas_sdhi_internal_dmac_of_match[] = {
 	{ .compatible = "renesas,sdhi-r7s9210", .data = &of_rza2_compatible, },
 	{ .compatible = "renesas,sdhi-mmc-r8a77470", .data = &of_rcar_gen3_compatible, },
-	{ .compatible = "renesas,sdhi-r8a7795", .data = &of_rcar_gen3_compatible, },
+	{ .compatible = "renesas,sdhi-r8a7795", .data = &of_r8a7795_compatible, },
 	{ .compatible = "renesas,sdhi-r8a7796", .data = &of_rcar_gen3_compatible, },
+	{ .compatible = "renesas,sdhi-r8a77961", .data = &of_r8a77961_compatible, },
+	{ .compatible = "renesas,sdhi-r8a77965", .data = &of_r8a77965_compatible, },
+	{ .compatible = "renesas,sdhi-r8a77980", .data = &of_r8a77980_compatible, },
+	{ .compatible = "renesas,sdhi-r8a77990", .data = &of_r8a77990_compatible, },
 	{ .compatible = "renesas,rcar-gen3-sdhi", .data = &of_rcar_gen3_compatible, },
 	{},
 };
diff --git a/drivers/mmc/host/renesas_sdhi_sys_dmac.c b/drivers/mmc/host/renesas_sdhi_sys_dmac.c
index ffa64211f4de..9255e93e6248 100644
--- a/drivers/mmc/host/renesas_sdhi_sys_dmac.c
+++ b/drivers/mmc/host/renesas_sdhi_sys_dmac.c
@@ -25,11 +25,15 @@
 
 #define TMIO_MMC_MIN_DMA_LEN 8
 
-static const struct renesas_sdhi_of_data of_default_cfg = {
+static const struct renesas_sdhi_of_data of_data_default_cfg = {
 	.tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
 };
 
-static const struct renesas_sdhi_of_data of_rz_compatible = {
+static const struct renesas_sdhi_of_data_with_quirks of_default_cfg = {
+	.of_data	= &of_data_default_cfg,
+};
+
+static const struct renesas_sdhi_of_data of_data_rz = {
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_32BIT_DATA_PORT |
 			  TMIO_MMC_HAVE_CBSY,
 	.tmio_ocr_mask	= MMC_VDD_32_33,
@@ -37,13 +41,21 @@ static const struct renesas_sdhi_of_data of_rz_compatible = {
 			  MMC_CAP_WAIT_WHILE_BUSY,
 };
 
-static const struct renesas_sdhi_of_data of_rcar_gen1_compatible = {
+static const struct renesas_sdhi_of_data_with_quirks of_rz_compatible = {
+	.of_data	= &of_data_rz,
+};
+
+static const struct renesas_sdhi_of_data of_data_rcar_gen1 = {
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_CLK_ACTUAL,
 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_WAIT_WHILE_BUSY,
 	.capabilities2	= MMC_CAP2_NO_WRITE_PROTECT,
 };
 
+static const struct renesas_sdhi_of_data_with_quirks of_rcar_gen1_compatible = {
+	.of_data	= &of_data_rcar_gen1,
+};
+
 /* Definitions for sampling clocks */
 static struct renesas_sdhi_scc rcar_gen2_scc_taps[] = {
 	{
@@ -56,7 +68,7 @@ static struct renesas_sdhi_scc rcar_gen2_scc_taps[] = {
 	},
 };
 
-static const struct renesas_sdhi_of_data of_rcar_gen2_compatible = {
+static const struct renesas_sdhi_of_data of_data_rcar_gen2 = {
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_CLK_ACTUAL |
 			  TMIO_MMC_HAVE_CBSY | TMIO_MMC_MIN_RCAR2,
 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
@@ -70,6 +82,10 @@ static const struct renesas_sdhi_of_data of_rcar_gen2_compatible = {
 	.max_blk_count	= UINT_MAX / TMIO_MAX_BLK_SIZE,
 };
 
+static const struct renesas_sdhi_of_data_with_quriks of_rcar_gen2_compatible = {
+	.of_data	= &of_data_rcar_gen2,
+};
+
 static const struct of_device_id renesas_sdhi_sys_dmac_of_match[] = {
 	{ .compatible = "renesas,sdhi-sh73a0", .data = &of_default_cfg, },
 	{ .compatible = "renesas,sdhi-r8a73a4", .data = &of_default_cfg, },
-- 
2.25.1


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

* Re: [PATCH/RFC] mmc: host: renesas_sdhi: Refactor of_device_id.data
  2021-06-25  7:55 [PATCH/RFC] mmc: host: renesas_sdhi: Refactor of_device_id.data Yoshihiro Shimoda
@ 2021-06-25 11:20 ` Geert Uytterhoeven
  2021-06-25 12:36   ` Yoshihiro Shimoda
  2021-06-25 11:56 ` kernel test robot
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2021-06-25 11:20 UTC (permalink / raw)
  To: Yoshihiro Shimoda
  Cc: Ulf Hansson, Wolfram Sang, Linux MMC List, Linux-Renesas

Hi Shimoda-san,

On Fri, Jun 25, 2021 at 9:56 AM Yoshihiro Shimoda
<yoshihiro.shimoda.uh@renesas.com> wrote:
> Refactor of_device_id.data to avoid increasing numbers of
> sdhi_quirks_match[] entry when we add other stable SoCs like
> r8a779m*.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Thanks for your patch!

> --- a/drivers/mmc/host/renesas_sdhi_core.c
> +++ b/drivers/mmc/host/renesas_sdhi_core.c
> @@ -941,13 +910,8 @@ static const struct soc_device_attribute sdhi_quirks_match[]  = {
>         { .soc_id = "r8a774a1", .revision = "ES1.[012]", .data = &sdhi_quirks_4tap_nohs400 },
>         { .soc_id = "r8a7795", .revision = "ES1.*", .data = &sdhi_quirks_4tap_nohs400 },
>         { .soc_id = "r8a7795", .revision = "ES2.0", .data = &sdhi_quirks_4tap },
> -       { .soc_id = "r8a7795", .revision = "ES3.*", .data = &sdhi_quirks_bad_taps2367 },
>         { .soc_id = "r8a7796", .revision = "ES1.[012]", .data = &sdhi_quirks_4tap_nohs400 },
>         { .soc_id = "r8a7796", .revision = "ES1.*", .data = &sdhi_quirks_r8a7796_es13 },
> -       { .soc_id = "r8a77961", .data = &sdhi_quirks_bad_taps1357 },
> -       { .soc_id = "r8a77965", .data = &sdhi_quirks_r8a77965 },
> -       { .soc_id = "r8a77980", .data = &sdhi_quirks_nohs400 },
> -       { .soc_id = "r8a77990", .data = &sdhi_quirks_r8a77990 },
>         { /* Sentinel. */ },
>  };
>
> @@ -957,6 +921,7 @@ int renesas_sdhi_probe(struct platform_device *pdev,
>         struct tmio_mmc_data *mmd = pdev->dev.platform_data;
>         const struct renesas_sdhi_quirks *quirks = NULL;
>         const struct renesas_sdhi_of_data *of_data;
> +       const struct renesas_sdhi_of_data_with_quirks *of_data_quirks;
>         const struct soc_device_attribute *attr;
>         struct tmio_mmc_data *mmc_data;
>         struct tmio_mmc_dma *dma_priv;
> @@ -966,11 +931,14 @@ int renesas_sdhi_probe(struct platform_device *pdev,
>         struct resource *res;
>         u16 ver;
>
> -       of_data = of_device_get_match_data(&pdev->dev);
> +       of_data_quirks = of_device_get_match_data(&pdev->dev);
> +       of_data = of_data_quirks->of_data;
>
>         attr = soc_device_match(sdhi_quirks_match);
>         if (attr)
>                 quirks = attr->data;
> +       else
> +               quirks = of_data_quirks->quirks;

Please do not use "else" statements in soc_device_match()-based
quirk handling, as that makes it less trivial to remove the quirk
handling later.

I.e. move "quirks = of_data_quirks->quirks;" up, before the call
to soc_device_match().

>
>         res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>         if (!res)

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH/RFC] mmc: host: renesas_sdhi: Refactor of_device_id.data
  2021-06-25  7:55 [PATCH/RFC] mmc: host: renesas_sdhi: Refactor of_device_id.data Yoshihiro Shimoda
  2021-06-25 11:20 ` Geert Uytterhoeven
@ 2021-06-25 11:56 ` kernel test robot
  2021-06-25 12:42 ` Yoshihiro Shimoda
  2021-06-25 13:31 ` kernel test robot
  3 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-06-25 11:56 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3367 bytes --]

Hi Yoshihiro,

[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on linus/master]
[also build test ERROR on v5.13-rc7 next-20210624]
[cannot apply to ulf.hansson-mmc/next mmc/mmc-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Yoshihiro-Shimoda/mmc-host-renesas_sdhi-Refactor-of_device_id-data/20210625-155649
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 44db63d1ad8d71c6932cbe007eb41f31c434d140
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/65ed2fb7de0fe472ab41c6027706b4f08a176305
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Yoshihiro-Shimoda/mmc-host-renesas_sdhi-Refactor-of_device_id-data/20210625-155649
        git checkout 65ed2fb7de0fe472ab41c6027706b4f08a176305
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sh 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

>> drivers/mmc/host/renesas_sdhi_sys_dmac.c:85:21: error: variable 'of_rcar_gen2_compatible' has initializer but incomplete type
      85 | static const struct renesas_sdhi_of_data_with_quriks of_rcar_gen2_compatible = {
         |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/mmc/host/renesas_sdhi_sys_dmac.c:86:3: error: 'const struct renesas_sdhi_of_data_with_quriks' has no member named 'of_data'
      86 |  .of_data = &of_data_rcar_gen2,
         |   ^~~~~~~
>> drivers/mmc/host/renesas_sdhi_sys_dmac.c:86:13: warning: excess elements in struct initializer
      86 |  .of_data = &of_data_rcar_gen2,
         |             ^
   drivers/mmc/host/renesas_sdhi_sys_dmac.c:86:13: note: (near initialization for 'of_rcar_gen2_compatible')
>> drivers/mmc/host/renesas_sdhi_sys_dmac.c:85:54: error: storage size of 'of_rcar_gen2_compatible' isn't known
      85 | static const struct renesas_sdhi_of_data_with_quriks of_rcar_gen2_compatible = {
         |                                                      ^~~~~~~~~~~~~~~~~~~~~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for SND_ATMEL_SOC_PDC
   Depends on SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && HAS_DMA
   Selected by
   - SND_ATMEL_SOC_SSC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC
   - SND_ATMEL_SOC_SSC_PDC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && ATMEL_SSC


vim +/of_rcar_gen2_compatible +85 drivers/mmc/host/renesas_sdhi_sys_dmac.c

    84	
  > 85	static const struct renesas_sdhi_of_data_with_quriks of_rcar_gen2_compatible = {
  > 86		.of_data	= &of_data_rcar_gen2,
    87	};
    88	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 54789 bytes --]

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

* RE: [PATCH/RFC] mmc: host: renesas_sdhi: Refactor of_device_id.data
  2021-06-25 11:20 ` Geert Uytterhoeven
@ 2021-06-25 12:36   ` Yoshihiro Shimoda
  0 siblings, 0 replies; 6+ messages in thread
From: Yoshihiro Shimoda @ 2021-06-25 12:36 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Ulf Hansson, Wolfram Sang, Linux MMC List, Linux-Renesas

Hi Geert-san,

> From: Geert Uytterhoeven, Sent: Friday, June 25, 2021 8:21 PM
> 
> On Fri, Jun 25, 2021 at 9:56 AM Yoshihiro Shimoda wrote:
> > Refactor of_device_id.data to avoid increasing numbers of
> > sdhi_quirks_match[] entry when we add other stable SoCs like
> > r8a779m*.
> >
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> 
> Thanks for your patch!
> 
> > --- a/drivers/mmc/host/renesas_sdhi_core.c
> > +++ b/drivers/mmc/host/renesas_sdhi_core.c
> > @@ -941,13 +910,8 @@ static const struct soc_device_attribute sdhi_quirks_match[]  = {
> >         { .soc_id = "r8a774a1", .revision = "ES1.[012]", .data = &sdhi_quirks_4tap_nohs400 },
> >         { .soc_id = "r8a7795", .revision = "ES1.*", .data = &sdhi_quirks_4tap_nohs400 },
> >         { .soc_id = "r8a7795", .revision = "ES2.0", .data = &sdhi_quirks_4tap },
> > -       { .soc_id = "r8a7795", .revision = "ES3.*", .data = &sdhi_quirks_bad_taps2367 },
> >         { .soc_id = "r8a7796", .revision = "ES1.[012]", .data = &sdhi_quirks_4tap_nohs400 },
> >         { .soc_id = "r8a7796", .revision = "ES1.*", .data = &sdhi_quirks_r8a7796_es13 },
> > -       { .soc_id = "r8a77961", .data = &sdhi_quirks_bad_taps1357 },
> > -       { .soc_id = "r8a77965", .data = &sdhi_quirks_r8a77965 },
> > -       { .soc_id = "r8a77980", .data = &sdhi_quirks_nohs400 },
> > -       { .soc_id = "r8a77990", .data = &sdhi_quirks_r8a77990 },
> >         { /* Sentinel. */ },
> >  };
> >
> > @@ -957,6 +921,7 @@ int renesas_sdhi_probe(struct platform_device *pdev,
> >         struct tmio_mmc_data *mmd = pdev->dev.platform_data;
> >         const struct renesas_sdhi_quirks *quirks = NULL;
> >         const struct renesas_sdhi_of_data *of_data;
> > +       const struct renesas_sdhi_of_data_with_quirks *of_data_quirks;
> >         const struct soc_device_attribute *attr;
> >         struct tmio_mmc_data *mmc_data;
> >         struct tmio_mmc_dma *dma_priv;
> > @@ -966,11 +931,14 @@ int renesas_sdhi_probe(struct platform_device *pdev,
> >         struct resource *res;
> >         u16 ver;
> >
> > -       of_data = of_device_get_match_data(&pdev->dev);
> > +       of_data_quirks = of_device_get_match_data(&pdev->dev);
> > +       of_data = of_data_quirks->of_data;
> >
> >         attr = soc_device_match(sdhi_quirks_match);
> >         if (attr)
> >                 quirks = attr->data;
> > +       else
> > +               quirks = of_data_quirks->quirks;
> 
> Please do not use "else" statements in soc_device_match()-based
> quirk handling, as that makes it less trivial to remove the quirk
> handling later.
> 
> I.e. move "quirks = of_data_quirks->quirks;" up, before the call
> to soc_device_match().

Thank you for your review and suggestion! I'll fix this.

Best regards,
Yoshihiro Shimoda


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

* RE: [PATCH/RFC] mmc: host: renesas_sdhi: Refactor of_device_id.data
  2021-06-25  7:55 [PATCH/RFC] mmc: host: renesas_sdhi: Refactor of_device_id.data Yoshihiro Shimoda
  2021-06-25 11:20 ` Geert Uytterhoeven
  2021-06-25 11:56 ` kernel test robot
@ 2021-06-25 12:42 ` Yoshihiro Shimoda
  2021-06-25 13:31 ` kernel test robot
  3 siblings, 0 replies; 6+ messages in thread
From: Yoshihiro Shimoda @ 2021-06-25 12:42 UTC (permalink / raw)
  To: ulf.hansson, wsa+renesas; +Cc: linux-mmc, linux-renesas-soc

Hi,

> From: Yoshihiro Shimoda, Sent: Friday, June 25, 2021 4:55 PM
> 
> Refactor of_device_id.data to avoid increasing numbers of
> sdhi_quirks_match[] entry when we add other stable SoCs like
> r8a779m*.
> 
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
<snip>
> diff --git a/drivers/mmc/host/renesas_sdhi_sys_dmac.c b/drivers/mmc/host/renesas_sdhi_sys_dmac.c
> index ffa64211f4de..9255e93e6248 100644
> --- a/drivers/mmc/host/renesas_sdhi_sys_dmac.c
> +++ b/drivers/mmc/host/renesas_sdhi_sys_dmac.c
> @@ -25,11 +25,15 @@
<snip> 
> @@ -70,6 +82,10 @@ static const struct renesas_sdhi_of_data of_rcar_gen2_compatible = {
>  	.max_blk_count	= UINT_MAX / TMIO_MAX_BLK_SIZE,
>  };
> 
> +static const struct renesas_sdhi_of_data_with_quriks of_rcar_gen2_compatible = {

s/quriks/quirks/

I got this report from kernel test robot locally.
So, I'll fix this build error (in next week).

Best regards,
Yoshihiro Shimoda


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

* Re: [PATCH/RFC] mmc: host: renesas_sdhi: Refactor of_device_id.data
  2021-06-25  7:55 [PATCH/RFC] mmc: host: renesas_sdhi: Refactor of_device_id.data Yoshihiro Shimoda
                   ` (2 preceding siblings ...)
  2021-06-25 12:42 ` Yoshihiro Shimoda
@ 2021-06-25 13:31 ` kernel test robot
  3 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-06-25 13:31 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 4851 bytes --]

Hi Yoshihiro,

[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on linus/master]
[also build test ERROR on v5.13-rc7 next-20210625]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Yoshihiro-Shimoda/mmc-host-renesas_sdhi-Refactor-of_device_id-data/20210625-155649
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 44db63d1ad8d71c6932cbe007eb41f31c434d140
config: arm-randconfig-r026-20210622 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 9ca0171a9ffdef5fdb1511d197a3fd72490362de)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://github.com/0day-ci/linux/commit/65ed2fb7de0fe472ab41c6027706b4f08a176305
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Yoshihiro-Shimoda/mmc-host-renesas_sdhi-Refactor-of_device_id-data/20210625-155649
        git checkout 65ed2fb7de0fe472ab41c6027706b4f08a176305
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

>> drivers/mmc/host/renesas_sdhi_sys_dmac.c:85:54: error: variable has incomplete type 'const struct renesas_sdhi_of_data_with_quriks'
   static const struct renesas_sdhi_of_data_with_quriks of_rcar_gen2_compatible = {
                                                        ^
   drivers/mmc/host/renesas_sdhi_sys_dmac.c:85:21: note: forward declaration of 'struct renesas_sdhi_of_data_with_quriks'
   static const struct renesas_sdhi_of_data_with_quriks of_rcar_gen2_compatible = {
                       ^
>> drivers/mmc/host/renesas_sdhi_sys_dmac.c:108:1: error: definition of variable with array type needs an explicit size or an initializer
   MODULE_DEVICE_TABLE(of, renesas_sdhi_sys_dmac_of_match);
   ^
   include/linux/module.h:243:21: note: expanded from macro 'MODULE_DEVICE_TABLE'
   extern typeof(name) __mod_##type##__##name##_device_table               \
                       ^
   <scratch space>:214:1: note: expanded from here
   __mod_of__renesas_sdhi_sys_dmac_of_match_device_table
   ^
   2 errors generated.
--
>> drivers/mmc/host/renesas_sdhi_core.c:894:41: warning: unused variable 'sdhi_quirks_nohs400' [-Wunused-const-variable]
   static const struct renesas_sdhi_quirks sdhi_quirks_nohs400 = {
                                           ^
   1 warning generated.


vim +85 drivers/mmc/host/renesas_sdhi_sys_dmac.c

    84	
  > 85	static const struct renesas_sdhi_of_data_with_quriks of_rcar_gen2_compatible = {
    86		.of_data	= &of_data_rcar_gen2,
    87	};
    88	
    89	static const struct of_device_id renesas_sdhi_sys_dmac_of_match[] = {
    90		{ .compatible = "renesas,sdhi-sh73a0", .data = &of_default_cfg, },
    91		{ .compatible = "renesas,sdhi-r8a73a4", .data = &of_default_cfg, },
    92		{ .compatible = "renesas,sdhi-r8a7740", .data = &of_default_cfg, },
    93		{ .compatible = "renesas,sdhi-r7s72100", .data = &of_rz_compatible, },
    94		{ .compatible = "renesas,sdhi-r8a7778", .data = &of_rcar_gen1_compatible, },
    95		{ .compatible = "renesas,sdhi-r8a7779", .data = &of_rcar_gen1_compatible, },
    96		{ .compatible = "renesas,sdhi-r8a7743", .data = &of_rcar_gen2_compatible, },
    97		{ .compatible = "renesas,sdhi-r8a7745", .data = &of_rcar_gen2_compatible, },
    98		{ .compatible = "renesas,sdhi-r8a7790", .data = &of_rcar_gen2_compatible, },
    99		{ .compatible = "renesas,sdhi-r8a7791", .data = &of_rcar_gen2_compatible, },
   100		{ .compatible = "renesas,sdhi-r8a7792", .data = &of_rcar_gen2_compatible, },
   101		{ .compatible = "renesas,sdhi-r8a7793", .data = &of_rcar_gen2_compatible, },
   102		{ .compatible = "renesas,sdhi-r8a7794", .data = &of_rcar_gen2_compatible, },
   103		{ .compatible = "renesas,rcar-gen1-sdhi", .data = &of_rcar_gen1_compatible, },
   104		{ .compatible = "renesas,rcar-gen2-sdhi", .data = &of_rcar_gen2_compatible, },
   105		{ .compatible = "renesas,sdhi-shmobile" },
   106		{},
   107	};
 > 108	MODULE_DEVICE_TABLE(of, renesas_sdhi_sys_dmac_of_match);
   109	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 32301 bytes --]

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

end of thread, other threads:[~2021-06-25 13:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-25  7:55 [PATCH/RFC] mmc: host: renesas_sdhi: Refactor of_device_id.data Yoshihiro Shimoda
2021-06-25 11:20 ` Geert Uytterhoeven
2021-06-25 12:36   ` Yoshihiro Shimoda
2021-06-25 11:56 ` kernel test robot
2021-06-25 12:42 ` Yoshihiro Shimoda
2021-06-25 13:31 ` kernel test robot

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.