Linux Renesas SOC kernel development
 help / color / mirror / Atom feed
* Re: [PATCH 0/9] clocksource/drivers/clksrc-of: Improve error handling
       [not found] <1464770093-12667-1-git-send-email-daniel.lezcano@linaro.org>
@ 2016-06-07  9:54 ` Geert Uytterhoeven
  2016-06-07 11:35   ` Daniel Lezcano
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2016-06-07  9:54 UTC (permalink / raw)
  To: Daniel Lezcano
  Cc: Thomas Gleixner, linux-kernel@vger.kernel.org, linux-renesas-soc

Hi Daniel,

On Wed, Jun 1, 2016 at 10:34 AM, Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:
> The macro CLOCKSOURCE_OF_DECLARE is widely used in the timer drivers.
>
> Basically, this macro is defined to insert in a table a tuple name,function.
> This function is an init function called when the name matches the DT node and
> its signature is:
>
>         typedef void (*of_init_fn_1)(struct device_node *);
>
> It does not return an error code.
>
> That results in the clocksource-probe not being able to figure out if the driver
> was correctly initialized or not, the different drivers to act as they were the
> only ones on the system (panic, instead of failing gracefully), and duplicated
> code for error reporting.
>
> This series initiates the logic change and centralize the error handling in the
> clocksource probe code.
>
> In order to do the changes little by little, a new macro was introduced:
>
>  CLOCKSOURCE_OF_DECLARE_RET()

As I have no other thread to reply to, I'm using this related one.

commit bcbe219f9306da478b77e705a7273843c2660d7b
Author: Daniel Lezcano <daniel.lezcano@linaro.org>
Date:   Tue Jun 7 00:27:44 2016 +0200

    clocksources: Switch back to the clksrc table

    Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

in clockevents/clockevents/next breaks the boot on e.g. r8a7791/koelsch
(arm32) and r8a7795/salvator-x (arm64).

Using "earlycon keep_bootcon" on koelsch (this doesn't help on arm64)
reveals it's stuck at:

    clocksource_probe: no matching clocksources found
    sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every
21474836475000000ns
    Calibrating delay loop...

With the above commit reverted, it works again:

    Architected cp15 timer(s) running at 10.00MHz (virt).
    clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles:
0x24e6a1710, max_idle_ns: 440795202120 ns
    sched_clock: 56 bits at 10MHz, resolution 100ns, wraps every 4398046511100ns
    Switching to timer-based delay loop, resolution 100ns
    Calibrating delay loop (skipped), value calculated using timer
frequency.. 20.00 BogoMIPS (lpj=100000)

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 0/9] clocksource/drivers/clksrc-of: Improve error handling
  2016-06-07  9:54 ` [PATCH 0/9] clocksource/drivers/clksrc-of: Improve error handling Geert Uytterhoeven
@ 2016-06-07 11:35   ` Daniel Lezcano
  2016-06-07 22:23   ` Daniel Lezcano
  2016-06-08 14:10   ` Daniel Lezcano
  2 siblings, 0 replies; 6+ messages in thread
From: Daniel Lezcano @ 2016-06-07 11:35 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Thomas Gleixner, linux-kernel@vger.kernel.org, linux-renesas-soc

On 06/07/2016 11:54 AM, Geert Uytterhoeven wrote:
> Hi Daniel,
>
> On Wed, Jun 1, 2016 at 10:34 AM, Daniel Lezcano
> <daniel.lezcano@linaro.org> wrote:
>> The macro CLOCKSOURCE_OF_DECLARE is widely used in the timer drivers.
>>
>> Basically, this macro is defined to insert in a table a tuple name,function.
>> This function is an init function called when the name matches the DT node and
>> its signature is:
>>
>>          typedef void (*of_init_fn_1)(struct device_node *);
>>
>> It does not return an error code.
>>
>> That results in the clocksource-probe not being able to figure out if the driver
>> was correctly initialized or not, the different drivers to act as they were the
>> only ones on the system (panic, instead of failing gracefully), and duplicated
>> code for error reporting.
>>
>> This series initiates the logic change and centralize the error handling in the
>> clocksource probe code.
>>
>> In order to do the changes little by little, a new macro was introduced:
>>
>>   CLOCKSOURCE_OF_DECLARE_RET()
>
> As I have no other thread to reply to, I'm using this related one.
>
> commit bcbe219f9306da478b77e705a7273843c2660d7b
> Author: Daniel Lezcano <daniel.lezcano@linaro.org>
> Date:   Tue Jun 7 00:27:44 2016 +0200
>
>      clocksources: Switch back to the clksrc table
>
>      Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
>
> in clockevents/clockevents/next breaks the boot on e.g. r8a7791/koelsch
> (arm32) and r8a7795/salvator-x (arm64).
>
> Using "earlycon keep_bootcon" on koelsch (this doesn't help on arm64)
> reveals it's stuck at:
>
>      clocksource_probe: no matching clocksources found
>      sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every
> 21474836475000000ns
>      Calibrating delay loop...
>
> With the above commit reverted, it works again:

Ah, thanks for reporting.

I will fix it.

   -- Daniel

-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

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

* Re: [PATCH 0/9] clocksource/drivers/clksrc-of: Improve error handling
  2016-06-07  9:54 ` [PATCH 0/9] clocksource/drivers/clksrc-of: Improve error handling Geert Uytterhoeven
  2016-06-07 11:35   ` Daniel Lezcano
@ 2016-06-07 22:23   ` Daniel Lezcano
  2016-06-08 14:10   ` Daniel Lezcano
  2 siblings, 0 replies; 6+ messages in thread
From: Daniel Lezcano @ 2016-06-07 22:23 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Thomas Gleixner, linux-kernel@vger.kernel.org, linux-renesas-soc

On 06/07/2016 11:54 AM, Geert Uytterhoeven wrote:
> Hi Daniel,

Hi Geert,

[ ... ]

> Using "earlycon keep_bootcon" on koelsch (this doesn't help on arm64)
> reveals it's stuck at:
>
>      clocksource_probe: no matching clocksources found
>      sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every
> 21474836475000000ns
>      Calibrating delay loop...
>

Ok, so the "renesas,cmt-48-gen2" is not impacted by the changes because 
it uses the platform approach. Very likely, the issue is coming from the 
arch_arm_timer failing somewhere.

Or I added a regression and the timer is wrongly returning an error, or 
the error is always there and now it is caught.

Can you give the traces before 'clocksource_probe: no matching 
clocksources found' ?

   -- Daniel

-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

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

* Re: [PATCH 0/9] clocksource/drivers/clksrc-of: Improve error handling
  2016-06-07  9:54 ` [PATCH 0/9] clocksource/drivers/clksrc-of: Improve error handling Geert Uytterhoeven
  2016-06-07 11:35   ` Daniel Lezcano
  2016-06-07 22:23   ` Daniel Lezcano
@ 2016-06-08 14:10   ` Daniel Lezcano
  2016-06-09  7:46     ` Geert Uytterhoeven
  2 siblings, 1 reply; 6+ messages in thread
From: Daniel Lezcano @ 2016-06-08 14:10 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Thomas Gleixner, linux-kernel@vger.kernel.org, linux-renesas-soc

On 06/07/2016 11:54 AM, Geert Uytterhoeven wrote:

[ ... ]

> in clockevents/clockevents/next breaks the boot on e.g. r8a7791/koelsch
> (arm32) and r8a7795/salvator-x (arm64).
>
> Using "earlycon keep_bootcon" on koelsch (this doesn't help on arm64)
> reveals it's stuck at:
>
>      clocksource_probe: no matching clocksources found
>      sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every
> 21474836475000000ns
>      Calibrating delay loop...
>
> With the above commit reverted, it works again:
>
>      Architected cp15 timer(s) running at 10.00MHz (virt).
>      clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles:
> 0x24e6a1710, max_idle_ns: 440795202120 ns
>      sched_clock: 56 bits at 10MHz, resolution 100ns, wraps every 4398046511100ns
>      Switching to timer-based delay loop, resolution 100ns
>      Calibrating delay loop (skipped), value calculated using timer
> frequency.. 20.00 BogoMIPS (lpj=100000)

I think it is fixed now and pushed on my tree. Is it possible to confirm 
your boards are working correctly again after the linux-next is updated 
with my latest changes ?

Thanks for the report.

   -- Daniel


-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

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

* Re: [PATCH 0/9] clocksource/drivers/clksrc-of: Improve error handling
  2016-06-08 14:10   ` Daniel Lezcano
@ 2016-06-09  7:46     ` Geert Uytterhoeven
  2016-06-09  7:49       ` Daniel Lezcano
  0 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2016-06-09  7:46 UTC (permalink / raw)
  To: Daniel Lezcano
  Cc: Thomas Gleixner, linux-kernel@vger.kernel.org, linux-renesas-soc

Hi Daniel,

On Wed, Jun 8, 2016 at 4:10 PM, Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:
> On 06/07/2016 11:54 AM, Geert Uytterhoeven wrote:
>
> [ ... ]
>
>> in clockevents/clockevents/next breaks the boot on e.g. r8a7791/koelsch
>> (arm32) and r8a7795/salvator-x (arm64).
>>
>> Using "earlycon keep_bootcon" on koelsch (this doesn't help on arm64)
>> reveals it's stuck at:
>>
>>      clocksource_probe: no matching clocksources found
>>      sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every
>> 21474836475000000ns
>>      Calibrating delay loop...
>>
>> With the above commit reverted, it works again:
>>
>>      Architected cp15 timer(s) running at 10.00MHz (virt).
>>      clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles:
>> 0x24e6a1710, max_idle_ns: 440795202120 ns
>>      sched_clock: 56 bits at 10MHz, resolution 100ns, wraps every
>> 4398046511100ns
>>      Switching to timer-based delay loop, resolution 100ns
>>      Calibrating delay loop (skipped), value calculated using timer
>> frequency.. 20.00 BogoMIPS (lpj=100000)
>
> I think it is fixed now and pushed on my tree. Is it possible to confirm
> your boards are working correctly again after the linux-next is updated with
> my latest changes ?

I can confirm the issue is fixed in today's clockevents/next
(52be039599e1339e).

Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 0/9] clocksource/drivers/clksrc-of: Improve error handling
  2016-06-09  7:46     ` Geert Uytterhoeven
@ 2016-06-09  7:49       ` Daniel Lezcano
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Lezcano @ 2016-06-09  7:49 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Thomas Gleixner, linux-kernel@vger.kernel.org, linux-renesas-soc

On 06/09/2016 09:46 AM, Geert Uytterhoeven wrote:
> Hi Daniel,
>
> On Wed, Jun 8, 2016 at 4:10 PM, Daniel Lezcano
> <daniel.lezcano@linaro.org> wrote:
>> On 06/07/2016 11:54 AM, Geert Uytterhoeven wrote:
>>
>> [ ... ]
>>
>>> in clockevents/clockevents/next breaks the boot on e.g. r8a7791/koelsch
>>> (arm32) and r8a7795/salvator-x (arm64).
>>>
>>> Using "earlycon keep_bootcon" on koelsch (this doesn't help on arm64)
>>> reveals it's stuck at:
>>>
>>>       clocksource_probe: no matching clocksources found
>>>       sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every
>>> 21474836475000000ns
>>>       Calibrating delay loop...
>>>
>>> With the above commit reverted, it works again:
>>>
>>>       Architected cp15 timer(s) running at 10.00MHz (virt).
>>>       clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles:
>>> 0x24e6a1710, max_idle_ns: 440795202120 ns
>>>       sched_clock: 56 bits at 10MHz, resolution 100ns, wraps every
>>> 4398046511100ns
>>>       Switching to timer-based delay loop, resolution 100ns
>>>       Calibrating delay loop (skipped), value calculated using timer
>>> frequency.. 20.00 BogoMIPS (lpj=100000)
>>
>> I think it is fixed now and pushed on my tree. Is it possible to confirm
>> your boards are working correctly again after the linux-next is updated with
>> my latest changes ?
>
> I can confirm the issue is fixed in today's clockevents/next
> (52be039599e1339e).

Great ! Thanks for testing.

   -- Daniel


-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

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

end of thread, other threads:[~2016-06-09  7:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1464770093-12667-1-git-send-email-daniel.lezcano@linaro.org>
2016-06-07  9:54 ` [PATCH 0/9] clocksource/drivers/clksrc-of: Improve error handling Geert Uytterhoeven
2016-06-07 11:35   ` Daniel Lezcano
2016-06-07 22:23   ` Daniel Lezcano
2016-06-08 14:10   ` Daniel Lezcano
2016-06-09  7:46     ` Geert Uytterhoeven
2016-06-09  7:49       ` Daniel Lezcano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox