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 DF2AC352C4F for ; Tue, 7 Apr 2026 15:01:10 +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=1775574070; cv=none; b=euSyAX/FOEiVyaAOia1HLKZoWdTZOJLN9SqKp9MF7vsLz1O1itTtvChn2Grbh2NZRPI6t7Um74j1gIR8cM5A7ddU3Nn9F6YO4o5uLipbBteNvtqWwocGRma/IK0Tah4AQpswUm3LqiDuG9m4+TrT0k+dt38er8HSCmrCcPkoiuM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775574070; c=relaxed/simple; bh=wmcNw6eEVvVhfEVqJwTotfE/7e+Z+TudWMgFwN7An9g=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=bwUnzq+yq1M3aN+Q6Eg/rCcTOPWFyhJq7ST3HSRbseb5wqr6r4q/1SLPhBJ2zpi7P3GpVhJT+nlvmy/IqKCHcy842q3usHwaImIJbT+/6YDha5wo5DIgFbFdNzKg2Fn3r9b8JTQRhKMubERV7ukD6vUU2Oijp8rYd0D79X5NEFk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=DJWC1FfX; 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="DJWC1FfX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24509C116C6; Tue, 7 Apr 2026 15:01:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1775574070; bh=wmcNw6eEVvVhfEVqJwTotfE/7e+Z+TudWMgFwN7An9g=; h=Subject:To:Cc:From:Date:From; b=DJWC1FfX1Dy/fnOiZ/K3c/BLE3kkRqTVD3PUvxAZu1tmg2SvTiAtesbPF5LcSXk71 AI79SgFgyNOSVDHbHd/fc1y7lpQTkL0OHeMpvJEuXOW0LWM743TCC3fsfXtLekg/Mg jJFXCMBxeOPpWCT0mdFow/w99T7Pz4A/QE5GCUYQ= Subject: FAILED: patch "[PATCH] iio: adc: ti-adc161s626: fix buffer read on big-endian" failed to apply to 5.10-stable tree To: dlechner@baylibre.com,Jonathan.Cameron@huawei.com,Stable@vger.kernel.org Cc: From: Date: Tue, 07 Apr 2026 17:01:00 +0200 Message-ID: <2026040700-cylinder-stunning-dc4d@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 The patch below does not apply to the 5.10-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y git checkout FETCH_HEAD git cherry-pick -x 24869650dff34a6fc8fd1cc91b2058a72f9abc95 # git commit -s git send-email --to '' --in-reply-to '2026040700-cylinder-stunning-dc4d@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 24869650dff34a6fc8fd1cc91b2058a72f9abc95 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Sat, 14 Mar 2026 18:13:31 -0500 Subject: [PATCH] iio: adc: ti-adc161s626: fix buffer read on big-endian Rework ti_adc_trigger_handler() to properly handle data on big-endian architectures. The scan data format is 16-bit CPU-endian, so we can't cast it to a int * on big-endian and expect it to work. Instead, we introduce a local int variable to read the data into, and then copy it to the buffer. Since the buffer isn't passed to any SPI functions, we don't need it to be DMA-safe. So we can drop it from the driver data struct and just use stack memory for the scan data. Since there is only one data value (plus timestamp), we don't need an array and can just declare a struct with the correct data type instead. Also fix alignment of iio_get_time_ns() to ( while we are touching this. Fixes: 4d671b71beef ("iio: adc: ti-adc161s626: add support for TI 1-channel differential ADCs") Signed-off-by: David Lechner Cc: Signed-off-by: Jonathan Cameron diff --git a/drivers/iio/adc/ti-adc161s626.c b/drivers/iio/adc/ti-adc161s626.c index 28aa6b80160c..42968d96572b 100644 --- a/drivers/iio/adc/ti-adc161s626.c +++ b/drivers/iio/adc/ti-adc161s626.c @@ -70,8 +70,6 @@ struct ti_adc_data { u8 read_size; u8 shift; - - u8 buffer[16] __aligned(IIO_DMA_MINALIGN); }; static int ti_adc_read_measurement(struct ti_adc_data *data, @@ -114,15 +112,20 @@ static irqreturn_t ti_adc_trigger_handler(int irq, void *private) struct iio_poll_func *pf = private; struct iio_dev *indio_dev = pf->indio_dev; struct ti_adc_data *data = iio_priv(indio_dev); - int ret; + struct { + s16 data; + aligned_s64 timestamp; + } scan = { }; + int ret, val; - ret = ti_adc_read_measurement(data, &indio_dev->channels[0], - (int *) &data->buffer); - if (!ret) - iio_push_to_buffers_with_timestamp(indio_dev, - data->buffer, - iio_get_time_ns(indio_dev)); + ret = ti_adc_read_measurement(data, &indio_dev->channels[0], &val); + if (ret) + goto exit_notify_done; + scan.data = val; + iio_push_to_buffers_with_timestamp(indio_dev, &scan, iio_get_time_ns(indio_dev)); + + exit_notify_done: iio_trigger_notify_done(indio_dev->trig); return IRQ_HANDLED;