All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/1] rpmsg: virtio_rpmsg_bus: fix channel creation
@ 2016-12-15 14:49 Loic Pallardy
  2016-12-16  5:09 ` Bjorn Andersson
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Loic Pallardy @ 2016-12-15 14:49 UTC (permalink / raw)
  To: bjorn.andersson, ohad, lee.jones
  Cc: loic.pallardy, linux-remoteproc, kernel, patrice.chotard

Since commit 4dffed5b3ac796b ("rpmsg: Name rpmsg devices based on
channel id"), it is no more possible for a firmware to register twice
a service (on different endpoints). rpmsg_register_device function
is failing when calling device_add for the second time as second
device has the same name as first one already register.
It is because name is based only on service name and so is not more
unique. Previously name was unique thanks to the use of rpmsg_dev_index.

This patch adds destination and source endpoint numbers device name to
create an unique identifier.

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
---
v2: Update commit header with commit ID generating regression
Fix rpmsg_core instead of virtio_rpmsg

 drivers/rpmsg/rpmsg_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
index a79cb5a..18c73e0 100644
--- a/drivers/rpmsg/rpmsg_core.c
+++ b/drivers/rpmsg/rpmsg_core.c
@@ -453,8 +453,8 @@ int rpmsg_register_device(struct rpmsg_device *rpdev)
 	struct device *dev = &rpdev->dev;
 	int ret;
 
-	dev_set_name(&rpdev->dev, "%s:%s",
-		     dev_name(dev->parent), rpdev->id.name);
+	dev_set_name(&rpdev->dev, "%s.%d.%d.%s", dev_name(dev->parent),
+		     rpdev->src, rpdev->dst, rpdev->id.name);
 
 	rpdev->dev.bus = &rpmsg_bus;
 	rpdev->dev.release = rpmsg_release_device;
-- 
1.9.1

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

end of thread, other threads:[~2017-01-11 22:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-15 14:49 [PATCH v2 1/1] rpmsg: virtio_rpmsg_bus: fix channel creation Loic Pallardy
2016-12-16  5:09 ` Bjorn Andersson
2016-12-27 22:36   ` Suman Anna
2016-12-30 19:56     ` Bjorn Andersson
2017-01-09 23:45       ` Bjorn Andersson
2017-01-10  0:47         ` Suman Anna
2017-01-11 19:57           ` Bjorn Andersson
2017-01-10  8:18         ` Loic PALLARDY
2017-01-11 22:08           ` Bjorn Andersson
2016-12-16 10:39 ` [STLinux Kernel] " Peter Griffin
2017-01-10  7:51 ` Lee Jones
2017-01-10  8:05   ` Marek Novak

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.