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 914A01DF74F for ; Wed, 20 Aug 2025 09:05:43 +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=1755680743; cv=none; b=bVgKIGH3ARj7piXg3W8S3l4DrzvNNXSaIzyjI6btRYcWtY4hKHhaGfYqR0wsNam7+tferOmMy7/JK130Hc9Q7089lDLWAi1e7nbw6RO+WIcQ4ah2h3St9CdIXt4Vokd21usFPbDsAxgmEN0MrBkh1nxVhSrbKrWq5qRt5myNelo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755680743; c=relaxed/simple; bh=BI7Upv0jWbd90G4Nj5xpjrZ+n+2k5tUsPfyNjzrrj1Q=; h=Subject:To:From:Date:Message-ID:MIME-Version:Content-Type; b=bkWpFlVzN2qg/2Yv1dSPXAEVtGE1tkA7EiYpMkzr0t11odVJO++LLyAPnmbbSLWp9ic0hO/EN1AQnePytc+wtmkpt0N8gxrliyPWVaOVxtPQaQAXaKrcruknAHrWK90QeN8nB+rZg8/wgsZRWQLCwmyZinL6sn3Lc/1ww2CUB4I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XYY7TF4P; 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="XYY7TF4P" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C58DC4CEEB; Wed, 20 Aug 2025 09:05:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755680743; bh=BI7Upv0jWbd90G4Nj5xpjrZ+n+2k5tUsPfyNjzrrj1Q=; h=Subject:To:From:Date:From; b=XYY7TF4PJZHOaii8ION3aDtmvLSjpS0Xi3xa3CS3ff7WDaOGZuZBGncX6Nw06YmBC VrbYXBuZkflZb2nQ7Y05Ioa6Juru+TDvnCS4ZqHG6maaehKXI+uWjzCFA9/1Q4EgFk MKHZymlXTePs0F1NrwMMqYTbVBINZRrsAdUMH/fQ= Subject: patch "iio: proximity: isl29501: fix buffered read on big-endian systems" added to char-misc-linus To: dlechner@baylibre.com,Jonathan.Cameron@huawei.com,Stable@vger.kernel.org From: Date: Wed, 20 Aug 2025 11:05:33 +0200 Message-ID: <2025082033-copious-cage-e62b@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: proximity: isl29501: fix buffered read on big-endian systems 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-linus 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 hopefully also be merged in Linus's tree for the next -rc kernel release. If you have any questions about this process, please let me know. >From de18e978d0cda23e4c102e18092b63a5b0b3a800 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Tue, 22 Jul 2025 15:54:21 -0500 Subject: iio: proximity: isl29501: fix buffered read on big-endian systems Fix passing a u32 value as a u16 buffer scan item. This works on little- endian systems, but not on big-endian systems. A new local variable is introduced for getting the register value and the array is changed to a struct to make the data layout more explicit rather than just changing the type and having to recalculate the proper length needed for the timestamp. Fixes: 1c28799257bc ("iio: light: isl29501: Add support for the ISL29501 ToF sensor.") Signed-off-by: David Lechner Link: https://patch.msgid.link/20250722-iio-use-more-iio_declare_buffer_with_ts-7-v2-1-d3ebeb001ed3@baylibre.com Cc: Signed-off-by: Jonathan Cameron --- drivers/iio/proximity/isl29501.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/iio/proximity/isl29501.c b/drivers/iio/proximity/isl29501.c index d1510fe24050..f69db6f2f380 100644 --- a/drivers/iio/proximity/isl29501.c +++ b/drivers/iio/proximity/isl29501.c @@ -938,12 +938,18 @@ static irqreturn_t isl29501_trigger_handler(int irq, void *p) struct iio_dev *indio_dev = pf->indio_dev; struct isl29501_private *isl29501 = iio_priv(indio_dev); const unsigned long *active_mask = indio_dev->active_scan_mask; - u32 buffer[4] __aligned(8) = {}; /* 1x16-bit + naturally aligned ts */ + u32 value; + struct { + u16 data; + aligned_s64 ts; + } scan = { }; - if (test_bit(ISL29501_DISTANCE_SCAN_INDEX, active_mask)) - isl29501_register_read(isl29501, REG_DISTANCE, buffer); + if (test_bit(ISL29501_DISTANCE_SCAN_INDEX, active_mask)) { + isl29501_register_read(isl29501, REG_DISTANCE, &value); + scan.data = value; + } - iio_push_to_buffers_with_timestamp(indio_dev, buffer, pf->timestamp); + iio_push_to_buffers_with_timestamp(indio_dev, &scan, pf->timestamp); iio_trigger_notify_done(indio_dev->trig); return IRQ_HANDLED; -- 2.50.1