All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] remoteproc: core: misc update
@ 2025-10-16 11:47 Peng Fan
  2025-10-16 11:47 ` [PATCH v3 1/4] remoteproc: core: Drop redundant initialization of 'ret' in rproc_shutdown() Peng Fan
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Peng Fan @ 2025-10-16 11:47 UTC (permalink / raw)
  To: Bjorn Andersson, Mathieu Poirier, Andrew Davis, Arnaud Pouliquen,
	Daniel Baluta, Maxime Coquelin, Alexandre Torgue
  Cc: linux-stm32, linux-remoteproc, linux-kernel, Peng Fan

This patchset is a misc update of remoteproc_core.c.
Patch 1: Drop a pointless initialization to variable ret
Patch 2-3: Cleanup the included headers
Patch 4: Remove export of rproc_va_to_pa

I am also reviewing the rproc->lock usage and thinking whether we
need to add a lockdep_assert_held for some functions that should have
lock held. But not sure.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
Changes in v3:
- Drop patch 4: Use cleanup API. Because there is a deadlock issue
  reported, need review the lock usage before the cleanup.
- Drop patch 6 & 7: Use bitfield for bool
- Add A-b from Andrew

Changes in v2:
- Add patch 6 "remoteproc: stm32: Avoid directly taking address of auto_boot"
  to address stm32_rproc.c build issue
- Link to v1: https://lore.kernel.org/r/20251005-remoteproc-cleanup-v1-0-09a9fdea0063@nxp.com

---
Peng Fan (4):
      remoteproc: core: Drop redundant initialization of 'ret' in rproc_shutdown()
      remoteproc: core: Sort header includes
      remoteproc: core: Removed unused headers
      remoteproc: core: Remove unused export of rproc_va_to_pa

 drivers/remoteproc/remoteproc_core.c | 31 +++++++++++++------------------
 1 file changed, 13 insertions(+), 18 deletions(-)
---
base-commit: 1fdbb3ff1233e204e26f9f6821ae9c125a055229
change-id: 20251016-rproc-cleanup-v3-330464eee32e

Best regards,
-- 
Peng Fan <peng.fan@nxp.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3 1/4] remoteproc: core: Drop redundant initialization of 'ret' in rproc_shutdown()
  2025-10-16 11:47 [PATCH v3 0/4] remoteproc: core: misc update Peng Fan
@ 2025-10-16 11:47 ` Peng Fan
  2025-10-16 11:47 ` [PATCH v3 2/4] remoteproc: core: Sort header includes Peng Fan
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Peng Fan @ 2025-10-16 11:47 UTC (permalink / raw)
  To: Bjorn Andersson, Mathieu Poirier, Andrew Davis, Arnaud Pouliquen,
	Daniel Baluta, Maxime Coquelin, Alexandre Torgue
  Cc: linux-stm32, linux-remoteproc, linux-kernel, Peng Fan

The variable ret is immediately assigned the return value of
mutex_lock_interruptible(), making its prior initialization to zero
unnecessary. Remove the redundant assignment

No functional changes.

Acked-by: Andrew Davis <afd@ti.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/remoteproc/remoteproc_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 82567210052893a501e7591204af1feb07befb22..29bbaa349e340eedd122fb553004f7e6a5c46e55 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -1989,7 +1989,7 @@ EXPORT_SYMBOL(rproc_boot);
 int rproc_shutdown(struct rproc *rproc)
 {
 	struct device *dev = &rproc->dev;
-	int ret = 0;
+	int ret;
 
 	ret = mutex_lock_interruptible(&rproc->lock);
 	if (ret) {

-- 
2.37.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v3 2/4] remoteproc: core: Sort header includes
  2025-10-16 11:47 [PATCH v3 0/4] remoteproc: core: misc update Peng Fan
  2025-10-16 11:47 ` [PATCH v3 1/4] remoteproc: core: Drop redundant initialization of 'ret' in rproc_shutdown() Peng Fan
@ 2025-10-16 11:47 ` Peng Fan
  2025-10-16 11:48 ` [PATCH v3 3/4] remoteproc: core: Removed unused headers Peng Fan
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Peng Fan @ 2025-10-16 11:47 UTC (permalink / raw)
  To: Bjorn Andersson, Mathieu Poirier, Andrew Davis, Arnaud Pouliquen,
	Daniel Baluta, Maxime Coquelin, Alexandre Torgue
  Cc: linux-stm32, linux-remoteproc, linux-kernel, Peng Fan

Reordered the header includes in drivers/remoteproc/remoteproc_core.c
to follow alphabetical order to simplify future maintenance.

No functional changes.

Acked-by: Andrew Davis <afd@ti.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/remoteproc/remoteproc_core.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 29bbaa349e340eedd122fb553004f7e6a5c46e55..f7d21e99d171667d925de769db003c4e13fe8fe8 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -16,29 +16,29 @@
 
 #define pr_fmt(fmt)    "%s: " fmt, __func__
 
+#include <asm/byteorder.h>
+#include <linux/crc32.h>
+#include <linux/debugfs.h>
 #include <linux/delay.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
 #include <linux/device.h>
-#include <linux/panic_notifier.h>
-#include <linux/slab.h>
-#include <linux/mutex.h>
 #include <linux/dma-mapping.h>
+#include <linux/elf.h>
 #include <linux/firmware.h>
-#include <linux/string.h>
-#include <linux/debugfs.h>
-#include <linux/rculist.h>
-#include <linux/remoteproc.h>
-#include <linux/iommu.h>
 #include <linux/idr.h>
-#include <linux/elf.h>
-#include <linux/crc32.h>
+#include <linux/iommu.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/mutex.h>
 #include <linux/of_platform.h>
 #include <linux/of_reserved_mem.h>
+#include <linux/panic_notifier.h>
+#include <linux/platform_device.h>
+#include <linux/rculist.h>
+#include <linux/remoteproc.h>
+#include <linux/slab.h>
+#include <linux/string.h>
 #include <linux/virtio_ids.h>
 #include <linux/virtio_ring.h>
-#include <asm/byteorder.h>
-#include <linux/platform_device.h>
 
 #include "remoteproc_internal.h"
 

-- 
2.37.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v3 3/4] remoteproc: core: Removed unused headers
  2025-10-16 11:47 [PATCH v3 0/4] remoteproc: core: misc update Peng Fan
  2025-10-16 11:47 ` [PATCH v3 1/4] remoteproc: core: Drop redundant initialization of 'ret' in rproc_shutdown() Peng Fan
  2025-10-16 11:47 ` [PATCH v3 2/4] remoteproc: core: Sort header includes Peng Fan
@ 2025-10-16 11:48 ` Peng Fan
  2025-10-16 11:48 ` [PATCH v3 4/4] remoteproc: core: Remove unused export of rproc_va_to_pa Peng Fan
  2025-10-27 15:31 ` [PATCH v3 0/4] remoteproc: core: misc update Mathieu Poirier
  4 siblings, 0 replies; 6+ messages in thread
From: Peng Fan @ 2025-10-16 11:48 UTC (permalink / raw)
  To: Bjorn Andersson, Mathieu Poirier, Andrew Davis, Arnaud Pouliquen,
	Daniel Baluta, Maxime Coquelin, Alexandre Torgue
  Cc: linux-stm32, linux-remoteproc, linux-kernel, Peng Fan

There is no user of crc32.h, debugfs.h, of_reserved_mem.h, virtio_ids.h,
so remove from the included headers.

No functional changes.

Acked-by: Andrew Davis <afd@ti.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/remoteproc/remoteproc_core.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index f7d21e99d171667d925de769db003c4e13fe8fe8..8004a480348378abef78ad5641a8c8b5766c20a6 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -17,8 +17,6 @@
 #define pr_fmt(fmt)    "%s: " fmt, __func__
 
 #include <asm/byteorder.h>
-#include <linux/crc32.h>
-#include <linux/debugfs.h>
 #include <linux/delay.h>
 #include <linux/device.h>
 #include <linux/dma-mapping.h>
@@ -30,14 +28,12 @@
 #include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/of_platform.h>
-#include <linux/of_reserved_mem.h>
 #include <linux/panic_notifier.h>
 #include <linux/platform_device.h>
 #include <linux/rculist.h>
 #include <linux/remoteproc.h>
 #include <linux/slab.h>
 #include <linux/string.h>
-#include <linux/virtio_ids.h>
 #include <linux/virtio_ring.h>
 
 #include "remoteproc_internal.h"

-- 
2.37.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v3 4/4] remoteproc: core: Remove unused export of rproc_va_to_pa
  2025-10-16 11:47 [PATCH v3 0/4] remoteproc: core: misc update Peng Fan
                   ` (2 preceding siblings ...)
  2025-10-16 11:48 ` [PATCH v3 3/4] remoteproc: core: Removed unused headers Peng Fan
@ 2025-10-16 11:48 ` Peng Fan
  2025-10-27 15:31 ` [PATCH v3 0/4] remoteproc: core: misc update Mathieu Poirier
  4 siblings, 0 replies; 6+ messages in thread
From: Peng Fan @ 2025-10-16 11:48 UTC (permalink / raw)
  To: Bjorn Andersson, Mathieu Poirier, Andrew Davis, Arnaud Pouliquen,
	Daniel Baluta, Maxime Coquelin, Alexandre Torgue
  Cc: linux-stm32, linux-remoteproc, linux-kernel, Peng Fan

commit 086d08725d34 ("remoteproc: create vdev subdevice with specific dma
memory pool") added an export for rproc_va_to_pa. However, since its
introduction, this symbol has not been used by any loadable modules. It
remains only referenced within remoteproc_virtio.c, which is always built
together with remoteproc_core.c.

As such, exporting rproc_va_to_pa is unnecessary, so remove the export.

No functional changes.

Acked-by: Andrew Davis <afd@ti.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/remoteproc/remoteproc_core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 8004a480348378abef78ad5641a8c8b5766c20a6..aada2780b343c32956a93b3558d4c28e04c5b5cc 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -155,7 +155,6 @@ phys_addr_t rproc_va_to_pa(void *cpu_addr)
 	WARN_ON(!virt_addr_valid(cpu_addr));
 	return virt_to_phys(cpu_addr);
 }
-EXPORT_SYMBOL(rproc_va_to_pa);
 
 /**
  * rproc_da_to_va() - lookup the kernel virtual address for a remoteproc address

-- 
2.37.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v3 0/4] remoteproc: core: misc update
  2025-10-16 11:47 [PATCH v3 0/4] remoteproc: core: misc update Peng Fan
                   ` (3 preceding siblings ...)
  2025-10-16 11:48 ` [PATCH v3 4/4] remoteproc: core: Remove unused export of rproc_va_to_pa Peng Fan
@ 2025-10-27 15:31 ` Mathieu Poirier
  4 siblings, 0 replies; 6+ messages in thread
From: Mathieu Poirier @ 2025-10-27 15:31 UTC (permalink / raw)
  To: Peng Fan
  Cc: Bjorn Andersson, Andrew Davis, Arnaud Pouliquen, Daniel Baluta,
	Maxime Coquelin, Alexandre Torgue, linux-stm32, linux-remoteproc,
	linux-kernel

On Thu, Oct 16, 2025 at 07:47:57PM +0800, Peng Fan wrote:
> This patchset is a misc update of remoteproc_core.c.
> Patch 1: Drop a pointless initialization to variable ret
> Patch 2-3: Cleanup the included headers
> Patch 4: Remove export of rproc_va_to_pa
> 
> I am also reviewing the rproc->lock usage and thinking whether we
> need to add a lockdep_assert_held for some functions that should have
> lock held. But not sure.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
> Changes in v3:
> - Drop patch 4: Use cleanup API. Because there is a deadlock issue
>   reported, need review the lock usage before the cleanup.
> - Drop patch 6 & 7: Use bitfield for bool
> - Add A-b from Andrew
> 
> Changes in v2:
> - Add patch 6 "remoteproc: stm32: Avoid directly taking address of auto_boot"
>   to address stm32_rproc.c build issue
> - Link to v1: https://lore.kernel.org/r/20251005-remoteproc-cleanup-v1-0-09a9fdea0063@nxp.com
> 
> ---
> Peng Fan (4):
>       remoteproc: core: Drop redundant initialization of 'ret' in rproc_shutdown()
>       remoteproc: core: Sort header includes
>       remoteproc: core: Removed unused headers
>       remoteproc: core: Remove unused export of rproc_va_to_pa
>

I have applied this set.

Thanks,
Mathieu
 
>  drivers/remoteproc/remoteproc_core.c | 31 +++++++++++++------------------
>  1 file changed, 13 insertions(+), 18 deletions(-)
> ---
> base-commit: 1fdbb3ff1233e204e26f9f6821ae9c125a055229
> change-id: 20251016-rproc-cleanup-v3-330464eee32e
> 
> Best regards,
> -- 
> Peng Fan <peng.fan@nxp.com>
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-10-27 15:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-16 11:47 [PATCH v3 0/4] remoteproc: core: misc update Peng Fan
2025-10-16 11:47 ` [PATCH v3 1/4] remoteproc: core: Drop redundant initialization of 'ret' in rproc_shutdown() Peng Fan
2025-10-16 11:47 ` [PATCH v3 2/4] remoteproc: core: Sort header includes Peng Fan
2025-10-16 11:48 ` [PATCH v3 3/4] remoteproc: core: Removed unused headers Peng Fan
2025-10-16 11:48 ` [PATCH v3 4/4] remoteproc: core: Remove unused export of rproc_va_to_pa Peng Fan
2025-10-27 15:31 ` [PATCH v3 0/4] remoteproc: core: misc update Mathieu Poirier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.