Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp225823rdb; Tue, 5 Dec 2023 03:58:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IEUDZQ0z/rFg9rCSapgvzgJFqfAnFozrTSTvkec+gIElkVt3Xur5v9EKsQstLIWWSfY7WKr X-Received: by 2002:a05:6a20:3951:b0:18f:5ff3:9b5e with SMTP id r17-20020a056a20395100b0018f5ff39b5emr2502095pzg.94.1701777491686; Tue, 05 Dec 2023 03:58:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701777491; cv=none; d=google.com; s=arc-20160816; b=JaRrLGZHH922m/Hm8UNjdUyOgDC2r7jUezE2zu0MZHt5MveOlD/fWsJd+s0sikhiiX UQG+A/pqTpdShUq0cWbMT2S1laQmOKoE5EAW1Om6xwzEtbJ6F+iQvV20iBSbOiQ1xdad jS2BwSI0XK/0MRqEYBqOOtIcmQI7yBtePS4MLwJtgnBsQQGUosQ7go4nmjulmvb2BSZo TIPzGW9JhIHaqWPySFI5+o2F0KNzqwwU2ay/dcFODohxtvkQDXc513vKl2q2ikcYXzoN HlSNcZhbfTFrAxtUdP+LClCtvMbyBMtXGItKZovnfXSl1DQ4ZRvt7+k3K+DAMNQtBQJA fQXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=WAw5aOcHJcYASQz0eHH4lmIjL4FIKnv8jTkbUdzuwNM=; fh=JgAlsAqiOrWHGJqQRxxZNoq5f6m/xZrHuhGrDUBUzO0=; b=oazv7dipcr5mAZM5LsvuFBm5QKpKDR0OXlqvfz0fnOjZ/JXSYjbT+ETZBR7HB40hkE 8AygbQXKGB78CTZ4XFR27zByj9Hq5dCC6ZOm0Ov8hKByiUUhWvJUihHjY7oXl0TG3dbO wuw+UOBZawqyXC5UgkaSouSukV76pbYQ79D5sehUHGKT+SEDFtG6N/81iJDB5LWa3ccx pPCpSgDaLp4Uf8bk1H9YSRGX+fUuuMNzgJWeZvFgRhM/N0+fftxSvvZBLox4klj6rWeX lhqqNuLnE/MS2DL/orHVQhmS+cJFmjV/QlxZ8XCgDz1J8WwWgG66XgsCoSBDvlnArZWi pGTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="fl0/f1fD"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id oc2-20020a17090b1c0200b00286988cd141si4227853pjb.111.2023.12.05.03.58.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 03:58:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="fl0/f1fD"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 269DD80A41A2; Tue, 5 Dec 2023 03:58:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347050AbjLEL5z (ORCPT + 99 others); Tue, 5 Dec 2023 06:57:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345120AbjLEL5y (ORCPT ); Tue, 5 Dec 2023 06:57:54 -0500 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0C56A7; Tue, 5 Dec 2023 03:58:00 -0800 (PST) Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1d0521554ddso25834435ad.2; Tue, 05 Dec 2023 03:58:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701777480; x=1702382280; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=WAw5aOcHJcYASQz0eHH4lmIjL4FIKnv8jTkbUdzuwNM=; b=fl0/f1fD3kfD69bhtf5c8SYyw+Xcb1D4b1O/n7/7ySQpstv68abbbHJJV3CHyRmRH6 vzP70bT9KRGR6KJPlT9nldFhyYNQwleTSIn2MsOrGwcP4nUeyP8xcs5TqzKPU0ERGHdR mbmUmedX4ZvYBamL5S2VP0qn3GBShT0DiqnDYv3IqqbFrNlRoNNwetxSZoyEYN64QRF0 anU+zNCeumR4iJ4QuXobCzEOI662KNSjgCJnOg77s5MvWz8H8X9KyiINKJox65XrJs4G TxiSyYCBac/F6byzCxBENCZQOGmxtDiOKp61TggC1hmKD6Q/kv1H0/wPraY1iz+CpD38 HExw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701777480; x=1702382280; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WAw5aOcHJcYASQz0eHH4lmIjL4FIKnv8jTkbUdzuwNM=; b=IoBdUVTGfYjfG8KLrd9QQFLuRiiyAiou1fsDqEHT2/UlFdAl9sZbRfyxUOwQ5Wysq0 XOF+ZsV0sHhUo5OdonAQQb+WiuWKXGG8abGakNEEhfDgA6JKr5dIooHFaHK5zRi251QE tBrSJHMuK2QAHJEpcbKfx68krFOAcLSseHwWWI0nuoVlQNHZqx1Zn4Cb4cNy1yhov0ez Qe1NJq5bgSMXLDvDx8PgAHnsppJBYOlJz+osF7qleb2eWDbFWHlr4lh4iq/haRymNK/+ 8em+UVyxZTmYcrojHbHTT+7MZZrlvUcFtHFb+FA2kRlNyiv3brCCm9zrCkNR+/ubuEV/ sxRA== X-Gm-Message-State: AOJu0YxSRzLMKvEVlF/Zj0iTR8xoLAipQ2+DB7RtDXrxiZhZeZao8kKW eNkjKWMdyaCKwXreEQXAfYbmy1Pfl+3uTTCPo26gP5vhgxxV/Q== X-Received: by 2002:a17:90b:1e41:b0:286:d1d6:9a61 with SMTP id pi1-20020a17090b1e4100b00286d1d69a61mr854689pjb.7.1701777480051; Tue, 05 Dec 2023 03:58:00 -0800 (PST) MIME-Version: 1.0 References: <20231205-rkisp-irq-fix-v1-0-f4045c74ba45@ideasonboard.com> <20231205-rkisp-irq-fix-v1-2-f4045c74ba45@ideasonboard.com> In-Reply-To: <20231205-rkisp-irq-fix-v1-2-f4045c74ba45@ideasonboard.com> From: Adam Ford Date: Tue, 5 Dec 2023 05:57:48 -0600 Message-ID: Subject: Re: [PATCH 2/4] media: rkisp1: Fix IRQ handler return values To: Tomi Valkeinen Cc: Dafna Hirschfeld , Laurent Pinchart , Mauro Carvalho Chehab , Heiko Stuebner , Paul Elder , Alexander Stein , kieran.bingham@ideasonboard.com, umang.jain@ideasonboard.com, linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 05 Dec 2023 03:58:09 -0800 (PST) On Tue, Dec 5, 2023 at 2:10=E2=80=AFAM Tomi Valkeinen wrote: > > The IRQ handler rkisp1_isr() calls sub-handlers, all of which returns an > irqreturn_t value, but rkisp1_isr() ignores those values and always > returns IRQ_HANDLED. > > Fix this by collecting the return values, and returning IRQ_HANDLED or > IRQ_NONE as appropriate. > > Signed-off-by: Tomi Valkeinen > --- > drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 18 ++++++++++++++-= --- > 1 file changed, 14 insertions(+), 4 deletions(-) > > diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c b/driver= s/media/platform/rockchip/rkisp1/rkisp1-dev.c > index 76f93614b4cf..1d60f4b8bd09 100644 > --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c > +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c > @@ -445,17 +445,27 @@ static int rkisp1_entities_register(struct rkisp1_d= evice *rkisp1) > > static irqreturn_t rkisp1_isr(int irq, void *ctx) > { > + irqreturn_t ret; > + > /* > * Call rkisp1_capture_isr() first to handle the frame that > * potentially completed using the current frame_sequence number = before > * it is potentially incremented by rkisp1_isp_isr() in the verti= cal > * sync. > */ > - rkisp1_capture_isr(irq, ctx); > - rkisp1_isp_isr(irq, ctx); > - rkisp1_csi_isr(irq, ctx); > > - return IRQ_HANDLED; > + ret =3D IRQ_NONE; > + > + if (rkisp1_capture_isr(irq, ctx) =3D=3D IRQ_HANDLED) > + ret =3D IRQ_HANDLED; > + > + if (rkisp1_isp_isr(irq, ctx) =3D=3D IRQ_HANDLED) > + ret =3D IRQ_HANDLED; > + > + if (rkisp1_csi_isr(irq, ctx) =3D=3D IRQ_HANDLED) > + ret =3D IRQ_HANDLED; > + It seems like we're throwing away the value of ret each time the subsequent if statement is evaluated. Whether or not they return didn't matter before, and the only one that seems using the return code is the last one. Wouldn't it be simpler to use ret =3D rkisp1_capture_isr(irq, ctx), ret =3D rkisp1_isp_isr(irq, ctx) and ret =3D rkisp1_csi_isr(irq, ctx) if we care about the return code? How do you expect this to return if one of the first two don't return IRQ_HANDLED? adam > + return ret; > } > > static const char * const px30_isp_clks[] =3D { > > -- > 2.34.1 >