linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: kempld-core: Check for DMI definition before ACPI
@ 2020-11-10  7:46 Michael Brunner
  2020-11-10 14:39 ` Guenter Roeck
  2020-11-10 15:23 ` [PATCH v2] " Michael Brunner
  0 siblings, 2 replies; 12+ messages in thread
From: Michael Brunner @ 2020-11-10  7:46 UTC (permalink / raw)
  To: lee.jones; +Cc: linux, sameo, mibru, vkrasnov, linux-kernel, mvanyulin

Change the detection order to priorize DMI table entries over available
ACPI entries.

This makes it more easy for product developers to patch product specific
handling into the driver.
Furthermore it allows to simplify the implementation a bit and
especially to remove the need to force synchronous probing.

Based on the following commit introduced with v5.10-rc1:
commit e8299c7313af ("mfd: Add ACPI support to Kontron PLD driver")

Signed-off-by: Michael Brunner <michael.brunner@kontron.com>
---
 drivers/mfd/kempld-core.c | 23 ++---------------------
 1 file changed, 2 insertions(+), 21 deletions(-)

diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c
index 2c9295953c11..aa7f386646a1 100644
--- a/drivers/mfd/kempld-core.c
+++ b/drivers/mfd/kempld-core.c
@@ -125,7 +125,6 @@ static const struct kempld_platform_data kempld_platform_data_generic = {
 };
 
 static struct platform_device *kempld_pdev;
-static bool kempld_acpi_mode;
 
 static int kempld_create_platform_device(const struct dmi_system_id *id)
 {
@@ -501,8 +500,6 @@ static int kempld_probe(struct platform_device *pdev)
 		ret = kempld_get_acpi_data(pdev);
 		if (ret)
 			return ret;
-
-		kempld_acpi_mode = true;
 	} else if (kempld_pdev != pdev) {
 		/*
 		 * The platform device we are probing is not the one we
@@ -565,7 +562,6 @@ static struct platform_driver kempld_driver = {
 	.driver		= {
 		.name	= "kempld",
 		.acpi_match_table = ACPI_PTR(kempld_acpi_table),
-		.probe_type = PROBE_FORCE_SYNCHRONOUS,
 	},
 	.probe		= kempld_probe,
 	.remove		= kempld_remove,
@@ -884,7 +880,6 @@ MODULE_DEVICE_TABLE(dmi, kempld_dmi_table);
 static int __init kempld_init(void)
 {
 	const struct dmi_system_id *id;
-	int ret;
 
 	if (force_device_id[0]) {
 		for (id = kempld_dmi_table;
@@ -894,24 +889,10 @@ static int __init kempld_init(void)
 					break;
 		if (id->matches[0].slot == DMI_NONE)
 			return -ENODEV;
-	}
-
-	ret = platform_driver_register(&kempld_driver);
-	if (ret)
-		return ret;
-
-	/*
-	 * With synchronous probing the device should already be probed now.
-	 * If no device id is forced and also no ACPI definition for the
-	 * device was found, scan DMI table as fallback.
-	 *
-	 * If drivers_autoprobing is disabled and the device is found here,
-	 * only that device can be bound manually later.
-	 */
-	if (!kempld_pdev && !kempld_acpi_mode)
+	} else
 		dmi_check_system(kempld_dmi_table);
 
-	return 0;
+	return platform_driver_register(&kempld_driver);
 }
 
 static void __exit kempld_exit(void)
-- 
2.25.1


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

* Re: [PATCH] mfd: kempld-core: Check for DMI definition before ACPI
  2020-11-10  7:46 [PATCH] mfd: kempld-core: Check for DMI definition before ACPI Michael Brunner
@ 2020-11-10 14:39 ` Guenter Roeck
  2020-11-10 15:41   ` Michael Brunner
  2020-11-10 15:23 ` [PATCH v2] " Michael Brunner
  1 sibling, 1 reply; 12+ messages in thread
From: Guenter Roeck @ 2020-11-10 14:39 UTC (permalink / raw)
  To: Michael Brunner, lee.jones
  Cc: sameo, mibru, vkrasnov, linux-kernel, mvanyulin

On 11/9/20 11:46 PM, Michael Brunner wrote:
> Change the detection order to priorize DMI table entries over available
> ACPI entries.
> 
> This makes it more easy for product developers to patch product specific
> handling into the driver.
> Furthermore it allows to simplify the implementation a bit and
> especially to remove the need to force synchronous probing.
> 
> Based on the following commit introduced with v5.10-rc1:
> commit e8299c7313af ("mfd: Add ACPI support to Kontron PLD driver")
> 
> Signed-off-by: Michael Brunner <michael.brunner@kontron.com>
> ---
>  drivers/mfd/kempld-core.c | 23 ++---------------------
>  1 file changed, 2 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c
> index 2c9295953c11..aa7f386646a1 100644
> --- a/drivers/mfd/kempld-core.c
> +++ b/drivers/mfd/kempld-core.c
> @@ -125,7 +125,6 @@ static const struct kempld_platform_data kempld_platform_data_generic = {
>  };
>  
>  static struct platform_device *kempld_pdev;
> -static bool kempld_acpi_mode;
>  
>  static int kempld_create_platform_device(const struct dmi_system_id *id)
>  {
> @@ -501,8 +500,6 @@ static int kempld_probe(struct platform_device *pdev)
>  		ret = kempld_get_acpi_data(pdev);
>  		if (ret)
>  			return ret;
> -
> -		kempld_acpi_mode = true;
>  	} else if (kempld_pdev != pdev) {
>  		/*
>  		 * The platform device we are probing is not the one we
> @@ -565,7 +562,6 @@ static struct platform_driver kempld_driver = {
>  	.driver		= {
>  		.name	= "kempld",
>  		.acpi_match_table = ACPI_PTR(kempld_acpi_table),
> -		.probe_type = PROBE_FORCE_SYNCHRONOUS,
>  	},
>  	.probe		= kempld_probe,
>  	.remove		= kempld_remove,
> @@ -884,7 +880,6 @@ MODULE_DEVICE_TABLE(dmi, kempld_dmi_table);
>  static int __init kempld_init(void)
>  {
>  	const struct dmi_system_id *id;
> -	int ret;
>  
>  	if (force_device_id[0]) {
>  		for (id = kempld_dmi_table;
> @@ -894,24 +889,10 @@ static int __init kempld_init(void)
>  					break;
>  		if (id->matches[0].slot == DMI_NONE)
>  			return -ENODEV;
> -	}
> -
> -	ret = platform_driver_register(&kempld_driver);
> -	if (ret)
> -		return ret;
> -
> -	/*
> -	 * With synchronous probing the device should already be probed now.
> -	 * If no device id is forced and also no ACPI definition for the
> -	 * device was found, scan DMI table as fallback.
> -	 *
> -	 * If drivers_autoprobing is disabled and the device is found here,
> -	 * only that device can be bound manually later.
> -	 */
> -	if (!kempld_pdev && !kempld_acpi_mode)
> +	} else

	} else {
>  		dmi_check_system(kempld_dmi_table);
	}

Guenter

>  
> -	return 0;
> +	return platform_driver_register(&kempld_driver);
>  }
>  
>  static void __exit kempld_exit(void)
> 


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

* [PATCH v2] mfd: kempld-core: Check for DMI definition before ACPI
  2020-11-10  7:46 [PATCH] mfd: kempld-core: Check for DMI definition before ACPI Michael Brunner
  2020-11-10 14:39 ` Guenter Roeck
@ 2020-11-10 15:23 ` Michael Brunner
  2020-11-10 16:11   ` Guenter Roeck
                     ` (2 more replies)
  1 sibling, 3 replies; 12+ messages in thread
From: Michael Brunner @ 2020-11-10 15:23 UTC (permalink / raw)
  To: lee.jones; +Cc: linux, sameo, mibru, vkrasnov, linux-kernel, mvanyulin

Change the detection order to priorize DMI table entries over available
ACPI entries.

This makes it more easy for product developers to patch product specific
handling into the driver.
Furthermore it allows to simplify the implementation a bit and
especially to remove the need to force synchronous probing.

Based on the following commit introduced with v5.10-rc1:
commit e8299c7313af ("mfd: Add ACPI support to Kontron PLD driver")

v2: Fixed coding style as suggested by Guenther Roeck

Signed-off-by: Michael Brunner <michael.brunner@kontron.com>
---
 drivers/mfd/kempld-core.c | 24 +++---------------------
 1 file changed, 3 insertions(+), 21 deletions(-)

diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c
index 2c9295953c11..ecd26271b9a4 100644
--- a/drivers/mfd/kempld-core.c
+++ b/drivers/mfd/kempld-core.c
@@ -125,7 +125,6 @@ static const struct kempld_platform_data kempld_platform_data_generic = {
 };
 
 static struct platform_device *kempld_pdev;
-static bool kempld_acpi_mode;
 
 static int kempld_create_platform_device(const struct dmi_system_id *id)
 {
@@ -501,8 +500,6 @@ static int kempld_probe(struct platform_device *pdev)
 		ret = kempld_get_acpi_data(pdev);
 		if (ret)
 			return ret;
-
-		kempld_acpi_mode = true;
 	} else if (kempld_pdev != pdev) {
 		/*
 		 * The platform device we are probing is not the one we
@@ -565,7 +562,6 @@ static struct platform_driver kempld_driver = {
 	.driver		= {
 		.name	= "kempld",
 		.acpi_match_table = ACPI_PTR(kempld_acpi_table),
-		.probe_type = PROBE_FORCE_SYNCHRONOUS,
 	},
 	.probe		= kempld_probe,
 	.remove		= kempld_remove,
@@ -884,7 +880,6 @@ MODULE_DEVICE_TABLE(dmi, kempld_dmi_table);
 static int __init kempld_init(void)
 {
 	const struct dmi_system_id *id;
-	int ret;
 
 	if (force_device_id[0]) {
 		for (id = kempld_dmi_table;
@@ -894,24 +889,11 @@ static int __init kempld_init(void)
 					break;
 		if (id->matches[0].slot == DMI_NONE)
 			return -ENODEV;
-	}
-
-	ret = platform_driver_register(&kempld_driver);
-	if (ret)
-		return ret;
-
-	/*
-	 * With synchronous probing the device should already be probed now.
-	 * If no device id is forced and also no ACPI definition for the
-	 * device was found, scan DMI table as fallback.
-	 *
-	 * If drivers_autoprobing is disabled and the device is found here,
-	 * only that device can be bound manually later.
-	 */
-	if (!kempld_pdev && !kempld_acpi_mode)
+	} else {
 		dmi_check_system(kempld_dmi_table);
+	}
 
-	return 0;
+	return platform_driver_register(&kempld_driver);
 }
 
 static void __exit kempld_exit(void)
-- 
2.25.1


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

* Re: [PATCH] mfd: kempld-core: Check for DMI definition before ACPI
  2020-11-10 14:39 ` Guenter Roeck
@ 2020-11-10 15:41   ` Michael Brunner
  2020-11-10 16:10     ` Guenter Roeck
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Brunner @ 2020-11-10 15:41 UTC (permalink / raw)
  To: linux, lee.jones; +Cc: sameo, mibru, vkrasnov, linux-kernel, mvanyulin

Hi Guenter,

thank you for the feedback! checkpatch didn't catch this.
I sent v2 of the patch.

Best regards,
  Michael

On Tue, 2020-11-10 at 06:39 -0800, Guenter Roeck wrote:
> On 11/9/20 11:46 PM, Michael Brunner wrote:
> > Change the detection order to priorize DMI table entries over
> > available
> > ACPI entries.
> > 
> > This makes it more easy for product developers to patch product
> > specific
> > handling into the driver.
> > Furthermore it allows to simplify the implementation a bit and
> > especially to remove the need to force synchronous probing.
> > 
> > Based on the following commit introduced with v5.10-rc1:
> > commit e8299c7313af ("mfd: Add ACPI support to Kontron PLD driver")
> > 
> > Signed-off-by: Michael Brunner <michael.brunner@kontron.com>
> > ---
> >  drivers/mfd/kempld-core.c | 23 ++---------------------
> >  1 file changed, 2 insertions(+), 21 deletions(-)
> > 
> > diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c
> > index 2c9295953c11..aa7f386646a1 100644
> > --- a/drivers/mfd/kempld-core.c
> > +++ b/drivers/mfd/kempld-core.c
> > @@ -125,7 +125,6 @@ static const struct kempld_platform_data
> > kempld_platform_data_generic = {
> >  };
> >  
> >  static struct platform_device *kempld_pdev;
> > -static bool kempld_acpi_mode;
> >  
> >  static int kempld_create_platform_device(const struct
> > dmi_system_id *id)
> >  {
> > @@ -501,8 +500,6 @@ static int kempld_probe(struct platform_device
> > *pdev)
> >  		ret = kempld_get_acpi_data(pdev);
> >  		if (ret)
> >  			return ret;
> > -
> > -		kempld_acpi_mode = true;
> >  	} else if (kempld_pdev != pdev) {
> >  		/*
> >  		 * The platform device we are probing is not the one we
> > @@ -565,7 +562,6 @@ static struct platform_driver kempld_driver = {
> >  	.driver		= {
> >  		.name	= "kempld",
> >  		.acpi_match_table = ACPI_PTR(kempld_acpi_table),
> > -		.probe_type = PROBE_FORCE_SYNCHRONOUS,
> >  	},
> >  	.probe		= kempld_probe,
> >  	.remove		= kempld_remove,
> > @@ -884,7 +880,6 @@ MODULE_DEVICE_TABLE(dmi, kempld_dmi_table);
> >  static int __init kempld_init(void)
> >  {
> >  	const struct dmi_system_id *id;
> > -	int ret;
> >  
> >  	if (force_device_id[0]) {
> >  		for (id = kempld_dmi_table;
> > @@ -894,24 +889,10 @@ static int __init kempld_init(void)
> >  					break;
> >  		if (id->matches[0].slot == DMI_NONE)
> >  			return -ENODEV;
> > -	}
> > -
> > -	ret = platform_driver_register(&kempld_driver);
> > -	if (ret)
> > -		return ret;
> > -
> > -	/*
> > -	 * With synchronous probing the device should already be probed
> > now.
> > -	 * If no device id is forced and also no ACPI definition for
> > the
> > -	 * device was found, scan DMI table as fallback.
> > -	 *
> > -	 * If drivers_autoprobing is disabled and the device is found
> > here,
> > -	 * only that device can be bound manually later.
> > -	 */
> > -	if (!kempld_pdev && !kempld_acpi_mode)
> > +	} else
> 
> 	} else {
> >  		dmi_check_system(kempld_dmi_table);
> 	}
> 
> Guenter
> 
> >  
> > -	return 0;
> > +	return platform_driver_register(&kempld_driver);
> >  }
> >  
> >  static void __exit kempld_exit(void)
> > 

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

* Re: [PATCH] mfd: kempld-core: Check for DMI definition before ACPI
  2020-11-10 15:41   ` Michael Brunner
@ 2020-11-10 16:10     ` Guenter Roeck
  0 siblings, 0 replies; 12+ messages in thread
From: Guenter Roeck @ 2020-11-10 16:10 UTC (permalink / raw)
  To: Michael Brunner
  Cc: lee.jones, sameo, mibru, vkrasnov, linux-kernel, mvanyulin

On Tue, Nov 10, 2020 at 03:41:47PM +0000, Michael Brunner wrote:
> Hi Guenter,
> 
> thank you for the feedback! checkpatch didn't catch this.
> I sent v2 of the patch.
> 

It may have been "demoted" to --strict for whatever reason.

Guenter

> Best regards,
>   Michael
> 
> On Tue, 2020-11-10 at 06:39 -0800, Guenter Roeck wrote:
> > On 11/9/20 11:46 PM, Michael Brunner wrote:
> > > Change the detection order to priorize DMI table entries over
> > > available
> > > ACPI entries.
> > > 
> > > This makes it more easy for product developers to patch product
> > > specific
> > > handling into the driver.
> > > Furthermore it allows to simplify the implementation a bit and
> > > especially to remove the need to force synchronous probing.
> > > 
> > > Based on the following commit introduced with v5.10-rc1:
> > > commit e8299c7313af ("mfd: Add ACPI support to Kontron PLD driver")
> > > 
> > > Signed-off-by: Michael Brunner <michael.brunner@kontron.com>
> > > ---
> > >  drivers/mfd/kempld-core.c | 23 ++---------------------
> > >  1 file changed, 2 insertions(+), 21 deletions(-)
> > > 
> > > diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c
> > > index 2c9295953c11..aa7f386646a1 100644
> > > --- a/drivers/mfd/kempld-core.c
> > > +++ b/drivers/mfd/kempld-core.c
> > > @@ -125,7 +125,6 @@ static const struct kempld_platform_data
> > > kempld_platform_data_generic = {
> > >  };
> > >  
> > >  static struct platform_device *kempld_pdev;
> > > -static bool kempld_acpi_mode;
> > >  
> > >  static int kempld_create_platform_device(const struct
> > > dmi_system_id *id)
> > >  {
> > > @@ -501,8 +500,6 @@ static int kempld_probe(struct platform_device
> > > *pdev)
> > >  		ret = kempld_get_acpi_data(pdev);
> > >  		if (ret)
> > >  			return ret;
> > > -
> > > -		kempld_acpi_mode = true;
> > >  	} else if (kempld_pdev != pdev) {
> > >  		/*
> > >  		 * The platform device we are probing is not the one we
> > > @@ -565,7 +562,6 @@ static struct platform_driver kempld_driver = {
> > >  	.driver		= {
> > >  		.name	= "kempld",
> > >  		.acpi_match_table = ACPI_PTR(kempld_acpi_table),
> > > -		.probe_type = PROBE_FORCE_SYNCHRONOUS,
> > >  	},
> > >  	.probe		= kempld_probe,
> > >  	.remove		= kempld_remove,
> > > @@ -884,7 +880,6 @@ MODULE_DEVICE_TABLE(dmi, kempld_dmi_table);
> > >  static int __init kempld_init(void)
> > >  {
> > >  	const struct dmi_system_id *id;
> > > -	int ret;
> > >  
> > >  	if (force_device_id[0]) {
> > >  		for (id = kempld_dmi_table;
> > > @@ -894,24 +889,10 @@ static int __init kempld_init(void)
> > >  					break;
> > >  		if (id->matches[0].slot == DMI_NONE)
> > >  			return -ENODEV;
> > > -	}
> > > -
> > > -	ret = platform_driver_register(&kempld_driver);
> > > -	if (ret)
> > > -		return ret;
> > > -
> > > -	/*
> > > -	 * With synchronous probing the device should already be probed
> > > now.
> > > -	 * If no device id is forced and also no ACPI definition for
> > > the
> > > -	 * device was found, scan DMI table as fallback.
> > > -	 *
> > > -	 * If drivers_autoprobing is disabled and the device is found
> > > here,
> > > -	 * only that device can be bound manually later.
> > > -	 */
> > > -	if (!kempld_pdev && !kempld_acpi_mode)
> > > +	} else
> > 
> > 	} else {
> > >  		dmi_check_system(kempld_dmi_table);
> > 	}
> > 
> > Guenter
> > 
> > >  
> > > -	return 0;
> > > +	return platform_driver_register(&kempld_driver);
> > >  }
> > >  
> > >  static void __exit kempld_exit(void)
> > > 

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

* Re: [PATCH v2] mfd: kempld-core: Check for DMI definition before ACPI
  2020-11-10 15:23 ` [PATCH v2] " Michael Brunner
@ 2020-11-10 16:11   ` Guenter Roeck
  2020-11-13 10:14     ` Lee Jones
  2020-11-13 10:16   ` Lee Jones
  2020-11-16  6:42   ` [PATCH v3] " Michael Brunner
  2 siblings, 1 reply; 12+ messages in thread
From: Guenter Roeck @ 2020-11-10 16:11 UTC (permalink / raw)
  To: Michael Brunner
  Cc: lee.jones, sameo, mibru, vkrasnov, linux-kernel, mvanyulin

On Tue, Nov 10, 2020 at 03:23:21PM +0000, Michael Brunner wrote:
> Change the detection order to priorize DMI table entries over available
> ACPI entries.
> 
> This makes it more easy for product developers to patch product specific
> handling into the driver.
> Furthermore it allows to simplify the implementation a bit and
> especially to remove the need to force synchronous probing.
> 
> Based on the following commit introduced with v5.10-rc1:
> commit e8299c7313af ("mfd: Add ACPI support to Kontron PLD driver")
> 
> v2: Fixed coding style as suggested by Guenther Roeck
> 

Nit: change logs should be after '---'.

Other than that,

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

Guenter

> Signed-off-by: Michael Brunner <michael.brunner@kontron.com>
> ---
>  drivers/mfd/kempld-core.c | 24 +++---------------------
>  1 file changed, 3 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c
> index 2c9295953c11..ecd26271b9a4 100644
> --- a/drivers/mfd/kempld-core.c
> +++ b/drivers/mfd/kempld-core.c
> @@ -125,7 +125,6 @@ static const struct kempld_platform_data kempld_platform_data_generic = {
>  };
>  
>  static struct platform_device *kempld_pdev;
> -static bool kempld_acpi_mode;
>  
>  static int kempld_create_platform_device(const struct dmi_system_id *id)
>  {
> @@ -501,8 +500,6 @@ static int kempld_probe(struct platform_device *pdev)
>  		ret = kempld_get_acpi_data(pdev);
>  		if (ret)
>  			return ret;
> -
> -		kempld_acpi_mode = true;
>  	} else if (kempld_pdev != pdev) {
>  		/*
>  		 * The platform device we are probing is not the one we
> @@ -565,7 +562,6 @@ static struct platform_driver kempld_driver = {
>  	.driver		= {
>  		.name	= "kempld",
>  		.acpi_match_table = ACPI_PTR(kempld_acpi_table),
> -		.probe_type = PROBE_FORCE_SYNCHRONOUS,
>  	},
>  	.probe		= kempld_probe,
>  	.remove		= kempld_remove,
> @@ -884,7 +880,6 @@ MODULE_DEVICE_TABLE(dmi, kempld_dmi_table);
>  static int __init kempld_init(void)
>  {
>  	const struct dmi_system_id *id;
> -	int ret;
>  
>  	if (force_device_id[0]) {
>  		for (id = kempld_dmi_table;
> @@ -894,24 +889,11 @@ static int __init kempld_init(void)
>  					break;
>  		if (id->matches[0].slot == DMI_NONE)
>  			return -ENODEV;
> -	}
> -
> -	ret = platform_driver_register(&kempld_driver);
> -	if (ret)
> -		return ret;
> -
> -	/*
> -	 * With synchronous probing the device should already be probed now.
> -	 * If no device id is forced and also no ACPI definition for the
> -	 * device was found, scan DMI table as fallback.
> -	 *
> -	 * If drivers_autoprobing is disabled and the device is found here,
> -	 * only that device can be bound manually later.
> -	 */
> -	if (!kempld_pdev && !kempld_acpi_mode)
> +	} else {
>  		dmi_check_system(kempld_dmi_table);
> +	}
>  
> -	return 0;
> +	return platform_driver_register(&kempld_driver);
>  }
>  
>  static void __exit kempld_exit(void)
> -- 
> 2.25.1
> 

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

* Re: [PATCH v2] mfd: kempld-core: Check for DMI definition before ACPI
  2020-11-10 16:11   ` Guenter Roeck
@ 2020-11-13 10:14     ` Lee Jones
  0 siblings, 0 replies; 12+ messages in thread
From: Lee Jones @ 2020-11-13 10:14 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Michael Brunner, sameo, mibru, vkrasnov, linux-kernel, mvanyulin

On Tue, 10 Nov 2020, Guenter Roeck wrote:

> On Tue, Nov 10, 2020 at 03:23:21PM +0000, Michael Brunner wrote:
> > Change the detection order to priorize DMI table entries over available
> > ACPI entries.
> > 
> > This makes it more easy for product developers to patch product specific
> > handling into the driver.
> > Furthermore it allows to simplify the implementation a bit and
> > especially to remove the need to force synchronous probing.
> > 
> > Based on the following commit introduced with v5.10-rc1:
> > commit e8299c7313af ("mfd: Add ACPI support to Kontron PLD driver")
> > 
> > v2: Fixed coding style as suggested by Guenther Roeck
> > 
> 
> Nit: change logs should be after '---'.

Right.  Please submit a v3 fixing this.

> Other than that,
> 
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH v2] mfd: kempld-core: Check for DMI definition before ACPI
  2020-11-10 15:23 ` [PATCH v2] " Michael Brunner
  2020-11-10 16:11   ` Guenter Roeck
@ 2020-11-13 10:16   ` Lee Jones
  2020-11-16  6:46     ` Michael Brunner
  2020-11-16  6:42   ` [PATCH v3] " Michael Brunner
  2 siblings, 1 reply; 12+ messages in thread
From: Lee Jones @ 2020-11-13 10:16 UTC (permalink / raw)
  To: Michael Brunner; +Cc: linux, sameo, mibru, vkrasnov, linux-kernel, mvanyulin

On Tue, 10 Nov 2020, Michael Brunner wrote:

> Change the detection order to priorize DMI table entries over available
> ACPI entries.
> 
> This makes it more easy for product developers to patch product specific
> handling into the driver.
> Furthermore it allows to simplify the implementation a bit and
> especially to remove the need to force synchronous probing.


> Based on the following commit introduced with v5.10-rc1:
> commit e8299c7313af ("mfd: Add ACPI support to Kontron PLD driver")

This section should also be removed from the change log.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* [PATCH v3] mfd: kempld-core: Check for DMI definition before ACPI
  2020-11-10 15:23 ` [PATCH v2] " Michael Brunner
  2020-11-10 16:11   ` Guenter Roeck
  2020-11-13 10:16   ` Lee Jones
@ 2020-11-16  6:42   ` Michael Brunner
  2020-11-27  7:53     ` Lee Jones
  2 siblings, 1 reply; 12+ messages in thread
From: Michael Brunner @ 2020-11-16  6:42 UTC (permalink / raw)
  To: lee.jones; +Cc: linux, sameo, mibru, vkrasnov, linux-kernel, mvanyulin

Change the detection order to priorize DMI table entries over available
ACPI entries.

This makes it more easy for product developers to patch product specific
handling into the driver.
Furthermore it allows to simplify the implementation a bit and
especially to remove the need to force synchronous probing.

Signed-off-by: Michael Brunner <michael.brunner@kontron.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
---

v3: Cleaned up comment, added Reviewed-by

 drivers/mfd/kempld-core.c | 24 +++---------------------
 1 file changed, 3 insertions(+), 21 deletions(-)

diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c
index 2c9295953c11..ecd26271b9a4 100644
--- a/drivers/mfd/kempld-core.c
+++ b/drivers/mfd/kempld-core.c
@@ -125,7 +125,6 @@ static const struct kempld_platform_data kempld_platform_data_generic = {
 };
 
 static struct platform_device *kempld_pdev;
-static bool kempld_acpi_mode;
 
 static int kempld_create_platform_device(const struct dmi_system_id *id)
 {
@@ -501,8 +500,6 @@ static int kempld_probe(struct platform_device *pdev)
 		ret = kempld_get_acpi_data(pdev);
 		if (ret)
 			return ret;
-
-		kempld_acpi_mode = true;
 	} else if (kempld_pdev != pdev) {
 		/*
 		 * The platform device we are probing is not the one we
@@ -565,7 +562,6 @@ static struct platform_driver kempld_driver = {
 	.driver		= {
 		.name	= "kempld",
 		.acpi_match_table = ACPI_PTR(kempld_acpi_table),
-		.probe_type = PROBE_FORCE_SYNCHRONOUS,
 	},
 	.probe		= kempld_probe,
 	.remove		= kempld_remove,
@@ -884,7 +880,6 @@ MODULE_DEVICE_TABLE(dmi, kempld_dmi_table);
 static int __init kempld_init(void)
 {
 	const struct dmi_system_id *id;
-	int ret;
 
 	if (force_device_id[0]) {
 		for (id = kempld_dmi_table;
@@ -894,24 +889,11 @@ static int __init kempld_init(void)
 					break;
 		if (id->matches[0].slot == DMI_NONE)
 			return -ENODEV;
-	}
-
-	ret = platform_driver_register(&kempld_driver);
-	if (ret)
-		return ret;
-
-	/*
-	 * With synchronous probing the device should already be probed now.
-	 * If no device id is forced and also no ACPI definition for the
-	 * device was found, scan DMI table as fallback.
-	 *
-	 * If drivers_autoprobing is disabled and the device is found here,
-	 * only that device can be bound manually later.
-	 */
-	if (!kempld_pdev && !kempld_acpi_mode)
+	} else {
 		dmi_check_system(kempld_dmi_table);
+	}
 
-	return 0;
+	return platform_driver_register(&kempld_driver);
 }
 
 static void __exit kempld_exit(void)
-- 
2.25.1


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

* Re: [PATCH v2] mfd: kempld-core: Check for DMI definition before ACPI
  2020-11-13 10:16   ` Lee Jones
@ 2020-11-16  6:46     ` Michael Brunner
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Brunner @ 2020-11-16  6:46 UTC (permalink / raw)
  To: lee.jones; +Cc: linux, sameo, mibru, vkrasnov, linux-kernel, mvanyulin

On Fri, 2020-11-13 at 10:16 +0000, Lee Jones wrote:
> On Tue, 10 Nov 2020, Michael Brunner wrote:
> 
> > Change the detection order to priorize DMI table entries over
> > available
> > ACPI entries.
> > 
> > This makes it more easy for product developers to patch product
> > specific
> > handling into the driver.
> > Furthermore it allows to simplify the implementation a bit and
> > especially to remove the need to force synchronous probing.
> > Based on the following commit introduced with v5.10-rc1:
> > commit e8299c7313af ("mfd: Add ACPI support to Kontron PLD driver")
> 
> This section should also be removed from the change log.

No problem, just sent v3.

Thanks,
  Michael

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

* Re: [PATCH v3] mfd: kempld-core: Check for DMI definition before ACPI
  2020-11-16  6:42   ` [PATCH v3] " Michael Brunner
@ 2020-11-27  7:53     ` Lee Jones
  2020-11-30 13:08       ` Michael Brunner
  0 siblings, 1 reply; 12+ messages in thread
From: Lee Jones @ 2020-11-27  7:53 UTC (permalink / raw)
  To: Michael Brunner; +Cc: linux, sameo, mibru, vkrasnov, linux-kernel, mvanyulin

On Mon, 16 Nov 2020, Michael Brunner wrote:

> Change the detection order to priorize DMI table entries over available
> ACPI entries.
> 
> This makes it more easy for product developers to patch product specific
> handling into the driver.
> Furthermore it allows to simplify the implementation a bit and
> especially to remove the need to force synchronous probing.
> 
> Signed-off-by: Michael Brunner <michael.brunner@kontron.com>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> 
> v3: Cleaned up comment, added Reviewed-by
> 
>  drivers/mfd/kempld-core.c | 24 +++---------------------
>  1 file changed, 3 insertions(+), 21 deletions(-)

Nit: Just letting you know that checkpatch.pl complains about your
patches, since your From: address does not match your SoB one.

Patch applied though, thanks.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH v3] mfd: kempld-core: Check for DMI definition before ACPI
  2020-11-27  7:53     ` Lee Jones
@ 2020-11-30 13:08       ` Michael Brunner
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Brunner @ 2020-11-30 13:08 UTC (permalink / raw)
  To: lee.jones; +Cc: linux, sameo, mibru, vkrasnov, linux-kernel, mvanyulin

On Fri, 2020-11-27 at 07:53 +0000, Lee Jones wrote:
> On Mon, 16 Nov 2020, Michael Brunner wrote:
> 
> > Change the detection order to priorize DMI table entries over
> > available
> > ACPI entries.
> > 
> > This makes it more easy for product developers to patch product
> > specific
> > handling into the driver.
> > Furthermore it allows to simplify the implementation a bit and
> > especially to remove the need to force synchronous probing.
> > 
> > Signed-off-by: Michael Brunner <michael.brunner@kontron.com>
> > Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> > ---
> > 
> > v3: Cleaned up comment, added Reviewed-by
> > 
> >  drivers/mfd/kempld-core.c | 24 +++---------------------
> >  1 file changed, 3 insertions(+), 21 deletions(-)
> 
> Nit: Just letting you know that checkpatch.pl complains about your
> patches, since your From: address does not match your SoB one.
> 
> Patch applied though, thanks.

Thanks!

Regarding the From - I guess it is because the upper-case letters. I
will check how to fix this for the next time. In the worst case I guess
I have to adapt the SoB.

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

end of thread, other threads:[~2020-11-30 13:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-10  7:46 [PATCH] mfd: kempld-core: Check for DMI definition before ACPI Michael Brunner
2020-11-10 14:39 ` Guenter Roeck
2020-11-10 15:41   ` Michael Brunner
2020-11-10 16:10     ` Guenter Roeck
2020-11-10 15:23 ` [PATCH v2] " Michael Brunner
2020-11-10 16:11   ` Guenter Roeck
2020-11-13 10:14     ` Lee Jones
2020-11-13 10:16   ` Lee Jones
2020-11-16  6:46     ` Michael Brunner
2020-11-16  6:42   ` [PATCH v3] " Michael Brunner
2020-11-27  7:53     ` Lee Jones
2020-11-30 13:08       ` Michael Brunner

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).