From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795911457; b=L3fA+ktxw6KL6Mw6hhz5sWQ1WBq6o+UyQWaQlZP4XCKzIdorLYVK3MsDguhaMpQ0Kk0H IUGkiORfuLbannyOz5xahL/ma1OrWyk6Mtsd1mDssB6gQPetwhwoZcYq4fhMOa/WVNGJ6 WbcrKXIGn7Nq7d1fdAHil79fpJ6NhYrjNGCVHVM2P/sauaKyThc9Yzsofd6I61jdlmkzA 36/P4ehn4BXhZ2DFzwrkfoWyElaSRMVE7Rr7O1/xRtHl2AmDK+cPQMF0EAf1ukzrp6Tkh JHZuMDyk55tXWwSTzpujdyHdDBkoRoXYYVFsOKgkRd9H66Qv0UQOH1CpO5oytcYmz9g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795911457; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: In-Reply-To:References:X-Mailer:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=58Q2CXnEehdWWSeVyK0SxqmriMjpk1GXU7lID1D4GZM=; b=CzXpOqfervbu97TbLha7RPi/oE+i0ekOtvy7MRuMU4bGjwZ9prYWxcOQRNsDYEoNSRrJ 33mVSWI5T8kq9SPU3ur4QK1/SSHVyxLHhEKXdcXStN54CryZLro3G2NDCwnWkaPyya6Ln O8G3ASoXuoKM8rBq58nDWGreVzaHXfiMky61FBU7a8zYE5wwXCglGXtLo6I4wCfzdUYa6 cXI+yhOr+eZ0qNEOU7iG/NpYlWrIB0/2vA7BsZETLq/UDqyHUHqjj/4l62kqbHk/rR1Dq NQ8rIrClDScvExiO7vmWBvhRp5DtIbwTufhgwg6RlZQkX5D1ssFLXHcTkJlfSaERiOw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=buxbJhlf; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1DEC9606A31C; Sun, 29 Nov 2026 00:17:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=buxbJhlf 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-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > > > + 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 >