On Mon, May 15, 2017 at 8:38 PM, George Burgess gbiv@google.com wrote:
Awesome, thank you all!
I applied both patches to my local kernel (tried both 4.9 from AOSP, and 4.11 from upstream Linux), and can't seem to get my device to fully boot. :/
Looking at `dmesg` from failed runs, it seems that etm0 is being initialized cleanly, but initializing any other etm {1..7} causes my kernel to panic. All of the panics take the form "Unhandled fault: synchronous external abort (0x96000210) at $addr," where $addr is `drvdata->base + TRCIDR0` (from etm4_init_arch_data in drivers/hwtracing/coresight/coresight-etm4x.c).
I've messed around a bit, and it seems that writes to `drvdata->base + multiple_offsets` are perfectly OK, but the moment that you try to read from it, you get a panic. Like said, this only occurs on ETMs that aren't etm0. If I just throw a `if (drvdata->cpu) return;` in before we try to read from `*drvdata->base`, the device boots happily with a single ETM.
Do you all have any tips for tracking down what's causing this? Linux isn't exactly my specialty, so my troubleshooting attempts haven't really gotten me very far. :)
If it matters, my coresight-related configuration options are: CONFIG_CORESIGHT=y CONFIG_CORESIGHT_ETBV10=y CONFIG_CORESIGHT_SOURCE_ETM4X=y CONFIG_CORESIGHT_LINKS_AND_SINKS=y CONFIG_CORESIGHT_LINK_AND_SINK_TMC=y CONFIG_CORESIGHT_QCOM_REPLICATOR=y CONFIG_CORESIGHT_SINK_TPIU=y CONFIG_CORESIGHT_STM=y
(I just ticked whatever boxes looked even mildly relevant. ;) Cutting down on what's enabled doesn't seem to help, though...)
Hi George,
I have also seen the hang on my device, though I was not able to identify what caused the device to reboot: I am still waiting for a UART device https://www.seeedstudio.com/96Boards-UART-p-2525.html to arrive to see the output of the console.
My setup is AOSP master with kernel 4.9 from https://android.googlesource.com/kernel/hikey-linaro and the two patches sent by Mathieu applied on top of the android kernel. The .config generated by "make hikey_defconfig" works fine, then the device keeps rebooting when configured with CoreSight with this change:
--- .config-0 2017-05-15 10:20:02.152499418 -0500 +++ .config-1 2017-05-15 10:21:48.157466820 -0500 @@ -4010,7 +4010,10 @@ # CONFIG_LIBNVDIMM is not set # CONFIG_DEV_DAX is not set # CONFIG_NVMEM is not set -# CONFIG_STM is not set +CONFIG_STM=y +# CONFIG_STM_DUMMY is not set +# CONFIG_STM_SOURCE_CONSOLE is not set +# CONFIG_STM_SOURCE_HEARTBEAT is not set # CONFIG_INTEL_TH is not set
# @@ -4484,7 +4487,14 @@ # CONFIG_PID_IN_CONTEXTIDR is not set # CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET is not set # CONFIG_DEBUG_ALIGN_RODATA is not set -# CONFIG_CORESIGHT is not set +CONFIG_CORESIGHT=y +CONFIG_CORESIGHT_LINKS_AND_SINKS=y +CONFIG_CORESIGHT_LINK_AND_SINK_TMC=y +CONFIG_CORESIGHT_SINK_TPIU=y +CONFIG_CORESIGHT_SINK_ETBV10=y +CONFIG_CORESIGHT_SOURCE_ETM4X=y +CONFIG_CORESIGHT_QCOM_REPLICATOR=y +CONFIG_CORESIGHT_STM=y
# # Security options