15 Sep, 2020
1 commit
-
Complete the virtio_rpmsg_channel structure description to fix a
compilation warning with W=1 option:drivers/rpmsg/virtio_rpmsg_bus.c:95: warning: Cannot understand
* @vrp: the remote processor this channel belongs toReviewed-by: Mathieu Poirier
Signed-off-by: Arnaud Pouliquen
Link: https://lore.kernel.org/r/20200731074850.3262-1-arnaud.pouliquen@st.com
Signed-off-by: Bjorn Andersson
22 Jul, 2020
1 commit
-
According to the VirtIO 1.0 spec data, sent over virtual queues must
be in little-endian format. Update the RPMsg VirtIO implementation
to enforce that but let legacy configurations continue use native
endianness.Acked-by: Michael S. Tsirkin
Signed-off-by: Guennadi Liakhovetski
Reviewed-by: Mathieu Poirier
Tested-by: Arnaud Pouliquen
Link: https://lore.kernel.org/r/20200721085638.GA3815@ubuntu
Signed-off-by: Bjorn Andersson
13 May, 2020
1 commit
-
The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:struct foo {
int stuff;
struct boo array[];
};By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last in the structure, which
will help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.Also, notice that, dynamic memory allocations won't be affected by
this change:"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]sizeof(flexible-array-member) triggers a warning because flexible array
members have incomplete type[1]. There are some instances of code in
which the sizeof operator is being incorrectly/erroneously applied to
zero-length arrays and the result is zero. Such instances may be hiding
some bugs. So, this work (flexible-array member conversions) will also
help to get completely rid of those sorts of issues.This issue was found with the help of Coccinelle.
[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")Signed-off-by: Gustavo A. R. Silva
Link: https://lore.kernel.org/r/20200507191948.GA16053@embeddedor
Signed-off-by: Bjorn Andersson
28 Aug, 2019
1 commit
-
The virtio_rpmsg_bus driver uses the "%p" format-specifier for
printing the vring buffer address. This prints only a hashed
pointer even for previliged users. Use "%pK" instead so that
the address can be printed during debug using kptr_restrict
sysctl.Signed-off-by: Suman Anna
Signed-off-by: Bjorn Andersson
21 Feb, 2019
2 commits
-
Make header files alphabetical order.
Signed-off-by: Loic Pallardy
Signed-off-by: Bjorn Andersson -
Remoteproc is now capable to create one specific sub-device per
virtio link to associate a dedicated memory pool.
This implies to change device used by virtio_rpmsg for
buffer allocation from grand-parent to parent.Signed-off-by: Loic Pallardy
Reviewed-by: Anup Patel
Tested-by: Anup Patel
Signed-off-by: Bjorn Andersson
04 Jun, 2018
1 commit
-
Use the appropriate SPDX license identifier in the virtio rpmsg
bus driver source file and drop the previous boilerplate license
text.Signed-off-by: Suman Anna
Signed-off-by: Bjorn Andersson
25 Aug, 2017
2 commits
-
To specify memory for remoteproc, we declare (dma_declare_coherent_memory())
an area which is ioremap'ed to the vmalloc area. However, this address is
not a kernel address so virt_addr_valid(buf) fails.Signed-off-by: Ludovic Barre
Signed-off-by: Loic Pallardy
Acked-by: Patrice Chotard
Tested-by: Suman Anna
Signed-off-by: Bjorn Andersson -
Rpmsg buffer size is currently fixed to 512 bytes.
This patch introduces a new capability in struct virtproc_info
to tune shared buffer size between host and coprocessor
according to the needs.Acked-by: Suman Anna
Signed-off-by: Loic Pallardy
Signed-off-by: Bjorn Andersson
27 Jul, 2017
1 commit
-
Commit 8a228ecfe086b ("rpmsg: Indirection table for rpmsg_endpoint
operations") has made the rpmsg_send_offchannel_raw() a static
function and local to the virtio_rpmsg_bus module, but has not
dropped the corresponding EXPORT_SYMBOL. Fix this.Signed-off-by: Suman Anna
Signed-off-by: Bjorn Andersson
26 Jun, 2017
3 commits
-
Trivial cleanup: the .ops pointer is assigned twice. This patch removes the
first assignment.Acked-by: Suman Anna
Signed-off-by: Henri Roosen
Signed-off-by: Bjorn Andersson -
Commit 2a48d7322dc8 ("rpmsg: rpmsg_send() operations takes rpmsg_endpoint")
only changed the nameservice address for virtio_rpmsg_announce_create() but
did not do the same change for virtio_rpmsg_announce_destroy().Signed-off-by: Henri Roosen
Signed-off-by: Bjorn Andersson -
A device might not have an endpoint assigned. This patch checks if
rpdev->ept has a value before dereferencing or using it.Signed-off-by: Henri Roosen
Signed-off-by: Bjorn Andersson
18 May, 2017
1 commit
-
The rpmsg devices are allocated in the backends and as such must be
freed there as well.Signed-off-by: Bjorn Andersson
03 May, 2017
1 commit
-
We are going to add more parameters to find_vqs, let's wrap the call so
we don't need to tweak all drivers every time.Signed-off-by: Michael S. Tsirkin
28 Feb, 2017
1 commit
-
Add a struct irq_affinity pointer to the find_vqs methods, which if set
is used to tell the PCI layer to create the MSI-X vectors for our I/O
virtqueues with the proper affinity from the start. Compared to after
the fact affinity hints this gives us an instantly working setup and
allows to allocate the irq descritors node-local and avoid interconnect
traffic. Last but not least this will allow blk-mq queues are created
based on the interrupt affinity for storage drivers.Signed-off-by: Christoph Hellwig
Reviewed-by: Jason Wang
Signed-off-by: Michael S. Tsirkin
09 Sep, 2016
15 commits
-
Some rpmsg backends support holding on to and redelivering messages upon
failed handling of them, so provide a way for the callback to report and
error and allow the backends to handle this.Signed-off-by: Bjorn Andersson
-
Move virtio rpmsg implementation details from the public header file to
the virtio rpmsg implementation.Signed-off-by: Bjorn Andersson
-
Create a container struct virtio_rpmsg_channel around the rpmsg_channel
to keep virtio backend information separate from the rpmsg and public
API. This makes the public structures independant of virtio.Signed-off-by: Bjorn Andersson
-
Extract the generic rpmsg core functionality from the virtio rpmsg
implementation, splitting the implementation in a rpmsg core and a
virtio backend.Based on initial work by Sricharan R
Cc: Sricharan R
Signed-off-by: Bjorn Andersson -
The tail of create_channel() is common among all rpmsg backends, so
split it off from the virtio specific part to allow it to be extracted
to the rpmsg core.Signed-off-by: Bjorn Andersson
-
Extract and move the helper function for finding rpmsg child devices to
the core.Signed-off-by: Bjorn Andersson
-
Move the rpmsg_send() and rpmsg_destroy_ept() interface to the rpmsg
core, so that we eventually can hide the rpmsg_endpoint ops from the
public API.Signed-off-by: Bjorn Andersson
-
Add indirection table for rpmsg_endpoint related operations and move
virtio implementation behind this, this finishes of the decoupling of
the virtio implementation from the public API.Signed-off-by: Bjorn Andersson
-
Extract the now indirect rpmsg_create_ept() interface to a separate
file and start building up a rpmsg core.Signed-off-by: Bjorn Andersson
-
To allow for multiple backend implementations add an indireection table
for rpmsg_device related operations and move the virtio implementation
behind this table.Signed-off-by: Bjorn Andersson
-
The rpmsg device representing struct is called rpmsg_channel and the
variable name used throughout is rpdev, with the communication happening
on endpoints it's clearer to just call this a "device" in a public API.Signed-off-by: Bjorn Andersson
-
As we introduce support for additional rpmsg backends, some of these
only supports point-to-point "links" represented by a name. By making
rpmsg_create_ept() take a channel_info struct we allow for these
backends to either be passed a source address, a destination address or
a name identifier.Signed-off-by: Bjorn Andersson
-
The rpmsg_send() operations has been taking a rpmsg_device, but this
forces users of secondary rpmsg_endpoints to use the rpmsg_sendto()
interface - by extracting source and destination from the given data
structures. If we instead pass the rpmsg_endpoint to these functions a
service can use rpmsg_sendto() to respond to messages, even on secondary
endpoints.In addition this would allow us to support operations on multiple
channels in future backends that does not support off-channel
operations.Signed-off-by: Bjorn Andersson
-
By basing rpmsg device names on channel id we end up with human readable
device names in sysfs and debug logs.Reviewed-by: Sarangdhar Joshi
Signed-off-by: Bjorn Andersson -
Make it possible to match rpmsg devices based on device tree node, in
addition to the id table. In some of these cases the rpmsg driver would
not have a id_table, so make this optional.Signed-off-by: Bjorn Andersson
13 Aug, 2016
5 commits
-
There are couple of print_hex_dump traces used in rpmsg code which
prints the actual byte messages being transferred between host and
the remote processors. These traces are quiet verbose and affects
performance, if the appropriate trace level is enabled. These hex
dumps are needed rather rarely, but are quite useful when debugging
complex IPC corner cases. So, this patch switches these hex dump
traces to use the dynamic_hex_dump() API.The hex dump traces are also enabled only when CONFIG_DYNAMIC_DEBUG
is enabled. This switch allows flexibility of controlling these
traces through dynamic debug, instead of removing them completely.Signed-off-by: Suman Anna
Signed-off-by: Bjorn Andersson -
This patch fixes most of the existing alignment checkpatch check
warnings of the type "Alignment should match open parenthesis"
in the virtio rpmsg bus code. A couple of them have been left as
is to not exceed the 80-char limit.Signed-off-by: Suman Anna
Signed-off-by: Bjorn Andersson -
The dma_addr_t types can be printed properly using the %pad
printk format-specifier, there is no need to resort to the
unsigned long long type-casting to deal with different possible
type sizes.Signed-off-by: Suman Anna
Signed-off-by: Bjorn Andersson -
These types of error prints are superfluous. The system will
pick up on OOM issues and let the user know. While at this,
fix the usage of using a structure instead of the actual
variable in one of the allocations.Signed-off-by: Suman Anna
Signed-off-by: Bjorn Andersson -
It should never have been there in the first place.
Signed-off-by: Lee Jones
Signed-off-by: Bjorn Andersson
11 Aug, 2016
1 commit
-
Found with scripts/coccinelle/misc/boolconv.cocci.
Signed-off-by: Andrew F. Davis
Signed-off-by: Bjorn Andersson
07 May, 2016
1 commit
-
Add register_rpmsg_driver helper macro that adds THIS_MODULE to
rpmsg_driver for the registering driver. We rename and modify
the existing register_rpmsg_driver to enable this.Signed-off-by: Andrew F. Davis
Acked-by: Suman Anna
Signed-off-by: Bjorn Andersson
13 Jan, 2016
1 commit
-
checkpatch.pl wants arrays of strings declared as follows:
static const char * const names[] = { "vq-1", "vq-2", "vq-3" };
Currently the find_vqs() function takes a const char *names[] argument
so passing checkpatch.pl's const char * const names[] results in a
compiler error due to losing the second const.This patch adjusts the find_vqs() prototype and updates all virtio
transports. This makes it possible for virtio_balloon.c, virtio_input.c,
virtgpu_kms.c, and virtio_rpmsg_bus.c to use the checkpatch.pl-friendly
type.Signed-off-by: Stefan Hajnoczi
Signed-off-by: Michael S. Tsirkin
Acked-by: Bjorn Andersson
13 Mar, 2015
1 commit
-
virtio spec requires that all drivers set DRIVER_OK
before using devices. While rpmsg isn't yet
included in the virtio 1 spec, previous spec versions
also required this.virtio rpmsg violates this rule: is calls kick
before setting DRIVER_OK.The fix isn't trivial since simply calling virtio_device_ready earlier
would mean we might get an interrupt in parallel with adding buffers.Instead, split kick out to prepare+notify calls. prepare before
virtio_device_ready - when we know we won't get interrupts. notify right
afterwards.Signed-off-by: Michael S. Tsirkin
Acked-by: Ohad Ben-Cohen
Signed-off-by: Rusty Russell