Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp826300pxb; Tue, 3 Nov 2020 13:38:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJtso71eFPPwJq1oyST7VVRm52F2YG3A++rzVqZ/YVaY+G4uKHQij8RJkZdtYpj3tPEI0b X-Received: by 2002:a17:906:4dc2:: with SMTP id f2mr16284118ejw.446.1604439534792; Tue, 03 Nov 2020 13:38:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604439534; cv=none; d=google.com; s=arc-20160816; b=uMeLjUVqu9RTt8llVIeEZyrLLjua9M2jCbGSlzS7me7+odonwFW2KzwWEuAQIljLXC fMrETDbXtf1TAtqeDwD2FuDkgV4zdNefRwE8BHm6kV2C37UQAznERuinap2lOEnBH1Eu fAkFiW8qBf0K7+lFcRWuTq9T2P+BVzzPbgpUtlhr9OuGqRdW6WzZ49mp4kVsA6I5btA6 Of0m2myRn7j/3OcJxArxZEYpU6tdMvcSdUdJxHpf3t5YlA1VomilS/5tv14/erqLmU5R 8afvIljpQ+f1dY+aYh1DtV6Y1DET4z2ZUDRaHuPFEbUWf4kfU43bKM02T0qwDoX+B7Rx Fu7Q== 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=E9+rs1atKnStHNyIBerGmzFhBIaintUJKDKzGjawTwQ=; b=NpOqYQEJ3tI7uKFV/pxlh7RgC4pRauzy1Koj4upWTmhyb8ijiVlUGyhpVTsXLUcq2m EsKQSbB9v5QXu9fjSgqUbdqVR1uAUHOFl0BN1G35BopaPhjRTKPD6lo+LbQM8QunGWwT w63NuMDUcDJl6zw1/WXB13y8/9PaoUQJtNxdmS7RmGyZaAPhUC/ppF6XJ/r0XZtq5ZcF akcOC24chicPJdMhCQVgHiRDlSyZx3sjHpH4a5ye0G94Y4wjnMNk7cjM8vfKwd60T8iO WxSuhD4/sQenlL8LVTrc5Ik8/dGkzpg9P6hyioKL8YrsHgBAGw5+Yn3nAZFpzdL5heQW S5wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IhtWPFNn; 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 u11si1459907edx.602.2020.11.03.13.38.32; Tue, 03 Nov 2020 13:38:54 -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=IhtWPFNn; 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 S2387516AbgKCVcd (ORCPT + 99 others); Tue, 3 Nov 2020 16:32:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:59238 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731747AbgKCU5G (ORCPT ); Tue, 3 Nov 2020 15:57:06 -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 EDC3822226; Tue, 3 Nov 2020 20:57:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437025; bh=t5kXTdQK7txFZo1R5QjB55qjqO/Gu8zeuSwKuzGDv/U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IhtWPFNnf8qeNSsRvCCKCDMBG3T5QglFm3NH03velaOW+eRuue+n8EAwzeoU7wU6v mo5kVz87IGH0qGfitYP1OhHOXOndXyTLHF0SJDKZc/F7JZW6OR7IbGE6Tcb7VfiPOm akyv37jy8tLIbvJcGD68VSvcr8taLSNhlLOL4yDo= 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 5.4 076/214] rpmsg: glink: Use complete_all for open states Date: Tue, 3 Nov 2020 21:35:24 +0100 Message-Id: <20201103203257.501297125@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203249.448706377@linuxfoundation.org> References: <20201103203249.448706377@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 1995f5b3ea677..d5114abcde197 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