mbox series

[v4,0/4] remoteproc: core: Fixes for rproc cdev and add

Message ID 1623783824-13395-1-git-send-email-sidgup@codeaurora.org
Headers show
Series remoteproc: core: Fixes for rproc cdev and add | expand

Message

Siddharth Gupta June 15, 2021, 7:03 p.m. UTC
This patch series contains stability fixes and error handling for remoteproc.

The changes included in this series do the following:
Patch 1: Fixes the creation of the rproc character device.
Patch 2: Validates rproc as the first step of rproc_add().
Patch 3: Fixes rproc cdev remove and the order of dev_del() and cdev_del().
Patch 4: Adds error handling in rproc_add().

v3 -> v4:
- Moved stable from CC to CC in sign-off area.

v2 -> v3:
- Removed extra file that got added by mistake.

v1 -> v2:
- Added extra patch which addresses Bjorn's comments on patch 3
  from v1.
- Fixed commit text for patch 2 (s/calling making/making).

Siddharth Gupta (4):
  remoteproc: core: Move cdev add before device add
  remoteproc: core: Move validate before device add
  remoteproc: core: Fix cdev remove and rproc del
  remoteproc: core: Cleanup device in case of failure

 drivers/remoteproc/remoteproc_cdev.c |  2 +-
 drivers/remoteproc/remoteproc_core.c | 27 ++++++++++++++++++---------
 2 files changed, 19 insertions(+), 10 deletions(-)

Comments

Greg KH June 15, 2021, 7:06 p.m. UTC | #1
On Tue, Jun 15, 2021 at 12:03:42PM -0700, Siddharth Gupta wrote:
> We can validate whether the remoteproc is correctly setup before
> making the cdev_add and device_add calls. This saves us the
> trouble of cleaning up later on.
> 
> Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org>
> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> Cc: stable@vger.kernel.org
> ---
>  drivers/remoteproc/remoteproc_core.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 

Why is this relevant for stable?  What commit does this fix?  Please put
a Fixes: tag for that.

thanks,

greg k-h
Greg KH June 15, 2021, 7:06 p.m. UTC | #2
On Tue, Jun 15, 2021 at 12:03:43PM -0700, Siddharth Gupta wrote:
> The rproc_char_device_remove() call currently unmaps the cdev
> region instead of simply deleting the cdev that was added as a
> part of the rproc_char_device_add() call. This change fixes that
> behaviour, and also fixes the order in which device_del() and
> cdev_del() need to be called.
> 
> Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org>
> Cc: stable@vger.kernel.org

Is this really needed for stable?  What bug does this solve?  ANd again,
fixes: ?