Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1228322rwr; Thu, 20 Apr 2023 11:44:47 -0700 (PDT) X-Google-Smtp-Source: AKy350bV428NmgUcUPrMqx9lx+ZN2VDGDJCbMR0TLkaRm7wJasS6mp2NS10KShN/CePxRg88rHDD X-Received: by 2002:a05:6a21:110c:b0:eb:6e43:8e1b with SMTP id oh12-20020a056a21110c00b000eb6e438e1bmr2991821pzb.30.1682016287393; Thu, 20 Apr 2023 11:44:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682016287; cv=none; d=google.com; s=arc-20160816; b=o0A7h3ghcvIwUucAoLHv4lvHpLSsbqHJ2uCCDHa+RC5At1VAIbC8qJ/t3HEnm+T7RX EBB/U3PPCIWYMbHvfy5gu2DTFs7OoybhHv7yyJ/BEgxnSjdMmlCr6VKgz4mqBhNnrhnF vul1kixwL/PY9xnU3hykMTBf8UXK5fu/KRViULX0ZzGfIBiNwXVVKQx3fA/J80xhJLeS PleJZNzq5ZlWp9Fsq9pv6jjmu5KIcCaO4p57l9m38sFMTrXdAipn40az7rWwjZMWmIWF t/cIHGs1Ea2cmrbGOHMNG5WNUM8Scf1MNddjRaSNOEp43HsJBOx+0tmEHn6dvIlve66D hK8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hnD6GlL2RrT5gEzOV0aWTshVKGmW+jAa0gtvVG/s7g4=; b=M1pCyv7hfPla0E4Y+iBW5BWBjse9TaSCyZ0ouxHi6JxB52vdiVhWT7vP8pH6GaqTt4 Jeevafk/ur/gSdevemh0HwM8s9G1R7DCEQZziGwAWBhE9/vq1tqx1InKrrVe4nj4rcF/ 1ntf5kfK3OorFKXxpb55TDOa24e8D+DdE4IhhGT6h8tkml5O9fjygUb+TTE3d5p8gtT8 SktNBvu/yMsLugzjCDIqEpLU/hNnPuL/wVofX+SgqPMWdakyBkxaaGjJb9mFrrBIZIpz YTZEbAPuU+DwvkGuu3wCwv7JJA7YM0VdzeIS77xmqCMcY2IWbk8rFvyrjRHTUGm8RTOo 7KRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="cqMQlb/z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 10-20020a63124a000000b0051f0d0d6359si1692095pgs.118.2023.04.20.11.44.32; Thu, 20 Apr 2023 11:44:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="cqMQlb/z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231465AbjDTSgK (ORCPT + 99 others); Thu, 20 Apr 2023 14:36:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232040AbjDTSgE (ORCPT ); Thu, 20 Apr 2023 14:36:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4A3D35BF; Thu, 20 Apr 2023 11:35:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 192116156F; Thu, 20 Apr 2023 18:34:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C00E7C433EF; Thu, 20 Apr 2023 18:34:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682015682; bh=jKr+iaLUp9CiJCCDhMqaQKsER/qVVoFkcU3AC2cTRmM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cqMQlb/zeWZeOkw/uFCl6i1K+Ji2WSqlh1mcWVweto2DvQnPx6AJJxsemvlHFKLyv NotURfec3mDHO9hahzDnSSZKBVZy5+pJ6GoWI9sncfdNMm/4jdK612fHzGTLnwGVCc 2m8S0isI7nsAftso5fBQIxSbjwS9KQtlxw3bVT/dAXqSkyTMVuNAL5FnNLiHbL00O8 QARyg5e19sJSV2X8jrYBefuLmlF0VG2TGopWxWz2+OCB7Dop2Zc+IcwEnbKFbGEuah V/eMUwWAhpuesd2Qr3Lm5JQTFLxa262ATwzFTqhoR9g5Kpp5LptzaBHKIZSGQpfJE1 WNS+JB5ZHuv1g== Date: Thu, 20 Apr 2023 11:38:11 -0700 From: Bjorn Andersson To: Sarannya S Cc: quic_bjorande@quicinc.com, arnaud.pouliquen@foss.st.com, swboyd@chromium.org, quic_clew@quicinc.com, mathieu.poirier@linaro.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, Deepak Kumar Singh Subject: Re: [PATCH V6 3/3] rpmsg: char: Add RPMSG GET/SET FLOWCONTROL IOCTL support Message-ID: <20230420183811.oujn5eqsnqug3u4a@ripper> References: <1681971690-28858-1-git-send-email-quic_sarannya@quicinc.com> <1681971690-28858-4-git-send-email-quic_sarannya@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1681971690-28858-4-git-send-email-quic_sarannya@quicinc.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 20, 2023 at 11:51:29AM +0530, Sarannya S wrote: > diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c [..] > @@ -297,14 +317,31 @@ static long rpmsg_eptdev_ioctl(struct file *fp, unsigned int cmd, > { > struct rpmsg_eptdev *eptdev = fp->private_data; > > - if (cmd != RPMSG_DESTROY_EPT_IOCTL) > - return -EINVAL; > + bool set; > + int ret; > > - /* Don't allow to destroy a default endpoint. */ > - if (eptdev->default_ept) > - return -EINVAL; > + switch (cmd) { > + case RPMSG_GET_OUTGOING_FLOWCONTROL: > + eptdev->remote_flow_updated = false; > + ret = put_user(eptdev->remote_flow, (int __user *)arg); > + break; > + case RPMSG_SET_INCOMING_FLOWCONTROL: > + set = !!arg; > + ret = rpmsg_set_flow_control(eptdev->ept, set, 0); The last parameter should be eptdev->chinfo.dst. Regards, Bjorn