linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFT] regulator: tps6507x: Fix boot regression due to testing wrong init_data pointer
@ 2019-05-16 12:48 Axel Lin
  2019-05-16 13:54 ` Sekhar Nori
  2019-05-16 18:03 ` Applied "regulator: tps6507x: Fix boot regression due to testing wrong init_data pointer" to the regulator tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2019-05-16 12:48 UTC (permalink / raw)
  To: Mark Brown; +Cc: Sekhar Nori, Liam Girdwood, linux-kernel, Axel Lin

A NULL init_data once incremented will lead to oops, fix it.

Fixes: f979c08f7624 ("regulator: tps6507x: Convert to regulator core's simplified DT parsing code")
Reported-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
Hi Sekhar,
Please check if this patch works, thanks.
Axel
 drivers/regulator/tps6507x-regulator.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/regulator/tps6507x-regulator.c b/drivers/regulator/tps6507x-regulator.c
index a1b7fab91dd4..d2a8f69b2665 100644
--- a/drivers/regulator/tps6507x-regulator.c
+++ b/drivers/regulator/tps6507x-regulator.c
@@ -403,12 +403,12 @@ static int tps6507x_pmic_probe(struct platform_device *pdev)
 	/* common for all regulators */
 	tps->mfd = tps6507x_dev;
 
-	for (i = 0; i < TPS6507X_NUM_REGULATOR; i++, info++, init_data++) {
+	for (i = 0; i < TPS6507X_NUM_REGULATOR; i++, info++) {
 		/* Register the regulators */
 		tps->info[i] = info;
-		if (init_data && init_data->driver_data) {
+		if (init_data && init_data[i].driver_data) {
 			struct tps6507x_reg_platform_data *data =
-					init_data->driver_data;
+					init_data[i].driver_data;
 			info->defdcdc_default = data->defdcdc_default;
 		}
 
-- 
2.20.1


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

* Re: [PATCH RFT] regulator: tps6507x: Fix boot regression due to testing wrong init_data pointer
  2019-05-16 12:48 [PATCH RFT] regulator: tps6507x: Fix boot regression due to testing wrong init_data pointer Axel Lin
@ 2019-05-16 13:54 ` Sekhar Nori
  2019-05-16 18:03 ` Applied "regulator: tps6507x: Fix boot regression due to testing wrong init_data pointer" to the regulator tree Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Sekhar Nori @ 2019-05-16 13:54 UTC (permalink / raw)
  To: Axel Lin, Mark Brown; +Cc: Liam Girdwood, linux-kernel, Adam Ford

On 16/05/19 6:18 PM, Axel Lin wrote:
> A NULL init_data once incremented will lead to oops, fix it.
> 
> Fixes: f979c08f7624 ("regulator: tps6507x: Convert to regulator core's simplified DT parsing code")
> Reported-by: Sekhar Nori <nsekhar@ti.com>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> Hi Sekhar,
> Please check if this patch works, thanks.
> Axel

Boot is fine now and PMIC regulator rail microvolts readings from sysfs
are correct as well. I did not try to change the voltages though.

Tested-by: Sekhar Nori <nsekhar@ti.com>

Thanks,
Sekhar

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

* Applied "regulator: tps6507x: Fix boot regression due to testing wrong init_data pointer" to the regulator tree
  2019-05-16 12:48 [PATCH RFT] regulator: tps6507x: Fix boot regression due to testing wrong init_data pointer Axel Lin
  2019-05-16 13:54 ` Sekhar Nori
@ 2019-05-16 18:03 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2019-05-16 18:03 UTC (permalink / raw)
  To: Axel Lin; +Cc: Liam Girdwood, linux-kernel, Mark Brown, Sekhar Nori

The patch

   regulator: tps6507x: Fix boot regression due to testing wrong init_data pointer

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-5.2

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 7d293f56456120efa97c4e18250d86d2a05ad0bd Mon Sep 17 00:00:00 2001
From: Axel Lin <axel.lin@ingics.com>
Date: Thu, 16 May 2019 20:48:08 +0800
Subject: [PATCH] regulator: tps6507x: Fix boot regression due to testing wrong
 init_data pointer

A NULL init_data once incremented will lead to oops, fix it.

Fixes: f979c08f7624 ("regulator: tps6507x: Convert to regulator core's simplified DT parsing code")
Reported-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Tested-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/regulator/tps6507x-regulator.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/regulator/tps6507x-regulator.c b/drivers/regulator/tps6507x-regulator.c
index a1b7fab91dd4..d2a8f69b2665 100644
--- a/drivers/regulator/tps6507x-regulator.c
+++ b/drivers/regulator/tps6507x-regulator.c
@@ -403,12 +403,12 @@ static int tps6507x_pmic_probe(struct platform_device *pdev)
 	/* common for all regulators */
 	tps->mfd = tps6507x_dev;
 
-	for (i = 0; i < TPS6507X_NUM_REGULATOR; i++, info++, init_data++) {
+	for (i = 0; i < TPS6507X_NUM_REGULATOR; i++, info++) {
 		/* Register the regulators */
 		tps->info[i] = info;
-		if (init_data && init_data->driver_data) {
+		if (init_data && init_data[i].driver_data) {
 			struct tps6507x_reg_platform_data *data =
-					init_data->driver_data;
+					init_data[i].driver_data;
 			info->defdcdc_default = data->defdcdc_default;
 		}
 
-- 
2.20.1


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

end of thread, other threads:[~2019-05-16 18:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-16 12:48 [PATCH RFT] regulator: tps6507x: Fix boot regression due to testing wrong init_data pointer Axel Lin
2019-05-16 13:54 ` Sekhar Nori
2019-05-16 18:03 ` Applied "regulator: tps6507x: Fix boot regression due to testing wrong init_data pointer" to the regulator tree Mark Brown

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