[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMz4ku+ZZTp7HRV=XP3L0tnerSSmCK6hyJGH2P6U9XgC2xVOdA@mail.gmail.com>
Date: Mon, 21 Nov 2016 16:46:34 +0800
From: Baolin Wang <baolin.wang@...aro.org>
To: Ingo Molnar <mingo@...nel.org>
Cc: John Stultz <john.stultz@...aro.org>,
lkml <linux-kernel@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Richard Cochran <richardcochran@...il.com>,
Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [PATCH 1/4] time: alarmtimer: Add the trcepoints for alarmtimer
Hi Ingo,
On 21 November 2016 at 16:13, Ingo Molnar <mingo@...nel.org> wrote:
>
> * John Stultz <john.stultz@...aro.org> wrote:
>
>> @@ -222,7 +226,7 @@ static int alarmtimer_suspend(struct device *dev)
>> ktime_t min, now;
>> unsigned long flags;
>> struct rtc_device *rtc;
>> - int i;
>> + int i, type = 0;
>> int ret;
>>
>> spin_lock_irqsave(&freezer_delta_lock, flags);
>> @@ -247,8 +251,10 @@ static int alarmtimer_suspend(struct device *dev)
>> if (!next)
>> continue;
>> delta = ktime_sub(next->expires, base->gettime());
>> - if (!min.tv64 || (delta.tv64 < min.tv64))
>> + if (!min.tv64 || (delta.tv64 < min.tv64)) {
>> min = delta;
>> + type = i;
>> + }
>> }
>> if (min.tv64 == 0)
>> return 0;
>> @@ -264,6 +270,8 @@ static int alarmtimer_suspend(struct device *dev)
>> now = rtc_tm_to_ktime(tm);
>> now = ktime_add(now, min);
>>
>> + trace_alarmtimer_suspend(now, type);
>> +
>> /* Set alarm, if in the past reject suspend briefly to handle */
>> ret = rtc_timer_start(rtc, &rtctimer, now, ktime_set(0, 0));
>> if (ret < 0)
>
> Hm, there's a weirdness here: if freezer_delta != 0 when alarmtimer_suspend() is
> called then type might be '0', although it's not alarm_bases[0] this value is
> picked up from.
>
> Wouldn't it be better to initialize 'type' to -1 instead? (And rename it to
> min_type or so.)
Make sense. I will send out new patch to fix this. Thanks for your comments.
>
> That would disambiguate the freezer_delta special case in the trace.
>
> (Unless I missed something.)
>
> Thanks,
>
> Ingo
--
Baolin.wang
Best Regards
Powered by blists - more mailing lists