[<prev] [next>] [day] [month] [year] [list]
Message-ID: <0101016e9292cd9d-ebab0468-29d4-4c8f-b2f8-58f2a4a5e65e-000000@us-west-2.amazonses.com>
Date: Fri, 22 Nov 2019 10:05:24 +0000
From: Arun Kumar Neelakantam <aneela@...eaurora.org>
To: ohad@...ery.com, bjorn.andersson@...aro.org, clew@...eaurora.org,
sricharan@...eaurora.org
Cc: linux-remoteproc@...r.kernel.org, linux-kernel@...r.kernel.org,
Arun Kumar Neelakantam <aneela@...eaurora.org>,
Andy Gross <agross@...nel.org>,
linux-arm-msm@...r.kernel.org (open list:ARM/QUALCOMM SUPPORT)
Subject: [PATCH V5 5/5] rpmsg: glink: unregister rpmsg device during endpoint destroy
Rpmsg device unregister is not happening if channel close is triggered
from local side and causing re-registration of device failures.
Unregister rpmsg device for local close in endpoint destroy path.
Signed-off-by: Arun Kumar Neelakantam <aneela@...eaurora.org>
---
drivers/rpmsg/qcom_glink_native.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c
index 3732fc6..0ff4cbe 100644
--- a/drivers/rpmsg/qcom_glink_native.c
+++ b/drivers/rpmsg/qcom_glink_native.c
@@ -1187,6 +1187,7 @@ static void qcom_glink_destroy_ept(struct rpmsg_endpoint *ept)
{
struct glink_channel *channel = to_glink_channel(ept);
struct qcom_glink *glink = channel->glink;
+ struct rpmsg_channel_info chinfo;
unsigned long flags;
spin_lock_irqsave(&channel->recv_lock, flags);
@@ -1194,6 +1195,13 @@ static void qcom_glink_destroy_ept(struct rpmsg_endpoint *ept)
spin_unlock_irqrestore(&channel->recv_lock, flags);
/* Decouple the potential rpdev from the channel */
+ if (channel->rpdev) {
+ strncpy(chinfo.name, channel->name, sizeof(chinfo.name));
+ chinfo.src = RPMSG_ADDR_ANY;
+ chinfo.dst = RPMSG_ADDR_ANY;
+
+ rpmsg_unregister_device(glink->dev, &chinfo);
+ }
channel->rpdev = NULL;
qcom_glink_send_close_req(glink, channel);
@@ -1459,6 +1467,7 @@ static void qcom_glink_rx_close(struct qcom_glink *glink, unsigned int rcid)
rpmsg_unregister_device(glink->dev, &chinfo);
}
+ channel->rpdev = NULL;
qcom_glink_send_close_ack(glink, channel->rcid);
--
1.9.1
Powered by blists - more mailing lists