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: 9367957 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BCB3960487 for ; Sat, 8 Oct 2016 04:23:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D51B29897 for ; Sat, 8 Oct 2016 04:23:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 69A82298AD; Sat, 8 Oct 2016 04:23:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A06B29897 for ; Sat, 8 Oct 2016 04:23:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751404AbcJHEXW (ORCPT ); Sat, 8 Oct 2016 00:23:22 -0400 Received: from mail-pf0-f181.google.com ([209.85.192.181]:32823 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751211AbcJHEXU (ORCPT ); Sat, 8 Oct 2016 00:23:20 -0400 Received: by mail-pf0-f181.google.com with SMTP id 190so31821483pfv.0 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=cRm08t7v9eUnWv2BupYLSE2wy3xPIO5f4eTDSrXjbGcdUpjrX7t/WLUEMKZT8HYcaP uhNMG9wmI7GNquY9BP2P9gd7RjQS0B6uVZY9yr52LGTQWTR7OSSbNhDdwiHvKZHLRBB/ c4IHcPmYfJfw4l9ig8RoC3L5scWXQ+ZlnQy5Wt6DzdTKYKV/pPImfUEJ2gWpD08yJ9uQ kfYKe31sPpafPO6nsagRhrIXil7yB0H2/lKQyfSMzjUI6A+dQjRSzMrvCY/YgPOhVvly 3h/WS57PWM6AyFAngvYLplxYpXKS5+IQd7AqJCd+srLQEQig+OOUjdoUyYs/wYYqWuKp WenA== X-Gm-Message-State: AA6/9RkFmnKUSj7g7r3m9IGC7GP18+s2IV8XT0ONuhkSnfo3tWAAqkLcxJmH783JsXUMwrmn 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-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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);