linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Naveen Krishna Ch <naveenkrishna.ch@gmail.com>
To: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Eduardo Valentin <eduardo.valentin@ti.com>,
	Naveen Krishna Chatradhi <ch.naveen@samsung.com>,
	linux-pm@vger.kernel.org, rui.zhang@intel.com,
	"linux-samsung-soc@vger.kernel.org" 
	<linux-samsung-soc@vger.kernel.org>,
	linux-kernel@vger.kernel.org, amit.daniel@samsung.com,
	Kukjin Kim <kgene.kim@samsung.com>,
	devicetree@vger.kernel.org,
	Lukasz Majewski <l.majewski@samsung.com>
Subject: Re: [PATCH 1/3 v4] thermal: samsung: correct the fall interrupt en, status bit fields
Date: Tue, 15 Oct 2013 17:09:54 +0530	[thread overview]
Message-ID: <CAHfPSqDbvgtMpivfhwd4kW3NE7x2=-zyE1ugpox+e0+mxm7bmg@mail.gmail.com> (raw)
In-Reply-To: <3444817.fM2Daj9BhR@amdc1032>

On 14 October 2013 21:31, Bartlomiej Zolnierkiewicz
<b.zolnierkie@samsung.com> wrote:
> On Monday, October 14, 2013 10:18:03 AM Eduardo Valentin wrote:
>> On 11-10-2013 11:57, Bartlomiej Zolnierkiewicz wrote:
>> >
>> > Hi,
>> >
>> > On Friday, October 11, 2013 11:10:38 AM Eduardo Valentin wrote:
>> >> Hi Naveen,
>> >>
>> >> On 09-10-2013 10:03, Bartlomiej Zolnierkiewicz wrote:
>> >>>
>> >>> Hi,
>> >>>
>> >>> All patches (#1-#3) look good to me, FWIW you can add:
>> >>>
>> >>>   Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
>> >>>
>> >>> Please note that (at least) patch #3 conflicts with Lukasz's EXYNOS4412
>> >>> fixup patchset:
>> >>>
>> >>>   https://lkml.org/lkml/2013/10/9/35
>> >>>
>> >>> It is up to Eduardo to resolve this but it probably would be better to
>> >>> merge EXYNOS4412 fixes first and then add EXYNOS5420 support. This would
>> >>> require you to port patch #3 over Lukasz's patchset though.
>> >>
>> >> My question is if this fix applies also to EXYNOS4412, as it  is not
>> >> mentioned in the patch description and the change affects all supported
>> >
>> > This patch doesn't affect EXYNOS4210 as exynos4210_tmu_registers struct
>>
>> I was, at least for now, worried about 4412, as I mentioned above.
>>
>> > uses the default zero value for inten_fall_mask, inten_fall_shift and
>> > intclr_fall_shift.
>> >
>> >> chip version deliberately. Has this change been validated on all
>> >> supported chip versions?
>> >>
>> >> Amit, I saw you ack, but still, it is not clear how this change behaves
>> >> across supported hardware.
>> >
>> > For EXYNOS4412 and EXYNOS5250 this patch doesn't cause any functionality
>> > changes because while the patch changes inten_fall_shift usage to
>> > intclr_fall_shift one in exynos_tmu_initialize() it defines
>> > EXYNOS_TMU_CLEAR_FALL_INT_SHIFT to 12 (old EXYNOS_TMU_FALL_INT_SHIFT
>> > value).
>> >
>>
>> OK. Then the patch is about a symbol rename, right?
>
> Yes and while doing so it also changes the define and the value used on
> EXYNOS5440. I checked this change against the documentation today (please
> see below).
>
>> > This patch only changes driver behavior for EXYNOS5440 on which the
>> > used shift value changes from 4 to 12.
>>
>> I see.
>
> tmu_intstat and tmu_intclear refer to the same register on EXYNOS5440
> (EXYNOS5440_TMU_S0_7_IRQ defined to 0x230) and the documentation that
> I have says that the value 4 (which matches EXYNOS5440_TMU_FALL_INT_SHIFT
> before the patch) should be used for the shift value. However the patch
> doesn't define EXYNOS5440_TMU_CLEAR_FALL_INT_SHIFT and instead makes
> the code use generic EXYNOS_TMU_CLEAR_FALL_INT_SHIFT (defined to value
> 12) also on EXYNOS5440. This doesn't seem correct.

Right EXYNOS5440  User manual says TMU_S0-7_IRQEN register fields
RISE_IRQEN 3:0
FALL_IRQEN 7:4
Will make changes accordingly.

I've only tested on Exynos5250 and Exynos5420.
Depending on Amit for Exynos5440 as i don't hardware available.
>
> Naveen, this issue needs to be either fixed or explained properly (if
> the documentation is wrong) in the patch description. Please also put some
> information about hardware that you've tested your patch on in the patch
> description.
I've seen that the patches won't apply straight.
and there is a compilation warning introduced. Will fix both of them.
>
>> >
>> > PS I've only noticed it now but after this patch inten_fall_shift becomes
>> > unused and can be removed.
>> >
>>
>>
>> Then we should remove it.
>
> I completely agree.
>
> Best regards,
> --
> Bartlomiej Zolnierkiewicz
> Samsung R&D Institute Poland
> Samsung Electronics
>
>> > Best regards,
>> > --
>> > Bartlomiej Zolnierkiewicz
>> > Samsung R&D Institute Poland
>> > Samsung Electronics
>> >
>> >>>
>> >>> Best regards,
>> >>> --
>> >>> Bartlomiej Zolnierkiewicz
>> >>> Samsung R&D Institute Poland
>> >>> Samsung Electronics
>> >>>
>> >>> On Wednesday, October 09, 2013 05:38:27 PM Naveen Krishna Chatradhi wrote:
>> >>>> The FALL interrupt related en, status bits are available at an offset of
>> >>>> 16 on INTEN, INTSTAT registers and at an offset of
>> >>>> 12 on INTCLEAR register.
>> >>>>
>> >>>> This patch corrects the same for exyns5250 and exynos5440
>> >>>>
>> >>>> Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
>> >>>> ---
>> >>>> Changes since v1:
>> >>>> Changes since v2:
>> >>>> Changes since v3:
>> >>>>   None
>> >>>>
>> >>>>  drivers/thermal/samsung/exynos_tmu.c      |    2 +-
>> >>>>  drivers/thermal/samsung/exynos_tmu.h      |    2 ++
>> >>>>  drivers/thermal/samsung/exynos_tmu_data.c |    2 ++
>> >>>>  drivers/thermal/samsung/exynos_tmu_data.h |    3 ++-
>> >>>>  4 files changed, 7 insertions(+), 2 deletions(-)
>> >>>>
>> >>>> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
>> >>>> index b43afda..af69209 100644
>> >>>> --- a/drivers/thermal/samsung/exynos_tmu.c
>> >>>> +++ b/drivers/thermal/samsung/exynos_tmu.c
>> >>>> @@ -265,7 +265,7 @@ skip_calib_data:
>> >>>>                                  data->base + reg->threshold_th1);
>> >>>>
>> >>>>                  writel((reg->inten_rise_mask << reg->inten_rise_shift) |
>> >>>> -                        (reg->inten_fall_mask << reg->inten_fall_shift),
>> >>>> +                        (reg->inten_fall_mask << reg->intclr_fall_shift),
>> >>>>                                  data->base + reg->tmu_intclear);
>> >>>>
>> >>>>                  /* if last threshold limit is also present */
>> >>>> diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h
>> >>>> index b364c9e..7c6c34a 100644
>> >>>> --- a/drivers/thermal/samsung/exynos_tmu.h
>> >>>> +++ b/drivers/thermal/samsung/exynos_tmu.h
>> >>>> @@ -134,6 +134,7 @@ enum soc_type {
>> >>>>   * @inten_fall3_shift: shift bits of falling 3 interrupt bits.
>> >>>>   * @tmu_intstat: Register containing the interrupt status values.
>> >>>>   * @tmu_intclear: Register for clearing the raised interrupt status.
>> >>>> + * @intclr_fall_shift: shift bits for interrupt clear fall 0
>> >>>>   * @emul_con: TMU emulation controller register.
>> >>>>   * @emul_temp_shift: shift bits of emulation temperature.
>> >>>>   * @emul_time_shift: shift bits of emulation time.
>> >>>> @@ -204,6 +205,7 @@ struct exynos_tmu_registers {
>> >>>>          u32     tmu_intstat;
>> >>>>
>> >>>>          u32     tmu_intclear;
>> >>>> +        u32     intclr_fall_shift;
>> >>>>
>> >>>>          u32     emul_con;
>> >>>>          u32     emul_temp_shift;
>> >>>> diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c
>> >>>> index 9002499..23fea23 100644
>> >>>> --- a/drivers/thermal/samsung/exynos_tmu_data.c
>> >>>> +++ b/drivers/thermal/samsung/exynos_tmu_data.c
>> >>>> @@ -122,6 +122,7 @@ static const struct exynos_tmu_registers exynos5250_tmu_registers = {
>> >>>>          .inten_fall0_shift = EXYNOS_TMU_INTEN_FALL0_SHIFT,
>> >>>>          .tmu_intstat = EXYNOS_TMU_REG_INTSTAT,
>> >>>>          .tmu_intclear = EXYNOS_TMU_REG_INTCLEAR,
>> >>>> +        .intclr_fall_shift = EXYNOS_TMU_CLEAR_FALL_INT_SHIFT,
>> >>>>          .emul_con = EXYNOS_EMUL_CON,
>> >>>>          .emul_temp_shift = EXYNOS_EMUL_DATA_SHIFT,
>> >>>>          .emul_time_shift = EXYNOS_EMUL_TIME_SHIFT,
>> >>>> @@ -210,6 +211,7 @@ static const struct exynos_tmu_registers exynos5440_tmu_registers = {
>> >>>>          .inten_fall0_shift = EXYNOS5440_TMU_INTEN_FALL0_SHIFT,
>> >>>>          .tmu_intstat = EXYNOS5440_TMU_S0_7_IRQ,
>> >>>>          .tmu_intclear = EXYNOS5440_TMU_S0_7_IRQ,
>> >>>> +        .intclr_fall_shift = EXYNOS_TMU_CLEAR_FALL_INT_SHIFT,
>> >>>>          .tmu_irqstatus = EXYNOS5440_TMU_IRQ_STATUS,
>> >>>>          .emul_con = EXYNOS5440_TMU_S0_7_DEBUG,
>> >>>>          .emul_temp_shift = EXYNOS_EMUL_DATA_SHIFT,
>> >>>> diff --git a/drivers/thermal/samsung/exynos_tmu_data.h b/drivers/thermal/samsung/exynos_tmu_data.h
>> >>>> index dc7feb5..8788a87 100644
>> >>>> --- a/drivers/thermal/samsung/exynos_tmu_data.h
>> >>>> +++ b/drivers/thermal/samsung/exynos_tmu_data.h
>> >>>> @@ -69,9 +69,10 @@
>> >>>>  #define EXYNOS_TMU_RISE_INT_MASK        0x111
>> >>>>  #define EXYNOS_TMU_RISE_INT_SHIFT       0
>> >>>>  #define EXYNOS_TMU_FALL_INT_MASK        0x111
>> >>>> -#define EXYNOS_TMU_FALL_INT_SHIFT       12
>> >>>> +#define EXYNOS_TMU_FALL_INT_SHIFT       16
>> >>>>  #define EXYNOS_TMU_CLEAR_RISE_INT       0x111
>> >>>>  #define EXYNOS_TMU_CLEAR_FALL_INT       (0x111 << 12)
>> >>>> +#define EXYNOS_TMU_CLEAR_FALL_INT_SHIFT 12
>> >>>>  #define EXYNOS_TMU_TRIP_MODE_SHIFT      13
>> >>>>  #define EXYNOS_TMU_TRIP_MODE_MASK       0x7
>> >>>>  #define EXYNOS_TMU_THERM_TRIP_EN_SHIFT  12
>



-- 
Shine bright,
(: Nav :)

  reply	other threads:[~2013-10-15 11:40 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-01  6:02 [PATCH] thermal: exynos: Handle the misplaced TRIMINFO register Naveen Krishna Chatradhi
2013-08-01  8:32 ` amit daniel kachhap
2013-08-01  8:48   ` Naveen Krishna Ch
2013-08-01 10:36 ` [PATCH v2] " Naveen Krishna Chatradhi
2013-08-07  6:36   ` amit daniel kachhap
2013-08-07  6:43     ` Naveen Krishna Ch
2013-08-28  5:45 ` [PATCH 0/3] thermal: samsung: Add TMU for Exynos5420 Naveen Krishna Chatradhi
2013-08-28  5:45   ` [PATCH 1/3] thermal: samsung: correct the fall interrupt en, status bit fields Naveen Krishna Chatradhi
2013-08-28  5:57     ` amit daniel kachhap
2013-09-04  4:23     ` Naveen Krishna Chatradhi
2013-09-04  4:23       ` [PATCH 2/3] thermal: samsung: change base_common to more meaningful base_second Naveen Krishna Chatradhi
2013-09-06  4:38         ` amit daniel kachhap
2013-10-17  3:12         ` [PATCH 2/3 v6] " Naveen Krishna Chatradhi
2013-11-06 13:28         ` [PATCH 2/3 v7] " Naveen Krishna Chatradhi
2013-11-07  5:53         ` [PATCH 2/3 v8] " Naveen Krishna Chatradhi
2013-11-12  6:36         ` [PATCH 2/4 v9] " Naveen Krishna Chatradhi
2013-11-18  3:24           ` Naveen Krishna Ch
2013-11-19 13:04         ` [PATCH 2/4 v10] " Naveen Krishna Chatradhi
2013-11-22  8:56           ` Naveen Krishna Ch
2013-12-09 12:48           ` Tomasz Figa
2013-12-10  6:41         ` [PATCH v11 2/4] " Naveen Krishna Chatradhi
2013-12-18 15:51           ` Tomasz Figa
2013-12-19  6:06         ` [PATCH v12 " Naveen Krishna Chatradhi
2014-02-07  9:35           ` Naveen Krishna Ch
2013-09-04  4:23       ` [PATCH 3/3] thermal: samsung: Add TMU support for Exynos5420 SoCs Naveen Krishna Chatradhi
2013-10-03 12:01         ` Naveen Krishna Ch
2013-10-03 12:42           ` Bartlomiej Zolnierkiewicz
2013-10-09 11:45             ` Naveen Krishna Ch
2013-10-09 12:08         ` [PATCH 1/3 v4] thermal: samsung: correct the fall interrupt en, status bit fields Naveen Krishna Chatradhi
2013-10-09 12:08           ` [PATCH 2/3 v4] thermal: samsung: change base_common to more meaningful base_second Naveen Krishna Chatradhi
2013-10-14 13:47             ` Eduardo Valentin
2013-10-09 12:08           ` [PATCH 3/3 v4] thermal: samsung: Add TMU support for Exynos5420 SoCs Naveen Krishna Chatradhi
2013-10-09 14:03           ` [PATCH 1/3 v4] thermal: samsung: correct the fall interrupt en, status bit fields Bartlomiej Zolnierkiewicz
2013-10-11 15:10             ` Eduardo Valentin
2013-10-11 15:57               ` Bartlomiej Zolnierkiewicz
2013-10-14 14:18                 ` Eduardo Valentin
2013-10-14 16:01                   ` Bartlomiej Zolnierkiewicz
2013-10-15 11:39                     ` Naveen Krishna Ch [this message]
2013-10-14 13:56             ` Eduardo Valentin
2013-11-06 13:28         ` [PATCH 3/3 v7] thermal: samsung: Add TMU support for Exynos5420 SoCs Naveen Krishna Chatradhi
2013-11-06 13:44           ` Bartlomiej Zolnierkiewicz
2013-11-07  5:53         ` [PATCH 3/3 v8] " Naveen Krishna Chatradhi
2013-11-07 15:09           ` Tomasz Figa
2013-11-12  6:19             ` Naveen Krishna Ch
2013-11-12  6:37         ` [PATCH 3/4 v9] " Naveen Krishna Chatradhi
2013-11-18  3:22           ` Naveen Krishna Ch
2013-11-18 11:27             ` Mark Rutland
2013-12-09 12:43           ` Tomasz Figa
2013-11-19 13:05         ` [PATCH 3/4 v10] " Naveen Krishna Chatradhi
2013-11-22  8:55           ` Naveen Krishna Ch
2013-12-09 12:46           ` Tomasz Figa
2013-12-10  6:42         ` [PATCH v11 3/4] " Naveen Krishna Chatradhi
2013-12-18 15:50           ` Tomasz Figa
2013-12-19  4:44             ` Naveen Krishna Ch
2013-12-19  6:06         ` [PATCH v12 " Naveen Krishna Chatradhi
2013-12-19 11:34           ` Tomasz Figa
2014-02-07  9:34             ` Naveen Krishna Ch
2013-10-17  3:11     ` [PATCH 1/3 v6] thermal: samsung: add intclr_fall_shift bit in exynos_tmu_register Naveen Krishna Chatradhi
2013-10-17 10:03       ` Bartlomiej Zolnierkiewicz
2013-11-06 13:17         ` Naveen Krishna Ch
2013-11-06 13:36           ` Bartlomiej Zolnierkiewicz
2013-11-06 13:27       ` [PATCH 1/3 v7] " Naveen Krishna Chatradhi
2013-11-07  5:52       ` [PATCH 1/3 v8] thermal: samsung: add intclr_fall_shift bit in exynos_tmu_register struct Naveen Krishna Chatradhi
2013-11-07 10:48         ` Bartlomiej Zolnierkiewicz
2013-11-07 10:58           ` Naveen Krishna Ch
2013-11-07 14:47         ` Tomasz Figa
2013-11-12  6:36         ` [PATCH 1/4 v9] thermal: samsung: replace inten_ bit fields with intclr_ Naveen Krishna Chatradhi
2013-11-18  3:25           ` Naveen Krishna Ch
2013-11-19 13:04           ` [PATCH 1/4 v10] " Naveen Krishna Chatradhi
2013-12-09 12:51             ` Tomasz Figa
2013-12-10  6:41           ` [PATCH v11 1/4] " Naveen Krishna Chatradhi
2013-12-18 15:51             ` Tomasz Figa
2013-12-19  6:05           ` [PATCH v12 " Naveen Krishna Chatradhi
2014-01-02  2:33             ` Zhang Rui
2014-02-07  9:33               ` Naveen Krishna Ch
2014-04-10 12:43                 ` Bartlomiej Zolnierkiewicz
2013-08-28  5:45   ` [PATCH 2/3] thermal: samsung: Add TMU support for Exynos5420 SoCs Naveen Krishna Chatradhi
2013-08-28  5:58     ` amit daniel kachhap
2013-08-28  9:28     ` amit daniel kachhap
2013-10-17  3:12     ` [PATCH 3/3 v6] " Naveen Krishna Chatradhi
2013-08-28  5:45   ` [PATCH 3/3] thermal: exynos: Handle the misplaced TRIMINFO register Naveen Krishna Chatradhi
2013-08-28  6:03     ` amit daniel kachhap
2013-08-28  6:19       ` Naveen Krishna Ch
2013-08-28  8:43         ` amit daniel kachhap
2013-08-28  8:57           ` Naveen Krishna Ch
2013-08-28  9:04             ` amit daniel kachhap
2013-08-28 10:06     ` Bartlomiej Zolnierkiewicz
2013-11-12  6:35   ` [PATCH 0/3] thermal: samsung: Clean up and add support for Exynos5420 Naveen Krishna Chatradhi
2013-11-18  3:25     ` Naveen Krishna Ch
2013-12-10  6:40     ` [PATCH v11 0/4] " Naveen Krishna Chatradhi
2014-03-19 11:19       ` Leela Krishna Amudala
2014-03-19 15:58         ` Tomasz Figa
2014-03-20  2:45           ` Naveen Krishna Ch
2014-04-08  9:33             ` Javi Merino
2013-08-28  9:16 ` [PATCH 1/3 v2] thermal: samsung: correct the fall interrupt en, status bit fields Naveen Krishna Chatradhi
2013-08-28  9:16   ` [PATCH 2/3] thermal: samsung: change base_common to more meaningful base_second Naveen Krishna Chatradhi
2013-08-28  9:16   ` [PATCH v2: 3/3] thermal: samsung: Add TMU support for Exynos5420 SoCs Naveen Krishna Chatradhi
2013-08-28 10:38     ` Bartlomiej Zolnierkiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHfPSqDbvgtMpivfhwd4kW3NE7x2=-zyE1ugpox+e0+mxm7bmg@mail.gmail.com' \
    --to=naveenkrishna.ch@gmail.com \
    --cc=amit.daniel@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=ch.naveen@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=eduardo.valentin@ti.com \
    --cc=kgene.kim@samsung.com \
    --cc=l.majewski@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).