From patchwork Sat Oct 8 04:23:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 77373 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp501207qge; Fri, 7 Oct 2016 21:23:27 -0700 (PDT) X-Received: by 10.66.160.72 with SMTP id xi8mr34925485pab.78.1475900607861; Fri, 07 Oct 2016 21:23:27 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qo5si15428502pac.61.2016.10.07.21.23.27; Fri, 07 Oct 2016 21:23:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751297AbcJHEXW (ORCPT + 9 others); Sat, 8 Oct 2016 00:23:22 -0400 Received: from mail-pf0-f170.google.com ([209.85.192.170]:36529 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751119AbcJHEXU (ORCPT ); Sat, 8 Oct 2016 00:23:20 -0400 Received: by mail-pf0-f170.google.com with SMTP id i85so31715405pfa.3 for ; Fri, 07 Oct 2016 21:23:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=XFAsS865dvDEfVxCNLPKtKWZ5YIBjbpdeiWGxp/GQVk=; b=XcL5gchrJz27yKll5MivsljXcReK2QsyQ/CdZlc8uPqr4M7Tfo4lS61fL4uJ4SDMPD 9ohEEGYywPn5bXGJuxTAfO0y/H/FA0tebb2UYXjQZu7h4C9h90HKqT8Lkq2QJv6Zna3q Sg05oidmvjpaeTj1hZtKHSe6Wx50AO6um8M6Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=XFAsS865dvDEfVxCNLPKtKWZ5YIBjbpdeiWGxp/GQVk=; b=NYoirGJHDnRdkvH/tQ0tAPohaCBKwO6QMoFlIAOG6aD7UG6aTKXAL9jMUO0cz1N3Kv xCVspC5z5iuqcPAIDJ6qFI3ZZPkM5IwC3AcUSc70tgbhP4Ji97EL+kvmWo9NHURUe/rw oGR/57aBjLbevokTlwvhUoZzlf1OnmR7WM1nTzpjg4iIZowqe1WnSJMnQk2KPUdQW4a4 bZ+9Wy7sHBjdZ6Np/OEmsUYfGBSNOMrtsO9LpEqjHtIgX8aKRB4gIK15K4fyFcDqj24P v4JAR8gyAJ0wIzKfwm+cvfqPA/X1z7oBNstBp+OdebtE3D6ghESha400bt4gAX9UPIOd YO+A== X-Gm-Message-State: AA6/9RnPMLmLQ2gusKd4feo/ZXOuQWzD/yVwrpNWcoRpGdZB9C3BmJ3Z+YbOb9+jmIt4/na4 X-Received: by 10.98.82.209 with SMTP id g200mr12588946pfb.84.1475900600034; Fri, 07 Oct 2016 21:23:20 -0700 (PDT) Received: from localhost.localdomain (ip68-111-223-48.sd.sd.cox.net. [68.111.223.48]) by smtp.gmail.com with ESMTPSA id t67sm17537506pfd.32.2016.10.07.21.23.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Oct 2016 21:23:18 -0700 (PDT) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Cc: Jonathan Corbet , Linus Walleij , Marek Novak , Matteo Sartori , Michal Simek , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 1/5] rpmsg: smd: Reduce restrictions when finding channel Date: Fri, 7 Oct 2016 21:23:11 -0700 Message-Id: <1475900595-8375-1-git-send-email-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.5.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org SMD channels are created by the remotes in "opening" state, but sometimes as we close and try to reopen them they linger in closing state. Following the search for a matching channel the create_ept() will verify that the channel is in a suitable state, so we can lax the restrictions of the search function to work around above difference in behaviour. Signed-off-by: Bjorn Andersson --- drivers/rpmsg/qcom_smd.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c index 06fef2b4c814..92efa74a0024 100644 --- a/drivers/rpmsg/qcom_smd.c +++ b/drivers/rpmsg/qcom_smd.c @@ -820,20 +820,13 @@ qcom_smd_find_channel(struct qcom_smd_edge *edge, const char *name) struct qcom_smd_channel *channel; struct qcom_smd_channel *ret = NULL; unsigned long flags; - unsigned state; spin_lock_irqsave(&edge->channels_lock, flags); list_for_each_entry(channel, &edge->channels, list) { - if (strcmp(channel->name, name)) - continue; - - state = GET_RX_CHANNEL_INFO(channel, state); - if (state != SMD_CHANNEL_OPENING && - state != SMD_CHANNEL_OPENED) - continue; - - ret = channel; - break; + if (!strcmp(channel->name, name)) { + ret = channel; + break; + } } spin_unlock_irqrestore(&edge->channels_lock, flags);