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=1796424683; b=m83STVpp3WiY6yHeLdmZXYLWmBbiuj5enFIDco/1LSFJMBJj5mjM6oPS1i2iHOsADcKn 8ocKDEkCfw4axA53ZypL2Q0P4zlyfCSk6uJMxdmEPe1hRq+c00ZGN/w906ZyrVqOhAiHV kV+KTlRGRQdiqM7AIIdXEWnZCsOluqEnXgKEgHCN/24nPjLi1aBvyFCSZEJkxcPeso0po BSGQjhzw7A0yCPLE2LI0KfSTF+VfY4TrYeOjRRn0pW7+X+wvEgPDk7jpUpnFOI5aTamWd OsYD8l1i6gppwjvxvVnb6f4U94Te+8ghqzg+0FjkobLjUi4SDafPU5BwhhH2fuSud5Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796424683; 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=lzrWcQCJXVguUEpSW8RSAdvGFu6PnslmyFxxrLETaTg=; b=itVhrfCis3SkHkThfXZRs+YkU0ZvyEvWOiqmoI7iBzP3mAn1v9GV5uLbSKCF2W/PIRYl NmSkahA1wDXafE0LXEdHIIldd2hdVbjyBnASbWi3oqqTjQryH8bvtXBEDqhBNYnyzVGyF /9vP4rGyXHYhfspW4Kwl9JzCusB22HhhEedy9eveRgeJZeP5Gp5q5j2Nrr5sExwRcTuyo D8SEt/qjIOkJZO3i9m5X9NNbfg/w6zrNkzhNq02vVz8rpzSWH0O59iT5psfOFhUaC1cgz bkmPEsRCs1LTxdToensbtnQ1YUAu0HP1yzWYDxZ8YPhq/kt59fGY0Uu0rznk/6SJ0Mw== 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=jwNpdUAe; 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 94F59606A322; Fri, 4 Dec 2026 22:51:23 +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=jwNpdUAe Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5EDC11F00936; Fri, 4 Dec 2026 22:51:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796424683; bh=lzrWcQCJXVguUEpSW8RSAdvGFu6PnslmyFxxrLETaTg=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=jwNpdUAeSFHCfvEyf6U9HT+ZIz+4pj+eHL3j/lDt4P6Dzx+M9pD/EMr12TFN2Beg0 6cnObCGX+tq43H2zsmyjCpuHbz8R6iZ4p+6NC2BKhsDIkXjHyNb/JpPsfd/XlvN7f6 rFx3L+e6+dWF+g3GCmwDDwPkNBlyNkroRMXsR1HrYUH2Wd4OiuTxX73L5L/XOxoK0u P+vfs5G7/rvGc6j2LgrdbnXox27iS3RAKJ/HnhFpAwEKh6pTGuLMjVa8DQpUZ5V1wC XRceOplKW0af7qKhXKc3+db8iX1mxcJWVRe7NsfzLrfMPGKbUJ0KyK0QEM73YDKbyF NK8nmJcM/kSnQ== Date: Fri, 4 Dec 2026 22:51:16 +0000 From: Jonathan Cameron To: "Sabau, Radu bogdan" Cc: Radu Sabau via B4 Relay , "Sa, Nuno" , "Hennerich, Michael" , David Lechner , Andy Shevchenko , Ramona Gradinariu , "linux-iio@vger.kernel.org" , linux , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 6/7] iio: imu: adis16607: Add FIFO-based buffered capture Message-ID: <20261204225116.5d09b60a@jic23-hlaptop> In-Reply-To: References: <20261123-adis-fifo-v1-0-f6ad9e493e19@analog.com> <20261123-adis-fifo-v1-6-f6ad9e493e19@analog.com> <20261128220010.5d1235fe@jic23-hlaptop> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-pc-linux-gnu) X-Mailing-List: linux-kernel@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 On Wed, 2 Dec 2026 11:53:43 +0000 "Sabau, Radu bogdan" wrote: > > -----Original Message----- > > From: Jonathan Cameron > > Sent: Sunday, November 29, 2026 12:00 AM > > ... > > > > + ret = __adis_write_reg_16(adis, ADIS16607_REG_USER_FIFO_CFG, > > > + threshold & ADIS16607_FIFO_THR_MASK); > > > + if (ret) > > > + return ret; > > > + > > > + /* > > > + * The device cannot mask DEV_NOK for us: unrouting it leaves the pin > > > + * on its weak pull-up, which reads as asserted. Mask it on the host. > > > + */ > > > > Ah. This is the comment we need for the earlier patches. Is that generally > > true for all the kfifo supported devices, or should we be using some sort > > of flag to let the adis helper know if this is required? > > It is the same for all of them so far. The adis16475 FIFO variants and this > driver set unmasked_drdy, which adislib uses for parts whose pin cannot > be masked in the device. > The interrupts are level triggered, so nothing is lost while masked on the host. > > The helper relied on this without saying so. In v2 its function comment will > state that it is for such parts, and the commit messages of patches 2 and 4 > will give the reason. > I did not add a device-side path, as there is no FIFO part that can mask in > the device to test it on. > > Would you also like the helper to refuse to set up when unmasked_drdy > is not set? I left it out to avoid code that cannot run today, but it is a > three-line check. If there is no path to it running, then probably not needed. However if you feel it acts as convenient documentation to have the check, then go ahead. > > > > > > + enable_irq(adis->spi->irq); > > > > > > > > + > > > + /* The core's default; the device watermark follows buffer/watermark > > */ > > > + st->fifo_watermark = 1; > > > + > > > st->adis.ops = &adis16607_ops; > > > + /* > > > + * DEV_NOK is the OR of the DIAG_STAT flags and stays high until > > > + * DIAG_STAT is read. Use a level interrupt so a flag raised while it > > > + * is already high is not lost. > > > + */ > > > + st->adis.irq_flag = IRQF_TRIGGER_HIGH; > > For a modern driver explain why we don't get this from the firmware. > > > > No good reason, other than DEV_NOK being active high. > In v2 I will take the type from the interrupt specifier in firmware, falling > back to level high if there is none. For modern driver, don't have that fallback. If firmware is broken we don't generally guess how to fix it. The problem with assuming polarity has always been folk using not gates as cheap level shifters when the sensor and SoC voltages are different. Jonathan >