All of lore.kernel.org
 help / color / mirror / Atom feed
* [BUG]: A83T - AC100 gets the wrong number of parents
@ 2018-02-11  2:43 ` Philipp Rossak
  0 siblings, 0 replies; 4+ messages in thread
From: Philipp Rossak @ 2018-02-11  2:43 UTC (permalink / raw)
  To: linux-sunxi, maxime.ripard, wens
  Cc: linux-kernel, linux-arm-kernel, linux-clk, linux-rtc

Hey,

When I boot my A83T I get the following bootlog [1].

After some debugging, I found out that the function call:
clk_hw_get_num_parents() returns 2. After a look in the devicetree I
found out that this value should be 1, since we only have one parent
clock [3].
Setting the variable num_parents to 1 fixes the problem, but this is no
soultion.

Regards,
Philipp



[1]: https://pastebin.com/5c7hxjsS
[2]: http://lxr.bootlin.com/linux/v4.15/source/drivers/rtc/rtc-ac100.c#
L180
[3]: http://lxr.bootlin.com/linux/v4.15/source/arch/arm/boot/dts/sun8i-
a83t-bananapi-m3.dts#L159

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

* [BUG]: A83T - AC100 gets the wrong number of parents
@ 2018-02-11  2:43 ` Philipp Rossak
  0 siblings, 0 replies; 4+ messages in thread
From: Philipp Rossak @ 2018-02-11  2:43 UTC (permalink / raw)
  To: linux-arm-kernel

Hey,

When I boot my A83T I get the following bootlog [1].

After some debugging, I found out that the function call:
clk_hw_get_num_parents() returns 2. After a look in the devicetree I
found out that this value should be 1, since we only have one parent
clock [3].
Setting the variable num_parents to 1 fixes the problem, but this is no
soultion.

Regards,
Philipp



[1]: https://pastebin.com/5c7hxjsS
[2]: http://lxr.bootlin.com/linux/v4.15/source/drivers/rtc/rtc-ac100.c#
L180
[3]: http://lxr.bootlin.com/linux/v4.15/source/arch/arm/boot/dts/sun8i-
a83t-bananapi-m3.dts#L159

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

* Re: [BUG]: A83T - AC100 gets the wrong number of parents
  2018-02-11  2:43 ` Philipp Rossak
@ 2018-02-12  8:47   ` Chen-Yu Tsai
  -1 siblings, 0 replies; 4+ messages in thread
From: Chen-Yu Tsai @ 2018-02-12  8:47 UTC (permalink / raw)
  To: Philipp Rossak
  Cc: linux-sunxi, Maxime Ripard, linux-rtc, linux-kernel,
	linux-arm-kernel, linux-clk

On Sun, Feb 11, 2018 at 10:43 AM, Philipp Rossak <embed3d@gmail.com> wrote:
> Hey,
>
> When I boot my A83T I get the following bootlog [1].
>
> After some debugging, I found out that the function call:
> clk_hw_get_num_parents() returns 2. After a look in the devicetree I
> found out that this value should be 1, since we only have one parent
> clock [3].

Not really. The first parent is registered within the rtc-ac100 driver,
which also handles the clocks on the RTC side of the chip.

The clock in the device tree is meant to tie the two parts of the chip
together: the codec side provides a high speed clock to the RTC side.

> Setting the variable num_parents to 1 fixes the problem, but this is no
> soultion.

A good fix would be to check the return value of clk_hw_get_parent_by_index()
here: http://lxr.bootlin.com/linux/v4.16-rc1/source/drivers/rtc/rtc-ac100.c#L186
and skip it if it's NULL.

The driver is setup this way because the codec side is not implemented,
but the device tree binding is partially defined to include the clock.

ChenYu

> Regards,
> Philipp
>
>
>
> [1]: https://pastebin.com/5c7hxjsS
> [2]: http://lxr.bootlin.com/linux/v4.15/source/drivers/rtc/rtc-ac100.c#
> L180
> [3]: http://lxr.bootlin.com/linux/v4.15/source/arch/arm/boot/dts/sun8i-
> a83t-bananapi-m3.dts#L159
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [BUG]: A83T - AC100 gets the wrong number of parents
@ 2018-02-12  8:47   ` Chen-Yu Tsai
  0 siblings, 0 replies; 4+ messages in thread
From: Chen-Yu Tsai @ 2018-02-12  8:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Feb 11, 2018 at 10:43 AM, Philipp Rossak <embed3d@gmail.com> wrote:
> Hey,
>
> When I boot my A83T I get the following bootlog [1].
>
> After some debugging, I found out that the function call:
> clk_hw_get_num_parents() returns 2. After a look in the devicetree I
> found out that this value should be 1, since we only have one parent
> clock [3].

Not really. The first parent is registered within the rtc-ac100 driver,
which also handles the clocks on the RTC side of the chip.

The clock in the device tree is meant to tie the two parts of the chip
together: the codec side provides a high speed clock to the RTC side.

> Setting the variable num_parents to 1 fixes the problem, but this is no
> soultion.

A good fix would be to check the return value of clk_hw_get_parent_by_index()
here: http://lxr.bootlin.com/linux/v4.16-rc1/source/drivers/rtc/rtc-ac100.c#L186
and skip it if it's NULL.

The driver is setup this way because the codec side is not implemented,
but the device tree binding is partially defined to include the clock.

ChenYu

> Regards,
> Philipp
>
>
>
> [1]: https://pastebin.com/5c7hxjsS
> [2]: http://lxr.bootlin.com/linux/v4.15/source/drivers/rtc/rtc-ac100.c#
> L180
> [3]: http://lxr.bootlin.com/linux/v4.15/source/arch/arm/boot/dts/sun8i-
> a83t-bananapi-m3.dts#L159
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2018-02-12  8:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-11  2:43 [BUG]: A83T - AC100 gets the wrong number of parents Philipp Rossak
2018-02-11  2:43 ` Philipp Rossak
2018-02-12  8:47 ` Chen-Yu Tsai
2018-02-12  8:47   ` Chen-Yu Tsai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.