Skip to content

Commit b509c16

Browse files
committed
Merge tag 'rpmsg-v6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux
Pull rpmsg updates from Bjorn Andersson: - Remove some dead and unused code from core and virtio modules - Improve the error messages from the Qualcomm SMD driver and initialize an uninitialized variable in the send path * tag 'rpmsg-v6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: rpmsg: qcom_smd: Fix uninitialized return variable in __qcom_smd_send() rpmsg: qcom_smd: Improve error handling for qcom_smd_parse_edge rpmsg: Remove unused method pointers *send_offchannel rpmsg: virtio: Remove uncallable offchannel functions rpmsg: core: Remove deadcode
2 parents dcf9ee9 + 5de775d commit b509c16

File tree

6 files changed

+6
-165
lines changed

6 files changed

+6
-165
lines changed

Documentation/staging/rpmsg.rst

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -110,31 +110,6 @@ or a timeout of 15 seconds elapses. When the latter happens,
110110
The function can only be called from a process context (for now).
111111
Returns 0 on success and an appropriate error value on failure.
112112

113-
::
114-
115-
int rpmsg_send_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst,
116-
void *data, int len);
117-
118-
119-
sends a message across to the remote processor, using the src and dst
120-
addresses provided by the user.
121-
122-
The caller should specify the endpoint, the data it wants to send,
123-
its length (in bytes), and explicit source and destination addresses.
124-
The message will then be sent to the remote processor to which the
125-
endpoint's channel belongs, but the endpoint's src and channel dst
126-
addresses will be ignored (and the user-provided addresses will
127-
be used instead).
128-
129-
In case there are no TX buffers available, the function will block until
130-
one becomes available (i.e. until the remote processor consumes
131-
a tx buffer and puts it back on virtio's used descriptor ring),
132-
or a timeout of 15 seconds elapses. When the latter happens,
133-
-ERESTARTSYS is returned.
134-
135-
The function can only be called from a process context (for now).
136-
Returns 0 on success and an appropriate error value on failure.
137-
138113
::
139114

140115
int rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len);
@@ -173,27 +148,6 @@ return -ENOMEM without waiting until one becomes available.
173148
The function can only be called from a process context (for now).
174149
Returns 0 on success and an appropriate error value on failure.
175150

176-
::
177-
178-
int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst,
179-
void *data, int len);
180-
181-
182-
sends a message across to the remote processor, using source and
183-
destination addresses provided by the user.
184-
185-
The user should specify the channel, the data it wants to send,
186-
its length (in bytes), and explicit source and destination addresses.
187-
The message will then be sent to the remote processor to which the
188-
channel belongs, but the channel's src and dst addresses will be
189-
ignored (and the user-provided addresses will be used instead).
190-
191-
In case there are no TX buffers available, the function will immediately
192-
return -ENOMEM without waiting until one becomes available.
193-
194-
The function can only be called from a process context (for now).
195-
Returns 0 on success and an appropriate error value on failure.
196-
197151
::
198152

199153
struct rpmsg_endpoint *rpmsg_create_ept(struct rpmsg_device *rpdev,

drivers/rpmsg/qcom_smd.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ static int __qcom_smd_send(struct qcom_smd_channel *channel, const void *data,
746746
__le32 hdr[5] = { cpu_to_le32(len), };
747747
int tlen = sizeof(hdr) + len;
748748
unsigned long flags;
749-
int ret;
749+
int ret = 0;
750750

751751
/* Word aligned channels only accept word size aligned data */
752752
if (channel->info_word && len % 4)
@@ -1369,7 +1369,8 @@ static int qcom_smd_parse_edge(struct device *dev,
13691369
edge->mbox_chan = mbox_request_channel(&edge->mbox_client, 0);
13701370
if (IS_ERR(edge->mbox_chan)) {
13711371
if (PTR_ERR(edge->mbox_chan) != -ENODEV) {
1372-
ret = PTR_ERR(edge->mbox_chan);
1372+
ret = dev_err_probe(dev, PTR_ERR(edge->mbox_chan),
1373+
"failed to acquire IPC mailbox\n");
13731374
goto put_node;
13741375
}
13751376

@@ -1386,6 +1387,7 @@ static int qcom_smd_parse_edge(struct device *dev,
13861387
of_node_put(syscon_np);
13871388
if (IS_ERR(edge->ipc_regmap)) {
13881389
ret = PTR_ERR(edge->ipc_regmap);
1390+
dev_err(dev, "failed to get regmap from syscon: %d\n", ret);
13891391
goto put_node;
13901392
}
13911393

@@ -1501,10 +1503,8 @@ struct qcom_smd_edge *qcom_smd_register_edge(struct device *parent,
15011503
}
15021504

15031505
ret = qcom_smd_parse_edge(&edge->dev, node, edge);
1504-
if (ret) {
1505-
dev_err(&edge->dev, "failed to parse smd edge\n");
1506+
if (ret)
15061507
goto unregister_dev;
1507-
}
15081508

15091509
ret = qcom_smd_create_chrdev(edge);
15101510
if (ret) {

drivers/rpmsg/rpmsg_core.c

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -193,38 +193,6 @@ int rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst)
193193
}
194194
EXPORT_SYMBOL(rpmsg_sendto);
195195

196-
/**
197-
* rpmsg_send_offchannel() - send a message using explicit src/dst addresses
198-
* @ept: the rpmsg endpoint
199-
* @src: source address
200-
* @dst: destination address
201-
* @data: payload of message
202-
* @len: length of payload
203-
*
204-
* This function sends @data of length @len to the remote @dst address,
205-
* and uses @src as the source address.
206-
* The message will be sent to the remote processor which the @ept
207-
* endpoint belongs to.
208-
* In case there are no TX buffers available, the function will block until
209-
* one becomes available, or a timeout of 15 seconds elapses. When the latter
210-
* happens, -ERESTARTSYS is returned.
211-
*
212-
* Can only be called from process context (for now).
213-
*
214-
* Return: 0 on success and an appropriate error value on failure.
215-
*/
216-
int rpmsg_send_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst,
217-
void *data, int len)
218-
{
219-
if (WARN_ON(!ept))
220-
return -EINVAL;
221-
if (!ept->ops->send_offchannel)
222-
return -ENXIO;
223-
224-
return ept->ops->send_offchannel(ept, src, dst, data, len);
225-
}
226-
EXPORT_SYMBOL(rpmsg_send_offchannel);
227-
228196
/**
229197
* rpmsg_trysend() - send a message across to the remote processor
230198
* @ept: the rpmsg endpoint
@@ -301,37 +269,6 @@ __poll_t rpmsg_poll(struct rpmsg_endpoint *ept, struct file *filp,
301269
}
302270
EXPORT_SYMBOL(rpmsg_poll);
303271

304-
/**
305-
* rpmsg_trysend_offchannel() - send a message using explicit src/dst addresses
306-
* @ept: the rpmsg endpoint
307-
* @src: source address
308-
* @dst: destination address
309-
* @data: payload of message
310-
* @len: length of payload
311-
*
312-
* This function sends @data of length @len to the remote @dst address,
313-
* and uses @src as the source address.
314-
* The message will be sent to the remote processor which the @ept
315-
* endpoint belongs to.
316-
* In case there are no TX buffers available, the function will immediately
317-
* return -ENOMEM without waiting until one becomes available.
318-
*
319-
* Can only be called from process context (for now).
320-
*
321-
* Return: 0 on success and an appropriate error value on failure.
322-
*/
323-
int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst,
324-
void *data, int len)
325-
{
326-
if (WARN_ON(!ept))
327-
return -EINVAL;
328-
if (!ept->ops->trysend_offchannel)
329-
return -ENXIO;
330-
331-
return ept->ops->trysend_offchannel(ept, src, dst, data, len);
332-
}
333-
EXPORT_SYMBOL(rpmsg_trysend_offchannel);
334-
335272
/**
336273
* rpmsg_set_flow_control() - request remote to pause/resume transmission
337274
* @ept: the rpmsg endpoint

drivers/rpmsg/rpmsg_internal.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,8 @@ struct rpmsg_device_ops {
5050
* @destroy_ept: see @rpmsg_destroy_ept(), required
5151
* @send: see @rpmsg_send(), required
5252
* @sendto: see @rpmsg_sendto(), optional
53-
* @send_offchannel: see @rpmsg_send_offchannel(), optional
5453
* @trysend: see @rpmsg_trysend(), required
5554
* @trysendto: see @rpmsg_trysendto(), optional
56-
* @trysend_offchannel: see @rpmsg_trysend_offchannel(), optional
5755
* @poll: see @rpmsg_poll(), optional
5856
* @set_flow_control: see @rpmsg_set_flow_control(), optional
5957
* @get_mtu: see @rpmsg_get_mtu(), optional
@@ -67,13 +65,9 @@ struct rpmsg_endpoint_ops {
6765

6866
int (*send)(struct rpmsg_endpoint *ept, void *data, int len);
6967
int (*sendto)(struct rpmsg_endpoint *ept, void *data, int len, u32 dst);
70-
int (*send_offchannel)(struct rpmsg_endpoint *ept, u32 src, u32 dst,
71-
void *data, int len);
7268

7369
int (*trysend)(struct rpmsg_endpoint *ept, void *data, int len);
7470
int (*trysendto)(struct rpmsg_endpoint *ept, void *data, int len, u32 dst);
75-
int (*trysend_offchannel)(struct rpmsg_endpoint *ept, u32 src, u32 dst,
76-
void *data, int len);
7771
__poll_t (*poll)(struct rpmsg_endpoint *ept, struct file *filp,
7872
poll_table *wait);
7973
int (*set_flow_control)(struct rpmsg_endpoint *ept, bool pause, u32 dst);

drivers/rpmsg/virtio_rpmsg_bus.c

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,9 @@ static void virtio_rpmsg_destroy_ept(struct rpmsg_endpoint *ept);
141141
static int virtio_rpmsg_send(struct rpmsg_endpoint *ept, void *data, int len);
142142
static int virtio_rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len,
143143
u32 dst);
144-
static int virtio_rpmsg_send_offchannel(struct rpmsg_endpoint *ept, u32 src,
145-
u32 dst, void *data, int len);
146144
static int virtio_rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len);
147145
static int virtio_rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data,
148146
int len, u32 dst);
149-
static int virtio_rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src,
150-
u32 dst, void *data, int len);
151147
static ssize_t virtio_rpmsg_get_mtu(struct rpmsg_endpoint *ept);
152148
static struct rpmsg_device *__rpmsg_create_channel(struct virtproc_info *vrp,
153149
struct rpmsg_channel_info *chinfo);
@@ -156,10 +152,8 @@ static const struct rpmsg_endpoint_ops virtio_endpoint_ops = {
156152
.destroy_ept = virtio_rpmsg_destroy_ept,
157153
.send = virtio_rpmsg_send,
158154
.sendto = virtio_rpmsg_sendto,
159-
.send_offchannel = virtio_rpmsg_send_offchannel,
160155
.trysend = virtio_rpmsg_trysend,
161156
.trysendto = virtio_rpmsg_trysendto,
162-
.trysend_offchannel = virtio_rpmsg_trysend_offchannel,
163157
.get_mtu = virtio_rpmsg_get_mtu,
164158
};
165159

@@ -545,7 +539,7 @@ static void rpmsg_downref_sleepers(struct virtproc_info *vrp)
545539
* the function will immediately fail, and -ENOMEM will be returned.
546540
*
547541
* Normally drivers shouldn't use this function directly; instead, drivers
548-
* should use the appropriate rpmsg_{try}send{to, _offchannel} API
542+
* should use the appropriate rpmsg_{try}send{to} API
549543
* (see include/linux/rpmsg.h).
550544
*
551545
* 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,
665659
return rpmsg_send_offchannel_raw(rpdev, src, dst, data, len, true);
666660
}
667661

668-
static int virtio_rpmsg_send_offchannel(struct rpmsg_endpoint *ept, u32 src,
669-
u32 dst, void *data, int len)
670-
{
671-
struct rpmsg_device *rpdev = ept->rpdev;
672-
673-
return rpmsg_send_offchannel_raw(rpdev, src, dst, data, len, true);
674-
}
675-
676662
static int virtio_rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len)
677663
{
678664
struct rpmsg_device *rpdev = ept->rpdev;
@@ -690,14 +676,6 @@ static int virtio_rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data,
690676
return rpmsg_send_offchannel_raw(rpdev, src, dst, data, len, false);
691677
}
692678

693-
static int virtio_rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src,
694-
u32 dst, void *data, int len)
695-
{
696-
struct rpmsg_device *rpdev = ept->rpdev;
697-
698-
return rpmsg_send_offchannel_raw(rpdev, src, dst, data, len, false);
699-
}
700-
701679
static ssize_t virtio_rpmsg_get_mtu(struct rpmsg_endpoint *ept)
702680
{
703681
struct rpmsg_device *rpdev = ept->rpdev;

include/linux/rpmsg.h

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,9 @@ struct rpmsg_endpoint *rpmsg_create_ept(struct rpmsg_device *,
184184

185185
int rpmsg_send(struct rpmsg_endpoint *ept, void *data, int len);
186186
int rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst);
187-
int rpmsg_send_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst,
188-
void *data, int len);
189187

190188
int rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len);
191189
int rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst);
192-
int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst,
193-
void *data, int len);
194190

195191
__poll_t rpmsg_poll(struct rpmsg_endpoint *ept, struct file *filp,
196192
poll_table *wait);
@@ -271,15 +267,6 @@ static inline int rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len,
271267

272268
}
273269

274-
static inline int rpmsg_send_offchannel(struct rpmsg_endpoint *ept, u32 src,
275-
u32 dst, void *data, int len)
276-
{
277-
/* This shouldn't be possible */
278-
WARN_ON(1);
279-
280-
return -ENXIO;
281-
}
282-
283270
static inline int rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len)
284271
{
285272
/* This shouldn't be possible */
@@ -297,15 +284,6 @@ static inline int rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data,
297284
return -ENXIO;
298285
}
299286

300-
static inline int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src,
301-
u32 dst, void *data, int len)
302-
{
303-
/* This shouldn't be possible */
304-
WARN_ON(1);
305-
306-
return -ENXIO;
307-
}
308-
309287
static inline __poll_t rpmsg_poll(struct rpmsg_endpoint *ept,
310288
struct file *filp, poll_table *wait)
311289
{

0 commit comments

Comments
 (0)