[PATCH v6 03/14] gtrace: Add RISC-V platform driver for the gtrace framework
Zane Leung
liangzhen at linux.spacemit.com
Wed Nov 4 22:47:11 PST 2026
On 10/1/2026 1:22 PM, Mayuresh Chitale wrote:
> +static const struct of_device_id rvtrace_platform_match[] = {
> + { .compatible = "riscv,trace-component", .data = (void *)GTRACE_FORMAT_ETRACE },
> + {}
> +};
The current implementation with hardcoded .data = (void *)GTRACE_FORMAT_ETRACE prevents RISC-V N-trace
from working properly without extending the of_device_id table in the future.
This directly contradicts what you stated in the cover letter:
"The RISC-V trace component drivers are designed to be agnostic to the underlying trace protocol hence both
RISC-V E-trace and RISC-V N-trace should work fine. The discovery of trace protocol parameters are left to
user-space trace decoder."
Since the kernel driver is intended to be protocol-agnostic, and a specific in-kernel decoder is not yet implemented
at this stage, deferring the trace protocol discovery seems to be a much better approach. Once the sysfs interface is
introduced in future patches, the user-space trace decoder can naturally query and obtain the exact trace protocol
from it. Therefore, I suggest removing this E-trace specific hardcoding from the match table to keep the driver truly
protocol-agnostic as originally designed.
More information about the linux-riscv
mailing list