Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp736553imm; Fri, 27 Jul 2018 05:20:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfLrpUBR2owQPDvtKWN+HAn8sUYiUWmcFFCCIOzsDedmVnQuiYdd7rtMzrCRHOPjglkU90P X-Received: by 2002:a65:58c8:: with SMTP id e8-v6mr5880301pgu.96.1532694058188; Fri, 27 Jul 2018 05:20:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532694058; cv=none; d=google.com; s=arc-20160816; b=Yoa/HcaRd9rzPdtjcayTmH0YM0SA0e5v5NnRayv/5IOUSewdMZ+FxlHQmPVNSm3GJZ oT7hY03I9umk5lEfxSnfSe7gazvwwXGwuAG2hgCohHvK8jjed1fcw2qtQ8gZQ/7q4cTp 1DT48TccvrgbPc3QQJ78F2pqITAHpDSYVu0mZfPoazLhszR3kzaWZyq/9Trq5RQWZgiD NXxz++LQhUumcDcKGxzrfclMA23FW8CEj8m8g+KbqUJRbUj3n3LTSmqIfH84137YqXMk Dj8tuU1aqLvQOulfwC9H9N3oMaj8xmAW6aNalaBsMBrH6ahq/xWXrgrspUSYReQi16Bt 4gzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=4PUkMxFSy9Mg5mSqCEHwmblpsAPBGhURUx8sISTT4xk=; b=e5d8yMUyImveObz8W+gKdF1R9f9mpaE1Bbnbzl/ijIAtJiZiTZoFdQ9djGwyWe4+Tk mUazqYd6fK9FWCUvpje+UYQ/G7E3+JjY3PktghzTK+HiiZqVjJEJgR6P/2w0grb7LG2v kZbmLHQYw9ycFG2vJTcow2UKM9+hC15k1bOTTVRgYVb2Fs9K6esg6AkQif0t8TiVq3xR UGZ/qAy5CJh1VDs2n9uQPYDNvPpNuE6EehW/gUrMA0932qY8Hp5tMjNhtCLNY+JwFh5K Yr2nXbeFcVFZrZysRYZf6G937fyl3LEaYU3vn9xXCEzJ+oBKC611YkKMXt7IGnpQ9W+P 1Dqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=YbJ1gWnn; dkim=pass header.i=@codeaurora.org header.s=default header.b=HpiLiCAY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i15-v6si3962972pfk.146.2018.07.27.05.20.43; Fri, 27 Jul 2018 05:20:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=YbJ1gWnn; dkim=pass header.i=@codeaurora.org header.s=default header.b=HpiLiCAY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388735AbeG0Nke (ORCPT + 99 others); Fri, 27 Jul 2018 09:40:34 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:46848 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732143AbeG0Nke (ORCPT ); Fri, 27 Jul 2018 09:40:34 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8FA8260B7E; Fri, 27 Jul 2018 12:18:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532693933; bh=FcO1Ok20b2p6iYNYOhuNHiYFjhJWKXAtzItFAWI+ubg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YbJ1gWnnCaFy6S0BBTYrSevry3atoKddH3AQ2q/Vwdr1NQ0CZHtIcgVRFOjEvY0BK Zknr8eYC0QJOOxAvvv8CBQB0DVN+Bq2sQuv4xLxEi6D8M0ykJdtNQwHSMmNRkI1qlz aukuAMQDNV/kq6eY8/Cul4vxDoV0FkstfYKoHy8o= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from aneelaka-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: aneela@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id C4B6260BB0; Fri, 27 Jul 2018 12:18:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532693932; bh=FcO1Ok20b2p6iYNYOhuNHiYFjhJWKXAtzItFAWI+ubg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HpiLiCAY3/rqdIY9fYdhRv1i1bNj+fR2ptM+m+4IKKasZAuy2tWo92cNoVjCCHOS1 k6yQx4UtXb8lVL67YQ1UtlxG4DI1Zx/x95mtMpECS5RSTekU26gM3MxwAySfZzDvjR y1+jKdZBlx0s2t6TzQiCwEEtULcbatT0mm+s33Lg= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org C4B6260BB0 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=aneela@codeaurora.org From: Arun Kumar Neelakantam To: ohad@wizery.com, bjorn.andersson@linaro.org, clew@codeaurora.org, robh+dt@kernel.org, arnaud.pouliquen@st.com, andy.gross@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Arun Kumar Neelakantam Subject: [PATCH V4 8/9] rpmsg: glink: unregister rpmsg device during endpoint destroy Date: Fri, 27 Jul 2018 17:47:28 +0530 Message-Id: <1532693849-7037-9-git-send-email-aneela@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1532693849-7037-1-git-send-email-aneela@codeaurora.org> References: <1532693849-7037-1-git-send-email-aneela@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 484b427..d849bc4 100644 --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -1184,6 +1184,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); @@ -1191,6 +1192,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); @@ -1456,6 +1464,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); -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project