Status Update
Comments
di...@google.com <di...@google.com>
dm...@linaro.org <dm...@linaro.org> #2
Thank you for reporting this issue. For us to further investigate this issue, please provide the following additional information:
Please mention the steps to be followed for reproducing the issue with the given sample apk.
Android full bug report capturing
After reproducing the issue, press the volume up, volume down, and power button simultaneously. This will capture a bug report on your device in the “bug reports” directory.
Alternate method
Navigate to “Developer options”, ensure “USB debugging” is enabled, then enable “Bug report shortcut”. Capture bug report by holding the power button and selecting the “Take bug report” option.
Screen record of the issue, for clarity
Please capture screen record or video of the issue using the following steps:
adb shell screenrecord /sdcard/video.mp4
Subsequently use following command to pull the recorded file:
adb pull /sdcard/video.mp4\
Note: Please upload the files to google drive and share the folder to
sw...@google.com <sw...@google.com> #3
Error: The intent action com.example.action (used to send a broadcast) matches the intent filter of a non-exported receiver, registered via a call to Context.registerReceiver, or similar. If you are trying to invoke this specific receiver via the action then you should use Intent.setPackage(<APPLICATION_ID>). [UnsafeImplicitIntentLaunch]
Button(onClick = { context.sendBroadcast(Intent("com.example.action")) }) {}
I wasn't aware that the explicit intent requirements from API 34 applied to broadcasts as well. I do think it would be beneficial to display this error when building the app for development, not just during the build task to produce an APK. Either way, the issue isn't an issue after all.
sw...@google.com <sw...@google.com> #4
Thanks.
sw...@google.com <sw...@google.com> #5
* Dynamically registered receiver with RECEIVER_EXPORTED flag: Can get broadcast with custom action sent from the same app using `Context#sendBroadcast()` API.
* Dynamically registered receiver with RECEIVER_NOT_EXPORTED flag: Cannot get broadcast with custom action sent from the same app using `Context#sendBroadcast()` API.
sw...@google.com <sw...@google.com> #6
Thank you for reporting this issue. We have shared this with our product and engineering team and will update this issue with more information as it becomes available.
sw...@google.com <sw...@google.com> #7
Our engineering team responded :
It is indeed related to the changes applied for Safer Implicit Intents, this is the intended behaviour.
To fix this issue, the developer will need to make the intent explicit (either explicit by package or explicit by component), the following change will fix it:
@Composable
fun Greeting(name: String, modifier: Modifier = Modifier, context: Context) {
Button(onClick = { context.sendBroadcast(Intent("com.example.action")) }) {}
}
should become something like:
@Composable
fun Greeting(name: String, modifier: Modifier = Modifier, context: Context) {
val intent = Intent("com.example.action")
intent.setPackage(context.getPackageName())
Button(onClick = { context.sendBroadcast(intent) }) {}
}
db...@gmail.com <db...@gmail.com> #8
sw...@google.com <sw...@google.com> #9
sw...@google.com <sw...@google.com> #10
We’ll be closing this issue due to not having enough actionable information. If you continue to have this issue, please open a new issue and add the relevant information along with a reference link to the earlier issue.
sw...@google.com <sw...@google.com> #11
sw...@google.com <sw...@google.com> #12
sw...@google.com <sw...@google.com> #13
I have registered the receiver with a custom action.
Sending like this:
Intent intent = new Intent("com.gt-broadcast-refresh");
requireActivity().sendBroadcast(intent);
Receiving like this:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
requireActivity().registerReceiver(refreshUIReceiver, new IntentFilter("com.gt-broadcast-refresh"), Context.RECEIVER_NOT_EXPORTED);
} else {
requireActivity().registerReceiver(refreshUIReceiver, new IntentFilter("com.gt-broadcast-refresh"));
}
It will work in the emulator with an Android 14 device, but it will not work on a real device, such as the Google Pixel 8 Pro, because it will not listen to the action. I have configured the registration based on the Google documentation for Android 14.
should I need to add any extra flag or permission while sending the custom action?
sw...@google.com <sw...@google.com> #14
All, I found the solution for all requireActivity().registerReceiver()
calls. They will only listen for the action if the action is sent with the package name of the application. So whenever we send a broadcast, we should also set the package with the intent using intent.setPackage(getPackageName())
. Then, the registered receiver will be able to listen for the action.
Reference link:
sw...@google.com <sw...@google.com> #15
Unbelievable, 9 months later this is still not in the docs.
sw...@google.com <sw...@google.com> #16
ro...@google.com <ro...@google.com> #17
ap...@google.com <ap...@google.com> #18
ap...@google.com <ap...@google.com> #19
ap...@google.com <ap...@google.com> #20
ap...@google.com <ap...@google.com> #21
Branch: release-R124-15823.B-chromeos-6.6
commit e96f6a88b5e0635135aa645996e00f742e5a1570
Author: Stephen Boyd <swboyd@chromium.org>
Date: Wed Mar 27 13:27:37 2024
FROMLIST: clk: qcom: dispcc-sc7180: Force off rotator clk at probe
The 'disp_cc_mdss_rot_clk' is parented to 'disp_cc_pll0' and enabled out
of boot on sc7180 Trogdor devices. This is a problem because the mdss
driver (the driver for compatible node "qcom,sc7180-mdss") turns off
'disp_cc_mdss_mdp_clk' and that clk is also parented to 'disp_cc_pll0'.
When the display pll turns off, the rotator clk gets stuck on.
We don't really care about this clk being on through boot, so simply
disable the clk during driver probe to avoid this issue.
Cc: Bjorn Andersson <andersson@kernel.org>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Taniya Das <quic_tdas@quicinc.com>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
(am from
(also found at
BUG=b:319956935, b:330474631
TEST=Boot on lazor
Recovery flow on lazor
UPSTREAM-TASK=b:331677760
Change-Id: I08838e7e3691fc1818e3f91c9e72c2d781e3a642
Reviewed-on:
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Commit-Queue: Stephen Boyd <swboyd@chromium.org>
Commit-Queue: Douglas Anderson <dianders@chromium.org>
Tested-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Sean Paul <sean@poorly.run>
(cherry picked from commit 9e8799af6f0d52d3495e44982dcf85123112aca0)
Reviewed-on:
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
M drivers/clk/qcom/dispcc-sc7180.c
sw...@google.com <sw...@google.com> #23
It's merge window now so this will have to wait until that closes. I hope that Bjorn picks it up shortly after the window closes and lets it soak in linux-next for a while.
bugjuggler: wait 2w
bu...@google.com <bu...@google.com> #24
ap...@google.com <ap...@google.com> #25
Branch: chromeos-6.6
commit 9ac74b9ae59b8d62d886dad141fbd7f88a9c25e9
Author: Stephen Boyd <swboyd@chromium.org>
Date: Thu May 02 15:47:02 2024
FROMLIST: clk: qcom: Park shared RCGs upon registration
There's two problems with shared RCGs.
The first problem is that they incorrectly report the parent after
commit 703db1f5da1e ("clk: qcom: rcg2: Cache CFG register updates for
parked RCGs"). That's because the cached CFG register value needs to be
populated when the clk is registered. clk_rcg2_shared_enable() writes
the cached CFG register value 'parked_cfg'. This value is initially zero
due to static initializers. If a driver calls clk_enable() before
setting a rate or parent, it will set the parent to '0' which is
(almost?) always XO, and may not reflect the parent at registration. In
the worst case, this switches the RCG from sourcing a fast PLL to the
slow crystal speed.
The second problem is that the force enable bit isn't cleared. The force
enable bit is only used during parking and unparking of shared RCGs.
Otherwise it shouldn't be set because it keeps the RCG enabled even when
all the branches on the output of the RCG are disabled (the hardware has
a feedback mechanism so that any child branches keep the RCG enabled
when the branch enable bit is set). This problem wastes power if the clk
is unused, and is harmful in the case that the clk framework disables
the parent of the force enabled RCG. In the latter case, the GDSC the
shared RCG is associated with will get wedged if the RCG's source clk is
disabled and the GDSC tries to enable the RCG to do "housekeeping" while
powering on.
Both of these problems combined with incorrect runtime PM usage in the
display driver lead to a black screen on Qualcomm sc7180 Trogdor
chromebooks. What happens is that the bootloader leaves the
'disp_cc_mdss_rot_clk' enabled and the 'disp_cc_mdss_rot_clk_src' force
enabled and parented to 'disp_cc_pll0'. The mdss driver probes and
runtime suspends, disabling the mdss_gdsc which uses the
'disp_cc_mdss_rot_clk_src' for "housekeeping". The
'disp_cc_mdss_rot_clk' is disabled during late init because the clk is
unused, but the parent 'disp_cc_mdss_rot_clk_src' is still force enabled
because the force enable bit was never cleared. Then 'disp_cc_pll0' is
disabled because it is also unused. That's because the clk framework
believes the parent of the RCG is XO when it isn't. A child device of
the mdss device (e.g. DSI) runtime resumes mdss which powers on the
mdss_gdsc. This wedges the GDSC because 'disp_cc_mdss_rot_clk_src' is
parented to 'disp_cc_pll0' and that PLL is off. With the GDSC wedged,
mdss_runtime_resume() tries to enable 'disp_cc_mdss_mdp_clk' but it
can't because the GDSC has wedged all the clks associated with the GDSC
causing clks to stay stuck off.
This leads to the following warning seen at boot and a black screen
because the display driver fails to probe.
disp_cc_mdss_mdp_clk status stuck at 'off'
WARNING: CPU: 1 PID: 81 at drivers/clk/qcom/clk-branch.c:87 clk_branch_toggle+0x114/0x168
Modules linked in:
CPU: 1 PID: 81 Comm: kworker/u16:4 Not tainted 6.7.0-g0dd3ee311255 #1 f5757d475795053fd2ad52247a070cd50dd046f2
Hardware name: Google Lazor (rev1 - 2) with LTE (DT)
Workqueue: events_unbound deferred_probe_work_func
pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : clk_branch_toggle+0x114/0x168
lr : clk_branch_toggle+0x110/0x168
sp : ffffffc08084b670
pmr_save: 00000060
x29: ffffffc08084b680 x28: ffffff808006de00 x27: 0000000000000001
x26: ffffff8080dbd4f4 x25: 0000000000000000 x24: 0000000000000000
x23: 0000000000000000 x22: ffffffd838461198 x21: ffffffd838007997
x20: ffffffd837541d5c x19: 0000000000000001 x18: 0000000000000004
x17: 0000000000000000 x16: 0000000000000010 x15: ffffffd837070fac
x14: 0000000000000003 x13: 0000000000000004 x12: 0000000000000001
x11: c0000000ffffdfff x10: ffffffd838347aa0 x9 : 08dadf92e516c000
x8 : 08dadf92e516c000 x7 : 0000000000000000 x6 : 0000000000000027
x5 : ffffffd8385a61f2 x4 : 0000000000000000 x3 : ffffffc08084b398
x2 : ffffffc08084b3a0 x1 : 00000000ffffdfff x0 : 00000000fffffff0
Call trace:
clk_branch_toggle+0x114/0x168
clk_branch2_enable+0x24/0x30
clk_core_enable+0x5c/0x1c8
clk_enable+0x38/0x58
clk_bulk_enable+0x40/0xb0
mdss_runtime_resume+0x68/0x258
pm_generic_runtime_resume+0x30/0x44
__genpd_runtime_resume+0x30/0x80
genpd_runtime_resume+0x124/0x214
__rpm_callback+0x7c/0x15c
rpm_callback+0x30/0x88
rpm_resume+0x390/0x4d8
rpm_resume+0x43c/0x4d8
__pm_runtime_resume+0x54/0x98
__device_attach+0xe0/0x170
device_initial_probe+0x1c/0x28
bus_probe_device+0x48/0xa4
device_add+0x52c/0x6fc
mipi_dsi_device_register_full+0x104/0x1a8
devm_mipi_dsi_device_register_full+0x28/0x78
ti_sn_bridge_probe+0x1dc/0x2bc
auxiliary_bus_probe+0x4c/0x94
really_probe+0xf8/0x270
__driver_probe_device+0xa8/0x130
driver_probe_device+0x44/0x104
__device_attach_driver+0xa4/0xcc
bus_for_each_drv+0x94/0xe8
__device_attach+0xf8/0x170
device_initial_probe+0x1c/0x28
bus_probe_device+0x48/0xa4
deferred_probe_work_func+0x9c/0xd8
Fix these problems by parking shared RCGs at boot. This will properly
initialize the parked_cfg struct member so that the parent is reported
properly and ensure that the clk won't get stuck on or off because the
RCG is parented to the safe source (XO).
Fixes: 703db1f5da1e ("clk: qcom: rcg2: Cache CFG register updates for parked RCGs")
Reported-by: Stephen Boyd <sboyd@kernel.org>
Closes:
Closes:
Reported-by: Laura Nao <laura.nao@collabora.com>
Closes:
Cc: Bjorn Andersson <andersson@kernel.org>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Taniya Das <quic_tdas@quicinc.com>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
(am from
(also found at
BUG=b:319956935
TEST=emerge-trogdor chromeos-kernel-6_6; Boot on Lazor
UPSTREAM-TASK=b:331677760
Change-Id: Ia866b5ac5a1ce87b489ecc3ecf63f3fded97a3c8
Reviewed-on:
Tested-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Sean Paul <sean@poorly.run>
Commit-Queue: Stephen Boyd <swboyd@chromium.org>
M drivers/clk/qcom/clk-rcg2.c
ap...@google.com <ap...@google.com> #26
Branch: chromeos-6.6
commit 6761a826319bbcaec1d9044578ccb9cd91035bec
Author: Stephen Boyd <swboyd@chromium.org>
Date: Tue May 14 15:20:16 2024
Revert "FROMLIST: clk: qcom: dispcc-sc7180: Force off rotator clk at probe"
This reverts commit 9e8799af6f0d52d3495e44982dcf85123112aca0. We're
going to pick the alternative approach as FROMLIST.
BUG=b:331677760, b:319956935
TEST=emerge-trogdor chromeos-kernel-6_6; Boot on Lazor
Change-Id: I1e45683c8c1a2f0d89614e882dcd5f5ed06fd2c3
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-on:
Reviewed-by: Douglas Anderson <dianders@chromium.org>
M drivers/clk/qcom/dispcc-sc7180.c
ap...@google.com <ap...@google.com> #27
Branch: chromeos-6.6
commit 18d3b9ce2bb56c449002ae9c44a41916cc041a22
Author: Stephen Boyd <swboyd@chromium.org>
Date: Tue May 14 15:20:13 2024
Revert "FROMLIST: clk: qcom: Properly initialize shared RCGs upon registration"
This reverts commit 74d088b425d7b58e71c002e4480c2c0d96ce4e99. We're
going to pick the alternative approach as FROMLIST.
BUG=b:331677760, b:319956935
TEST=emerge-trogdor chromeos-kernel-6_6; Boot on Lazor
Cq-Depend: chromium:5540453
Change-Id: I8281d7b027e817cbf80e1593324ac3e816616f3e
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-on:
Reviewed-by: Douglas Anderson <dianders@chromium.org>
M drivers/clk/qcom/clk-rcg2.c
bu...@google.com <bu...@google.com>
di...@google.com <di...@google.com> #28
So what's the plan here? Is it a good time for the patches to land upstream now?
Also: do we keep this bug open even though we've also got a (non-public) upstream tracking bug at
sw...@google.com <sw...@google.com> #29
what's the plan here?
I've asked Bjorn and Dmitry on IRC to test and review the patch on the list. I expect Bjorn to merge it through the qcom clk driver branch so it gets plenty of time to bake in linux-next.
do we keep this bug open
That's my plan. I don't mind having two bugs for basically the same thing.
di...@google.com <di...@google.com> #30
Sounds good. Let's schedule a nag in another 3 weeks then...
bugjuggler: wait 3 weeks
bu...@google.com <bu...@google.com> #31
bu...@google.com <bu...@google.com>
di...@google.com <di...@google.com> #32
We're at -rc6 now. This feels like the kind of thing that should show up earlier in the merge window? I guess that means snooze for another 4 weeks?
bugjuggler: wait 4 weeks
bu...@google.com <bu...@google.com> #33
di...@google.com <di...@google.com> #34
di...@google.com <di...@google.com> #35
Patch IDs match. I guess keeping as FROMLIST is fine. Closing.
# Downstream:
$ git show 01a0a6cc8cfd | git patch-id
2f52f110c3d40a4c25b8657724551ddf400be4b0 01a0a6cc8cfd9952e72677d48d56cf6bc4e3a561
# Upstream:
$ git show 9ac74b9ae59b8d62d886dad141fbd7f88a9c25e9 | git patch-id
2f52f110c3d40a4c25b8657724551ddf400be4b0 9ac74b9ae59b8d62d886dad141fbd7f88a9c25e9
Description
The rcg clk parking logic in the qualcomm clk driver is broken. The original parking logic was written in commit [1] and then rewritten in commit [2] . The original implementation's flaw was that it left the RCG (root clock generator) dirty with the frequency that the clk framework had set on the clk instead of the safe frequency (XO speed). This caused two problems. Confusion when debugging because the register contents didn't match what the clk was actually programmed for and a real problem once the GDSC itself started hitting the RCG's "update" bit when powering on. Once the GDSC started trying to enable the clk by clearing the dirty state it caused clks to get stuck because the clk registers would be dirty with a configuration that selected a parent that's off (e.g. the display PLL).
7ef6f11887bd ("clk: qcom: Configure the RCGs to a safe source as needed")
703db1f5da1e ("clk: qcom: rcg2: Cache CFG register updates for parked RCGs")
The rewritten patch fixed this by caching the configuration register contents in software instead of in hardware. Moving the intended register setting out of the register fixed the problem because the GDSC enabling would only cause XO to be selected, and thus no stuck clk could occur. There's one problem in the patch though. The cached configuration register needs to be populated when the clk is registered, otherwise the contents are all zero, meaning source from XO. If an RCG is sourcing something besides XO (which we are on Trogdor) it will be switched over to XO when the clk is enabled the first time.
This design is still broken though because of another issue. The GDSC may need to enable more than one RCG to do "housekeeping" while turning on. In the case of display clks, the display GDSC enables more than one clk. If all the clks haven't been parked and some parent has been disabled then the GDSC is going to lock up and not actually turn on. This will lead to clks that otherwise have been parked not turning on properly. This is very confusing.
I diagnosed this problem in this thread . Here's what happens:
More specifically, the way we disable clks during late init and how we skip reading or writing the rcg enable bit causes clks to get stuck when the GDSC is turned on after disabling of unused clks. The RCG has a register bit that turns on the RCG. The branches which are children of that RCG automatically turn on the RCG when they are enabled or disabled themselves. There's a feedback mechanism in hardware that enables the RCG when a child branch is enabled. Given this design, the linux clk driver never writes the RCG enable bit unless it needs to ensure the RCG is on regardless of child branch state. The parking logic writes the rcg enable bit while parking the clk to ensure the parking actually works. Otherwise the parking itself may get stuck because both sources need to be clocking, along with the rcg itself, to ensure a proper switch.
When we disable unused clks, the rot branch is disabled but the rot rcg is not because it doesn't implement
struct clk_ops::is_enabled()
. Enabling the GDSC after late init wedges all the clks for the display subsystem (mdp and rot) because the GDSC turns on the clks temporarily and gets stuck when the rot rcg is sourcing from the display pll that is disabled.Another patch series has attempted to implement
struct clk_ops::is_enabled()
for parked RCGs. The downside of this approach is that it relies on the parent being XO to know that the clk is disabled and therefore XO has to be removed as a possible parent. This makes linking up parents confusing if the RCG is parented to XO during registration. The patch moves the parent to the first frequency in the frequency table during registration to avoid confusing theis_enabled()
clk op.The root cause of the problem is that the enable state of the clk tree is not being carried over properly from the bootloader. The disable unused clk code disables the child of the rcg, but it doesn't know about the parent being enabled and thus the rot rcg is never parked. To make matters worse, if the disable unused logic never runs we'll still have a problem because the display driver turns off the display pll (disp_cc_pll0), causing the rot clk to be stuck and any future attempts to enable the GDSC will wedge the mdp clk until the display pll is enabled (because rot has always been sourcing from the display pll).
A proper fix would probably be to teach the GDSC logic to park RCGs when the GDSC is powered down. This may run into a problem though where the display PLL is disabled before the GDSC is, and then the RCG can't be parked anymore. Another solution is to park all RCGs that are parkable at clk registration time and also clear the RCG enable bit (root enable bit). If we did this we may ruin continuous splash screen, but it would allow the GDSC to be enabled/disabled regardless of clk framework state.