Skip to contentSkip to conversation

PM / devfreq: exynos4_bus: Fix missing mutex_unlock if opp_find_freq_floor fails

PATCH RESEND In review Axel Lin 3 participants 8 messages Apr 12, 2013 – Apr 17, 2013

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH RESEND 1/3 PM / devfreq: exynos4_bus: Fix missing mutex_unlock if opp_find_freq_floor fails

We need to call mutex_unlock() in the error path.

---
 drivers/devfreq/exynos4_bus.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/devfreq/exynos4_bus.c +2 -1
index 1deee09..54b9615 100644
@@ -974,7 +974,8 @@ static int exynos4_busfreq_pm_notifier_event(struct notifier_block *this,
 			rcu_read_unlock();
 			dev_err(data->dev, "%s: unable to find a min freq\n",
 				__func__);
-			return PTR_ERR(opp);
+			err = PTR_ERR(opp);
+			goto unlock;
 		}
 		new_oppinfo.rate = opp_get_freq(opp);
 		new_oppinfo.volt = opp_get_voltage(opp);
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH RESEND 2/3 PM / devfreq: exynos4_bus: Constify clock divider table

These tables are never modified, make them const.

---
 drivers/devfreq/exynos4_bus.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/devfreq/exynos4_bus.c +8 -8
index 3f37f3b..45d00d1 100644
@@ -177,7 +177,7 @@ static unsigned int exynos4x12_int_volt[][EX4x12_LV_NUM] = {
 };
 
 /*** Clock Divider Data for Exynos4210 ***/
-static unsigned int exynos4210_clkdiv_dmc0[][8] = {
+static const unsigned int exynos4210_clkdiv_dmc0[][8] = {
 	/*
 	 * Clock divider value for following
 	 * { DIVACP, DIVACP_PCLK, DIVDPHY, DIVDMC, DIVDMCD
@@ -191,7 +191,7 @@ static unsigned int exynos4210_clkdiv_dmc0[][8] = {
 	/* DMC L2: 133MHz */
 	{ 5, 1, 1, 5, 1, 1, 3, 1 },
 };
-static unsigned int exynos4210_clkdiv_top[][5] = {
+static const unsigned int exynos4210_clkdiv_top[][5] = {
 	/*
 	 * Clock divider value for following
 	 * { DIVACLK200, DIVACLK100, DIVACLK160, DIVACLK133, DIVONENAND }
@@ -203,7 +203,7 @@ static unsigned int exynos4210_clkdiv_top[][5] = {
 	/* ACLK200 L2: 133MHz */
 	{ 5, 7, 7, 7, 1 },
 };
-static unsigned int exynos4210_clkdiv_lr_bus[][2] = {
+static const unsigned int exynos4210_clkdiv_lr_bus[][2] = {
 	/*
 	 * Clock divider value for following
 	 * { DIVGDL/R, DIVGPL/R }
@@ -217,7 +217,7 @@ static unsigned int exynos4210_clkdiv_lr_bus[][2] = {
 };
 
 /*** Clock Divider Data for Exynos4212/4412 ***/
-static unsigned int exynos4x12_clkdiv_dmc0[][6] = {
+static const unsigned int exynos4x12_clkdiv_dmc0[][6] = {
 	/*
 	 * Clock divider value for following
 	 * { DIVACP, DIVACP_PCLK, DIVDPHY, DIVDMC, DIVDMCD
@@ -235,7 +235,7 @@ static unsigned int exynos4x12_clkdiv_dmc0[][6] = {
 	/* DMC L4: 100MHz */
 	{7, 1, 1, 7, 1, 1},
 };
-static unsigned int exynos4x12_clkdiv_dmc1[][6] = {
+static const unsigned int exynos4x12_clkdiv_dmc1[][6] = {
 	/*
 	 * Clock divider value for following
 	 * { G2DACP, DIVC2C, DIVC2C_ACLK }
@@ -252,7 +252,7 @@ static unsigned int exynos4x12_clkdiv_dmc1[][6] = {
 	/* DMC L4: 100MHz */
 	{7, 7, 1},
 };
-static unsigned int exynos4x12_clkdiv_top[][5] = {
+static const unsigned int exynos4x12_clkdiv_top[][5] = {
 	/*
 	 * Clock divider value for following
 	 * { DIVACLK266_GPS, DIVACLK100, DIVACLK160,
@@ -270,7 +270,7 @@ static unsigned int exynos4x12_clkdiv_top[][5] = {
 	/* ACLK_GDL/R L4: 100MHz */
 	{7, 7, 7, 7, 1},
 };
-static unsigned int exynos4x12_clkdiv_lr_bus[][2] = {
+static const unsigned int exynos4x12_clkdiv_lr_bus[][2] = {
 	/*
 	 * Clock divider value for following
 	 * { DIVGDL/R, DIVGPL/R }
@@ -287,7 +287,7 @@ static unsigned int exynos4x12_clkdiv_lr_bus[][2] = {
 	/* ACLK_GDL/R L4: 100MHz */
 	{7, 1},
 };
-static unsigned int exynos4x12_clkdiv_sclkip[][3] = {
+static const unsigned int exynos4x12_clkdiv_sclkip[][3] = {
 	/*
 	 * Clock divider value for following
 	 * { DIVMFC, DIVJPEG, DIVFIMC0~3}
Signature · 1 line
1.7.9.5
author
#2 lore raw

PATCH RESEND 3/3 PM / devfreq: exynos4_bus: Fix table entry size for exynos4x12_clkdiv_dmc1

In reply to Axel Lin

exynos4x12_clkdiv_dmc1 contains { G2DACP, DIVC2C, DIVC2C_ACLK }, thus set the size to 3 rather than 6.

---
 drivers/devfreq/exynos4_bus.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/devfreq/exynos4_bus.c +1 -1
index 45d00d1..1deee09 100644
@@ -235,7 +235,7 @@ static const unsigned int exynos4x12_clkdiv_dmc0[][6] = {
 	/* DMC L4: 100MHz */
 	{7, 1, 1, 7, 1, 1},
 };
-static const unsigned int exynos4x12_clkdiv_dmc1[][6] = {
+static const unsigned int exynos4x12_clkdiv_dmc1[][3] = {
 	/*
 	 * Clock divider value for following
 	 * { G2DACP, DIVC2C, DIVC2C_ACLK }
Signature · 1 line
1.7.9.5
#3 lore raw
In reply to Axel Lin
Quoted 3 lines · Axel Lin

We need to call mutex_unlock() in the error path.

All three patches applied to linux-pm.git/linux-next.

Exynos maintainers, if you have any objections, please holler.

Thanks,
Rafael

Quoted 19 lines
---
 drivers/devfreq/exynos4_bus.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/devfreq/exynos4_bus.c +2 -1
index 1deee09..54b9615 100644
@@ -974,7 +974,8 @@ static int exynos4_busfreq_pm_notifier_event(struct notifier_block *this,
 			rcu_read_unlock();
 			dev_err(data->dev, "%s: unable to find a min freq\n",
 				__func__);
-			return PTR_ERR(opp);
+			err = PTR_ERR(opp);
+			goto unlock;
 		}
 		new_oppinfo.rate = opp_get_freq(opp);
 		new_oppinfo.volt = opp_get_voltage(opp);
Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
maintainer
#4 lore raw
Quoted 13 lines · 함명주
Quoted 12 lines
Quoted 11 lines · Axel Lin
Quoted 3 lines

We need to call mutex_unlock() in the error path.

All three patches applied to linux-pm.git/linux-next.

Exynos maintainers, if you have any objections, please holler.

Thanks,
Rafael

Quoted 8 lines
Quoted 4 lines

This patch was included in the last pull-request patchset though the path was updated. (its precedessor patch moved exynos drivers to /drivers/devfreq/exynos/* after adding Exynos common driver files)

OK, so do you want me to drop it?

What about the remaining two?

Yes, please drop 1/3. It's duplicated.

The patches 2~3/3 can wait. They are actually not bugfixes.

Quoted 49 lines

Do you have any more devfreq patches for me to take into v3.10? If so, please send a pull request ASAP.

Thanks,
Rafael

Quoted 30 lines
Quoted 30 lines
Quoted 20 lines
---
 drivers/devfreq/exynos4_bus.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/devfreq/exynos4_bus.c +2 -1
index 1deee09..54b9615 100644
@@ -974,7 +974,8 @@ static int exynos4_busfreq_pm_notifier_event(struct notifier_block *this,
 			rcu_read_unlock();
 			dev_err(data->dev, "%s: unable to find a min freq\n",
 				__func__);
-			return PTR_ERR(opp);
+			err = PTR_ERR(opp);
+			goto unlock;
 		}
 		new_oppinfo.rate = opp_get_freq(opp);
 		new_oppinfo.volt = opp_get_voltage(opp);
Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
#5 lore raw
Quoted 18 lines · myungjoo.ham
Quoted 18 lines · 함명주
Quoted 16 lines
Quoted 11 lines · Axel Lin
Quoted 3 lines

We need to call mutex_unlock() in the error path.

All three patches applied to linux-pm.git/linux-next.

Exynos maintainers, if you have any objections, please holler.

Thanks,
Rafael

This patch was included in the last pull-request patchset though the path was updated. (its precedessor patch moved exynos drivers to /drivers/devfreq/exynos/* after adding Exynos common driver files)

Quoted 7 lines
Quoted 3 lines

OK, so do you want me to drop it?

What about the remaining two?

Yes, please drop 1/3. It's duplicated.

The patches 2~3/3 can wait. They are actually not bugfixes.

OK, I've dropped all three.

Axel, please push [2-3/3] thorugh the Exynos tree.

Thanks,
Rafael

Quoted 26 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
---
 drivers/devfreq/exynos4_bus.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 17 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
drivers/devfreq/exynos4_bus.c +0 -0
index 1deee09..54b9615 100644
@@ -974,7 +974,8 @@ static int exynos4_busfreq_pm_notifier_event(struct notifier_block *this,
 			rcu_read_unlock();
 			dev_err(data->dev, "%s: unable to find a min freq\n",
Quoted 8 lines
Quoted 8 lines

drivers/devfreq/exynos4_bus.c static int exynos4_busfreq_pm_notifier_event(struct notifier_block *this, · line 981

Quoted 8 lines
drivers/devfreq/exynos4_bus.c +2 -1
 				__func__);
-			return PTR_ERR(opp);
+			err = PTR_ERR(opp);
+			goto unlock;
 		}
 		new_oppinfo.rate = opp_get_freq(opp);
 		new_oppinfo.volt = opp_get_voltage(opp);

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
author
#6 lore raw

2013/4/13 Rafael J. Wysocki <[email protected]>:

Quoted 23 lines · myungjoo.ham
Quoted 22 lines
Quoted 21 lines · 함명주
Quoted 9 lines
Quoted 9 lines · Axel Lin
Quoted 3 lines

We need to call mutex_unlock() in the error path.

All three patches applied to linux-pm.git/linux-next.

Exynos maintainers, if you have any objections, please holler.

Quoted 7 lines
Quoted 2 lines

Thanks,
Rafael

This patch was included in the last pull-request patchset though the path was updated. (its precedessor patch moved exynos drivers to /drivers/devfreq/exynos/* after adding Exynos common driver files)

OK, so do you want me to drop it?

What about the remaining two?

Quoted 7 lines
Quoted 3 lines

Yes, please drop 1/3. It's duplicated.

The patches 2~3/3 can wait. They are actually not bugfixes.

OK, I've dropped all three.

Axel, please push [2-3/3] thorugh the Exynos tree.

I thought I already Cc all devfreq maintainers.
Is there any other thing I need to do?

Regards,
Axel

#7 lore raw
Quoted 26 lines · Axel Lin

2013/4/13 Rafael J. Wysocki <[email protected]>:

Quoted 25 lines · myungjoo.ham
Quoted 24 lines
Quoted 13 lines · 함명주
Quoted 12 lines
Quoted 11 lines · Axel Lin
Quoted 3 lines

We need to call mutex_unlock() in the error path.

All three patches applied to linux-pm.git/linux-next.

Exynos maintainers, if you have any objections, please holler.

Thanks,
Rafael

Quoted 8 lines
Quoted 4 lines

This patch was included in the last pull-request patchset though the path was updated. (its precedessor patch moved exynos drivers to /drivers/devfreq/exynos/* after adding Exynos common driver files)

OK, so do you want me to drop it?

What about the remaining two?

Yes, please drop 1/3. It's duplicated.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

The patches 2~3/3 can wait. They are actually not bugfixes.

OK, I've dropped all three.

Axel, please push [2-3/3] thorugh the Exynos tree.

I thought I already Cc all devfreq maintainers.
Is there any other thing I need to do?

Just please let them know that you'd like them to take the patches, not me. :-)

Thanks,
Rafael

Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.