From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F6CA280317 for ; Mon, 2 Feb 2026 16:23:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770049381; cv=none; b=tcdXNlH382dj1wp/uBADX3u8QFO0+m5PLfa68Vt6Jsg5at8dVdTCtHBGixhHzaRz/vdkjdWKTPszVPA1dREYwd4U4vfAZVawmycPKn3Viemc9jfrqnyiI3O877rWopFT4E90oSoy+NiI/deJ1SLPmS8bdQQkn1XmTViAskVDICU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770049381; c=relaxed/simple; bh=whkiXr3/OMjQ1P1iaicVGr4ErX3dc8U7Sxj3cGd5hTI=; h=Subject:To:From:Date:Message-ID:MIME-Version:Content-Type; b=lmNy6hpKlf/GdJ8UlCpLHlOIyKJ7rlnYdkXeDEx/pCMMRvZDc85rU0zOAbMTkvsx+VY1NWIqDmx7dJQ6BzkAWjrf5/2Kiuk9ScJYeo7bhKhOaUM4PCf3+Qgv9kS/JJDWc36O3D4EQ6e3cmt+nJktJIEXVB3RH6pT7Jrig3+VC2I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=B71ZvgJG; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="B71ZvgJG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98FB5C116C6; Mon, 2 Feb 2026 16:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1770049381; bh=whkiXr3/OMjQ1P1iaicVGr4ErX3dc8U7Sxj3cGd5hTI=; h=Subject:To:From:Date:From; b=B71ZvgJGFjzVQHWVbtD3J/7ZlWNbuJXNOTcKdCW6KubxkETWZSLWaBK1kIHQHe2P6 AabKw99IVE/kxPmj6E+HNbLEqnf2Vqx8KZ7gUxlXTqmG9wJaDHwPEOyxZCJBe0Pl81 LZcLcY1Zxom9zJFwQWgASPSyH1Byy3voGfWWioVM= Subject: patch "iio: accel: adxl380: Avoid reading more entries than present in FIFO" added to char-misc-testing To: flavra@baylibre.com,Jonathan.Cameron@huawei.com,Stable@vger.kernel.org From: Date: Mon, 02 Feb 2026 17:09:29 +0100 Message-ID: <2026020229-enlighten-vegan-c433@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit This is a note to let you know that I've just added the patch titled iio: accel: adxl380: Avoid reading more entries than present in FIFO to my char-misc git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git in the char-misc-testing branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will be merged to the char-misc-next branch sometime soon, after it passes testing, and the merge window is open. If you have any questions about this process, please let me know. >From c1b14015224cfcccd5356333763f2f4f401bd810 Mon Sep 17 00:00:00 2001 From: Francesco Lavra Date: Mon, 19 Jan 2026 11:23:16 +0100 Subject: iio: accel: adxl380: Avoid reading more entries than present in FIFO The interrupt handler reads FIFO entries in batches of N samples, where N is the number of scan elements that have been enabled. However, the sensor fills the FIFO one sample at a time, even when more than one channel is enabled. Therefore,the number of entries reported by the FIFO status registers may not be a multiple of N; if this number is not a multiple, the number of entries read from the FIFO may exceed the number of entries actually present. To fix the above issue, round down the number of FIFO entries read from the status registers so that it is always a multiple of N. Fixes: df36de13677a ("iio: accel: add ADXL380 driver") Signed-off-by: Francesco Lavra Cc: Signed-off-by: Jonathan Cameron --- drivers/iio/accel/adxl380.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iio/accel/adxl380.c b/drivers/iio/accel/adxl380.c index ba550142866a..a77c2323d1aa 100644 --- a/drivers/iio/accel/adxl380.c +++ b/drivers/iio/accel/adxl380.c @@ -966,6 +966,7 @@ static irqreturn_t adxl380_irq_handler(int irq, void *p) if (ret) return IRQ_HANDLED; + fifo_entries = rounddown(fifo_entries, st->fifo_set_size); for (i = 0; i < fifo_entries; i += st->fifo_set_size) { ret = regmap_noinc_read(st->regmap, ADXL380_FIFO_DATA, &st->fifo_buf[i], -- 2.52.0