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: 9367989 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 2057F608A6 for ; Sat, 8 Oct 2016 04:25:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 09FB329781 for ; Sat, 8 Oct 2016 04:25:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4F17298B3; Sat, 8 Oct 2016 04:25:47 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6A721297E3 for ; Sat, 8 Oct 2016 04:25:47 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bsjAp-0001jX-56; Sat, 08 Oct 2016 04:23:47 +0000 Received: from mail-pf0-x230.google.com ([2607:f8b0:400e:c00::230]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bsjAk-0001gk-5k for linux-arm-kernel@lists.infradead.org; Sat, 08 Oct 2016 04:23:43 +0000 Received: by mail-pf0-x230.google.com with SMTP id i85so31715406pfa.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=ZtMNEEoQOkuuqjI09a0/Sw4zUWqozE4E0hj15C5+wQNNdCQgqFvXVc/S12uZW4lN9V Ghbic80I78/ekBymzyysXlhaEr36A5qj7Etx2vWLwQa15aDTi5E0cvBpF2/dchUMmDZx Tx9oklbH2paavi+AXqvExb7dkDAdgV9k2vR6QSiBnrMX7TRd+6ojf8VA5Xtzrqi6Vk0L K40L8TwH9ojzDrz4VeLCwbLnQd4uvMW/DmtYeNS/stEokVAgO0u6n9Gll/BNJh7uWlpX mmOKCbzco8A9E6hkoNfUUTj98ylCYkizYgczj9aI9rD0jE1pzsBbFci41h5aqce6SLnB LRsg== X-Gm-Message-State: AA6/9RlbZJ1KwxK+KBqw4M5XCV4tbOCGmnHDhOw+FKoSEkiShbZHtVvDMQ5FNLbirc19QrnX 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161007_212342_297376_C553836B X-CRM114-Status: GOOD ( 12.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michal Simek , linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org, Linus Walleij , Jonathan Corbet , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Marek Novak , Matteo Sartori , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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);