* [PATCH v3 1/3] rpmsg: core: Remove deadcode
2025-04-29 23:45 [PATCH v3 0/3] rpmsg offchannel deadcoding linux
@ 2025-04-29 23:45 ` linux
2025-04-29 23:45 ` [PATCH v3 2/3] rpmsg: virtio: Remove uncallable offchannel functions linux
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: linux @ 2025-04-29 23:45 UTC (permalink / raw)
To: arnaud.pouliquen, andersson, mathieu.poirier
Cc: corbet, linux-remoteproc, linux-doc, linux-kernel,
Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
rpmsg_send_offchannel() and rpmsg_trysend_offchannel() have been
unused since they were added in 2011's
commit bcabbccabffe ("rpmsg: add virtio-based remote processor messaging
bus")
Remove them and associated docs.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
Documentation/staging/rpmsg.rst | 46 ------------------------
drivers/rpmsg/rpmsg_core.c | 63 ---------------------------------
include/linux/rpmsg.h | 22 ------------
3 files changed, 131 deletions(-)
diff --git a/Documentation/staging/rpmsg.rst b/Documentation/staging/rpmsg.rst
index 3713adaa1608..40282cca86ca 100644
--- a/Documentation/staging/rpmsg.rst
+++ b/Documentation/staging/rpmsg.rst
@@ -110,31 +110,6 @@ or a timeout of 15 seconds elapses. When the latter happens,
The function can only be called from a process context (for now).
Returns 0 on success and an appropriate error value on failure.
-::
-
- int rpmsg_send_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst,
- void *data, int len);
-
-
-sends a message across to the remote processor, using the src and dst
-addresses provided by the user.
-
-The caller should specify the endpoint, the data it wants to send,
-its length (in bytes), and explicit source and destination addresses.
-The message will then be sent to the remote processor to which the
-endpoint's channel belongs, but the endpoint's src and channel dst
-addresses will be ignored (and the user-provided addresses will
-be used instead).
-
-In case there are no TX buffers available, the function will block until
-one becomes available (i.e. until the remote processor consumes
-a tx buffer and puts it back on virtio's used descriptor ring),
-or a timeout of 15 seconds elapses. When the latter happens,
--ERESTARTSYS is returned.
-
-The function can only be called from a process context (for now).
-Returns 0 on success and an appropriate error value on failure.
-
::
int rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len);
@@ -173,27 +148,6 @@ return -ENOMEM without waiting until one becomes available.
The function can only be called from a process context (for now).
Returns 0 on success and an appropriate error value on failure.
-::
-
- int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst,
- void *data, int len);
-
-
-sends a message across to the remote processor, using source and
-destination addresses provided by the user.
-
-The user should specify the channel, the data it wants to send,
-its length (in bytes), and explicit source and destination addresses.
-The message will then be sent to the remote processor to which the
-channel belongs, but the channel's src and dst addresses will be
-ignored (and the user-provided addresses will be used instead).
-
-In case there are no TX buffers available, the function will immediately
-return -ENOMEM without waiting until one becomes available.
-
-The function can only be called from a process context (for now).
-Returns 0 on success and an appropriate error value on failure.
-
::
struct rpmsg_endpoint *rpmsg_create_ept(struct rpmsg_device *rpdev,
diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
index 207b64c0a2fe..6ee36adcbdba 100644
--- a/drivers/rpmsg/rpmsg_core.c
+++ b/drivers/rpmsg/rpmsg_core.c
@@ -193,38 +193,6 @@ int rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst)
}
EXPORT_SYMBOL(rpmsg_sendto);
-/**
- * rpmsg_send_offchannel() - send a message using explicit src/dst addresses
- * @ept: the rpmsg endpoint
- * @src: source address
- * @dst: destination address
- * @data: payload of message
- * @len: length of payload
- *
- * This function sends @data of length @len to the remote @dst address,
- * and uses @src as the source address.
- * The message will be sent to the remote processor which the @ept
- * endpoint belongs to.
- * In case there are no TX buffers available, the function will block until
- * one becomes available, or a timeout of 15 seconds elapses. When the latter
- * happens, -ERESTARTSYS is returned.
- *
- * Can only be called from process context (for now).
- *
- * Return: 0 on success and an appropriate error value on failure.
- */
-int rpmsg_send_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst,
- void *data, int len)
-{
- if (WARN_ON(!ept))
- return -EINVAL;
- if (!ept->ops->send_offchannel)
- return -ENXIO;
-
- return ept->ops->send_offchannel(ept, src, dst, data, len);
-}
-EXPORT_SYMBOL(rpmsg_send_offchannel);
-
/**
* rpmsg_trysend() - send a message across to the remote processor
* @ept: the rpmsg endpoint
@@ -301,37 +269,6 @@ __poll_t rpmsg_poll(struct rpmsg_endpoint *ept, struct file *filp,
}
EXPORT_SYMBOL(rpmsg_poll);
-/**
- * rpmsg_trysend_offchannel() - send a message using explicit src/dst addresses
- * @ept: the rpmsg endpoint
- * @src: source address
- * @dst: destination address
- * @data: payload of message
- * @len: length of payload
- *
- * This function sends @data of length @len to the remote @dst address,
- * and uses @src as the source address.
- * The message will be sent to the remote processor which the @ept
- * endpoint belongs to.
- * In case there are no TX buffers available, the function will immediately
- * return -ENOMEM without waiting until one becomes available.
- *
- * Can only be called from process context (for now).
- *
- * Return: 0 on success and an appropriate error value on failure.
- */
-int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst,
- void *data, int len)
-{
- if (WARN_ON(!ept))
- return -EINVAL;
- if (!ept->ops->trysend_offchannel)
- return -ENXIO;
-
- return ept->ops->trysend_offchannel(ept, src, dst, data, len);
-}
-EXPORT_SYMBOL(rpmsg_trysend_offchannel);
-
/**
* rpmsg_set_flow_control() - request remote to pause/resume transmission
* @ept: the rpmsg endpoint
diff --git a/include/linux/rpmsg.h b/include/linux/rpmsg.h
index 90d8e4475f80..fb7ab9165645 100644
--- a/include/linux/rpmsg.h
+++ b/include/linux/rpmsg.h
@@ -184,13 +184,9 @@ struct rpmsg_endpoint *rpmsg_create_ept(struct rpmsg_device *,
int rpmsg_send(struct rpmsg_endpoint *ept, void *data, int len);
int rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst);
-int rpmsg_send_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst,
- void *data, int len);
int rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len);
int rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst);
-int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst,
- void *data, int len);
__poll_t rpmsg_poll(struct rpmsg_endpoint *ept, struct file *filp,
poll_table *wait);
@@ -271,15 +267,6 @@ static inline int rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len,
}
-static inline int rpmsg_send_offchannel(struct rpmsg_endpoint *ept, u32 src,
- u32 dst, void *data, int len)
-{
- /* This shouldn't be possible */
- WARN_ON(1);
-
- return -ENXIO;
-}
-
static inline int rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len)
{
/* This shouldn't be possible */
@@ -297,15 +284,6 @@ static inline int rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data,
return -ENXIO;
}
-static inline int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src,
- u32 dst, void *data, int len)
-{
- /* This shouldn't be possible */
- WARN_ON(1);
-
- return -ENXIO;
-}
-
static inline __poll_t rpmsg_poll(struct rpmsg_endpoint *ept,
struct file *filp, poll_table *wait)
{
--
2.49.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v3 2/3] rpmsg: virtio: Remove uncallable offchannel functions
2025-04-29 23:45 [PATCH v3 0/3] rpmsg offchannel deadcoding linux
2025-04-29 23:45 ` [PATCH v3 1/3] rpmsg: core: Remove deadcode linux
@ 2025-04-29 23:45 ` linux
2025-04-29 23:45 ` [PATCH v3 3/3] rpmsg: Remove unused method pointers *send_offchannel linux
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: linux @ 2025-04-29 23:45 UTC (permalink / raw)
To: arnaud.pouliquen, andersson, mathieu.poirier
Cc: corbet, linux-remoteproc, linux-doc, linux-kernel,
Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
The virtio_rpmsg_send_offchannel() and virtio_rpmsg_trysend_offchannel()
are wired up to the send_offchannel and trysend_offchannel members
of rpmsg_endpoint_ops, the only dereference of those was by
the unused, and now removed rpmsg_send_offchannel() and
rpmsg_trysend_offchannel() functions.
Remove them.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/rpmsg/virtio_rpmsg_bus.c | 24 +-----------------------
1 file changed, 1 insertion(+), 23 deletions(-)
diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c
index 89d7a3b8c48b..4730b1c8b322 100644
--- a/drivers/rpmsg/virtio_rpmsg_bus.c
+++ b/drivers/rpmsg/virtio_rpmsg_bus.c
@@ -141,13 +141,9 @@ static void virtio_rpmsg_destroy_ept(struct rpmsg_endpoint *ept);
static int virtio_rpmsg_send(struct rpmsg_endpoint *ept, void *data, int len);
static int virtio_rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len,
u32 dst);
-static int virtio_rpmsg_send_offchannel(struct rpmsg_endpoint *ept, u32 src,
- u32 dst, void *data, int len);
static int virtio_rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len);
static int virtio_rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data,
int len, u32 dst);
-static int virtio_rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src,
- u32 dst, void *data, int len);
static ssize_t virtio_rpmsg_get_mtu(struct rpmsg_endpoint *ept);
static struct rpmsg_device *__rpmsg_create_channel(struct virtproc_info *vrp,
struct rpmsg_channel_info *chinfo);
@@ -156,10 +152,8 @@ static const struct rpmsg_endpoint_ops virtio_endpoint_ops = {
.destroy_ept = virtio_rpmsg_destroy_ept,
.send = virtio_rpmsg_send,
.sendto = virtio_rpmsg_sendto,
- .send_offchannel = virtio_rpmsg_send_offchannel,
.trysend = virtio_rpmsg_trysend,
.trysendto = virtio_rpmsg_trysendto,
- .trysend_offchannel = virtio_rpmsg_trysend_offchannel,
.get_mtu = virtio_rpmsg_get_mtu,
};
@@ -545,7 +539,7 @@ static void rpmsg_downref_sleepers(struct virtproc_info *vrp)
* the function will immediately fail, and -ENOMEM will be returned.
*
* Normally drivers shouldn't use this function directly; instead, drivers
- * should use the appropriate rpmsg_{try}send{to, _offchannel} API
+ * should use the appropriate rpmsg_{try}send{to} API
* (see include/linux/rpmsg.h).
*
* Return: 0 on success and an appropriate error value on failure.
@@ -665,14 +659,6 @@ static int virtio_rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len,
return rpmsg_send_offchannel_raw(rpdev, src, dst, data, len, true);
}
-static int virtio_rpmsg_send_offchannel(struct rpmsg_endpoint *ept, u32 src,
- u32 dst, void *data, int len)
-{
- struct rpmsg_device *rpdev = ept->rpdev;
-
- return rpmsg_send_offchannel_raw(rpdev, src, dst, data, len, true);
-}
-
static int virtio_rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len)
{
struct rpmsg_device *rpdev = ept->rpdev;
@@ -690,14 +676,6 @@ static int virtio_rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data,
return rpmsg_send_offchannel_raw(rpdev, src, dst, data, len, false);
}
-static int virtio_rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src,
- u32 dst, void *data, int len)
-{
- struct rpmsg_device *rpdev = ept->rpdev;
-
- return rpmsg_send_offchannel_raw(rpdev, src, dst, data, len, false);
-}
-
static ssize_t virtio_rpmsg_get_mtu(struct rpmsg_endpoint *ept)
{
struct rpmsg_device *rpdev = ept->rpdev;
--
2.49.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v3 3/3] rpmsg: Remove unused method pointers *send_offchannel
2025-04-29 23:45 [PATCH v3 0/3] rpmsg offchannel deadcoding linux
2025-04-29 23:45 ` [PATCH v3 1/3] rpmsg: core: Remove deadcode linux
2025-04-29 23:45 ` [PATCH v3 2/3] rpmsg: virtio: Remove uncallable offchannel functions linux
@ 2025-04-29 23:45 ` linux
2025-04-30 7:11 ` [PATCH v3 0/3] rpmsg offchannel deadcoding Arnaud POULIQUEN
2025-05-06 17:27 ` Mathieu Poirier
4 siblings, 0 replies; 7+ messages in thread
From: linux @ 2025-04-29 23:45 UTC (permalink / raw)
To: arnaud.pouliquen, andersson, mathieu.poirier
Cc: corbet, linux-remoteproc, linux-doc, linux-kernel,
Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
After the previous patch, there are no implementers of the
send_offchannel() and trysend_offchannel() methods.
Remove them.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/rpmsg/rpmsg_internal.h | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/rpmsg/rpmsg_internal.h b/drivers/rpmsg/rpmsg_internal.h
index 42c7007be1b5..397e4926bd02 100644
--- a/drivers/rpmsg/rpmsg_internal.h
+++ b/drivers/rpmsg/rpmsg_internal.h
@@ -50,10 +50,8 @@ struct rpmsg_device_ops {
* @destroy_ept: see @rpmsg_destroy_ept(), required
* @send: see @rpmsg_send(), required
* @sendto: see @rpmsg_sendto(), optional
- * @send_offchannel: see @rpmsg_send_offchannel(), optional
* @trysend: see @rpmsg_trysend(), required
* @trysendto: see @rpmsg_trysendto(), optional
- * @trysend_offchannel: see @rpmsg_trysend_offchannel(), optional
* @poll: see @rpmsg_poll(), optional
* @set_flow_control: see @rpmsg_set_flow_control(), optional
* @get_mtu: see @rpmsg_get_mtu(), optional
@@ -67,13 +65,9 @@ struct rpmsg_endpoint_ops {
int (*send)(struct rpmsg_endpoint *ept, void *data, int len);
int (*sendto)(struct rpmsg_endpoint *ept, void *data, int len, u32 dst);
- int (*send_offchannel)(struct rpmsg_endpoint *ept, u32 src, u32 dst,
- void *data, int len);
int (*trysend)(struct rpmsg_endpoint *ept, void *data, int len);
int (*trysendto)(struct rpmsg_endpoint *ept, void *data, int len, u32 dst);
- int (*trysend_offchannel)(struct rpmsg_endpoint *ept, u32 src, u32 dst,
- void *data, int len);
__poll_t (*poll)(struct rpmsg_endpoint *ept, struct file *filp,
poll_table *wait);
int (*set_flow_control)(struct rpmsg_endpoint *ept, bool pause, u32 dst);
--
2.49.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH v3 0/3] rpmsg offchannel deadcoding
2025-04-29 23:45 [PATCH v3 0/3] rpmsg offchannel deadcoding linux
` (2 preceding siblings ...)
2025-04-29 23:45 ` [PATCH v3 3/3] rpmsg: Remove unused method pointers *send_offchannel linux
@ 2025-04-30 7:11 ` Arnaud POULIQUEN
2025-05-06 17:27 ` Mathieu Poirier
4 siblings, 0 replies; 7+ messages in thread
From: Arnaud POULIQUEN @ 2025-04-30 7:11 UTC (permalink / raw)
To: linux, andersson, mathieu.poirier
Cc: corbet, linux-remoteproc, linux-doc, linux-kernel
On 4/30/25 01:45, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> Hi,
> This removes a couple of unused functions in rpmsg,
> and (v2) after discussions with Arnaud, follows the thread
> and removes code that they would call.
Acked-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Thanks,
Arnaud
>
> (Build tested only)
>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
>
> V3
> Fixup comment on rpmsg_send_offchannel_raw(),
> removing the reference to "_offchannel" - as per Mathieu's
> review
>
> Dr. David Alan Gilbert (3):
> rpmsg: core: Remove deadcode
> rpmsg: virtio: Remove uncallable offchannel functions
> rpmsg: Remove unused method pointers *send_offchannel
>
> Documentation/staging/rpmsg.rst | 46 -----------------------
> drivers/rpmsg/rpmsg_core.c | 63 --------------------------------
> drivers/rpmsg/rpmsg_internal.h | 6 ---
> drivers/rpmsg/virtio_rpmsg_bus.c | 24 +-----------
> include/linux/rpmsg.h | 22 -----------
> 5 files changed, 1 insertion(+), 160 deletions(-)
>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v3 0/3] rpmsg offchannel deadcoding
2025-04-29 23:45 [PATCH v3 0/3] rpmsg offchannel deadcoding linux
` (3 preceding siblings ...)
2025-04-30 7:11 ` [PATCH v3 0/3] rpmsg offchannel deadcoding Arnaud POULIQUEN
@ 2025-05-06 17:27 ` Mathieu Poirier
2025-05-06 17:57 ` Dr. David Alan Gilbert
4 siblings, 1 reply; 7+ messages in thread
From: Mathieu Poirier @ 2025-05-06 17:27 UTC (permalink / raw)
To: linux
Cc: arnaud.pouliquen, andersson, corbet, linux-remoteproc, linux-doc,
linux-kernel
On Wed, Apr 30, 2025 at 12:45:56AM +0100, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> Hi,
> This removes a couple of unused functions in rpmsg,
> and (v2) after discussions with Arnaud, follows the thread
> and removes code that they would call.
>
> (Build tested only)
>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
>
> V3
> Fixup comment on rpmsg_send_offchannel_raw(),
> removing the reference to "_offchannel" - as per Mathieu's
> review
>
> Dr. David Alan Gilbert (3):
> rpmsg: core: Remove deadcode
> rpmsg: virtio: Remove uncallable offchannel functions
> rpmsg: Remove unused method pointers *send_offchannel
>
> Documentation/staging/rpmsg.rst | 46 -----------------------
> drivers/rpmsg/rpmsg_core.c | 63 --------------------------------
> drivers/rpmsg/rpmsg_internal.h | 6 ---
> drivers/rpmsg/virtio_rpmsg_bus.c | 24 +-----------
> include/linux/rpmsg.h | 22 -----------
> 5 files changed, 1 insertion(+), 160 deletions(-)
I have applied this patchet.
Thanks,
Mathieu
>
> --
> 2.49.0
>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v3 0/3] rpmsg offchannel deadcoding
2025-05-06 17:27 ` Mathieu Poirier
@ 2025-05-06 17:57 ` Dr. David Alan Gilbert
0 siblings, 0 replies; 7+ messages in thread
From: Dr. David Alan Gilbert @ 2025-05-06 17:57 UTC (permalink / raw)
To: Mathieu Poirier
Cc: arnaud.pouliquen, andersson, corbet, linux-remoteproc, linux-doc,
linux-kernel
* Mathieu Poirier (mathieu.poirier@linaro.org) wrote:
> On Wed, Apr 30, 2025 at 12:45:56AM +0100, linux@treblig.org wrote:
> > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> >
> > Hi,
> > This removes a couple of unused functions in rpmsg,
> > and (v2) after discussions with Arnaud, follows the thread
> > and removes code that they would call.
> >
> > (Build tested only)
> >
> > Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> >
> > V3
> > Fixup comment on rpmsg_send_offchannel_raw(),
> > removing the reference to "_offchannel" - as per Mathieu's
> > review
> >
> > Dr. David Alan Gilbert (3):
> > rpmsg: core: Remove deadcode
> > rpmsg: virtio: Remove uncallable offchannel functions
> > rpmsg: Remove unused method pointers *send_offchannel
> >
> > Documentation/staging/rpmsg.rst | 46 -----------------------
> > drivers/rpmsg/rpmsg_core.c | 63 --------------------------------
> > drivers/rpmsg/rpmsg_internal.h | 6 ---
> > drivers/rpmsg/virtio_rpmsg_bus.c | 24 +-----------
> > include/linux/rpmsg.h | 22 -----------
> > 5 files changed, 1 insertion(+), 160 deletions(-)
>
> I have applied this patchet.
Thanks!
Dave
> Thanks,
> Mathieu
>
> >
> > --
> > 2.49.0
> >
>
--
-----Open up your eyes, open up your mind, open up your code -------
/ Dr. David Alan Gilbert | Running GNU/Linux | Happy \
\ dave @ treblig.org | | In Hex /
\ _________________________|_____ http://www.treblig.org |_______/
^ permalink raw reply [flat|nested] 7+ messages in thread