Expose recovery/coredump configuration from sysfs
v3 cover Expose recovery/coredump configuration from sysfs
From Android R onwards Google has restricted access to debugfs in user and user-debug builds. This restricts access to most of the features exposed through debugfs. This patch series removes the recovery/coredump entries from debugfs and adds a configurable option to expose these interfaces from sysfs.
'Coredump' and 'Recovery' are critical interfaces that are required for remoteproc to work on Qualcomm Chipsets. Coredump configuration needs to be set to "inline" in debug/test build and "disabled" in production builds. Whereas recovery needs to be "disabled" for debugging purposes and "enabled" on production builds.
Changelog:
v3 -> v2:
- Remove the coredump/recovery entries from debugfs
- Expose recovery/coredump from sysfs under a feature flag
v1 -> v2:
- Correct the contact name in the sysfs documentation.
- Remove the redundant write documentation for coredump/recovery sysfs
- Add a feature flag to make this interface switch configurable.
Rishabh Bhatnagar (3):
remoteproc: Expose remoteproc configuration through sysfs
remoteproc: Add coredump configuration to sysfs
remoteproc: Add recovery configuration to sysfs
Documentation/ABI/testing/sysfs-class-remoteproc | 44 ++++++++ drivers/remoteproc/Kconfig | 12 +++ drivers/remoteproc/remoteproc_debugfs.c | 10 +- drivers/remoteproc/remoteproc_sysfs.c | 126 +++++++++++++++++++++++ 4 files changed, 190 insertions(+), 2 deletions(-)
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH v3 3/3 remoteproc: Add recovery configuration to sysfs
Expose recovery configuration in sysfs under a feature flag. This is useful for systems where access to debugfs might be limited.
--- Documentation/ABI/testing/sysfs-class-remoteproc | 20 ++++++ drivers/remoteproc/remoteproc_debugfs.c | 78 ------------------------ drivers/remoteproc/remoteproc_sysfs.c | 58 ++++++++++++++++++ 3 files changed, 78 insertions(+), 78 deletions(-)
Documentation/ABI/testing/sysfs-class-remoteproc +20 -0
@@ -82,3 +82,23 @@ Description: Remote processor coredump configuration all data is read by usersapce. "disabled" means no dump will be collected. + +What: /sys/class/remoteproc/.../recovery +Date: July 2020 +Contact: Bjorn Andersson <[email protected]>, Ohad Ben-Cohen <[email protected]> +Description: Remote processor recovery mechanism + + Reports the recovery mechanism of the remote processor, + which will be one of: + + "enabled" + "disabled" + + "enabled" means, the remote processor will be automatically + recovered whenever it crashes. Moreover, if the remote + processor crashes while recovery is disabled, it will + be automatically recovered too as soon as recovery is enabled. + + "disabled" means, a remote processor will remain in a crashed + state if it crashes. This is useful for debugging purposes; + without it, debugging a crash is substantially harder.
drivers/remoteproc/remoteproc_debugfs.c +0 -78
90 lines not on this page · raw message
drivers/remoteproc/remoteproc_sysfs.c +58 -0
70 lines not on this page · raw message
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH v3 1/3 remoteproc: Expose remoteproc configuration through sysfs
In reply to Rishabh BhatnagarAdd a feature flag to expose some of the remoteproc configuration through sysfs. This feature is helpful in systems where debugfs is not available/mounted. Currently the recovery and coredump configuration is exposed through sysfs rather than debugfs when this feature is selected.
--- drivers/remoteproc/Kconfig | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/remoteproc/Kconfig +11 -0
@@ -275,6 +275,17 @@ config TI_K3_DSP_REMOTEPROC It's safe to say N here if you're not interested in utilizing the DSP slave processors. +config RPROC_SYSFS_CONFIGURATION_SUPPORT + bool "Expose remoteproc configuration sysfs entries" + default y + help + Say y here to expose recovery and coredump configuration sysfs + entries. This is helpful in operating systems where debugfs is + not available/mounted. + + It's safe to say N here if you are not interested in accessing + recovery and coredump configuration through sysfs. + endif # REMOTEPROC endmenu
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH v3 2/3 remoteproc: Add coredump configuration to sysfs
In reply to Rishabh BhatnagarExpose coredump configuration in sysfs under a feature flag. This is useful for systems where access to debugfs might be limited.
--- Documentation/ABI/testing/sysfs-class-remoteproc | 24 +++++++ drivers/remoteproc/remoteproc_debugfs.c | 90 ------------------------ drivers/remoteproc/remoteproc_sysfs.c | 68 ++++++++++++++++++ 3 files changed, 92 insertions(+), 90 deletions(-)
Documentation/ABI/testing/sysfs-class-remoteproc +24 -0
@@ -58,3 +58,27 @@ Description: Remote processor name Reports the name of the remote processor. This can be used by userspace in exactly identifying a remote processor and ease up the usage in modifying the 'firmware' or 'state' files. + +What: /sys/class/remoteproc/.../coredump +Date: July 2020 +Contact: Bjorn Andersson <[email protected]>, Ohad Ben-Cohen <[email protected]> +Description: Remote processor coredump configuration + + Reports the coredump configuration of the remote processor, + which will be one of: + + "default" + "inline" + "disabled" + + "default" means when the remote processor's coredump is + collected it will be copied to a separate buffer and that + buffer is exposed to userspace. + + "inline" means when the remote processor's coredump is + collected userspace will directly read from the remote + processor's device memory. Extra buffer will not be used to + copy the dump. Also recovery process will not proceed until + all data is read by usersapce. + + "disabled" means no dump will be collected.
drivers/remoteproc/remoteproc_debugfs.c +0 -90
102 lines not on this page · raw message
drivers/remoteproc/remoteproc_sysfs.c +68 -0
80 lines not on this page · raw message
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v3 1/3] remoteproc: Expose remoteproc configuration through sysfs
In reply to Rishabh BhatnagarQuoted 6 lines · Rishabh Bhatnagar
Add a feature flag to expose some of the remoteproc configuration through sysfs. This feature is helpful in systems where debugfs is not available/mounted. Currently the recovery and coredump configuration is exposed through sysfs rather than debugfs when this feature is selected.
This commit message gives me the feeling that it's about making a selection between debugfs vs sysfs. But the patches moves the code from debugfs to sysfs and then hide it behind this config option.
That said, I just commented on v2 questioning that this should be a compile time option at all - might be useful for some drivers to dynamically "hide" these sysfs attributes though.
Regards,
Bjorn
Quoted 31 lines
Signed-off-by Rishabh Bhatnagar <[email protected]>--- drivers/remoteproc/Kconfig | 11 +++++++++++ 1 file changed, 11 insertions(+)drivers/remoteproc/Kconfig +11
-0@@ -275,6 +275,17 @@ config TI_K3_DSP_REMOTEPROC It's safe to say N here if you're not interested in utilizing the DSP slave processors. +config RPROC_SYSFS_CONFIGURATION_SUPPORT + bool "Expose remoteproc configuration sysfs entries" + default y + help + Say y here to expose recovery and coredump configuration sysfs + entries. This is helpful in operating systems where debugfs is + not available/mounted. + + It's safe to say N here if you are not interested in accessing + recovery and coredump configuration through sysfs. + endif # REMOTEPROC endmenuSignature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Quoted 5 lines · Rishabh Bhatnagar
Quoted 1 line
From Android R onwards Google has restricted access to debugfs in user
and user-debug builds. This restricts access to most of the features exposed through debugfs. This patch series removes the recovery/coredump entries from debugfs and adds a configurable option to expose these interfaces from sysfs.
so please fix android instead of messing up the upstream kernel.
Mathieu Poirier
maintainerRe: [PATCH v3 1/3] remoteproc: Expose remoteproc configuration through sysfs
In reply to Bjorn AnderssonQuoted 9 lines · Bjorn Andersson
Quoted 6 lines · Rishabh Bhatnagar
Add a feature flag to expose some of the remoteproc configuration through sysfs. This feature is helpful in systems where debugfs is not available/mounted. Currently the recovery and coredump configuration is exposed through sysfs rather than debugfs when this feature is selected.
Quoted 3 lines
This commit message gives me the feeling that it's about making a selection between debugfs vs sysfs. But the patches moves the code from debugfs to sysfs and then hide it behind this config option.
Yeah, that description is broken. Probably a copy/paste from V2.
Quoted 4 lines
That said, I just commented on v2 questioning that this should be a compile time option at all - might be useful for some drivers to dynamically "hide" these sysfs attributes though.
Dynamically hinding those would require intelligence from platform drivers, the same kind that could have use the API to manipulate the coredump mode. That would have been very easy without the need to move anything from debufs. But from what Rishab said his problem is at compile time.
Thanks,
Mathieu
Quoted 35 lines
Regards,
BjornQuoted 31 lines
Signed-off-by Rishabh Bhatnagar <[email protected]>--- drivers/remoteproc/Kconfig | 11 +++++++++++ 1 file changed, 11 insertions(+)drivers/remoteproc/Kconfig +11
-0@@ -275,6 +275,17 @@ config TI_K3_DSP_REMOTEPROC It's safe to say N here if you're not interested in utilizing the DSP slave processors. +config RPROC_SYSFS_CONFIGURATION_SUPPORT + bool "Expose remoteproc configuration sysfs entries" + default y + help + Say y here to expose recovery and coredump configuration sysfs + entries. This is helpful in operating systems where debugfs is + not available/mounted. + + It's safe to say N here if you are not interested in accessing + recovery and coredump configuration through sysfs. + endif # REMOTEPROC endmenuSignature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project