All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Pramod Maurya" <pramod.nexgen@gmail.com>
Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v4 2/3] staging: axis-fifo: Fix alignment of wait_event_interruptible arguments
Date: Fri, 15 May 2026 08:17:46 +0000	[thread overview]
Message-ID: <20260515081747.4E033C2BCB0@smtp.kernel.org> (raw)
In-Reply-To: <20260515075736.172172-3-pramod.nexgen@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The driver incorrectly uses register I/O accessors (iowrite32/ioread32) for FIFO stream data, corrupting the payload byte order on big-endian architectures.
--

commit 2b61bbc0527fc4d755d68d7a70237195d89efad6
Author: Pramod Maurya <pramod.nexgen@gmail.com>

staging: axis-fifo: Fix alignment of wait_event_interruptible arguments

This commit resolves a checkpatch warning about argument alignment in
wait_event_interruptible(). It breaks the condition at the comparison
operator to keep the line under 80 columns.

> diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
> index 3aa2aa870ea91..1c34de020cf85 100644
> --- a/drivers/staging/axis-fifo/axis-fifo.c
> +++ b/drivers/staging/axis-fifo/axis-fifo.c
> @@ -246,7 +246,8 @@ static ssize_t axis_fifo_write(struct file *f, const char __user *buf,
>  		mutex_lock(&fifo->write_lock);
>  
>  		ret = wait_event_interruptible(fifo->write_queue,
> -			ioread32(fifo->base_addr + XLLF_TDFV_OFFSET) >= words_to_write);
> +					       ioread32(fifo->base_addr + XLLF_TDFV_OFFSET) >=
> +					       words_to_write);
>  		if (ret)
>  			goto end_unlock;
>  	}

This isn't a bug introduced by this commit, but while reviewing
axis_fifo_write() I noticed a potential endianness issue later in the
function:

	for (int i = 0; i < words_to_write; ++i)
		iowrite32(txbuf[i], fifo->base_addr + XLLF_TDFD_OFFSET);

Could this loop corrupt the payload byte order on big-endian architectures?

Stream data fifos must exclusively use stream accessors (such as writesl()
and readsl()) to preserve memory byte order without applying unwanted
byte-swapping.

The driver currently uses register I/O accessors to transfer data to and
from the fifos (XLLF_TDFD_OFFSET and XLLF_RDFD_OFFSET). On big-endian
systems, iowrite32() maps to writel(), which performs CPU-to-device
byteswapping.

Are there similar issues in axis_fifo_read() where ioread32() is used to
read from XLLF_RDFD_OFFSET?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260515075736.172172-1-pramod.nexgen@gmail.com?part=2

  reply	other threads:[~2026-05-15  8:17 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-10  8:32 [PATCH v3] dt-bindings: iio: adc: Convert xilinx-xadc bindings to YAML schema Pramod Maurya
2026-05-10  9:43 ` Rob Herring (Arm)
2026-05-10 12:01 ` Pramod Maurya
2026-05-11 16:15   ` Jonathan Cameron
2026-05-11 16:24     ` David Lechner
2026-05-12 12:14       ` Rob Herring
2026-05-12 13:58         ` David Lechner
2026-05-12 14:10           ` Michal Simek
2026-05-12 14:16             ` David Lechner
2026-05-12 14:21               ` Michal Simek
2026-05-12 14:13           ` David Lechner
2026-05-12 19:42           ` Rob Herring
2026-05-12 20:03             ` David Lechner
2026-05-12 20:48               ` Rob Herring
2026-05-11 16:17   ` Jonathan Cameron
2026-05-11 20:55   ` sashiko-bot
2026-05-11 20:32 ` sashiko-bot
2026-05-15  7:57 ` [PATCH v4 0/3] Convert Xilinx XADC binding to YAML and related cleanups Pramod Maurya
2026-05-15  7:57   ` [PATCH v4 1/3] dt-bindings: iio: adc: Convert xilinx-xadc bindings to YAML schema Pramod Maurya
2026-05-15  8:07     ` sashiko-bot
2026-05-15  7:57   ` [PATCH v4 2/3] staging: axis-fifo: Fix alignment of wait_event_interruptible arguments Pramod Maurya
2026-05-15  8:17     ` sashiko-bot [this message]
2026-05-15  7:57   ` [PATCH v4 3/3] dt-bindings: misc: Add binding for Xilinx AXI-Stream FIFO Pramod Maurya
2026-05-15  8:32     ` sashiko-bot
2026-05-15 11:03     ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260515081747.4E033C2BCB0@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=pramod.nexgen@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.