Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp847775ybk; Wed, 13 May 2020 14:58:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxN28bPF6XkVBbT/hzPXpifz2/6mIfrPe4bfTw4GoAtjMEeBOVUn8D9EEU/5ew5KM3E/F8o X-Received: by 2002:a17:906:3607:: with SMTP id q7mr1013915ejb.81.1589407085687; Wed, 13 May 2020 14:58:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589407085; cv=none; d=google.com; s=arc-20160816; b=fbc0uMgbKh0+ggDHxE/1uKZvdGYzuyLcYea2PCl9fdCPzo5p4Ksv1MS75IE9SRHD/b 7ufDQdSeoo/cj5fh4tF5nVQfm7zDt+jqO6KT9n+7ZtNZFZm+qS07ijgGTpzRGYZc2tT/ CKrW5vuDQJvByNwDKiqX0izrW30qV859T6E5vuuu+RCwdSECp5DSlrorz/ikc4SwyhsJ sW09TuSxlmiYHz/GmWI9bdpPjoMeLzHumY7BlCmjzSPuDzPmheCPjNC0+YWm4A8iNArF ZawQPi0Anl1PqczQB6ZrR1bT0nr75weTv5vZxSCKEAjGnwiVN6oLtVlAY/BPJJoyRXQY 35WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=URXKt/CtJiUnLhAXRhzn7WHXaaovZqdso8oMCz+GR2c=; b=I7vDrmp8N5CttHrVdEfECmsEVvRU1bm5lTTpV7A/QJdUNh4SHGXzKg6f/nhmU6ie0h XX3weKbsAmtEPaCoKCH3F2gzcYNn5i65bg5TKE0AJr2j7nCVJLIOtTH2UM7HxWUMriTF HrnBUjKuzwAw63uTR753rGQvJWQPW3QtBXE04zy47548558sYuQCr1Dno2B8AiBpk2h9 wtGj8xa06k0+Opy33cP+Zdc4zGXCgN8MAUcRX0eFpGbrFkds26OwZ8LF/v6YGNRWG4yw h18a+coAuUnuQSdNMIHtSMJlC7nP4L+rQA4OjgAEqEG9pRhfR212xFC6KjO7ZSKrmuR1 rRAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zgg3uSPY; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pk16si614321ejb.310.2020.05.13.14.57.41; Wed, 13 May 2020 14:58:05 -0700 (PDT) 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=@linaro.org header.s=google header.b=zgg3uSPY; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729948AbgEMV4O (ORCPT + 99 others); Wed, 13 May 2020 17:56:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729487AbgEMV4O (ORCPT ); Wed, 13 May 2020 17:56:14 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A35F4C061A0C for ; Wed, 13 May 2020 14:56:12 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id s69so3378962pjb.4 for ; Wed, 13 May 2020 14:56:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=URXKt/CtJiUnLhAXRhzn7WHXaaovZqdso8oMCz+GR2c=; b=zgg3uSPYjx1Fq9SF/NJZDBOu6PaZKWswvNlnYpfhfyOpMHs9QgxJblQ9SHH8w4SVTm U/j8SreK901TGCI8VLZe+cGqfFACPgDBgsFNopQ6IwqhF0IGJlDwWt28aZCXIRLHhV2x vGCe2fw3s0+OSJ931/VrF+xGe/D1G4Mu+Q3175i9r/udCjesuDuaEWCHLlw4srYQ47+p wQodfH6T46WwVYrSeeva9WEM7EAc8UE64FUDcZ5lurlWEXPtrB5JiLHgSI1uOj7xhpoR zZalj0FxzE0WLn62TQJhBirmicHXekBH1wLvNpHuHHRl8xSfazqCZmDTTVBbex0zdZlN pr+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=URXKt/CtJiUnLhAXRhzn7WHXaaovZqdso8oMCz+GR2c=; b=ip8LcuEmunovghHgJ7VxhT8QKu8kgh3qRt0YAEky7uuNDfa/hIWXr+kiMqlcpmwdrf FiQnArnxK6UIrPZAO6N0b9VaV0nFB72eQb4+aeaMLgF+g/8qb9pvpmucLxFGFEFTjST6 GUGGyb+60LQiTsQMN7/vjlOReCOZmESJIikWRrLYcZM4G78VmXjcQ4ltIRp5qt4XHuKW X+yA2LJSyq6ejNqxPXcqvrrNaHY8f9bbzusEONX9+jC09AjGr2W/ModJa8WOdkHl8U/r ZlId+vh0ktCXpy5ZPEdsLs3oKZxIkL58RZZ3Hktp43VVGnog9xNcrsxgwZSkVlSVm0wa WDkg== X-Gm-Message-State: AGi0Pua+HjgRZ1o623YA/HcN9tUIJfw0HD43cEEDAkJ/uQ8TsEZZJJkw EurZNjJtjnren/bvjZpkjMIdzA== X-Received: by 2002:a17:90a:d3cc:: with SMTP id d12mr37699942pjw.158.1589406972131; Wed, 13 May 2020 14:56:12 -0700 (PDT) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id b24sm475244pfi.4.2020.05.13.14.56.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2020 14:56:11 -0700 (PDT) Date: Wed, 13 May 2020 15:56:09 -0600 From: Mathieu Poirier To: Arun Kumar Neelakantam Cc: ohad@wizery.com, bjorn.andersson@linaro.org, clew@codeaurora.org, sricharan@codeaurora.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Gross , "open list:ARM/QUALCOMM SUPPORT" Subject: Re: [PATCH V5 3/5] rpmsg: glink: Add support for rpmsg glink chrdev Message-ID: <20200513215609.GB8328@xps15> References: <1589346606-15046-1-git-send-email-aneela@codeaurora.org> <1589346606-15046-4-git-send-email-aneela@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1589346606-15046-4-git-send-email-aneela@codeaurora.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 13, 2020 at 10:40:04AM +0530, Arun Kumar Neelakantam wrote: > 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 604f11f..3a7f87c 100644 > --- a/drivers/rpmsg/qcom_glink_native.c > +++ b/drivers/rpmsg/qcom_glink_native.c > @@ -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)) Please move this to patch 01. > return 0; > > prop = of_find_property(np, "qcom,intents", NULL); > @@ -1574,6 +1574,40 @@ static void qcom_glink_cancel_rx_work(struct qcom_glink *glink) > kfree(dcmd); > } > > +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, > @@ -1633,6 +1667,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); > -- > 2.7.4