Commits
Suman Anna committed 330e368d27e
rpmsg: rpc: fix sysfs entry creation failures during recovery The rpmsg-rpc driver exposes a character device for each remote service (a rpmsg-rpc device) providing a bunch of remote execution functions. The remote service can be running on any of the available remote processors, and the supported functions are published as different sysfs entries on that particular device. These rpmsg-rpc devices are deleted and recreated as part of the reboot of the remote processor during an error recovery. The sysfs entries are also deleted and recreated. The current logic retains the associated rppc_device structure and the underlying device pointer if there are any applications actively using the character device at the time of the rpmsg-rpc device removal, and reuses it upon the reprobe of the same rpmsg-rpc device. The creation of the sysfs entries fails with -ENOENT due to an invalid reference to a non-existing parent object, and this is exposed first in 3.14 kernel due to the repartitioning of the core sysfs code into a new common kernfs code. Fix this by deleting the underlying device pointer in the driver's .remove, and recreating it with the appropriate new rpmsg server device as its parent in the driver's .probe function. A name description field is also added to the representative rppc_device structure for looking up the service on reprobe as the device name cannot be used due to the deletion of the device pointer. Signed-off-by: Suman Anna <s-anna@ti.com>