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 4DD703537CC for ; Tue, 7 Apr 2026 15:01:16 +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=1775574076; cv=none; b=GfK9lNTZr7Y2k2D2ZVhH/XbfMn0dt8PURcOwhlaQgKgE08ufzihdS1gBePHxg1BvdQJIoxosRJX9qjC4WkIj0TRBkbkkdRMbNaZJExQVZ1xsltQltJX3iUsexz+dYUSNCyOnJLiZMjB/r4MRmrBWM9buSA9cGRbcC7pgqoWG+3c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775574076; c=relaxed/simple; bh=x0wkhkZ9kkze0p8Y4tU6CWr/Qjl+IIah7QLcEnAvDt4=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=i+xLDnTc7qzHTgCV3lbxt8FKfFs9+LIhsmnNwfmsyyMkSrJnHPZeXzpnmmQHUuBylKUaaz9LP43SZLCi6tV+pFEJmarSvEvYm0Vlz6fCqJ1z8DtnB3Wk1HyOdcz60+5up9SXan+XwdGiwQlEErlcG0RNehNeDWBdIs7H3OIcgB8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=GiFMXLYX; 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="GiFMXLYX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ACB33C116C6; Tue, 7 Apr 2026 15:01:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1775574076; bh=x0wkhkZ9kkze0p8Y4tU6CWr/Qjl+IIah7QLcEnAvDt4=; h=Subject:To:Cc:From:Date:From; b=GiFMXLYXgkTq6VRyw/WT8k7KhzlDumxI04EkYbwqXZcyAhEii9LeGi7gUArzyC9Rf 8ND/0+IT7g2GFHyJUhmJ6tnGFSgaTpSPM7HIKsroKxUJXtG+LWyBbKsT5z5E8x/iao Q6TyUAf3J4p4NbvyXyVLYiIIvlNW/rqcFa0VL2xE= Subject: FAILED: patch "[PATCH] iio: adc: ti-adc161s626: use DMA-safe memory for spi_read()" failed to apply to 5.15-stable tree To: dlechner@baylibre.com,Jonathan.Cameron@huawei.com,Stable@vger.kernel.org,andriy.shevchenko@intel.com Cc: From: Date: Tue, 07 Apr 2026 17:01:13 +0200 Message-ID: <2026040713-crescent-angles-fabe@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.15-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.15.y git checkout FETCH_HEAD git cherry-pick -x 768461517a28d80fe81ea4d5d03a90cd184ea6ad # git commit -s git send-email --to '' --in-reply-to '2026040713-crescent-angles-fabe@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 768461517a28d80fe81ea4d5d03a90cd184ea6ad Mon Sep 17 00:00:00 2001 From: David Lechner Date: Sat, 14 Mar 2026 18:13:32 -0500 Subject: [PATCH] iio: adc: ti-adc161s626: use DMA-safe memory for spi_read() Add a DMA-safe buffer and use it for spi_read() instead of a stack memory. All SPI buffers must be DMA-safe. Since we only need up to 3 bytes, we just use a u8[] instead of __be16 and __be32 and change the conversion functions appropriately. Fixes: 4d671b71beef ("iio: adc: ti-adc161s626: add support for TI 1-channel differential ADCs") Signed-off-by: David Lechner Reviewed-by: Andy Shevchenko Cc: Signed-off-by: Jonathan Cameron diff --git a/drivers/iio/adc/ti-adc161s626.c b/drivers/iio/adc/ti-adc161s626.c index 42968d96572b..be1cc2e77862 100644 --- a/drivers/iio/adc/ti-adc161s626.c +++ b/drivers/iio/adc/ti-adc161s626.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -70,6 +71,7 @@ struct ti_adc_data { u8 read_size; u8 shift; + u8 buf[3] __aligned(IIO_DMA_MINALIGN); }; static int ti_adc_read_measurement(struct ti_adc_data *data, @@ -78,26 +80,20 @@ static int ti_adc_read_measurement(struct ti_adc_data *data, int ret; switch (data->read_size) { - case 2: { - __be16 buf; - - ret = spi_read(data->spi, (void *) &buf, 2); + case 2: + ret = spi_read(data->spi, data->buf, 2); if (ret) return ret; - *val = be16_to_cpu(buf); + *val = get_unaligned_be16(data->buf); break; - } - case 3: { - __be32 buf; - - ret = spi_read(data->spi, (void *) &buf, 3); + case 3: + ret = spi_read(data->spi, data->buf, 3); if (ret) return ret; - *val = be32_to_cpu(buf) >> 8; + *val = get_unaligned_be24(data->buf); break; - } default: return -EINVAL; }