From patchwork Wed Dec 6 10:12:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 174452 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4005853vqy; Wed, 6 Dec 2023 02:13:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IE7qT4XZ+obXbYqGMifFmWcFSQV/YjI3c/9UqG4y7S7T+pVj6RhLhkuafLkdRF4EBGpiFn5 X-Received: by 2002:a92:d68f:0:b0:35d:6991:a535 with SMTP id p15-20020a92d68f000000b0035d6991a535mr987774iln.30.1701857593741; Wed, 06 Dec 2023 02:13:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701857593; cv=none; d=google.com; s=arc-20160816; b=Lygk5RNxafI6z/tI2sbSrRDs/5kXZXSCoV1sz9nN9A3hYwS7cPAP5q2XA8ZIUcJyrb d9PbwV4zDx7Hpa8sObpRBOI8Au/XzN5kbiofZnwtBPUIM8qSVPjHz5RUwDeujhoS8gZj U4gX8Wtrc5+2oPs/OGTB5lVB4g8VHkTFArCcjTsQ3yIVFrp9OXq57VXw11k1WHS3ZjZO duOaq9hbCGCX2awnOXNCZaCQVKZL5Rw64SoTu71GH8FWHImlISSvQXrRQgjwx1oZ56CM etzAPqIiiO03aQljGbonz4NIRugemBfnqWWs4NlIQ/xgAx5vmuz9lW0REjZX1mgN26kX RW0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=st3yNcNWgRRruLRtw67rBI8I3dsxd5qa7XH85FT91SQ=; fh=6fL1NhFCGI+wAVvsHH1pL+P1muGn2uwGLcwd3RTuFww=; b=XIivaNUw05BYdmJy1NWg1hN6CZm4RmUuBhAKBtTRgov62wnGV+hlrrcU3lLO+2LAo7 LkzfLr84qisH32cJN3++d2b+FVD0MmOXAata7Uhe8JrS4nIaw1Rs/rgxo3yQj1ZPUYTY N8+KBTvR0R/JQ62QrdUX/YnZv8g6RNH0nV4udY0pWNNUTuZvKhujf12OqmoukwNHkDqu +FYCJTWnQXmmPY/xIQh5XUiwIwHW9ugzDp93dxdZNTf4x2T1CFE1DMIclrh76/t5kT6+ L79CR6VlRm79SOXckNEY4SR9ClGfvjxlB6fRMQIvJ8eQDZNrq1imMSCRfOcEL1IP2t66 huNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=cz2haK2O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id r28-20020a635d1c000000b005c219415020si10889174pgb.262.2023.12.06.02.13.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 02:13:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=cz2haK2O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 8C348802F540; Wed, 6 Dec 2023 02:13:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377533AbjLFKNB (ORCPT + 99 others); Wed, 6 Dec 2023 05:13:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377608AbjLFKMv (ORCPT ); Wed, 6 Dec 2023 05:12:51 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67F38D67; Wed, 6 Dec 2023 02:12:57 -0800 (PST) Received: from [127.0.1.1] (91-158-149-209.elisa-laajakaista.fi [91.158.149.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id BEFD21F73; Wed, 6 Dec 2023 11:12:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1701857532; bh=kTEQJAdraKwrzcd8ZJfODsKyAzCts6sPzE51t6mPv5U=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=cz2haK2OD5bPWnsON1BgC7pXGyYxdoSU5/LFsDYGcDMEQKRBpbOa9angdhJunGisq +toHkNLKqCXqRr/o8MhkAPkDmg3jCoKpMCOFqR6oCXzOrWeAgMsvSHH70cTgQ37YaU pRcQOWuWBntCvDjIqAqJ++QzXsF/GYzSy3UJYaOQ= From: Tomi Valkeinen Date: Wed, 06 Dec 2023 12:12:29 +0200 Subject: [PATCH v2 2/4] media: rkisp1: Fix IRQ handler return values MIME-Version: 1.0 Message-Id: <20231206-rkisp-irq-fix-v2-2-6ba4185eeb1f@ideasonboard.com> References: <20231206-rkisp-irq-fix-v2-0-6ba4185eeb1f@ideasonboard.com> In-Reply-To: <20231206-rkisp-irq-fix-v2-0-6ba4185eeb1f@ideasonboard.com> To: Dafna Hirschfeld , Laurent Pinchart , Mauro Carvalho Chehab , Heiko Stuebner , Paul Elder Cc: Alexander Stein , kieran.bingham@ideasonboard.com, umang.jain@ideasonboard.com, aford173@gmail.com, linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1657; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=kTEQJAdraKwrzcd8ZJfODsKyAzCts6sPzE51t6mPv5U=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlcEkhBdljqzcxdBz+n0Wffu84QmzeeRNvsvGC9 cGZSQNUbE+JAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZXBJIQAKCRD6PaqMvJYe 9aUMD/sECwuIEzxXDMinK22ykn6sULYtxlmWoqQFVcpYw+bgJVHt+hioXxZCPYN3ombSxlxQvUP XAf9qCLnbP6ywYh/g2iz/pf2CUJ8lr2vwMgD/mn+krMg3H0RubK5JM2mDdxp4Q/41VR6ETh+el1 /9xu2KTLFtOvjltjNUANLQJr8a16LwuDh8Ah5GtaD/T3qaVx7/ztWxkhCmKMn501fvi1lWHkwb3 6INakLtaDUMWNK33/ves8vzO77xQwemh9VBeh+Si8npZjrUDuui31TZcrdE9J3P66MLC3avRfVx NzE030mRNOv6eYYpXloFk1yCeCDdsSC4hae7M7YUyKPtUy0xnhHb4GFdzI52a3B3uZNp0KumFA6 /WVfNjO1scszA5xbpCUmiQVNTewp4GYp0jIRm39SBqA+M2Bvts2aydSdIGRmlsja2Fm7nGa2upJ V4XOnY+Kd2NI1REQ67usKfmPk5TXUALa9KpqGGeIBYeuFZn37joHclghA7Tjr96hAjmnBqOqILu DsVaqLUsQjaEV/batt9ydgvTYOq97ISZW2gZrmbCoLbxExWCsdL2Q1sNTtijABONT2r5lB3xBJZ dKeb0vSidXxLX4g0Gwon37xOsfFbpPP+lNSem+uVNur/4R7fOWj++2pGUM1k0VxDgLmYh1lGff8 wBMUB02ZqLQ45CQ== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Wed, 06 Dec 2023 02:13:10 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784527028019196322 X-GMAIL-MSGID: 1784527028019196322 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 Reviewed-by: Laurent Pinchart --- drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c index d4950294b7b9..030eb8c79546 100644 --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c @@ -444,17 +444,25 @@ static int rkisp1_entities_register(struct rkisp1_device *rkisp1) static irqreturn_t rkisp1_isr(int irq, void *ctx) { + irqreturn_t ret = IRQ_NONE; + /* * 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 vertical * sync. */ - rkisp1_capture_isr(irq, ctx); - rkisp1_isp_isr(irq, ctx); - rkisp1_csi_isr(irq, ctx); - return IRQ_HANDLED; + if (rkisp1_capture_isr(irq, ctx) == IRQ_HANDLED) + ret = IRQ_HANDLED; + + if (rkisp1_isp_isr(irq, ctx) == IRQ_HANDLED) + ret = IRQ_HANDLED; + + if (rkisp1_csi_isr(irq, ctx) == IRQ_HANDLED) + ret = IRQ_HANDLED; + + return ret; } static const char * const px30_isp_clks[] = {