From patchwork Fri Jul 27 12:17:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Kumar Neelakantam X-Patchwork-Id: 10547045 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 22E931751 for ; Fri, 27 Jul 2018 12:19:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 116052B852 for ; Fri, 27 Jul 2018 12:19:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 05AC72B858; Fri, 27 Jul 2018 12:19:27 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,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 A6FEA2B85A for ; Fri, 27 Jul 2018 12:19:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388498AbeG0NkA (ORCPT ); Fri, 27 Jul 2018 09:40:00 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:45270 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731020AbeG0Nj7 (ORCPT ); Fri, 27 Jul 2018 09:39:59 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 55EA260B7A; Fri, 27 Jul 2018 12:18:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532693899; bh=5FCC/tSqbFiWCwdfdm3rxP2znqlVaTi97Gj5xIu+aUs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CsLPRizkeAioQ1su++5fhs2mwmLvLrG+HTtxjCYEx0lDTOOaixNb7pna0vBnzsVed iovoq5xMkxkOV1c6G57HwdIA7K+b/LW3zkZhUvboz5hke0xgdYWxcS2iLXJ8lOfxSp 3lUVQ7a3YCz8sjVLchUOHmVuXa/RxDW/bWqvr+YA= Received: from aneelaka-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: aneela@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3B02D607B9; Fri, 27 Jul 2018 12:18:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532693898; bh=5FCC/tSqbFiWCwdfdm3rxP2znqlVaTi97Gj5xIu+aUs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X35p2oBJ9G2k6enCh/AVkji9Ttac+xShEbzcXr+cur8G7CxmTk67wWDIuwrVLdaLE Q+oJ/KnFfyyl5EXrwKQ9ZmkviGoFGQy9S0J5LHQr8Ak0NhKdBEnC9wUl8l4wq2TfJ7 J1ExKCi2WNI2LgWaVHNotq+jX7HEQBIDtwgedx8s= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3B02D607B9 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=aneela@codeaurora.org From: Arun Kumar Neelakantam To: ohad@wizery.com, bjorn.andersson@linaro.org, clew@codeaurora.org, robh+dt@kernel.org, arnaud.pouliquen@st.com, andy.gross@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Arun Kumar Neelakantam , David Brown , Mark Rutland , linux-arm-msm@vger.kernel.org (open list:ARM/QUALCOMM SUPPORT), linux-soc@vger.kernel.org (open list:ARM/QUALCOMM SUPPORT), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS) Subject: [PATCH V4 1/9] dt-bindings: soc: qcom: Add label for GLINK bindings Date: Fri, 27 Jul 2018 17:47:21 +0530 Message-Id: <1532693849-7037-2-git-send-email-aneela@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1532693849-7037-1-git-send-email-aneela@codeaurora.org> References: <1532693849-7037-1-git-send-email-aneela@codeaurora.org> 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 From: Chris Lew There are GLINK clients who open the same channel on multiple GLINK links. These clients need a way to distinguish which remoteproc they are communicating to. Add a label property to identify the edge this node represents. Signed-off-by: Chris Lew Signed-off-by: Arun Kumar Neelakantam Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt b/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt index 9663cab..0b8cc53 100644 --- a/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt @@ -10,6 +10,11 @@ edge. Value type: Definition: must be "qcom,glink-rpm" +- label: + Usage: optional + Value type: + Definition: should specify the subsystem name this edge corresponds to. + - interrupts: Usage: required Value type: From patchwork Fri Jul 27 12:17:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Kumar Neelakantam X-Patchwork-Id: 10547025 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 59F1C1822 for ; Fri, 27 Jul 2018 12:18:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 48B722B84D for ; Fri, 27 Jul 2018 12:18:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C2E72B852; Fri, 27 Jul 2018 12:18:36 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,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 C6A9B2B84D for ; Fri, 27 Jul 2018 12:18:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730575AbeG0NkJ (ORCPT ); Fri, 27 Jul 2018 09:40:09 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:45650 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730488AbeG0NkJ (ORCPT ); Fri, 27 Jul 2018 09:40:09 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 128C160B7B; Fri, 27 Jul 2018 12:18:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532693909; bh=/iwPFhzuTR1EhsAi4MUmkQ7Y2gHk8p8sHDiMTnBzjxk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FFb1RxZeeKnGPOxfvtKmjLsZJ2DgJChT+uboZvpCWSIwOr1OPb0fQh7/4CbOi3QFC NJsTklDVBDTo9fhix9/Hnp5oetEfF97ukb+0H6M4DKkW0Kf2iFIQttAjQhxtHkoZFL +QeRcCuypb8TMG6BclgnvFy7kfiLm4AEW8evYdeQ= Received: from aneelaka-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: aneela@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 8F07D605BD; Fri, 27 Jul 2018 12:18:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532693908; bh=/iwPFhzuTR1EhsAi4MUmkQ7Y2gHk8p8sHDiMTnBzjxk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JkOKDKLGA7vhWVJipiPa5gWiX5BVi3kUbdogsUXkap0jAoy5B/xCJBZvv8Kp6hw19 GV0QuVTOMoBB+IdEN9yQa6+058cFfuMwS7BLdMQh+8+xeaGiiNh/eUcmG0N7pYoqu4 WkpXTPqQhQBxH4H/UcLpE92CI+JAeq7VLs+Cv7Q0= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 8F07D605BD Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=aneela@codeaurora.org From: Arun Kumar Neelakantam To: ohad@wizery.com, bjorn.andersson@linaro.org, clew@codeaurora.org, robh+dt@kernel.org, arnaud.pouliquen@st.com, andy.gross@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Arun Kumar Neelakantam Subject: [PATCH V4 2/9] rpmsg: glink: Store edge name for glink device Date: Fri, 27 Jul 2018 17:47:22 +0530 Message-Id: <1532693849-7037-3-git-send-email-aneela@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1532693849-7037-1-git-send-email-aneela@codeaurora.org> References: <1532693849-7037-1-git-send-email-aneela@codeaurora.org> 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 From: Chris Lew Channels may need to identify the edge their channel was probed for. Store the edge name by reading the label property from device tree or default to the node name. Signed-off-by: Chris Lew Signed-off-by: Arun Kumar Neelakantam --- drivers/rpmsg/qcom_glink_native.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c index f505f58..22a3cac 100644 --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -93,6 +93,8 @@ struct glink_core_rx_intent { struct qcom_glink { struct device *dev; + const char *name; + struct mbox_client mbox_client; struct mbox_chan *mbox_chan; @@ -1572,6 +1574,10 @@ struct qcom_glink *qcom_glink_native_probe(struct device *dev, idr_init(&glink->lcids); idr_init(&glink->rcids); + ret = of_property_read_string(dev->of_node, "label", &glink->name); + if (ret < 0) + glink->name = dev->of_node->name; + glink->mbox_client.dev = dev; glink->mbox_client.knows_txdone = true; glink->mbox_chan = mbox_request_channel(&glink->mbox_client, 0); From patchwork Fri Jul 27 12:17:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Kumar Neelakantam X-Patchwork-Id: 10547043 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 498791751 for ; Fri, 27 Jul 2018 12:19:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38A2C2B852 for ; Fri, 27 Jul 2018 12:19:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2CB752B859; Fri, 27 Jul 2018 12:19:26 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,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 CF9572B852 for ; Fri, 27 Jul 2018 12:19:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730784AbeG0NkP (ORCPT ); Fri, 27 Jul 2018 09:40:15 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:45894 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730488AbeG0NkP (ORCPT ); Fri, 27 Jul 2018 09:40:15 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id BDC2C6085F; Fri, 27 Jul 2018 12:18:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532693914; bh=a0tfnI0doOCjNvfCw741371JJr81Y5dLABlWTH4KQxk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RId7ecU2ZKQhpIMU/KTo5Uj88DzKVZZZqEUQd44UANlke+hBC1t6QdNvQ1TxN3NbY 7SkkWMOjU0XSfGV2BuabI2jzWljhD2xxdPkM3/pOmxB/6g3j9BSCtxmnMtYFTVrZft gmiNipooMiaj0WHtQIEa4wXYmFgrSccAE2mHviMo= Received: from aneelaka-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: aneela@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4E2B560B7A; Fri, 27 Jul 2018 12:18:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532693914; bh=a0tfnI0doOCjNvfCw741371JJr81Y5dLABlWTH4KQxk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RId7ecU2ZKQhpIMU/KTo5Uj88DzKVZZZqEUQd44UANlke+hBC1t6QdNvQ1TxN3NbY 7SkkWMOjU0XSfGV2BuabI2jzWljhD2xxdPkM3/pOmxB/6g3j9BSCtxmnMtYFTVrZft gmiNipooMiaj0WHtQIEa4wXYmFgrSccAE2mHviMo= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4E2B560B7A Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=aneela@codeaurora.org From: Arun Kumar Neelakantam To: ohad@wizery.com, bjorn.andersson@linaro.org, clew@codeaurora.org, robh+dt@kernel.org, arnaud.pouliquen@st.com, andy.gross@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Arun Kumar Neelakantam Subject: [PATCH V4 3/9] rpmsg: glink: Use complete_all for open states Date: Fri, 27 Jul 2018 17:47:23 +0530 Message-Id: <1532693849-7037-4-git-send-email-aneela@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1532693849-7037-1-git-send-email-aneela@codeaurora.org> References: <1532693849-7037-1-git-send-email-aneela@codeaurora.org> 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 From: Chris Lew 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 --- drivers/rpmsg/qcom_glink_native.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c index 22a3cac..f43341d 100644 --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -949,7 +949,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; } @@ -1393,7 +1393,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); From patchwork Fri Jul 27 12:17:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Kumar Neelakantam X-Patchwork-Id: 10547027 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A50DF1751 for ; Fri, 27 Jul 2018 12:18:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 956342B84D for ; Fri, 27 Jul 2018 12:18:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89BE52B852; Fri, 27 Jul 2018 12:18:40 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,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 3763C2B84D for ; Fri, 27 Jul 2018 12:18:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388626AbeG0NkT (ORCPT ); Fri, 27 Jul 2018 09:40:19 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:46054 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730488AbeG0NkS (ORCPT ); Fri, 27 Jul 2018 09:40:18 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 3FB7560B7E; Fri, 27 Jul 2018 12:18:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532693918; bh=BY/aSkH9MI7NgUAIsPWv/6I20fPzcHPW17eOSShBZ8Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P6vtYGRNCpTxUXnBCKfghNj3aRSk59pRSezjkdKJRq3lmb+VW1Zv4FCIy4yC3veh5 38qwcVc9dx8KVC4K11wrzmCGURfGPLnUNvRUkGPcTMvj8uRzTAj2s7SIDea99nvja9 Pukctgh5vwVZPRKqSK4biSupc6QK9QASu3bqq49Y= Received: from aneelaka-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: aneela@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0650360B7B; Fri, 27 Jul 2018 12:18:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532693918; bh=BY/aSkH9MI7NgUAIsPWv/6I20fPzcHPW17eOSShBZ8Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P6vtYGRNCpTxUXnBCKfghNj3aRSk59pRSezjkdKJRq3lmb+VW1Zv4FCIy4yC3veh5 38qwcVc9dx8KVC4K11wrzmCGURfGPLnUNvRUkGPcTMvj8uRzTAj2s7SIDea99nvja9 Pukctgh5vwVZPRKqSK4biSupc6QK9QASu3bqq49Y= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0650360B7B Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=aneela@codeaurora.org From: Arun Kumar Neelakantam To: ohad@wizery.com, bjorn.andersson@linaro.org, clew@codeaurora.org, robh+dt@kernel.org, arnaud.pouliquen@st.com, andy.gross@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Arun Kumar Neelakantam Subject: [PATCH V4 4/9] rpmsg: Guard against null endpoint ops in destroy Date: Fri, 27 Jul 2018 17:47:24 +0530 Message-Id: <1532693849-7037-5-git-send-email-aneela@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1532693849-7037-1-git-send-email-aneela@codeaurora.org> References: <1532693849-7037-1-git-send-email-aneela@codeaurora.org> 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 From: Chris Lew In RPMSG GLINK the chrdev device will allocate an ept as part of the rpdev creation. This device will not register endpoint ops even though it has an allocated ept. Protect against the case where the device is being destroyed. Signed-off-by: Chris Lew Signed-off-by: Arun Kumar Neelakantam --- drivers/rpmsg/rpmsg_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c index b714a54..0860328 100644 --- a/drivers/rpmsg/rpmsg_core.c +++ b/drivers/rpmsg/rpmsg_core.c @@ -80,7 +80,7 @@ struct rpmsg_endpoint *rpmsg_create_ept(struct rpmsg_device *rpdev, */ void rpmsg_destroy_ept(struct rpmsg_endpoint *ept) { - if (ept) + if (ept && ept->ops) ept->ops->destroy_ept(ept); } EXPORT_SYMBOL(rpmsg_destroy_ept); From patchwork Fri Jul 27 12:17:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Kumar Neelakantam X-Patchwork-Id: 10547039 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CD4631822 for ; Fri, 27 Jul 2018 12:19:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B9DBE2B852 for ; Fri, 27 Jul 2018 12:19:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AAC602B858; Fri, 27 Jul 2018 12:19:16 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,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 4CA542B85A for ; Fri, 27 Jul 2018 12:19:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730866AbeG0NkX (ORCPT ); Fri, 27 Jul 2018 09:40:23 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:46266 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730488AbeG0NkW (ORCPT ); Fri, 27 Jul 2018 09:40:22 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 0115D60B11; Fri, 27 Jul 2018 12:18:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532693922; bh=gciUH9DwatZcOHGV9vSkKlvuQIZMiKJWEmVVfrbJ+xk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZnMh6orsCkJlL1sjTuN3CMlNCNk9pwfz2PM79KUjBApDq4vwxvUH4SoNjzhd90rxt Mih/Tn980IdlazPqhnBOg8PznDf5XcgPxGRWaZrtl5ubkln/pTlo4yCwsO9FYgEyUL vjy31KTOJGyyIIP6/00iPxX4TXRAElBGd4jBJxDg= Received: from aneelaka-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: aneela@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id AED9C60B83; Fri, 27 Jul 2018 12:18:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532693921; bh=gciUH9DwatZcOHGV9vSkKlvuQIZMiKJWEmVVfrbJ+xk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZbEV8k2xGbo3VbfeWiFQsM+UjHNTpqxC0ZsgBx316SsjeBmWJO5HMnhZH9N8+jxm8 UdCPD1bgNZ6Ya2jHgYb25ZvBCpk7Xq17G7Gs18CDYAODyWidrWofP+VNalWz6omGJd 2Am7QMBAAq1/1D4YJxKIfr5w4DrPHCsXKJSZ1feg= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org AED9C60B83 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=aneela@codeaurora.org From: Arun Kumar Neelakantam To: ohad@wizery.com, bjorn.andersson@linaro.org, clew@codeaurora.org, robh+dt@kernel.org, arnaud.pouliquen@st.com, andy.gross@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Arun Kumar Neelakantam Subject: [PATCH V4 5/9] rpmsg: glink: Add support for rpmsg glink chrdev Date: Fri, 27 Jul 2018 17:47:25 +0530 Message-Id: <1532693849-7037-6-git-send-email-aneela@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1532693849-7037-1-git-send-email-aneela@codeaurora.org> References: <1532693849-7037-1-git-send-email-aneela@codeaurora.org> 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 From: Chris Lew RPMSG provides a char device interface to userspace. Probe the rpmsg chrdev channel to enable the rpmsg_ctrl device creation on glink transports. Signed-off-by: Chris Lew Signed-off-by: Arun Kumar Neelakantam --- drivers/rpmsg/qcom_glink_native.c | 40 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c index f43341d..9f3d026 100644 --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -1158,7 +1158,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); @@ -1544,6 +1544,40 @@ static void qcom_glink_work(struct work_struct *work) } } +static void qcom_glink_device_release(struct device *dev) +{ + struct rpmsg_device *rpdev = to_rpmsg_device(dev); + struct glink_channel *channel = to_glink_channel(rpdev->ept); + + /* Release qcom_glink_alloc_channel() reference */ + kref_put(&channel->refcount, qcom_glink_channel_release); + kfree(rpdev); +} + +static int qcom_glink_create_chrdev(struct qcom_glink *glink) +{ + struct rpmsg_device *rpdev; + struct glink_channel *channel; + + rpdev = kzalloc(sizeof(*rpdev), GFP_KERNEL); + if (!rpdev) + return -ENOMEM; + + channel = qcom_glink_alloc_channel(glink, "rpmsg_chrdev"); + if (IS_ERR(channel)) { + kfree(rpdev); + return PTR_ERR(channel); + } + channel->rpdev = rpdev; + + rpdev->ept = &channel->ept; + rpdev->ops = &glink_device_ops; + rpdev->dev.parent = glink->dev; + rpdev->dev.release = qcom_glink_device_release; + + return rpmsg_chrdev_register_device(rpdev); +} + struct qcom_glink *qcom_glink_native_probe(struct device *dev, unsigned long features, struct qcom_glink_pipe *rx, @@ -1603,6 +1637,10 @@ struct qcom_glink *qcom_glink_native_probe(struct device *dev, if (ret) return ERR_PTR(ret); + ret = qcom_glink_create_chrdev(glink); + if (ret) + dev_err(glink->dev, "failed to register chrdev\n"); + return glink; } EXPORT_SYMBOL_GPL(qcom_glink_native_probe); From patchwork Fri Jul 27 12:17:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Kumar Neelakantam X-Patchwork-Id: 10547037 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4EA8513BB for ; Fri, 27 Jul 2018 12:19:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DC5D2B852 for ; Fri, 27 Jul 2018 12:19:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31CCF2B859; Fri, 27 Jul 2018 12:19:16 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,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 2450D2B852 for ; Fri, 27 Jul 2018 12:19:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730771AbeG0Nk1 (ORCPT ); Fri, 27 Jul 2018 09:40:27 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:46476 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730488AbeG0Nk1 (ORCPT ); Fri, 27 Jul 2018 09:40:27 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 190AA605BD; Fri, 27 Jul 2018 12:18:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532693926; bh=t7Cg7qiQtfy13b26flhqB4okLEiKCjABBkNCklA0/aQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DgKn48psG5Kxmja89ReyxDoOocDE8iqTZjTY/38R8Ye8hNcCo760yOdBSVgDjyfeN 4aVMquU4J9ik77HH/k8fOqPf4pyJYTaHiaiKDeFqiRmWBbuILNuflHo5uXFu2qaJVu AIGa0hdWLs22FnAJhcmfclzZJafRLCGHEU8k3D4s= Received: from aneelaka-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: aneela@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 6611060BB2; Fri, 27 Jul 2018 12:18:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532693925; bh=t7Cg7qiQtfy13b26flhqB4okLEiKCjABBkNCklA0/aQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O2TPcbudKi3+L/DPBj3AiI4yBDsE6unGSheP7OS7GcdNjRNq+S91HKnRG0BZaxlUU c2zHTEjFDaw2OhpkbbpJsUoTxXd6o4HaVATnLYBet2y851GoSQhDT1Hck7K6AMi9xu TEjwCnkWI481Yp+BZTFCVaeOV4hUcB0/qpQ15pjE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 6611060BB2 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=aneela@codeaurora.org From: Arun Kumar Neelakantam To: ohad@wizery.com, bjorn.andersson@linaro.org, clew@codeaurora.org, robh+dt@kernel.org, arnaud.pouliquen@st.com, andy.gross@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Arun Kumar Neelakantam Subject: [PATCH V4 6/9] rpmsg: glink: Expose rpmsg name attr for glink Date: Fri, 27 Jul 2018 17:47:26 +0530 Message-Id: <1532693849-7037-7-git-send-email-aneela@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1532693849-7037-1-git-send-email-aneela@codeaurora.org> References: <1532693849-7037-1-git-send-email-aneela@codeaurora.org> 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 From: Chris Lew Expose the name field as an attr so clients listening to uevents for rpmsg can identify the edge the events correspond to. Signed-off-by: Chris Lew Signed-off-by: Arun Kumar Neelakantam --- drivers/rpmsg/qcom_glink_native.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c index 9f3d026..7b4ffa0 100644 --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -1544,6 +1544,26 @@ static void qcom_glink_work(struct work_struct *work) } } +static ssize_t rpmsg_name_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + int ret = 0; + const char *name; + + ret = of_property_read_string(dev->of_node, "label", &name); + if (ret < 0) + name = dev->of_node->name; + + return snprintf(buf, RPMSG_NAME_SIZE, "%s\n", name); +} +static DEVICE_ATTR_RO(rpmsg_name); + +static struct attribute *qcom_glink_attrs[] = { + &dev_attr_rpmsg_name.attr, + NULL +}; +ATTRIBUTE_GROUPS(qcom_glink); + static void qcom_glink_device_release(struct device *dev) { struct rpmsg_device *rpdev = to_rpmsg_device(dev); @@ -1593,6 +1613,12 @@ struct qcom_glink *qcom_glink_native_probe(struct device *dev, return ERR_PTR(-ENOMEM); glink->dev = dev; + glink->dev->groups = qcom_glink_groups; + + ret = device_add_groups(dev, qcom_glink_groups); + if (ret) + dev_err(dev, "failed to add groups\n"); + glink->tx_pipe = tx; glink->rx_pipe = rx; From patchwork Fri Jul 27 12:17:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Kumar Neelakantam X-Patchwork-Id: 10547035 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A84EC13BB for ; Fri, 27 Jul 2018 12:19:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 971D72B84D for ; Fri, 27 Jul 2018 12:19:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B6712B852; Fri, 27 Jul 2018 12:19:11 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,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 2CEF52B84D for ; Fri, 27 Jul 2018 12:19:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388675AbeG0Nka (ORCPT ); Fri, 27 Jul 2018 09:40:30 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:46620 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732143AbeG0Nka (ORCPT ); Fri, 27 Jul 2018 09:40:30 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 70F2160B77; Fri, 27 Jul 2018 12:18:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532693929; bh=xuUWBr8dcM/MN5c95jbBMCh+7xN/ZW9Hqky4oSm3rnA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JRzTONZaVjTpZR1mZI4efBKFcsXSs4AbGtdVcMv5dW2fjMsuDJpsqTs/kzvhCy/Ve UZV0EpQ0ztu52FLdvakxC+WOvNedkTXCl2UQhYqPVexQ6mlWYAcyzhq1ddZu1WpaxI 3zNKPz6TwYsE2L5qwvb7QRE0uYiBPjvi8x2uhSrA= Received: from aneelaka-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: aneela@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 1BAE660B62; Fri, 27 Jul 2018 12:18:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532693929; bh=xuUWBr8dcM/MN5c95jbBMCh+7xN/ZW9Hqky4oSm3rnA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JRzTONZaVjTpZR1mZI4efBKFcsXSs4AbGtdVcMv5dW2fjMsuDJpsqTs/kzvhCy/Ve UZV0EpQ0ztu52FLdvakxC+WOvNedkTXCl2UQhYqPVexQ6mlWYAcyzhq1ddZu1WpaxI 3zNKPz6TwYsE2L5qwvb7QRE0uYiBPjvi8x2uhSrA= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 1BAE660B62 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=aneela@codeaurora.org From: Arun Kumar Neelakantam To: ohad@wizery.com, bjorn.andersson@linaro.org, clew@codeaurora.org, robh+dt@kernel.org, arnaud.pouliquen@st.com, andy.gross@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Arun Kumar Neelakantam Subject: [PATCH V4 7/9] rpmsg: glink: Remove chunk size word align warning Date: Fri, 27 Jul 2018 17:47:27 +0530 Message-Id: <1532693849-7037-8-git-send-email-aneela@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1532693849-7037-1-git-send-email-aneela@codeaurora.org> References: <1532693849-7037-1-git-send-email-aneela@codeaurora.org> 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 From: Chris Lew It is possible for the chunk sizes coming from the non RPM remote procs to not be word aligned. Remove the alignment warning and continue to read from the FIFO so execution is not stalled. Signed-off-by: Chris Lew Signed-off-by: Arun Kumar Neelakantam --- drivers/rpmsg/qcom_glink_native.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c index 7b4ffa0..484b427 100644 --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -789,9 +789,6 @@ static int qcom_glink_rx_data(struct qcom_glink *glink, size_t avail) return -EAGAIN; } - if (WARN(chunk_size % 4, "Incoming data must be word aligned\n")) - return -EINVAL; - rcid = le16_to_cpu(hdr.msg.param1); spin_lock_irqsave(&glink->idr_lock, flags); channel = idr_find(&glink->rcids, rcid); From patchwork Fri Jul 27 12:17:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Kumar Neelakantam X-Patchwork-Id: 10547029 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C7BEB13BB for ; Fri, 27 Jul 2018 12:18:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B72C92B84D for ; Fri, 27 Jul 2018 12:18:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB2F62B852; Fri, 27 Jul 2018 12:18:55 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,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 591352B84D for ; Fri, 27 Jul 2018 12:18:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388742AbeG0Nke (ORCPT ); Fri, 27 Jul 2018 09:40:34 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:46848 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732143AbeG0Nke (ORCPT ); Fri, 27 Jul 2018 09:40:34 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8FA8260B7E; Fri, 27 Jul 2018 12:18:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532693933; bh=FcO1Ok20b2p6iYNYOhuNHiYFjhJWKXAtzItFAWI+ubg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YbJ1gWnnCaFy6S0BBTYrSevry3atoKddH3AQ2q/Vwdr1NQ0CZHtIcgVRFOjEvY0BK Zknr8eYC0QJOOxAvvv8CBQB0DVN+Bq2sQuv4xLxEi6D8M0ykJdtNQwHSMmNRkI1qlz aukuAMQDNV/kq6eY8/Cul4vxDoV0FkstfYKoHy8o= Received: from aneelaka-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: aneela@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id C4B6260BB0; Fri, 27 Jul 2018 12:18:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532693932; bh=FcO1Ok20b2p6iYNYOhuNHiYFjhJWKXAtzItFAWI+ubg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HpiLiCAY3/rqdIY9fYdhRv1i1bNj+fR2ptM+m+4IKKasZAuy2tWo92cNoVjCCHOS1 k6yQx4UtXb8lVL67YQ1UtlxG4DI1Zx/x95mtMpECS5RSTekU26gM3MxwAySfZzDvjR y1+jKdZBlx0s2t6TzQiCwEEtULcbatT0mm+s33Lg= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org C4B6260BB0 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=aneela@codeaurora.org From: Arun Kumar Neelakantam To: ohad@wizery.com, bjorn.andersson@linaro.org, clew@codeaurora.org, robh+dt@kernel.org, arnaud.pouliquen@st.com, andy.gross@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Arun Kumar Neelakantam Subject: [PATCH V4 8/9] rpmsg: glink: unregister rpmsg device during endpoint destroy Date: Fri, 27 Jul 2018 17:47:28 +0530 Message-Id: <1532693849-7037-9-git-send-email-aneela@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1532693849-7037-1-git-send-email-aneela@codeaurora.org> References: <1532693849-7037-1-git-send-email-aneela@codeaurora.org> 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 Rpmsg device unregister is not happening if channel close is triggered from local side and causing re-registration of device failures. Unregister rpmsg device for local close in endpoint destroy path. Signed-off-by: Arun Kumar Neelakantam --- drivers/rpmsg/qcom_glink_native.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c index 484b427..d849bc4 100644 --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -1184,6 +1184,7 @@ static void qcom_glink_destroy_ept(struct rpmsg_endpoint *ept) { struct glink_channel *channel = to_glink_channel(ept); struct qcom_glink *glink = channel->glink; + struct rpmsg_channel_info chinfo; unsigned long flags; spin_lock_irqsave(&channel->recv_lock, flags); @@ -1191,6 +1192,13 @@ static void qcom_glink_destroy_ept(struct rpmsg_endpoint *ept) spin_unlock_irqrestore(&channel->recv_lock, flags); /* Decouple the potential rpdev from the channel */ + if (channel->rpdev) { + strncpy(chinfo.name, channel->name, sizeof(chinfo.name)); + chinfo.src = RPMSG_ADDR_ANY; + chinfo.dst = RPMSG_ADDR_ANY; + + rpmsg_unregister_device(glink->dev, &chinfo); + } channel->rpdev = NULL; qcom_glink_send_close_req(glink, channel); @@ -1456,6 +1464,7 @@ static void qcom_glink_rx_close(struct qcom_glink *glink, unsigned int rcid) rpmsg_unregister_device(glink->dev, &chinfo); } + channel->rpdev = NULL; qcom_glink_send_close_ack(glink, channel->rcid); From patchwork Fri Jul 27 12:17:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Kumar Neelakantam X-Patchwork-Id: 10547031 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 77C561751 for ; Fri, 27 Jul 2018 12:18:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 678812B84D for ; Fri, 27 Jul 2018 12:18:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B55C2B852; Fri, 27 Jul 2018 12:18:59 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,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 0BB8B2B84D for ; Fri, 27 Jul 2018 12:18:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388768AbeG0Nki (ORCPT ); Fri, 27 Jul 2018 09:40:38 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:47006 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732143AbeG0Nkh (ORCPT ); Fri, 27 Jul 2018 09:40:37 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 1EDE560B11; Fri, 27 Jul 2018 12:18:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532693937; bh=KO+GwULgWupur0W7x1US4LJMsdqqmKuGODeG47o5+78=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H9JJUKZgBKK1GAqunBtHRkl8XnKHFvpLiodmXoMaUjdqM3rTPVW51k3T6Xe00yRlq J5SgahjiqjFkbrzkQUJDyXFVdOjF7AoD4EfFNlsoLZLh77RGNOuqFpatw9LavvXTVw gWQ/+PEO4LMjZmNSHd29gvrT8smrXPZ1IUyqRHwM= Received: from aneelaka-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: aneela@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 7A6C660B77; Fri, 27 Jul 2018 12:18:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532693936; bh=KO+GwULgWupur0W7x1US4LJMsdqqmKuGODeG47o5+78=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pC78i3eP+6pUVfU+aystxRwuNyHGYpizv4+69F1k/ey4xdV1J7s0j8/xdaJ7odCOa Mj05b6SXeIMPy04qToq8sNYN/Qjb0EhsBxOZfG5YM9C1CiO9u++I8rZCmdRwBCUvtr 8k/BpUC8w4QOqtlp7aTwDbg4dapoL06SaCOk5QeY= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 7A6C660B77 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=aneela@codeaurora.org From: Arun Kumar Neelakantam To: ohad@wizery.com, bjorn.andersson@linaro.org, clew@codeaurora.org, robh+dt@kernel.org, arnaud.pouliquen@st.com, andy.gross@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Arun Kumar Neelakantam Subject: [PATCH V4 9/9] rpmsg: Add compat ioctl for rpmsg char driver Date: Fri, 27 Jul 2018 17:47:29 +0530 Message-Id: <1532693849-7037-10-git-send-email-aneela@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1532693849-7037-1-git-send-email-aneela@codeaurora.org> References: <1532693849-7037-1-git-send-email-aneela@codeaurora.org> 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 Add compat ioctl callback to support 32bit user space applications. Signed-off-by: Arun Kumar Neelakantam --- drivers/rpmsg/rpmsg_char.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c index 76a4477..a76b963 100644 --- a/drivers/rpmsg/rpmsg_char.c +++ b/drivers/rpmsg/rpmsg_char.c @@ -285,6 +285,7 @@ static long rpmsg_eptdev_ioctl(struct file *fp, unsigned int cmd, .write = rpmsg_eptdev_write, .poll = rpmsg_eptdev_poll, .unlocked_ioctl = rpmsg_eptdev_ioctl, + .compat_ioctl = rpmsg_eptdev_ioctl, }; static ssize_t name_show(struct device *dev, struct device_attribute *attr, @@ -445,6 +446,7 @@ static long rpmsg_ctrldev_ioctl(struct file *fp, unsigned int cmd, .open = rpmsg_ctrldev_open, .release = rpmsg_ctrldev_release, .unlocked_ioctl = rpmsg_ctrldev_ioctl, + .compat_ioctl = rpmsg_ctrldev_ioctl, }; static void rpmsg_ctrldev_release_device(struct device *dev)