From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A254606A32E for ; Sun, 29 Nov 2026 00:17:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=gpRorwc1; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=buxbJhlf DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=58Q2CXnEehdWWSeVyK0SxqmriMjpk1GXU7lID1D4GZM=; b=gpRorwc1DmTumF BBv4ChrlV3dR9VRNVLl/x7rZIQlzjkzl8gttzmnms5YWFO8Irm18vUVvKIGhz3UFSeaU6OkTQ2D2s xyvFJsqOc8VD7KZ0cifte9Ly1X5tmm3QvFiY/htyz7RyJNLNVPcC3c8UXl3/V6KDUlAG847xaI7pS pZQaZATv9jX6OpEPkHEC/koEhWQvGDlyfh7DgQT5/1vq+W/De3uyAFltXliEDGObG5yf2N1usMcYM eBPWaxR9oaKnuAmhm8sKUg1JLC4cTayqXzIc9ZRKTHskUdn7dk+cXbmrbQOW9nP9D7TcJKC14TRO2 7JjF8JaiGxfIKPqN1tTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXSbr-00000001MSC-3HLE; Sun, 29 Nov 2026 00:17:39 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXSbp-00000001MS6-3nYV for linux-arm-kernel@lists.infradead.org; Sun, 29 Nov 2026 00:17:37 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 01DC8602BE; Sun, 29 Nov 2026 00:17:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9EF151F00898; Sun, 29 Nov 2026 00:17:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795911456; bh=58Q2CXnEehdWWSeVyK0SxqmriMjpk1GXU7lID1D4GZM=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=buxbJhlfSI1NqQbPMjkYLbOAQvUV8lSBBNlzGd0h3crWst1WcVGlLuboB3ezIWtN0 j50Jh5GqRxyyI+CQBZ+xD4zr+mIsJCuT9FQ/uVWvqJPgKNuhEM3cTb0FQm1UFPNZNu UjDFIe9PFKCdXdy40LqVQrNTTZ7lBHgJ/hFFLTB5+L7G+lG0TXL8gQ3f3HZAxE64VU 3JbUMZ2Zbk79zfeOL3AyntOgu+vD058wJABjeUHxDfdVlI2WWamB59ZVvV8nHZXr7a ZHNjPibgLPPv0FRa/hXEDD7ich0PAdKRjeI3Bxmg9loSuPsm2tEEzS4x2STB7Uvam8 qQUGvzjrA9PvQ== Date: Sun, 29 Nov 2026 00:17:28 +0000 From: Jonathan Cameron To: Chi-Wen Weng Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, linux-arm-kernel@lists.infradead.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, chernyakin.victor.j@outlook.com, cwweng@nuvoton.com Subject: Re: [PATCH v5 3/3] iio: adc: Add Nuvoton MA35D1 EADC driver Message-ID: <20261129001728.41b338e1@jic23-hlaptop> In-Reply-To: References: <20261117082832.1551574-1-cwweng.linux@gmail.com> <20261117082832.1551574-4-cwweng.linux@gmail.com> <20261122030647.70b41b61@jic23-hlaptop> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-pc-linux-gnu) X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-7.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 > > > + if (!iio_buffer_enabled(indio_dev)) > > > + return 0; > > > > As above, I'm missing why we need to protect the call > > to resume_triggering. The pollfunc can't change between > > suspend and resume so there is either one there or not > > in both cases and the guards inside that call should take care > > of the rest. If I'm missing something we should look to > > fix it in those calls! > > Agreed. The same uninitialized IRQ concern applies to the resume helper. > > I also noticed that iio_trigger_attach_poll_func() does not clear > pf->irq on its error paths. If request_threaded_irq() or > set_trigger_state() fails, pf->irq can retain a stale positive IRQ > number after the resources have been released. The normal detach path > explicitly resets it to 0. > > The error propagation from iio_trigger_get_irq() was fixed by > dff701806ab6, but these two IRQ state issues remain in v7.4-rc4. > > Would it make sense to initialize pf->irq to 0 in iio_alloc_pollfunc() > and clear it on the attach error paths? Perfect. I'd written exactly that above before reading down to here. Thanks, Jonathan > > I agree that fixing this in the IIO core would be preferable to relying > on driver-specific checks. I haven't reproduced an IRQ failure at > runtime; these findings are based on source inspection. > > Thanks, > Chi-Wen >