All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mfd: tps65218: Reorder tps65218_regulator_id enum
@ 2018-02-16  4:17 ` Dave Gerlach
  0 siblings, 0 replies; 8+ messages in thread
From: Dave Gerlach @ 2018-02-16  4:17 UTC (permalink / raw)
  To: linux-kernel, Lee Jones
  Cc: linux-arm-kernel, linux-omap, Tony Lindgren, Mark Brown, Keerthy,
	Dave Gerlach

Commit 2dc4940360d4 ("regulator: tps65218: Remove all the compatibles")
changes the probe function of drivers/regulator/tps65218-regulator.c so
that it iterates through all available regulators and assumes that the
regulator IDs are sequential and match the order present in the enum
tps65218_regulator_id. However, for some reason the much older commit
c0ea88b890d6 ("regulator: tps65218: add support for LS3 current
regulator") updated all arrays with LS3 at the end but added it second
to last for the enum.

Because of this long standing mismatch in order between the
tps65218_regulator_id enum and the regulator_desc array in the tps65218
regulator driver, the new probe function causes the strobe values to be
associated with the wrong regulator ID. This causes LDO1 to fail to
suspend in tps65218_pmic_set_suspend_disable due to not having anything
probes for its strobe value. Fix the order in the enum so the probe
function works as the update intended.

Fixes: 2dc4940360d4 ("regulator: tps65218: Remove all the compatibles")
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
---
 include/linux/mfd/tps65218.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/mfd/tps65218.h b/include/linux/mfd/tps65218.h
index f069c518c0ed..c204d9a79436 100644
--- a/include/linux/mfd/tps65218.h
+++ b/include/linux/mfd/tps65218.h
@@ -205,10 +205,10 @@ enum tps65218_regulator_id {
 	TPS65218_DCDC_4,
 	TPS65218_DCDC_5,
 	TPS65218_DCDC_6,
-	/* LS's */
-	TPS65218_LS_3,
 	/* LDOs */
 	TPS65218_LDO_1,
+	/* LS's */
+	TPS65218_LS_3,
 };
 
 #define TPS65218_MAX_REG_ID		TPS65218_LDO_1
-- 
2.16.1

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

* [PATCH] mfd: tps65218: Reorder tps65218_regulator_id enum
@ 2018-02-16  4:17 ` Dave Gerlach
  0 siblings, 0 replies; 8+ messages in thread
From: Dave Gerlach @ 2018-02-16  4:17 UTC (permalink / raw)
  To: linux-kernel, Lee Jones
  Cc: linux-arm-kernel, linux-omap, Tony Lindgren, Mark Brown, Keerthy,
	Dave Gerlach

Commit 2dc4940360d4 ("regulator: tps65218: Remove all the compatibles")
changes the probe function of drivers/regulator/tps65218-regulator.c so
that it iterates through all available regulators and assumes that the
regulator IDs are sequential and match the order present in the enum
tps65218_regulator_id. However, for some reason the much older commit
c0ea88b890d6 ("regulator: tps65218: add support for LS3 current
regulator") updated all arrays with LS3 at the end but added it second
to last for the enum.

Because of this long standing mismatch in order between the
tps65218_regulator_id enum and the regulator_desc array in the tps65218
regulator driver, the new probe function causes the strobe values to be
associated with the wrong regulator ID. This causes LDO1 to fail to
suspend in tps65218_pmic_set_suspend_disable due to not having anything
probes for its strobe value. Fix the order in the enum so the probe
function works as the update intended.

Fixes: 2dc4940360d4 ("regulator: tps65218: Remove all the compatibles")
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
---
 include/linux/mfd/tps65218.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/mfd/tps65218.h b/include/linux/mfd/tps65218.h
index f069c518c0ed..c204d9a79436 100644
--- a/include/linux/mfd/tps65218.h
+++ b/include/linux/mfd/tps65218.h
@@ -205,10 +205,10 @@ enum tps65218_regulator_id {
 	TPS65218_DCDC_4,
 	TPS65218_DCDC_5,
 	TPS65218_DCDC_6,
-	/* LS's */
-	TPS65218_LS_3,
 	/* LDOs */
 	TPS65218_LDO_1,
+	/* LS's */
+	TPS65218_LS_3,
 };
 
 #define TPS65218_MAX_REG_ID		TPS65218_LDO_1
-- 
2.16.1

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

* [PATCH] mfd: tps65218: Reorder tps65218_regulator_id enum
@ 2018-02-16  4:17 ` Dave Gerlach
  0 siblings, 0 replies; 8+ messages in thread
From: Dave Gerlach @ 2018-02-16  4:17 UTC (permalink / raw)
  To: linux-arm-kernel

Commit 2dc4940360d4 ("regulator: tps65218: Remove all the compatibles")
changes the probe function of drivers/regulator/tps65218-regulator.c so
that it iterates through all available regulators and assumes that the
regulator IDs are sequential and match the order present in the enum
tps65218_regulator_id. However, for some reason the much older commit
c0ea88b890d6 ("regulator: tps65218: add support for LS3 current
regulator") updated all arrays with LS3 at the end but added it second
to last for the enum.

Because of this long standing mismatch in order between the
tps65218_regulator_id enum and the regulator_desc array in the tps65218
regulator driver, the new probe function causes the strobe values to be
associated with the wrong regulator ID. This causes LDO1 to fail to
suspend in tps65218_pmic_set_suspend_disable due to not having anything
probes for its strobe value. Fix the order in the enum so the probe
function works as the update intended.

Fixes: 2dc4940360d4 ("regulator: tps65218: Remove all the compatibles")
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
---
 include/linux/mfd/tps65218.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/mfd/tps65218.h b/include/linux/mfd/tps65218.h
index f069c518c0ed..c204d9a79436 100644
--- a/include/linux/mfd/tps65218.h
+++ b/include/linux/mfd/tps65218.h
@@ -205,10 +205,10 @@ enum tps65218_regulator_id {
 	TPS65218_DCDC_4,
 	TPS65218_DCDC_5,
 	TPS65218_DCDC_6,
-	/* LS's */
-	TPS65218_LS_3,
 	/* LDOs */
 	TPS65218_LDO_1,
+	/* LS's */
+	TPS65218_LS_3,
 };
 
 #define TPS65218_MAX_REG_ID		TPS65218_LDO_1
-- 
2.16.1

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

* Re: [PATCH] mfd: tps65218: Reorder tps65218_regulator_id enum
  2018-02-16  4:17 ` Dave Gerlach
  (?)
@ 2018-02-16  4:40   ` Keerthy
  -1 siblings, 0 replies; 8+ messages in thread
From: Keerthy @ 2018-02-16  4:40 UTC (permalink / raw)
  To: Dave Gerlach, linux-kernel, Lee Jones
  Cc: linux-arm-kernel, linux-omap, Tony Lindgren, Mark Brown



On Friday 16 February 2018 09:47 AM, Dave Gerlach wrote:
> Commit 2dc4940360d4 ("regulator: tps65218: Remove all the compatibles")
> changes the probe function of drivers/regulator/tps65218-regulator.c so
> that it iterates through all available regulators and assumes that the
> regulator IDs are sequential and match the order present in the enum
> tps65218_regulator_id. However, for some reason the much older commit
> c0ea88b890d6 ("regulator: tps65218: add support for LS3 current
> regulator") updated all arrays with LS3 at the end but added it second
> to last for the enum.
> 
> Because of this long standing mismatch in order between the
> tps65218_regulator_id enum and the regulator_desc array in the tps65218
> regulator driver, the new probe function causes the strobe values to be
> associated with the wrong regulator ID. This causes LDO1 to fail to
> suspend in tps65218_pmic_set_suspend_disable due to not having anything
> probes for its strobe value. Fix the order in the enum so the probe
> function works as the update intended.

Reviewed-by: Keerthy <j-keerthy@ti.com>

> 
> Fixes: 2dc4940360d4 ("regulator: tps65218: Remove all the compatibles")
> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
> ---
>  include/linux/mfd/tps65218.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/mfd/tps65218.h b/include/linux/mfd/tps65218.h
> index f069c518c0ed..c204d9a79436 100644
> --- a/include/linux/mfd/tps65218.h
> +++ b/include/linux/mfd/tps65218.h
> @@ -205,10 +205,10 @@ enum tps65218_regulator_id {
>  	TPS65218_DCDC_4,
>  	TPS65218_DCDC_5,
>  	TPS65218_DCDC_6,
> -	/* LS's */
> -	TPS65218_LS_3,
>  	/* LDOs */
>  	TPS65218_LDO_1,
> +	/* LS's */
> +	TPS65218_LS_3,
>  };
>  
>  #define TPS65218_MAX_REG_ID		TPS65218_LDO_1
> 

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

* Re: [PATCH] mfd: tps65218: Reorder tps65218_regulator_id enum
@ 2018-02-16  4:40   ` Keerthy
  0 siblings, 0 replies; 8+ messages in thread
From: Keerthy @ 2018-02-16  4:40 UTC (permalink / raw)
  To: Dave Gerlach, linux-kernel, Lee Jones
  Cc: linux-arm-kernel, linux-omap, Tony Lindgren, Mark Brown



On Friday 16 February 2018 09:47 AM, Dave Gerlach wrote:
> Commit 2dc4940360d4 ("regulator: tps65218: Remove all the compatibles")
> changes the probe function of drivers/regulator/tps65218-regulator.c so
> that it iterates through all available regulators and assumes that the
> regulator IDs are sequential and match the order present in the enum
> tps65218_regulator_id. However, for some reason the much older commit
> c0ea88b890d6 ("regulator: tps65218: add support for LS3 current
> regulator") updated all arrays with LS3 at the end but added it second
> to last for the enum.
> 
> Because of this long standing mismatch in order between the
> tps65218_regulator_id enum and the regulator_desc array in the tps65218
> regulator driver, the new probe function causes the strobe values to be
> associated with the wrong regulator ID. This causes LDO1 to fail to
> suspend in tps65218_pmic_set_suspend_disable due to not having anything
> probes for its strobe value. Fix the order in the enum so the probe
> function works as the update intended.

Reviewed-by: Keerthy <j-keerthy@ti.com>

> 
> Fixes: 2dc4940360d4 ("regulator: tps65218: Remove all the compatibles")
> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
> ---
>  include/linux/mfd/tps65218.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/mfd/tps65218.h b/include/linux/mfd/tps65218.h
> index f069c518c0ed..c204d9a79436 100644
> --- a/include/linux/mfd/tps65218.h
> +++ b/include/linux/mfd/tps65218.h
> @@ -205,10 +205,10 @@ enum tps65218_regulator_id {
>  	TPS65218_DCDC_4,
>  	TPS65218_DCDC_5,
>  	TPS65218_DCDC_6,
> -	/* LS's */
> -	TPS65218_LS_3,
>  	/* LDOs */
>  	TPS65218_LDO_1,
> +	/* LS's */
> +	TPS65218_LS_3,
>  };
>  
>  #define TPS65218_MAX_REG_ID		TPS65218_LDO_1
> 

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

* [PATCH] mfd: tps65218: Reorder tps65218_regulator_id enum
@ 2018-02-16  4:40   ` Keerthy
  0 siblings, 0 replies; 8+ messages in thread
From: Keerthy @ 2018-02-16  4:40 UTC (permalink / raw)
  To: linux-arm-kernel



On Friday 16 February 2018 09:47 AM, Dave Gerlach wrote:
> Commit 2dc4940360d4 ("regulator: tps65218: Remove all the compatibles")
> changes the probe function of drivers/regulator/tps65218-regulator.c so
> that it iterates through all available regulators and assumes that the
> regulator IDs are sequential and match the order present in the enum
> tps65218_regulator_id. However, for some reason the much older commit
> c0ea88b890d6 ("regulator: tps65218: add support for LS3 current
> regulator") updated all arrays with LS3 at the end but added it second
> to last for the enum.
> 
> Because of this long standing mismatch in order between the
> tps65218_regulator_id enum and the regulator_desc array in the tps65218
> regulator driver, the new probe function causes the strobe values to be
> associated with the wrong regulator ID. This causes LDO1 to fail to
> suspend in tps65218_pmic_set_suspend_disable due to not having anything
> probes for its strobe value. Fix the order in the enum so the probe
> function works as the update intended.

Reviewed-by: Keerthy <j-keerthy@ti.com>

> 
> Fixes: 2dc4940360d4 ("regulator: tps65218: Remove all the compatibles")
> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
> ---
>  include/linux/mfd/tps65218.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/mfd/tps65218.h b/include/linux/mfd/tps65218.h
> index f069c518c0ed..c204d9a79436 100644
> --- a/include/linux/mfd/tps65218.h
> +++ b/include/linux/mfd/tps65218.h
> @@ -205,10 +205,10 @@ enum tps65218_regulator_id {
>  	TPS65218_DCDC_4,
>  	TPS65218_DCDC_5,
>  	TPS65218_DCDC_6,
> -	/* LS's */
> -	TPS65218_LS_3,
>  	/* LDOs */
>  	TPS65218_LDO_1,
> +	/* LS's */
> +	TPS65218_LS_3,
>  };
>  
>  #define TPS65218_MAX_REG_ID		TPS65218_LDO_1
> 

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

* Re: [PATCH] mfd: tps65218: Reorder tps65218_regulator_id enum
  2018-02-16  4:17 ` Dave Gerlach
@ 2018-03-07 13:00   ` Lee Jones
  -1 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2018-03-07 13:00 UTC (permalink / raw)
  To: Dave Gerlach
  Cc: linux-kernel, linux-arm-kernel, linux-omap, Tony Lindgren,
	Mark Brown, Keerthy

On Thu, 15 Feb 2018, Dave Gerlach wrote:

> Commit 2dc4940360d4 ("regulator: tps65218: Remove all the compatibles")
> changes the probe function of drivers/regulator/tps65218-regulator.c so
> that it iterates through all available regulators and assumes that the
> regulator IDs are sequential and match the order present in the enum
> tps65218_regulator_id. However, for some reason the much older commit
> c0ea88b890d6 ("regulator: tps65218: add support for LS3 current
> regulator") updated all arrays with LS3 at the end but added it second
> to last for the enum.
> 
> Because of this long standing mismatch in order between the
> tps65218_regulator_id enum and the regulator_desc array in the tps65218
> regulator driver, the new probe function causes the strobe values to be
> associated with the wrong regulator ID. This causes LDO1 to fail to
> suspend in tps65218_pmic_set_suspend_disable due to not having anything
> probes for its strobe value. Fix the order in the enum so the probe
> function works as the update intended.

This sounds super fragile.

I'm willing to accept this patch if it 'makes stuff work', but we
should look into why a dynamically assigned enum is sensitive to
ordering.  At the very least you should consider providing a comment
with working to that effect.

> Fixes: 2dc4940360d4 ("regulator: tps65218: Remove all the compatibles")
> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
> ---
>  include/linux/mfd/tps65218.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

-- 
Lee Jones
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* [PATCH] mfd: tps65218: Reorder tps65218_regulator_id enum
@ 2018-03-07 13:00   ` Lee Jones
  0 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2018-03-07 13:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 15 Feb 2018, Dave Gerlach wrote:

> Commit 2dc4940360d4 ("regulator: tps65218: Remove all the compatibles")
> changes the probe function of drivers/regulator/tps65218-regulator.c so
> that it iterates through all available regulators and assumes that the
> regulator IDs are sequential and match the order present in the enum
> tps65218_regulator_id. However, for some reason the much older commit
> c0ea88b890d6 ("regulator: tps65218: add support for LS3 current
> regulator") updated all arrays with LS3 at the end but added it second
> to last for the enum.
> 
> Because of this long standing mismatch in order between the
> tps65218_regulator_id enum and the regulator_desc array in the tps65218
> regulator driver, the new probe function causes the strobe values to be
> associated with the wrong regulator ID. This causes LDO1 to fail to
> suspend in tps65218_pmic_set_suspend_disable due to not having anything
> probes for its strobe value. Fix the order in the enum so the probe
> function works as the update intended.

This sounds super fragile.

I'm willing to accept this patch if it 'makes stuff work', but we
should look into why a dynamically assigned enum is sensitive to
ordering.  At the very least you should consider providing a comment
with working to that effect.

> Fixes: 2dc4940360d4 ("regulator: tps65218: Remove all the compatibles")
> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
> ---
>  include/linux/mfd/tps65218.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

-- 
Lee Jones
Linaro Services Technical Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

end of thread, other threads:[~2018-03-07 13:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-16  4:17 [PATCH] mfd: tps65218: Reorder tps65218_regulator_id enum Dave Gerlach
2018-02-16  4:17 ` Dave Gerlach
2018-02-16  4:17 ` Dave Gerlach
2018-02-16  4:40 ` Keerthy
2018-02-16  4:40   ` Keerthy
2018-02-16  4:40   ` Keerthy
2018-03-07 13:00 ` Lee Jones
2018-03-07 13:00   ` Lee Jones

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.