Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 927979 - sys-kernel/gentoo-sources-6.6.21: uart's clock shot down while used
Summary: sys-kernel/gentoo-sources-6.6.21: uart's clock shot down while used
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: ARM64 Linux
: Normal normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-27 17:53 UTC by Étienne Buira
Modified: 2024-03-30 10:39 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
dmesg with clk_ignore_unused (dmesg,14.94 KB, text/plain)
2024-03-27 18:32 UTC, Étienne Buira
Details
config (config,106.02 KB, text/plain)
2024-03-27 18:35 UTC, Étienne Buira
Details
config.v6.6 (config.v6.6,240.82 KB, application/x-troff-man)
2024-03-29 05:56 UTC, Hans Ulli Kroll
Details
workaround (workaround_uart2clock.patch,876 bytes, patch)
2024-03-29 16:54 UTC, Étienne Buira
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Étienne Buira 2024-03-27 17:53:12 UTC
Hi all,

I try to boot a Rock64, but it crashes just after printing "clk: Disabling unused clocks".
If i put clk_ignore_unused kernel command line item, it proceeds further.

Looking at clk/clk.c, it looks like each clock has a kind of reference count. However, i couldn't see any acquire/release in kernel/time/clocksource.c. Not sure it is the underlying problem however.

Any idea how to sort this out?


Reproducible: Always
Comment 1 Hans Ulli Kroll 2024-03-27 18:13:29 UTC
Hi

.. this is not a general gentoo problem, 
because you are compiling your kernel "at your own"
This can be anything ..

- Did you have a running kernel with a lower version number ?
- "clk: Disabling unused clock" is a normal procedure and should not crash
- dmesg missing
- missing compiled in drivers (which are needed to start) 

Rock64 looks like a rk3399 or ek3328 SoC ?
Comment 2 Étienne Buira 2024-03-27 18:32:05 UTC
Created attachment 888825 [details]
dmesg with clk_ignore_unused

Hi,

Thanks for your help.

Indeed, Rock64 is RK3328 based (with RK805 providing power and RTC).
I never had any kernel working on this SBC, i'm trying to make one.

Here is the dmesg with clk_ignore_unused. Without, it just stops at "clk: Disabling unused clocks"
Comment 3 Étienne Buira 2024-03-27 18:35:00 UTC
Created attachment 888826 [details]
config

And here is the config i used, it is a work in progress (and do not have proper sd block support).
Comment 4 Mike Pagano gentoo-dev 2024-03-27 19:27:01 UTC
(In reply to Étienne Buira from comment #3)
> Created attachment 888826 [details]
> config
> 
> And here is the config i used, it is a work in progress (and do not have
> proper sd block support).

You ever try one of these kernels?

https://github.com/ayufan-rock64/linux-mainline-kernel
Comment 5 Étienne Buira 2024-03-28 11:35:34 UTC
(In reply to Mike Pagano from comment #4)
> You ever try one of these kernels?
> 
> https://github.com/ayufan-rock64/linux-mainline-kernel

Hi,

Nope, i didn't use any other kernel than gentoo-sources, and ideally, i'd like to stick to it.
Comment 6 Étienne Buira 2024-03-28 12:54:41 UTC
Just an update if someone is interested.
The issue is uart2 (which i get my output from) clock gets disabled while in use.
Comment 7 Hans Ulli Kroll 2024-03-28 14:13:16 UTC
> VFS: Cannot open root device "/dev/mmcblk1p5" or unknown-block(0,0)

you should set CONFIG_MMC_DW

also for network and usb
CONFIG_DWMAC_ROCKCHIP
CONFIG_USB_DWC3
Comment 8 Étienne Buira 2024-03-28 14:54:44 UTC
(In reply to Hans Ulli Kroll from comment #7)
> > VFS: Cannot open root device "/dev/mmcblk1p5" or unknown-block(0,0)
> 
> you should set CONFIG_MMC_DW
> 
> also for network and usb
> CONFIG_DWMAC_ROCKCHIP
> CONFIG_USB_DWC3

Thanks, i added MMC_DW, and MMC_DW_ROCKCHIP, it looks like recognised, but do not show up in available partitions (MMC_BLOCK is in too).

I'm not at the point of configuring network and usb now :)
Comment 9 Mike Gilbert gentoo-dev 2024-03-28 19:48:23 UTC
Closing as INVALID as this seems to be kernel config related and insufficient info has been provided to identify any "bug".
Comment 10 Étienne Buira 2024-03-28 20:38:38 UTC
There actually _is_ a bug, not related to config, and expressed/understood better in comment #6.
I also provided all information requested.
Comment 11 Mike Pagano gentoo-dev 2024-03-28 22:54:22 UTC
(In reply to Étienne Buira from comment #5)
> (In reply to Mike Pagano from comment #4)
> > You ever try one of these kernels?
> > 
> > https://github.com/ayufan-rock64/linux-mainline-kernel
> 
> Hi,
> 
> Nope, i didn't use any other kernel than gentoo-sources, and ideally, i'd
> like to stick to it.

What I mean is, do they have a working config you can start from to use on gentoo-sources?
Comment 12 Hans Ulli Kroll 2024-03-29 05:56:24 UTC
Created attachment 888952 [details]
config.v6.6
Comment 13 Hans Ulli Kroll 2024-03-29 06:04:57 UTC
Hello Étienne 

this should be a kernel config error first !

You also missed 
CONFIG_MTD_OF_PARTS
Maybe more options are missing, I don't know.

The easiest part is to use a running kernel from ayufan an use the config from there.
I you dare to use your own compiled kernel, you can start with my config.

Please be aware most kernels use modules to load the driver, which are on rootfs. So you must copy this on your eMMC or sdcard.

Or compile this into your kernel image, but sometimes here is some size problem with the bootloader. IFAIR it's about 32 MiB
Comment 14 Étienne Buira 2024-03-29 16:54:34 UTC
Created attachment 889019 [details, diff]
workaround

This really looks like a kernel bug, as this patch works around it for my use-case.
But the underlying problem is kernel does not figure out this clock is used and needed by current console.

OT about config: Thank you Hans, i got a working kernel now.
Comment 15 Étienne Buira 2024-03-30 10:39:57 UTC
Please apologise, enabling some specific quirk solved the issue.