Received: by 2002:a05:6622:f08:0:0:0:0 with SMTP id l8csp4480336ivc; Tue, 3 Nov 2020 13:08:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxf6uioX6eOKECtuFxgL8J6kUuqM9+mS9h6e+/9pPxRpAsD+X+KGMchzoEOIP4GfeHDhLKw X-Received: by 2002:a17:906:3e08:: with SMTP id k8mr22482594eji.478.1604437708406; Tue, 03 Nov 2020 13:08:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604437708; cv=none; d=google.com; s=arc-20160816; b=uEPXE5H/Hy6ITcyKDX0pK5z15kjz0W0Bcq70K1LMUB0YnVbVQih6bI1Ms7RqxyJeAm 9teBVLXkrJDcBDxlgXy7RmFy41ztMFB+Je4meSanoHKy6eoy7qcxk/fy0nbVqxfOVV8D UkBSGQYhrfmLz4U/d3t5eIC/HtGyKK98NT6/WZ49OHkyGZF1DMsPcjCthoc/IP1Q/uOL KkZhLeynTzs1UQIoBa5VD9z7BnMECOPx7UvWJyGr/FmrdHxfxJWpnNDykBoquBauLtxj Dd3UAEKCA9Tm3TYmWOhpfY9bDiet9RpeDl7n3LOtdaJXwRmEfgvO4mOMPAELEujUmWcH FiNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AKb3ycXHnYE2Me0J33nFE8VLybmqH7DnzV9qArnkM/M=; b=rLPfmoaVkZHNxi2cDH0Fhmn8N79a3Dcy2wLwjq0eEM+vheMWlIPkWxuhmA+Q4F8oGR CWBaikFUlSqLR8UWqyXnCe9uVP2Vwh3eFRPDA5WDLjQSWLM+ERofmjcXQQJ1/JTqredN ojgq9rCs+SOD16yJhTA/l2wIVsw4dicwoK4IbN+atui8N4+rbgFVMl2DOxua/7p16Wui bdTu1DQoglofNg3+n2zrwvmlRE7vVTxeofBfeozFialK78WjDftngbFy5uGVyKp5yxvO 7tVzcNEZu+Pv+Ho5p7S6LFIGwtMRY4qc3B19sZpb2PZKHWkINiviC/lQUMXGzqQOp8RR P4kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="xM1U/xrW"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c8si13477549edl.252.2020.11.03.13.08.05; Tue, 03 Nov 2020 13:08:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="xM1U/xrW"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730012AbgKCVEs (ORCPT + 99 others); Tue, 3 Nov 2020 16:04:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:42860 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388013AbgKCVEm (ORCPT ); Tue, 3 Nov 2020 16:04:42 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2D7A2206B5; Tue, 3 Nov 2020 21:04:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437481; bh=X5a1uvzYGmq5gW5+Myp/lnzk7747LtgnpE0vjziG6ZM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xM1U/xrWQw8weL9t7DaouSlh0JSoZ5teZ7l/cJBArioWD2+vQl5xNrGwawGNB9wYm zsT31SORz/39kt32TjeJpnAQrgyn5Yic08bkcmpC60AnuKl5YNsW4nBAa8a1wJ9KER kr6AlXlIYIisMBsQlXh4s1OxoR+P9014z8IwrCXQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chris Lew , Arun Kumar Neelakantam , Deepak Kumar Singh , Bjorn Andersson , Sasha Levin Subject: [PATCH 4.19 096/191] rpmsg: glink: Use complete_all for open states Date: Tue, 3 Nov 2020 21:36:28 +0100 Message-Id: <20201103203242.817041055@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203232.656475008@linuxfoundation.org> References: <20201103203232.656475008@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chris Lew [ Upstream commit 4fcdaf6e28d11e2f3820d54dd23cd12a47ddd44e ] The open_req and open_ack completion variables are the state variables to represet a remote channel as open. Use complete_all so there are no races with waiters and using completion_done. Signed-off-by: Chris Lew Signed-off-by: Arun Kumar Neelakantam Signed-off-by: Deepak Kumar Singh Link: https://lore.kernel.org/r/1593017121-7953-2-git-send-email-deesin@codeaurora.org Signed-off-by: Bjorn Andersson Signed-off-by: Sasha Levin --- drivers/rpmsg/qcom_glink_native.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c index facc577ab0acc..a755f85686e53 100644 --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -970,7 +970,7 @@ static int qcom_glink_rx_open_ack(struct qcom_glink *glink, unsigned int lcid) return -EINVAL; } - complete(&channel->open_ack); + complete_all(&channel->open_ack); return 0; } @@ -1178,7 +1178,7 @@ static int qcom_glink_announce_create(struct rpmsg_device *rpdev) __be32 *val = defaults; int size; - if (glink->intentless) + if (glink->intentless || !completion_done(&channel->open_ack)) return 0; prop = of_find_property(np, "qcom,intents", NULL); @@ -1413,7 +1413,7 @@ static int qcom_glink_rx_open(struct qcom_glink *glink, unsigned int rcid, channel->rcid = ret; spin_unlock_irqrestore(&glink->idr_lock, flags); - complete(&channel->open_req); + complete_all(&channel->open_req); if (create_device) { rpdev = kzalloc(sizeof(*rpdev), GFP_KERNEL); -- 2.27.0