diff mbox

thermal: exynos: fix register read in TMU

Message ID 1443699599-9693-1-git-send-email-sudipm.mukherjee@gmail.com (mailing list archive)
State Accepted
Delegated to: Eduardo Valentin
Headers show

Commit Message

Sudip Mukherjee Oct. 1, 2015, 11:39 a.m. UTC
The value of emul_con was getting overwritten if the selected soc is
SOC_ARCH_EXYNOS5260. And so as a result we were reading from the wrong
register in the case of SOC_ARCH_EXYNOS5260.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 drivers/thermal/samsung/exynos_tmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Krzysztof Kozlowski Oct. 1, 2015, 1:18 p.m. UTC | #1
2015-10-01 20:39 GMT+09:00 Sudip Mukherjee <sudipm.mukherjee@gmail.com>:
> The value of emul_con was getting overwritten if the selected soc is
> SOC_ARCH_EXYNOS5260. And so as a result we were reading from the wrong
> register in the case of SOC_ARCH_EXYNOS5260.

How the value is overwritten if the soc is Exynos5260? I can't see it
(although the "else if" is still more obvious than "if" but how does
the description match the code?).

Best regards,
Krzysztof

>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
>  drivers/thermal/samsung/exynos_tmu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> index 0bae8cc..ca920b0 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -932,7 +932,7 @@ static void exynos4412_tmu_set_emulation(struct exynos_tmu_data *data,
>
>         if (data->soc == SOC_ARCH_EXYNOS5260)
>                 emul_con = EXYNOS5260_EMUL_CON;
> -       if (data->soc == SOC_ARCH_EXYNOS5433)
> +       else if (data->soc == SOC_ARCH_EXYNOS5433)
>                 emul_con = EXYNOS5433_TMU_EMUL_CON;
>         else if (data->soc == SOC_ARCH_EXYNOS7)
>                 emul_con = EXYNOS7_TMU_REG_EMUL_CON;
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sudip Mukherjee Oct. 1, 2015, 2:12 p.m. UTC | #2
On Thu, Oct 01, 2015 at 10:18:57PM +0900, Krzysztof Kozlowski wrote:
> 2015-10-01 20:39 GMT+09:00 Sudip Mukherjee <sudipm.mukherjee@gmail.com>:
> > The value of emul_con was getting overwritten if the selected soc is
> > SOC_ARCH_EXYNOS5260. And so as a result we were reading from the wrong
> > register in the case of SOC_ARCH_EXYNOS5260.
> 
> How the value is overwritten if the soc is Exynos5260? I can't see it
> (although the "else if" is still more obvious than "if" but how does
> the description match the code?).
The code here is:
if (data->soc == SOC_ARCH_EXYNOS5260)
	emul_con = EXYNOS5260_EMUL_CON;
if (data->soc == SOC_ARCH_EXYNOS5433)
	emul_con = EXYNOS5433_TMU_EMUL_CON;
else if (data->soc == SOC_ARCH_EXYNOS7)
	emul_con = EXYNOS7_TMU_REG_EMUL_CON;
else
	emul_con = EXYNOS_EMUL_CON;

So if data->soc is SOC_ARCH_EXYNOS5260 , then emul_con becomes
EXYNOS5260_EMUL_CON. But again for the else part it will become
EXYNOS_EMUL_CON.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Krzysztof Kozlowski Oct. 1, 2015, 11:43 p.m. UTC | #3
2015-10-01 23:12 GMT+09:00 Sudip Mukherjee <sudipm.mukherjee@gmail.com>:
> On Thu, Oct 01, 2015 at 10:18:57PM +0900, Krzysztof Kozlowski wrote:
>> 2015-10-01 20:39 GMT+09:00 Sudip Mukherjee <sudipm.mukherjee@gmail.com>:
>> > The value of emul_con was getting overwritten if the selected soc is
>> > SOC_ARCH_EXYNOS5260. And so as a result we were reading from the wrong
>> > register in the case of SOC_ARCH_EXYNOS5260.
>>
>> How the value is overwritten if the soc is Exynos5260? I can't see it
>> (although the "else if" is still more obvious than "if" but how does
>> the description match the code?).
> The code here is:
> if (data->soc == SOC_ARCH_EXYNOS5260)
>         emul_con = EXYNOS5260_EMUL_CON;
> if (data->soc == SOC_ARCH_EXYNOS5433)
>         emul_con = EXYNOS5433_TMU_EMUL_CON;
> else if (data->soc == SOC_ARCH_EXYNOS7)
>         emul_con = EXYNOS7_TMU_REG_EMUL_CON;
> else
>         emul_con = EXYNOS_EMUL_CON;
>
> So if data->soc is SOC_ARCH_EXYNOS5260 , then emul_con becomes
> EXYNOS5260_EMUL_CON. But again for the else part it will become
> EXYNOS_EMUL_CON.

Indeed!

Fixes: 488c7455d74c ("thermal: exynos: Add the support for Exynos5433 TMU")

Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Best regards,
Krzysztof
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Chanwoo Choi Oct. 2, 2015, 12:03 a.m. UTC | #4
On 2015? 10? 01? 20:39, Sudip Mukherjee wrote:
> The value of emul_con was getting overwritten if the selected soc is
> SOC_ARCH_EXYNOS5260. And so as a result we were reading from the wrong
> register in the case of SOC_ARCH_EXYNOS5260.
> 
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
>  drivers/thermal/samsung/exynos_tmu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> index 0bae8cc..ca920b0 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -932,7 +932,7 @@ static void exynos4412_tmu_set_emulation(struct exynos_tmu_data *data,
>  
>  	if (data->soc == SOC_ARCH_EXYNOS5260)
>  		emul_con = EXYNOS5260_EMUL_CON;
> -	if (data->soc == SOC_ARCH_EXYNOS5433)
> +	else if (data->soc == SOC_ARCH_EXYNOS5433)
>  		emul_con = EXYNOS5433_TMU_EMUL_CON;
>  	else if (data->soc == SOC_ARCH_EXYNOS7)
>  		emul_con = EXYNOS7_TMU_REG_EMUL_CON;
> 

Thanks for your point out. Looks good to me. 

Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>

Thanks,
Chanwoo Choi
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sudip Mukherjee Oct. 8, 2015, 2:21 p.m. UTC | #5
On Fri, Oct 02, 2015 at 08:43:52AM +0900, Krzysztof Kozlowski wrote:
> 2015-10-01 23:12 GMT+09:00 Sudip Mukherjee <sudipm.mukherjee@gmail.com>:
> > On Thu, Oct 01, 2015 at 10:18:57PM +0900, Krzysztof Kozlowski wrote:
> >> 2015-10-01 20:39 GMT+09:00 Sudip Mukherjee <sudipm.mukherjee@gmail.com>:
> >> > The value of emul_con was getting overwritten if the selected soc is
> >> > SOC_ARCH_EXYNOS5260. And so as a result we were reading from the wrong
> >> > register in the case of SOC_ARCH_EXYNOS5260.
> >>
> >> How the value is overwritten if the soc is Exynos5260? I can't see it
> >> (although the "else if" is still more obvious than "if" but how does
> >> the description match the code?).
> > The code here is:
> > if (data->soc == SOC_ARCH_EXYNOS5260)
> >         emul_con = EXYNOS5260_EMUL_CON;
> > if (data->soc == SOC_ARCH_EXYNOS5433)
> >         emul_con = EXYNOS5433_TMU_EMUL_CON;
> > else if (data->soc == SOC_ARCH_EXYNOS7)
> >         emul_con = EXYNOS7_TMU_REG_EMUL_CON;
> > else
> >         emul_con = EXYNOS_EMUL_CON;
> >
> > So if data->soc is SOC_ARCH_EXYNOS5260 , then emul_con becomes
> > EXYNOS5260_EMUL_CON. But again for the else part it will become
> > EXYNOS_EMUL_CON.
> 
> Indeed!
> 
> Fixes: 488c7455d74c ("thermal: exynos: Add the support for Exynos5433 TMU")
> 
> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Hi Krzysztof,
Who will pick this one up? I still do not see it in linux-next.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Krzysztof Kozlowski Oct. 9, 2015, 11:35 a.m. UTC | #6
2015-10-08 23:21 GMT+09:00 Sudip Mukherjee <sudipm.mukherjee@gmail.com>:
> On Fri, Oct 02, 2015 at 08:43:52AM +0900, Krzysztof Kozlowski wrote:
>> 2015-10-01 23:12 GMT+09:00 Sudip Mukherjee <sudipm.mukherjee@gmail.com>:
>> > On Thu, Oct 01, 2015 at 10:18:57PM +0900, Krzysztof Kozlowski wrote:
>> >> 2015-10-01 20:39 GMT+09:00 Sudip Mukherjee <sudipm.mukherjee@gmail.com>:
>> >> > The value of emul_con was getting overwritten if the selected soc is
>> >> > SOC_ARCH_EXYNOS5260. And so as a result we were reading from the wrong
>> >> > register in the case of SOC_ARCH_EXYNOS5260.
>> >>
>> >> How the value is overwritten if the soc is Exynos5260? I can't see it
>> >> (although the "else if" is still more obvious than "if" but how does
>> >> the description match the code?).
>> > The code here is:
>> > if (data->soc == SOC_ARCH_EXYNOS5260)
>> >         emul_con = EXYNOS5260_EMUL_CON;
>> > if (data->soc == SOC_ARCH_EXYNOS5433)
>> >         emul_con = EXYNOS5433_TMU_EMUL_CON;
>> > else if (data->soc == SOC_ARCH_EXYNOS7)
>> >         emul_con = EXYNOS7_TMU_REG_EMUL_CON;
>> > else
>> >         emul_con = EXYNOS_EMUL_CON;
>> >
>> > So if data->soc is SOC_ARCH_EXYNOS5260 , then emul_con becomes
>> > EXYNOS5260_EMUL_CON. But again for the else part it will become
>> > EXYNOS_EMUL_CON.
>>
>> Indeed!
>>
>> Fixes: 488c7455d74c ("thermal: exynos: Add the support for Exynos5433 TMU")
>>
>> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
>
> Hi Krzysztof,
> Who will pick this one up? I still do not see it in linux-next.

Hi!

I guess it is a patch for Lukasz.

Lukasz,
Do you plan to pick it up or maybe this should go through samsung-soc tree?

Best regards,
Krzysztof
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lukasz Majewski Oct. 9, 2015, 12:07 p.m. UTC | #7
Hi Krzysztof,

> 2015-10-08 23:21 GMT+09:00 Sudip Mukherjee
> <sudipm.mukherjee@gmail.com>:
> > On Fri, Oct 02, 2015 at 08:43:52AM +0900, Krzysztof Kozlowski wrote:
> >> 2015-10-01 23:12 GMT+09:00 Sudip Mukherjee
> >> <sudipm.mukherjee@gmail.com>:
> >> > On Thu, Oct 01, 2015 at 10:18:57PM +0900, Krzysztof Kozlowski
> >> > wrote:
> >> >> 2015-10-01 20:39 GMT+09:00 Sudip Mukherjee
> >> >> <sudipm.mukherjee@gmail.com>:
> >> >> > The value of emul_con was getting overwritten if the selected
> >> >> > soc is SOC_ARCH_EXYNOS5260. And so as a result we were
> >> >> > reading from the wrong register in the case of
> >> >> > SOC_ARCH_EXYNOS5260.
> >> >>
> >> >> How the value is overwritten if the soc is Exynos5260? I can't
> >> >> see it (although the "else if" is still more obvious than "if"
> >> >> but how does the description match the code?).
> >> > The code here is:
> >> > if (data->soc == SOC_ARCH_EXYNOS5260)
> >> >         emul_con = EXYNOS5260_EMUL_CON;
> >> > if (data->soc == SOC_ARCH_EXYNOS5433)
> >> >         emul_con = EXYNOS5433_TMU_EMUL_CON;
> >> > else if (data->soc == SOC_ARCH_EXYNOS7)
> >> >         emul_con = EXYNOS7_TMU_REG_EMUL_CON;
> >> > else
> >> >         emul_con = EXYNOS_EMUL_CON;
> >> >
> >> > So if data->soc is SOC_ARCH_EXYNOS5260 , then emul_con becomes
> >> > EXYNOS5260_EMUL_CON. But again for the else part it will become
> >> > EXYNOS_EMUL_CON.
> >>
> >> Indeed!
> >>
> >> Fixes: 488c7455d74c ("thermal: exynos: Add the support for
> >> Exynos5433 TMU")
> >>
> >> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> >
> > Hi Krzysztof,
> > Who will pick this one up? I still do not see it in linux-next.
> 
> Hi!
> 
> I guess it is a patch for Lukasz.
> 
> Lukasz,
> Do you plan to pick it up or maybe this should go through samsung-soc
> tree?

This is the only one patch, which is waiting in my queue. Since no more
fixes available, please feel free to grab this patch to samsung-soc.

Acked-by: Lukasz Majewski <l.majewski@samsung.com>

> 
> Best regards,
> Krzysztof
Krzysztof Kozlowski Oct. 10, 2015, 4:36 a.m. UTC | #8
W dniu 09.10.2015 o 21:07, Lukasz Majewski pisze:
> Hi Krzysztof,
> 
>> 2015-10-08 23:21 GMT+09:00 Sudip Mukherjee
>> <sudipm.mukherjee@gmail.com>:
>>> On Fri, Oct 02, 2015 at 08:43:52AM +0900, Krzysztof Kozlowski wrote:
>>>> 2015-10-01 23:12 GMT+09:00 Sudip Mukherjee
>>>> <sudipm.mukherjee@gmail.com>:
>>>>> On Thu, Oct 01, 2015 at 10:18:57PM +0900, Krzysztof Kozlowski
>>>>> wrote:
>>>>>> 2015-10-01 20:39 GMT+09:00 Sudip Mukherjee
>>>>>> <sudipm.mukherjee@gmail.com>:
>>>>>>> The value of emul_con was getting overwritten if the selected
>>>>>>> soc is SOC_ARCH_EXYNOS5260. And so as a result we were
>>>>>>> reading from the wrong register in the case of
>>>>>>> SOC_ARCH_EXYNOS5260.
>>>>>>
>>>>>> How the value is overwritten if the soc is Exynos5260? I can't
>>>>>> see it (although the "else if" is still more obvious than "if"
>>>>>> but how does the description match the code?).
>>>>> The code here is:
>>>>> if (data->soc == SOC_ARCH_EXYNOS5260)
>>>>>         emul_con = EXYNOS5260_EMUL_CON;
>>>>> if (data->soc == SOC_ARCH_EXYNOS5433)
>>>>>         emul_con = EXYNOS5433_TMU_EMUL_CON;
>>>>> else if (data->soc == SOC_ARCH_EXYNOS7)
>>>>>         emul_con = EXYNOS7_TMU_REG_EMUL_CON;
>>>>> else
>>>>>         emul_con = EXYNOS_EMUL_CON;
>>>>>
>>>>> So if data->soc is SOC_ARCH_EXYNOS5260 , then emul_con becomes
>>>>> EXYNOS5260_EMUL_CON. But again for the else part it will become
>>>>> EXYNOS_EMUL_CON.
>>>>
>>>> Indeed!
>>>>
>>>> Fixes: 488c7455d74c ("thermal: exynos: Add the support for
>>>> Exynos5433 TMU")
>>>>
>>>> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
>>>
>>> Hi Krzysztof,
>>> Who will pick this one up? I still do not see it in linux-next.
>>
>> Hi!
>>
>> I guess it is a patch for Lukasz.
>>
>> Lukasz,
>> Do you plan to pick it up or maybe this should go through samsung-soc
>> tree?
> 
> This is the only one patch, which is waiting in my queue. Since no more
> fixes available, please feel free to grab this patch to samsung-soc.
> 
> Acked-by: Lukasz Majewski <l.majewski@samsung.com>

Okay, thanks! Applied to fixes for current cycle. I'll it send later to
Kukjin (unless he picks it as well).

Best regards,
Krzysztof

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

Patch

diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 0bae8cc..ca920b0 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -932,7 +932,7 @@  static void exynos4412_tmu_set_emulation(struct exynos_tmu_data *data,
 
 	if (data->soc == SOC_ARCH_EXYNOS5260)
 		emul_con = EXYNOS5260_EMUL_CON;
-	if (data->soc == SOC_ARCH_EXYNOS5433)
+	else if (data->soc == SOC_ARCH_EXYNOS5433)
 		emul_con = EXYNOS5433_TMU_EMUL_CON;
 	else if (data->soc == SOC_ARCH_EXYNOS7)
 		emul_con = EXYNOS7_TMU_REG_EMUL_CON;