diff mbox series

[v2] mmc: sdhci-of-dwcmshc: add ACPI match data for BlueField-3 SoC

Message ID 20220807205630.251939-1-limings@nvidia.com
State Superseded
Headers show
Series [v2] mmc: sdhci-of-dwcmshc: add ACPI match data for BlueField-3 SoC | expand

Commit Message

Liming Sun Aug. 7, 2022, 8:56 p.m. UTC
Commit 08f3dff799d43 introduces the of_device_get_match_data()
checking for some chip but breaks the BlueField-3 firmware which
uses ACPI instead. This commit adds the ACPI match data and
quirks/quirks2 to re-enable the support of BlueField-3 SoC.

Reviewed-by: David Woods <davwoods@nvidia.com>
Signed-off-by: Liming Sun <limings@nvidia.com>
---
v1->v2:
    Fixes an acpi warning
    Reported-by: kernel test robot <lkp@intel.com>
v1: Initial version.
---
 drivers/mmc/host/sdhci-of-dwcmshc.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

Comments

Adrian Hunter Aug. 8, 2022, 8:26 a.m. UTC | #1
On 7/08/22 23:56, Liming Sun wrote:
> Commit 08f3dff799d43 introduces the of_device_get_match_data()
> checking for some chip but breaks the BlueField-3 firmware which
> uses ACPI instead. This commit adds the ACPI match data and
> quirks/quirks2 to re-enable the support of BlueField-3 SoC.
> 
> Reviewed-by: David Woods <davwoods@nvidia.com>
> Signed-off-by: Liming Sun <limings@nvidia.com>

Please re-base this patch because it does not apply to
latest mmc "next" branch.

> ---
> v1->v2:
>     Fixes an acpi warning
>     Reported-by: kernel test robot <lkp@intel.com>
> v1: Initial version.
> ---
>  drivers/mmc/host/sdhci-of-dwcmshc.c | 16 ++++++++++++++--
>  1 file changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c
> index bac874ab0b33..a0c73ddaaaa4 100644
> --- a/drivers/mmc/host/sdhci-of-dwcmshc.c
> +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
> @@ -279,6 +279,15 @@ static const struct sdhci_pltfm_data sdhci_dwcmshc_pdata = {
>  	.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
>  };
>  
> +#ifdef CONFIG_ACPI
> +static const struct sdhci_pltfm_data sdhci_dwcmshc_bf3_pdata = {
> +	.ops = &sdhci_dwcmshc_ops,
> +	.quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
> +	.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
> +		   SDHCI_QUIRK2_ACMD23_BROKEN,
> +};
> +#endif
> +
>  static const struct sdhci_pltfm_data sdhci_dwcmshc_rk3568_pdata = {
>  	.ops = &sdhci_dwcmshc_rk3568_ops,
>  	.quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN |
> @@ -336,7 +345,10 @@ MODULE_DEVICE_TABLE(of, sdhci_dwcmshc_dt_ids);
>  
>  #ifdef CONFIG_ACPI
>  static const struct acpi_device_id sdhci_dwcmshc_acpi_ids[] = {
> -	{ .id = "MLNXBF30" },
> +	{
> +		.id = "MLNXBF30",
> +		.driver_data = (kernel_ulong_t)&sdhci_dwcmshc_bf3_pdata,
> +	},
>  	{}
>  };
>  #endif
> @@ -352,7 +364,7 @@ static int dwcmshc_probe(struct platform_device *pdev)
>  	int err;
>  	u32 extra;
>  
> -	pltfm_data = of_device_get_match_data(&pdev->dev);
> +	pltfm_data = device_get_match_data(&pdev->dev);
>  	if (!pltfm_data) {
>  		dev_err(&pdev->dev, "Error: No device match data found\n");
>  		return -ENODEV;
Liming Sun Aug. 9, 2022, 5:39 p.m. UTC | #2
Thanks. Done and rebased to mmc 'next' in patch v3.

> -----Original Message-----
> From: Adrian Hunter <adrian.hunter@intel.com>
> Sent: Monday, August 8, 2022 4:26 AM
> To: Liming Sun <limings@nvidia.com>; Ulf Hansson <ulf.hansson@linaro.org>;
> David Woods <davwoods@nvidia.com>; Shawn Lin <shawn.lin@rock-
> chips.com>
> Cc: linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v2] mmc: sdhci-of-dwcmshc: add ACPI match data for
> BlueField-3 SoC
> 
> On 7/08/22 23:56, Liming Sun wrote:
> > Commit 08f3dff799d43 introduces the of_device_get_match_data()
> > checking for some chip but breaks the BlueField-3 firmware which
> > uses ACPI instead. This commit adds the ACPI match data and
> > quirks/quirks2 to re-enable the support of BlueField-3 SoC.
> >
> > Reviewed-by: David Woods <davwoods@nvidia.com>
> > Signed-off-by: Liming Sun <limings@nvidia.com>
> 
> Please re-base this patch because it does not apply to
> latest mmc "next" branch.
> 
> > ---
> > v1->v2:
> >     Fixes an acpi warning
> >     Reported-by: kernel test robot <lkp@intel.com>
> > v1: Initial version.
> > ---
> >  drivers/mmc/host/sdhci-of-dwcmshc.c | 16 ++++++++++++++--
> >  1 file changed, 14 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c
> b/drivers/mmc/host/sdhci-of-dwcmshc.c
> > index bac874ab0b33..a0c73ddaaaa4 100644
> > --- a/drivers/mmc/host/sdhci-of-dwcmshc.c
> > +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
> > @@ -279,6 +279,15 @@ static const struct sdhci_pltfm_data
> sdhci_dwcmshc_pdata = {
> >  	.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
> >  };
> >
> > +#ifdef CONFIG_ACPI
> > +static const struct sdhci_pltfm_data sdhci_dwcmshc_bf3_pdata = {
> > +	.ops = &sdhci_dwcmshc_ops,
> > +	.quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
> > +	.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
> > +		   SDHCI_QUIRK2_ACMD23_BROKEN,
> > +};
> > +#endif
> > +
> >  static const struct sdhci_pltfm_data sdhci_dwcmshc_rk3568_pdata = {
> >  	.ops = &sdhci_dwcmshc_rk3568_ops,
> >  	.quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN |
> > @@ -336,7 +345,10 @@ MODULE_DEVICE_TABLE(of,
> sdhci_dwcmshc_dt_ids);
> >
> >  #ifdef CONFIG_ACPI
> >  static const struct acpi_device_id sdhci_dwcmshc_acpi_ids[] = {
> > -	{ .id = "MLNXBF30" },
> > +	{
> > +		.id = "MLNXBF30",
> > +		.driver_data = (kernel_ulong_t)&sdhci_dwcmshc_bf3_pdata,
> > +	},
> >  	{}
> >  };
> >  #endif
> > @@ -352,7 +364,7 @@ static int dwcmshc_probe(struct platform_device
> *pdev)
> >  	int err;
> >  	u32 extra;
> >
> > -	pltfm_data = of_device_get_match_data(&pdev->dev);
> > +	pltfm_data = device_get_match_data(&pdev->dev);
> >  	if (!pltfm_data) {
> >  		dev_err(&pdev->dev, "Error: No device match data found\n");
> >  		return -ENODEV;
diff mbox series

Patch

diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c
index bac874ab0b33..a0c73ddaaaa4 100644
--- a/drivers/mmc/host/sdhci-of-dwcmshc.c
+++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
@@ -279,6 +279,15 @@  static const struct sdhci_pltfm_data sdhci_dwcmshc_pdata = {
 	.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
 };
 
+#ifdef CONFIG_ACPI
+static const struct sdhci_pltfm_data sdhci_dwcmshc_bf3_pdata = {
+	.ops = &sdhci_dwcmshc_ops,
+	.quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
+	.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
+		   SDHCI_QUIRK2_ACMD23_BROKEN,
+};
+#endif
+
 static const struct sdhci_pltfm_data sdhci_dwcmshc_rk3568_pdata = {
 	.ops = &sdhci_dwcmshc_rk3568_ops,
 	.quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN |
@@ -336,7 +345,10 @@  MODULE_DEVICE_TABLE(of, sdhci_dwcmshc_dt_ids);
 
 #ifdef CONFIG_ACPI
 static const struct acpi_device_id sdhci_dwcmshc_acpi_ids[] = {
-	{ .id = "MLNXBF30" },
+	{
+		.id = "MLNXBF30",
+		.driver_data = (kernel_ulong_t)&sdhci_dwcmshc_bf3_pdata,
+	},
 	{}
 };
 #endif
@@ -352,7 +364,7 @@  static int dwcmshc_probe(struct platform_device *pdev)
 	int err;
 	u32 extra;
 
-	pltfm_data = of_device_get_match_data(&pdev->dev);
+	pltfm_data = device_get_match_data(&pdev->dev);
 	if (!pltfm_data) {
 		dev_err(&pdev->dev, "Error: No device match data found\n");
 		return -ENODEV;