Closed Miouyouyou closed 4 years ago
Start working on compilation of 4.16-rc4...
Prompting kernel config questions this time... Restart script after
$ cp tmp/RockMyy-0dfd08eeb9ca1ece37b083e22c494afd5f4a379c/config/v4.16/config-latest .config
$ cp .config linux
PASSED! No vblank timeout dmesg_4.16-rc4-RockMyy-16Bits-Edition.log
Alright...
My guess is that it could be either this change : https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/gpu/drm?h=v4.16&id=b24791fe00f8b089d5b10cb7bcc4e1ae88b4831b or this change https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/gpu/drm?h=v4.16&id=5a9f698feb11b198f17b2acebbfe0e2716a3beed
Both were introduced with the kernel 4.16-rc7.
One way to test one of the patches, without the other, would be to :
cd linux
wget https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/drivers/gpu/drm?id=b24791fe00f8b089d5b10cb7bcc4e1ae88b4831b -O GetFB.patch
git apply -R ./GetFB.patch
cd linux
wget https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/drivers/gpu/drm?id=5a9f698feb11b198f17b2acebbfe0e2716a3beed -O DRMAST.patch
git apply -R DRMAST.patch
If that still fails... It will be time for some "printk" debugging.
Ok, start compile 4.16-rc7
With both changes:
Linux tinkerboard 4.16.0-rc7-RockMyy-16Bits-Edition #1 SMP PREEMPT Mon Jul 23 15:45:32 UTC 2018 armv7l
dmesg | grep vblank
[ 1.112528] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 1.112531] [drm] No driver support for vblank timestamp query.
[ 1.287346] WARNING: CPU: 0 PID: 102 at drivers/gpu/drm/drm_atomic_helper.c:1349 drm_atomic_helper_wait_for_vblanks+0x1c8/0x1e0
[ 1.287348] [CRTC:30:crtc-0] vblank wait timed out
[ 1.287404] [<c011f2ec>] (warn_slowpath_fmt) from [<c070b2f8>] (drm_atomic_helper_wait_for_vblanks+0x1c8/0x1e0)
[ 1.287411] [<c070b2f8>] (drm_atomic_helper_wait_for_vblanks) from [<c070cc60>] (drm_atomic_helper_commit_tail_rpm+0x48/0x58)
git apply -R ./GetFB.patch
dmesg | grep vblank
[ 1.113467] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 1.113469] [drm] No driver support for vblank timestamp query.
[ 1.288810] WARNING: CPU: 0 PID: 101 at drivers/gpu/drm/drm_atomic_helper.c:1349 drm_atomic_helper_wait_for_vblanks+0x1c8/0x1e0
[ 1.288851] [CRTC:30:crtc-0] vblank wait timed out
[ 1.288909] [<c011f2ec>] (warn_slowpath_fmt) from [<c070b2f8>] (drm_atomic_helper_wait_for_vblanks+0x1c8/0x1e0)
[ 1.288915] [<c070b2f8>] (drm_atomic_helper_wait_for_vblanks) from [<c070cc60>] (drm_atomic_helper_commit_tail_rpm+0x48/0x58)
git apply -R ./DRMAST.patch
error: drivers/gpu/drm/ast/ast_tables.h: No such file or directory
Oh, should have backup linux/ before git apply...
You can do git checkout -- .
to revert non commited changes.
I'm surprised you don't have this file, since it's still present in the latest 4.18-rc.
Be sure to apply the patch from the linux
directory, else the patch will fail.
Anyway, we're sure that it's between the rc4 and rc7. So if you're good for a last compilation, try the -rc6. If the problem doesn't occur with the -rc6, that it's clearly in between.
In this case, keep the linux/
of the rc6 and rc7`, we'll need it, since we'll have to add some "printk" to the code, in order to understand how things are initialised in both trees and pinpoint the differences.
Oops, stupid me! I actually execute the wget/git apply
in the wrong machine...
Anyway, saved linux/ of rc7
git apply -R ./DRMAST.patch
dmesg | grep vblank
[ 1.111755] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 1.111758] [drm] No driver support for vblank timestamp query.
[ 1.284329] WARNING: CPU: 3 PID: 102 at drivers/gpu/drm/drm_atomic_helper.c:1349 drm_atomic_helper_wait_for_vblanks+0x1c8/0x1e0
[ 1.284331] [CRTC:30:crtc-0] vblank wait timed out
[ 1.284388] [<c011f2ec>] (warn_slowpath_fmt) from [<c070b2f8>] (drm_atomic_helper_wait_for_vblanks+0x1c8/0x1e0)
[ 1.284395] [<c070b2f8>] (drm_atomic_helper_wait_for_vblanks) from [<c070cc60>] (drm_atomic_helper_commit_tail_rpm+0x48/0x58)
So not rc7. Go for -rc6 now...
rc6 PASSED!
Linux tinkerboard 4.16.0-rc6-RockMyy-16Bits-Edition #1 SMP PREEMPT Tue Jul 24 08:27:54 UTC 2018 armv7l GNU/Linux
root@tinkerboard:~#
root@tinkerboard:~# dmesg | grep vblank
[ 1.112326] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 1.112328] [drm] No driver support for vblank timestamp query.
I have both linux/ ready: drwxr-xr-x 27 root root 4096 Jul 24 10:03 linux_4.16-rc6 drwxr-xr-x 25 root root 4096 Jul 24 07:18 linux_4.16-rc7
Here's the patch that should apply to both. This will pollute the logs so get the logs quickly.
From aef02775f33ba10090388316648e1206f45e74fc Mon Sep 17 00:00:00 2001
From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
Date: Tue, 24 Jul 2018 21:18:17 +0200
Subject: [PATCH] Let's pollute the logs
To get some informations about CRTC.
Not really working at the moment.
Most informations are bogus.
Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr>
---
drivers/gpu/drm/drm_atomic_helper.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index ae3cbfe9e..37f1fc62a 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -1345,6 +1345,23 @@ drm_atomic_helper_wait_for_vblanks(struct drm_device *dev,
drm_crtc_vblank_count(crtc),
msecs_to_jiffies(50));
+ dev_warn(dev->dev, "(Myy)\n"
+ "\tCRTC[%i] (%d : %s)\n"
+ "\tOld state last vblank Count : %llu\n"
+ "\tCRTC Vblank_count : %llu\n"
+ "\tWait Event Timeout Ret : %d\n"
+ "\tCRTC Interrupt enabled ? %d\n"
+ "\tCRTC Interrupt number : %d\n"
+ "\tCRTC Device : %p\n"
+ "\tArgument Device : %p\n",
+ i, crtc->base.id, crtc->name,
+ old_state->crtcs[i].last_vblank_count,
+ drm_crtc_vblank_count(crtc),
+ ret,
+ (crtc->dev ? crtc->dev->irq_enabled : 0),
+ (crtc->dev ? crtc->dev->irq : 0),
+ crtc->dev, dev);
+
WARN(!ret, "[CRTC:%d:%s] vblank wait timed out\n",
crtc->base.id, crtc->name);
--
2.16.4
Once you're done with the patch, try to the following :
cd linux_4.16-rc7
wget https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/?id=3215b9d57a2c75c4305a3956ca303d7004485200 -O Clocks.patch
git apply -R Clocks.patch
And see how it goes.
Note that this patch should be applied to both kernels and tested on both, in order to see if there's any difference between them.
The last commands only target the rc7.
What's wrong? linux/ is a clone of linux_4.16-rc6
root@91d81f86bc53:/usr/src/linux# git am a.patch
Applying: Let's pollute the logs
error: patch failed: drivers/gpu/drm/drm_atomic_helper.c:1345
error: drivers/gpu/drm/drm_atomic_helper.c: patch does not apply
Patch failed at 0001 Let's pollute the logs
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Resolved:
root@91d81f86bc53:/usr/src/linux# git am --ignore-whitespace --ignore-space-change a.patch
Applying: Let's pollute the logs
this is linux_4.16-rc7 after "Applying: Let's pollute the logs" patch:
root@91d81f86bc53:/usr/src/linux# git apply -R Clocks.patch
error: patch failed: drivers/clk/clk-aspeed.c:259
error: drivers/clk/clk-aspeed.c: patch does not apply
root@91d81f86bc53:/usr/src/linux# git apply -v -R Clocks.patch
Checking patch drivers/clk/sunxi-ng/ccu-sun6i-a31.c...
Checking patch drivers/clk/imx/clk-imx51-imx53.c...
Checking patch drivers/clk/ti/clkctrl.c...
Checking patch drivers/clk/ti/clk-33xx.c...
Checking patch drivers/clk/ti/clk-43xx.c...
Checking patch drivers/clk/clk.c...
Hunk #1 succeeded at 2311 (offset -2 lines).
Checking patch drivers/clk/clk.c...
Hunk #1 succeeded at 2969 (offset -2 lines).
Hunk #2 succeeded at 3002 (offset -2 lines).
Checking patch drivers/clk/clk.c...
Checking patch drivers/clk/hisilicon/clk-hi3660-stub.c...
Checking patch drivers/clk/qcom/apcs-msm8916.c...
Checking patch drivers/clk/clk-aspeed.c...
error: while searching for:
{
struct aspeed_clk_gate *gate = to_aspeed_clk_gate(hw);
u32 clk = BIT(gate->clock_idx);
u32 enval = (gate->flags & CLK_GATE_SET_TO_DISABLE) ? 0 : clk;
u32 reg;
regmap_read(gate->map, ASPEED_CLK_STOP_CTRL, ®);
return ((reg & clk) == enval) ? 1 : 0;
}
static const struct clk_ops aspeed_clk_gate_ops = {
error: patch failed: drivers/clk/clk-aspeed.c:259
error: drivers/clk/clk-aspeed.c: patch does not apply
Checking patch drivers/clk/clk-aspeed.c...
Checking patch drivers/clk/bcm/clk-bcm2835.c...
Checking patch drivers/clk/bcm/clk-bcm2835.c...
root@91d81f86bc53:/usr/src/linux#
Which version does /usr/src/linux links to ? This is the latest patch affecting drivers/clk/clk-aspeed.c for the 4.16-rc7, so I don't know why it does not apply... I'll try to prepare a tarball if needed.
It is 4.16-rc7, I even deleted linux/ and restarted the script again from scratch:
root@91d81f86bc53:/usr/src# more GetPatchAndCompileKernel_4.16-rc7.sh
export ARCH=arm
export CROSS_COMPILE=
export KERNEL_GIT_URL='git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git'
export KERNEL_SERIES=v4.16
export KERNEL_BRANCH=v4.16-rc7
export LOCALVERSION=-RockMyy-16Bits-Edition
export MALI_VERSION=r19p0-01rel0
export MALI_BASE_URL=https://developer.arm.com/-/media/Files/downloads/mali-drivers/kernel/mali-midgard-gpu
Note: checking out '3eb2ce825ea1ad89d20f7a3b5780df850e4be274'.
Well, let's try it like that than :
wget https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/drivers/clk/clk-aspeed.c?id=8a53fc511c5ec81347b981b438f68c3dde421608 -O clk.patch
git apply -R clk.patch
I'm just wondering if some Clock patches generated issues with the HDMI detection.
Hmm, I guess I messed up the vblank count display. In the first case, it seems to be at 0 (2**32 overflowing at 0) In the second case, it seems to be at -46, if it's a 32 bits value...
I'll try to modify my script so that you can pull the kernel sources at one specific commit...
It seems like a very subtle bug. If you remove the timestamps of both dmesg logs and you cut them before the first "Myy" log and do a diff, both logs are almost identical. Some pointers addresses change, but that's due to the recompilation process and various sources change, but these addresses don't seem null or completely off (like 0xffffffff).
That some tricky bug...
Could you test a compilation by doing like this :
mv linux{,.bak}
wget https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/snapshot/linux-3215b9d57a2c75c4305a3956ca303d7004485200.tar.gz -O linux.tgz
tar zxvf linux.tgz
mv linux-3215* linux
cd linux
git init .
git add .
git commit -m "My wonderful kernel"
cd ..
And then run the usual script.
FYI, Nodepad++ for Windows can compare the logs without cutting time stamp.
I will try that out tomorrow...
Was the screen plugged-in during the boot sequence ? I'm reading this, in your last log :
[ 1.114972] [drm] Cannot find any crtc or sizes
Oops. switched off
If you still have these issues, feel free to reopen this ticket. Meanwhile, I'm closing it due to no activity.
On some configurations, the framebuffer fails to initialize the screen correctly.
It seems that the problem started to occur since some 4.16-rcX version. In such events, the system boots fine and X11 starts without issues.
So it's highly probable that this is a framebuffer related issue.