Message ID | 20221219115725.11992-6-umang.jain@ideasonboard.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2343865wrn; Mon, 19 Dec 2022 04:02:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf7M80s3veFjechuYD3+8B0RkRtCUpa642Q32k3ttHp4TSvOCgxkrbz8dupQj44ckuDSjeVz X-Received: by 2002:a05:6a20:ba8f:b0:ac:7539:389f with SMTP id fb15-20020a056a20ba8f00b000ac7539389fmr45599736pzb.56.1671451369580; Mon, 19 Dec 2022 04:02:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671451369; cv=none; d=google.com; s=arc-20160816; b=bhCxhE2JBmlEred0dMVEvzo1sSb91tg+bWkNnqomcSqyz3uOfv1F+6df7MLVC/OQup Zrj+I1US96oYIJJQPrWy2dJgJ2chJW78lJot//FVbWAe5NP+KhQiasUyBG3z0SSgRyfb K9bv77PhfMJgNlu9Une5tEOljvRjNJ0ZiQnPR/ILbZBXWiSFZ6u2kgW416EVhq3HHHFL UQjp2Vh0pG190jxw2gkzB3MW52bZV2+dGybPEP7l1qp1aPXHxwmNb6Kz3iDnlK3owcKH uJJ51CKwhZLtq5Ldc80zgsj31kKE4g6qr734TyI/In8KuQ36n4MeLTK+sGv2bS7Vjp9q 1ijA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VxSrd0Gob5HmlZLTArfCZXyByBVFCysHJQzuvczuLrQ=; b=tI5YQQUQZtOq/eLqFwx+LUmac4ykPoyY29ZJRiiC76GEN9KNX5EJ7YtILaqnACipy+ 1erXyX/XzzTcoNWXholzDS9pevp/+Qaoo3eOGM5kpBfQjVkWYtM8SBIuspSu9eNRfMB9 qa9acrvyrZiNmZoH+r6nn58P+tlQyeKbm7Hrz6PcO06CYm2M4LTAhWhFXgE5Rq/ieaW1 9pP4xG9tbyDo9lOtk7XKBMkKa7dRGUciQfQBKfMBheWapR1AL3FwO3O/X6o5lhAbpC2y csKIFJ142C792Mv1sjmAe/zefh9H3Let/SPJQ5eQEFEX9G8mzAni0u0i2r4X1OipXnkx pxvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="VJ/3b6+7"; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q18-20020a631f52000000b004791f802befsi10270217pgm.275.2022.12.19.04.02.36; Mon, 19 Dec 2022 04:02:49 -0800 (PST) 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 (test mode) header.i=@ideasonboard.com header.s=mail header.b="VJ/3b6+7"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231773AbiLSL6g (ORCPT <rfc822;peekingduck44@gmail.com> + 99 others); Mon, 19 Dec 2022 06:58:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231690AbiLSL6Q (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 19 Dec 2022 06:58:16 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F9E3F039; Mon, 19 Dec 2022 03:58:15 -0800 (PST) Received: from umang.jainideasonboard.com (unknown [IPv6:2401:4900:1f3e:7d24:3f0:3e81:fb16:ab4d]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id AF18C825; Mon, 19 Dec 2022 12:58:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1671451094; bh=U4AsQkzYd1PDi/2MceWavcKccSKSoRxFVZd5HokQOSM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VJ/3b6+7HMvZn1HMYMUJndDv2VTxgGfZCPJ7bQVANEjCfQopAZxUz/UvTnuXAjsHy KGCQsAn4REpMFKCxVXJUIgvWe124ah8A0GMdfRuOlysHmzm+TA4pxqC9pPlOPEq21w JpKKwvg81MM/K70epa92UL16yF53SVst+ZC2TvT8= From: Umang Jain <umang.jain@ideasonboard.com> To: linux-staging@lists.linux.dev, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Kees Cook <keescook@chromium.org>, Stefan Wahren <stefan.wahren@i2se.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Florian Fainelli <f.fainelli@gmail.com>, Adrien Thierry <athierry@redhat.com>, Dan Carpenter <error27@gmail.com>, Dave Stevenson <dave.stevenson@raspberrypi.com>, Kieran Bingham <kieran.bingham@ideasonboard.com>, Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Umang Jain <umang.jain@ideasonboard.com> Subject: [PATCH v2 5/7] vc04_services: vchiq_arm: Drop VCHIQ_RETRY usage on disconnect Date: Mon, 19 Dec 2022 17:27:23 +0530 Message-Id: <20221219115725.11992-6-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221219115725.11992-1-umang.jain@ideasonboard.com> References: <20221219115725.11992-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752643791552469083?= X-GMAIL-MSGID: =?utf-8?q?1752643791552469083?= |
Series |
staging: vc04_services: Remove custom return values
|
|
Commit Message
Umang Jain
Dec. 19, 2022, 11:57 a.m. UTC
Drop the usage of VCHIQ_RETRY when the vchiq has connection status
VCHIQ_CONNSTATE_DISCONNECTED. Disconnected status will not be valid to
carry on a retry, replace the VCHIQ_RETRY with -ENOTCONN.
This patch removes the usage of vCHIQ_RETRY completely and act as
intermediatory to address the TODO item:
* Get rid of custom function return values
for vc04_services/interface.
Fixes: 71bad7f08641 ("staging: add bcm2708 vchiq driver")
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
---
.../staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
Hi Umang, Am 19.12.22 um 12:57 schrieb Umang Jain: > Drop the usage of VCHIQ_RETRY when the vchiq has connection status > VCHIQ_CONNSTATE_DISCONNECTED. Disconnected status will not be valid to > carry on a retry, replace the VCHIQ_RETRY with -ENOTCONN. > > This patch removes the usage of vCHIQ_RETRY completely and act as > intermediatory to address the TODO item: > * Get rid of custom function return values > for vc04_services/interface. > > Fixes: 71bad7f08641 ("staging: add bcm2708 vchiq driver") please drop this fixes tag since this commit doesn't fix a real issue and also shouldn't be applied to stable. > Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> > --- > .../staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c > index 9c64d5de810e..ddb6d0f4daed 100644 > --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c > +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c > @@ -3641,7 +3641,7 @@ vchiq_loud_error_footer(void) > int vchiq_send_remote_use(struct vchiq_state *state) > { > if (state->conn_state == VCHIQ_CONNSTATE_DISCONNECTED) > - return VCHIQ_RETRY; > + return -ENOTCONN; > > return queue_message(state, NULL, MAKE_REMOTE_USE, NULL, NULL, 0, 0); > } > @@ -3649,7 +3649,7 @@ int vchiq_send_remote_use(struct vchiq_state *state) > int vchiq_send_remote_use_active(struct vchiq_state *state) > { > if (state->conn_state == VCHIQ_CONNSTATE_DISCONNECTED) > - return VCHIQ_RETRY; > + return -ENOTCONN; > > return queue_message(state, NULL, MAKE_REMOTE_USE_ACTIVE, > NULL, NULL, 0, 0);
Hi Stefan, On 12/22/22 4:37 PM, Stefan Wahren wrote: > Hi Umang, > > Am 19.12.22 um 12:57 schrieb Umang Jain: >> Drop the usage of VCHIQ_RETRY when the vchiq has connection status >> VCHIQ_CONNSTATE_DISCONNECTED. Disconnected status will not be valid to >> carry on a retry, replace the VCHIQ_RETRY with -ENOTCONN. >> >> This patch removes the usage of vCHIQ_RETRY completely and act as >> intermediatory to address the TODO item: >> * Get rid of custom function return values >> for vc04_services/interface. >> >> Fixes: 71bad7f08641 ("staging: add bcm2708 vchiq driver") > please drop this fixes tag since this commit doesn't fix a real issue > and also shouldn't be applied to stable. Should I send a v3 of the series with updated commit message or can you drop the tag while applying? Other option would be to send v2.1 --in-reply-to this patch. I am fine with anything as long as it aligns with the merging workflow. Thanks, Umang >> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> >> --- >> .../staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git >> a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c >> b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c >> index 9c64d5de810e..ddb6d0f4daed 100644 >> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c >> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c >> @@ -3641,7 +3641,7 @@ vchiq_loud_error_footer(void) >> int vchiq_send_remote_use(struct vchiq_state *state) >> { >> if (state->conn_state == VCHIQ_CONNSTATE_DISCONNECTED) >> - return VCHIQ_RETRY; >> + return -ENOTCONN; >> return queue_message(state, NULL, MAKE_REMOTE_USE, NULL, >> NULL, 0, 0); >> } >> @@ -3649,7 +3649,7 @@ int vchiq_send_remote_use(struct vchiq_state >> *state) >> int vchiq_send_remote_use_active(struct vchiq_state *state) >> { >> if (state->conn_state == VCHIQ_CONNSTATE_DISCONNECTED) >> - return VCHIQ_RETRY; >> + return -ENOTCONN; >> return queue_message(state, NULL, MAKE_REMOTE_USE_ACTIVE, >> NULL, NULL, 0, 0);
Hi Umang, Am 22.12.22 um 13:04 schrieb Umang Jain: > Hi Stefan, > > On 12/22/22 4:37 PM, Stefan Wahren wrote: >> Hi Umang, >> >> Am 19.12.22 um 12:57 schrieb Umang Jain: >>> Drop the usage of VCHIQ_RETRY when the vchiq has connection status >>> VCHIQ_CONNSTATE_DISCONNECTED. Disconnected status will not be valid to >>> carry on a retry, replace the VCHIQ_RETRY with -ENOTCONN. >>> >>> This patch removes the usage of vCHIQ_RETRY completely and act as >>> intermediatory to address the TODO item: >>> * Get rid of custom function return values >>> for vc04_services/interface. >>> >>> Fixes: 71bad7f08641 ("staging: add bcm2708 vchiq driver") >> please drop this fixes tag since this commit doesn't fix a real issue >> and also shouldn't be applied to stable. > > Should I send a v3 of the series with updated commit message or can > you drop the tag while applying? Greg is the maintainer of staging, so i cannot decide. But i would prefer a v3 with my tested tag added and this fixes tag dropped. Best regards > > Other option would be to send v2.1 --in-reply-to this patch. I am > fine with anything as long as it aligns with the merging workflow. > > Thanks, > Umang >>> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> >>> --- >>> .../staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 4 ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git >>> a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c >>> b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c >>> index 9c64d5de810e..ddb6d0f4daed 100644 >>> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c >>> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c >>> @@ -3641,7 +3641,7 @@ vchiq_loud_error_footer(void) >>> int vchiq_send_remote_use(struct vchiq_state *state) >>> { >>> if (state->conn_state == VCHIQ_CONNSTATE_DISCONNECTED) >>> - return VCHIQ_RETRY; >>> + return -ENOTCONN; >>> return queue_message(state, NULL, MAKE_REMOTE_USE, NULL, >>> NULL, 0, 0); >>> } >>> @@ -3649,7 +3649,7 @@ int vchiq_send_remote_use(struct vchiq_state >>> *state) >>> int vchiq_send_remote_use_active(struct vchiq_state *state) >>> { >>> if (state->conn_state == VCHIQ_CONNSTATE_DISCONNECTED) >>> - return VCHIQ_RETRY; >>> + return -ENOTCONN; >>> return queue_message(state, NULL, MAKE_REMOTE_USE_ACTIVE, >>> NULL, NULL, 0, 0); >
On Thu, Dec 22, 2022 at 12:07:56PM +0100, Stefan Wahren wrote: > Hi Umang, > > Am 19.12.22 um 12:57 schrieb Umang Jain: > > Drop the usage of VCHIQ_RETRY when the vchiq has connection status > > VCHIQ_CONNSTATE_DISCONNECTED. Disconnected status will not be valid to > > carry on a retry, replace the VCHIQ_RETRY with -ENOTCONN. > > > > This patch removes the usage of vCHIQ_RETRY completely and act as > > intermediatory to address the TODO item: > > * Get rid of custom function return values > > for vc04_services/interface. > > > > Fixes: 71bad7f08641 ("staging: add bcm2708 vchiq driver") > please drop this fixes tag since this commit doesn't fix a real issue and > also shouldn't be applied to stable. I asked Umang to add the Fixes tag based on the patch description and based on that it seemed like a behavior change just from looking at the patch. But actually you are right that the fixes tag is not required. The vchiq_send_remote_use() function is never called (dead code). The vchiq_send_remote_use_active() function now returns a mix of custom error codes and negative error codes. (Ugly). The caller only tests for VCHIQ_SUCCESS so this code does not change behavior. I really feel like the commit description needs to be clearer on this. The fixes tag is not really about stable. Stable uses the tag, but the fixes tag is appropriate whenever there is a bug fix. regards, dan carpenter
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c index 9c64d5de810e..ddb6d0f4daed 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c @@ -3641,7 +3641,7 @@ vchiq_loud_error_footer(void) int vchiq_send_remote_use(struct vchiq_state *state) { if (state->conn_state == VCHIQ_CONNSTATE_DISCONNECTED) - return VCHIQ_RETRY; + return -ENOTCONN; return queue_message(state, NULL, MAKE_REMOTE_USE, NULL, NULL, 0, 0); } @@ -3649,7 +3649,7 @@ int vchiq_send_remote_use(struct vchiq_state *state) int vchiq_send_remote_use_active(struct vchiq_state *state) { if (state->conn_state == VCHIQ_CONNSTATE_DISCONNECTED) - return VCHIQ_RETRY; + return -ENOTCONN; return queue_message(state, NULL, MAKE_REMOTE_USE_ACTIVE, NULL, NULL, 0, 0);