Skip to contentSkip to conversation

Move recovery/coredump configuration to sysfs

PATCH In review Rishabh Bhatnagar 2 participants 5 messages Sep 17, 2020 – Sep 18, 2020 Remote processor (remoteproc)

lore
Share & tools
lore
#0 lore raw

v4 cover Move recovery/coredump configuration to 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 moves them to 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:

v4 -> v3:
- Remove the feature flag to expose recovery/coredump

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
#1 lore raw

PATCH v4 1/2 remoteproc: Move coredump configuration to sysfs

Move coredump configuration from debugfs to sysfs. This will allow usage of this configuration feature in production devices 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            | 64 +++++++++++++++++
 3 files changed, 88 insertions(+), 90 deletions(-)
Documentation/ABI/testing/sysfs-class-remoteproc +24 -0
index 36094fb..f6c44fa 100644
@@ -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 +64 -0

76 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
#2 lore raw

PATCH v4 2/2 remoteproc: Move recovery configuration to sysfs

In reply to Rishabh Bhatnagar

Move recovery configuration from debugfs to sysfs. This will allow usage of this configuration feature in production devices 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            | 56 +++++++++++++++++
 3 files changed, 76 insertions(+), 78 deletions(-)
Documentation/ABI/testing/sysfs-class-remoteproc +20 -0
index f6c44fa..7368b50 100644
@@ -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 +56 -0

68 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
#3 lore raw
In reply to Rishabh Bhatnagar
Quoted 29 lines · Rishabh Bhatnagar

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 moves them to 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:

v4 -> v3:
- Remove the feature flag to expose recovery/coredump

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

Quoted 6 lines
 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(-)

Hi,

Is there a patch 3/3?
This email (reply) is patch 0/3, then I see

                      patch 1/2
                      patch 2/2

so I'm confused. However, the diffstat above references a Kconfig file and neither patch 1/2 nor patch 2/2 contains any Kconfig changes.

thanks.

Signature · 1 line
~Randy
#4 lore raw
Quoted 40 lines · Randy Dunlap
Quoted 29 lines · Rishabh Bhatnagar

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 moves them to 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:

v4 -> v3:
- Remove the feature flag to expose recovery/coredump

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

Quoted 7 lines
 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(-)

Hi,

Quoted 8 lines

Is there a patch 3/3?
This email (reply) is patch 0/3, then I see

                      patch 1/2
                      patch 2/2

so I'm confused. However, the diffstat above references a Kconfig file and neither patch 1/2 nor patch 2/2 contains any Kconfig changes.

thanks.

Hi Randy,
The cover letter got messed up. There are only 2 patches now whereas in the earlier versions there were 3 patches. I'll be sending out v5 soon. Please review that.