mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] staging: axis-fifo: I/O accessor cleanups
@ 2026-01-13 13:38 Minu Jin
  2026-01-13 13:38 ` [PATCH 1/2] staging: axis-fifo: introduce helper functions for register access Minu Jin
  2026-01-13 13:38 ` [PATCH 2/2] staging: axis-fifo: Use bulk I/O accessors for data transfers Minu Jin
  0 siblings, 2 replies; 4+ messages in thread
From: Minu Jin @ 2026-01-13 13:38 UTC (permalink / raw)
  To: gregkh
  Cc: ovidiu.panait.oss, gshahrouzi, linux-staging, linux-kernel, Minu Jin

This series refactors I/O access patterns in the axis-fifo driver
to improve code readability and align with kernel coding conventions.

Patch 1 introduces wrapper functions for single register access.
Patch 2 replaces manual loops with standard bulk I/O accessors.

No functional changes intended.

Minu Jin (2):
  staging: axis-fifo: Introduce helper functions for register access
  staging: axis-fifo: Use bulk I/O accessors for data transfers

 drivers/staging/axis-fifo/axis-fifo.c | 64 +++++++++++++++++----------
 1 file changed, 40 insertions(+), 24 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] staging: axis-fifo: introduce helper functions for register access
  2026-01-13 13:38 [PATCH 0/2] staging: axis-fifo: I/O accessor cleanups Minu Jin
@ 2026-01-13 13:38 ` Minu Jin
  2026-01-13 13:38 ` [PATCH 2/2] staging: axis-fifo: Use bulk I/O accessors for data transfers Minu Jin
  1 sibling, 0 replies; 4+ messages in thread
From: Minu Jin @ 2026-01-13 13:38 UTC (permalink / raw)
  To: gregkh
  Cc: ovidiu.panait.oss, gshahrouzi, linux-staging, linux-kernel, Minu Jin

This patch introduces axis_fifo_read_reg(), axis_fifo_write_reg()
to wrap raw ioread32, iowrite32 calls. Using these helper functions
improves code readability and provides a cleaner abstraction for
hardware register access.

All existing single register I/O calls updated to use these
new helpers. This refactoring also ensures a consistent access
pattern and makes future maintenance easier.

Signed-off-by: Minu Jin <s9430939@naver.com>
---
 drivers/staging/axis-fifo/axis-fifo.c | 45 ++++++++++++++++-----------
 1 file changed, 27 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
index 509d620d6ce7..525156583c4a 100644
--- a/drivers/staging/axis-fifo/axis-fifo.c
+++ b/drivers/staging/axis-fifo/axis-fifo.c
@@ -145,16 +145,26 @@ struct axis_fifo_debug_reg {
  * ----------------------------
  */
 
+static inline u32 axis_fifo_read_reg(struct axis_fifo *fifo, int offset)
+{
+	return ioread32(fifo->base_addr + offset);
+}
+
+static inline void axis_fifo_write_reg(struct axis_fifo *fifo, int offset, u32 val)
+{
+	iowrite32(val, fifo->base_addr + offset);
+}
+
 static void reset_ip_core(struct axis_fifo *fifo)
 {
-	iowrite32(XLLF_SRR_RESET_MASK, fifo->base_addr + XLLF_SRR_OFFSET);
-	iowrite32(XLLF_TDFR_RESET_MASK, fifo->base_addr + XLLF_TDFR_OFFSET);
-	iowrite32(XLLF_RDFR_RESET_MASK, fifo->base_addr + XLLF_RDFR_OFFSET);
-	iowrite32(XLLF_INT_TC_MASK | XLLF_INT_RC_MASK | XLLF_INT_RPURE_MASK |
+	axis_fifo_write_reg(fifo, XLLF_SRR_OFFSET, XLLF_SRR_RESET_MASK);
+	axis_fifo_write_reg(fifo, XLLF_TDFR_OFFSET, XLLF_TDFR_RESET_MASK);
+	axis_fifo_write_reg(fifo, XLLF_RDFR_OFFSET, XLLF_RDFR_RESET_MASK);
+	axis_fifo_write_reg(fifo, XLLF_IER_OFFSET, XLLF_INT_TC_MASK |
+			XLLF_INT_RC_MASK | XLLF_INT_RPURE_MASK |
 		  XLLF_INT_RPORE_MASK | XLLF_INT_RPUE_MASK |
-		  XLLF_INT_TPOE_MASK | XLLF_INT_TSE_MASK,
-		  fifo->base_addr + XLLF_IER_OFFSET);
-	iowrite32(XLLF_INT_CLEAR_ALL, fifo->base_addr + XLLF_ISR_OFFSET);
+		  XLLF_INT_TPOE_MASK | XLLF_INT_TSE_MASK);
+	axis_fifo_write_reg(fifo, XLLF_ISR_OFFSET, XLLF_INT_CLEAR_ALL);
 }
 
 /**
@@ -192,7 +202,7 @@ static ssize_t axis_fifo_read(struct file *f, char __user *buf,
 		if (!mutex_trylock(&fifo->read_lock))
 			return -EAGAIN;
 
-		if (!ioread32(fifo->base_addr + XLLF_RDFO_OFFSET)) {
+		if (!axis_fifo_read_reg(fifo, XLLF_RDFO_OFFSET)) {
 			ret = -EAGAIN;
 			goto end_unlock;
 		}
@@ -203,7 +213,7 @@ static ssize_t axis_fifo_read(struct file *f, char __user *buf,
 		 */
 		mutex_lock(&fifo->read_lock);
 		ret = wait_event_interruptible_timeout(fifo->read_queue,
-						       ioread32(fifo->base_addr + XLLF_RDFO_OFFSET),
+						       axis_fifo_read_reg(fifo, XLLF_RDFO_OFFSET),
 						       read_timeout);
 
 		if (ret <= 0) {
@@ -218,7 +228,7 @@ static ssize_t axis_fifo_read(struct file *f, char __user *buf,
 		}
 	}
 
-	bytes_available = ioread32(fifo->base_addr + XLLF_RLR_OFFSET);
+	bytes_available = axis_fifo_read_reg(fifo, XLLF_RLR_OFFSET);
 	words_available = bytes_available / sizeof(u32);
 	if (!bytes_available) {
 		dev_err(fifo->dt_device, "received a packet of length 0\n");
@@ -334,8 +344,7 @@ static ssize_t axis_fifo_write(struct file *f, const char __user *buf,
 		if (!mutex_trylock(&fifo->write_lock))
 			return -EAGAIN;
 
-		if (words_to_write > ioread32(fifo->base_addr +
-					      XLLF_TDFV_OFFSET)) {
+		if (words_to_write > axis_fifo_read_reg(fifo, XLLF_TDFV_OFFSET)) {
 			ret = -EAGAIN;
 			goto end_unlock;
 		}
@@ -347,7 +356,7 @@ static ssize_t axis_fifo_write(struct file *f, const char __user *buf,
 		 */
 		mutex_lock(&fifo->write_lock);
 		ret = wait_event_interruptible_timeout(fifo->write_queue,
-						       ioread32(fifo->base_addr + XLLF_TDFV_OFFSET)
+						       axis_fifo_read_reg(fifo, XLLF_TDFV_OFFSET)
 								>= words_to_write,
 						       write_timeout);
 
@@ -373,7 +382,7 @@ static ssize_t axis_fifo_write(struct file *f, const char __user *buf,
 		iowrite32(txbuf[i], fifo->base_addr + XLLF_TDFD_OFFSET);
 
 	/* write packet size to fifo */
-	iowrite32(len, fifo->base_addr + XLLF_TLR_OFFSET);
+	axis_fifo_write_reg(fifo, XLLF_TLR_OFFSET, len);
 
 	ret = len;
 	kvfree(txbuf);
@@ -388,8 +397,8 @@ static irqreturn_t axis_fifo_irq(int irq, void *dw)
 	struct axis_fifo *fifo = dw;
 	u32 isr, ier, intr;
 
-	ier = ioread32(fifo->base_addr + XLLF_IER_OFFSET);
-	isr = ioread32(fifo->base_addr + XLLF_ISR_OFFSET);
+	ier = axis_fifo_read_reg(fifo, XLLF_IER_OFFSET);
+	isr = axis_fifo_read_reg(fifo, XLLF_ISR_OFFSET);
 	intr = ier & isr;
 
 	if (intr & XLLF_INT_RC_MASK)
@@ -414,7 +423,7 @@ static irqreturn_t axis_fifo_irq(int irq, void *dw)
 		dev_err(fifo->dt_device,
 			"transmit length mismatch error interrupt\n");
 
-	iowrite32(XLLF_INT_CLEAR_ALL, fifo->base_addr + XLLF_ISR_OFFSET);
+	axis_fifo_write_reg(fifo, XLLF_ISR_OFFSET, XLLF_INT_CLEAR_ALL);
 
 	return IRQ_HANDLED;
 }
@@ -464,7 +473,7 @@ static int axis_fifo_debugfs_regs_show(struct seq_file *m, void *p)
 	struct axis_fifo *fifo = m->private;
 
 	for (reg = regs; reg->name; ++reg) {
-		u32 val = ioread32(fifo->base_addr + reg->offset);
+		u32 val = axis_fifo_read_reg(fifo, reg->offset);
 
 		seq_printf(m, "%*s: 0x%08x\n", AXIS_FIFO_DEBUG_REG_NAME_MAX_LEN,
 			   reg->name, val);
-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] staging: axis-fifo: Use bulk I/O accessors for data transfers
  2026-01-13 13:38 [PATCH 0/2] staging: axis-fifo: I/O accessor cleanups Minu Jin
  2026-01-13 13:38 ` [PATCH 1/2] staging: axis-fifo: introduce helper functions for register access Minu Jin
@ 2026-01-13 13:38 ` Minu Jin
  2026-01-14 12:17   ` kernel test robot
  1 sibling, 1 reply; 4+ messages in thread
From: Minu Jin @ 2026-01-13 13:38 UTC (permalink / raw)
  To: gregkh
  Cc: ovidiu.panait.oss, gshahrouzi, linux-staging, linux-kernel, Minu Jin

Replace manual for loops with ioread32_rep/iowrite32_rep.
Add axis_fifo_read_data() and axis_fifo_write_data() wrappers to
encapsulate these block-transfer operations.

No functional changes intended

Signed-off-by: Minu Jin <s9430939@naver.com>
---
 drivers/staging/axis-fifo/axis-fifo.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
index 525156583c4a..9663d2efd411 100644
--- a/drivers/staging/axis-fifo/axis-fifo.c
+++ b/drivers/staging/axis-fifo/axis-fifo.c
@@ -150,11 +150,21 @@ static inline u32 axis_fifo_read_reg(struct axis_fifo *fifo, int offset)
 	return ioread32(fifo->base_addr + offset);
 }
 
+static inline void axis_fifo_read_data(struct axis_fifo *fifo, void *buf, int count)
+{
+	ioread32_rep(fifo->base_addr + XLLF_RDFD_OFFSET, buf, count);
+}
+
 static inline void axis_fifo_write_reg(struct axis_fifo *fifo, int offset, u32 val)
 {
 	iowrite32(val, fifo->base_addr + offset);
 }
 
+static inline void axis_fifo_write_data(struct axis_fifo *fifo, const void *buf, int count)
+{
+	iowrite32_rep(fifo->base_addr + XLLF_TDFD_OFFSET, buf, count);
+}
+
 static void reset_ip_core(struct axis_fifo *fifo)
 {
 	axis_fifo_write_reg(fifo, XLLF_SRR_OFFSET, XLLF_SRR_RESET_MASK);
@@ -259,10 +269,8 @@ static ssize_t axis_fifo_read(struct file *f, char __user *buf,
 	while (words_available > 0) {
 		copy = min(words_available, READ_BUF_SIZE);
 
-		for (i = 0; i < copy; i++) {
-			tmp_buf[i] = ioread32(fifo->base_addr +
-					      XLLF_RDFD_OFFSET);
-		}
+		axis_fifo_read_data(fifo, tmp_buf, copy);
+
 		words_available -= copy;
 
 		if (copy_to_user(buf + copied * sizeof(u32), tmp_buf,
@@ -378,8 +386,7 @@ static ssize_t axis_fifo_write(struct file *f, const char __user *buf,
 		goto end_unlock;
 	}
 
-	for (int i = 0; i < words_to_write; ++i)
-		iowrite32(txbuf[i], fifo->base_addr + XLLF_TDFD_OFFSET);
+	axis_fifo_write_data(fifo, txbuf, words_to_write);
 
 	/* write packet size to fifo */
 	axis_fifo_write_reg(fifo, XLLF_TLR_OFFSET, len);
-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] staging: axis-fifo: Use bulk I/O accessors for data transfers
  2026-01-13 13:38 ` [PATCH 2/2] staging: axis-fifo: Use bulk I/O accessors for data transfers Minu Jin
@ 2026-01-14 12:17   ` kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2026-01-14 12:17 UTC (permalink / raw)
  To: Minu Jin, gregkh
  Cc: oe-kbuild-all, ovidiu.panait.oss, gshahrouzi, linux-staging,
	linux-kernel, Minu Jin

Hi Minu,

kernel test robot noticed the following build warnings:

[auto build test WARNING on staging/staging-linus]
[also build test WARNING on linus/master v6.19-rc5]
[cannot apply to staging/staging-testing staging/staging-next next-20260114]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Minu-Jin/staging-axis-fifo-introduce-helper-functions-for-register-access/20260113-215835
base:   staging/staging-linus
patch link:    https://lore.kernel.org/r/20260113133831.3422480-3-s9430939%40naver.com
patch subject: [PATCH 2/2] staging: axis-fifo: Use bulk I/O accessors for data transfers
config: powerpc-randconfig-001-20260114 (https://download.01.org/0day-ci/archive/20260114/202601141928.CyFxDTEk-lkp@intel.com/config)
compiler: powerpc-linux-gcc (GCC) 11.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260114/202601141928.CyFxDTEk-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601141928.CyFxDTEk-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/staging/axis-fifo/axis-fifo.c: In function 'axis_fifo_read':
>> drivers/staging/axis-fifo/axis-fifo.c:203:22: warning: unused variable 'i' [-Wunused-variable]
     203 |         unsigned int i;
         |                      ^


vim +/i +203 drivers/staging/axis-fifo/axis-fifo.c

4a965c5f89decd Jacob Feder       2018-07-22  179  
0443b3f4436321 Quentin Deslandes 2020-01-21  180  /**
bbf40b2f6e38d0 Lee Jones         2021-04-14  181   * axis_fifo_read() - Read a packet from AXIS-FIFO character device.
c848434c629db5 Lee Jones         2021-04-14  182   * @f: Open file.
c848434c629db5 Lee Jones         2021-04-14  183   * @buf: User space buffer to read to.
c848434c629db5 Lee Jones         2021-04-14  184   * @len: User space buffer length.
c848434c629db5 Lee Jones         2021-04-14  185   * @off: Buffer offset.
0443b3f4436321 Quentin Deslandes 2020-01-21  186   *
0443b3f4436321 Quentin Deslandes 2020-01-21  187   * As defined by the device's documentation, we need to check the device's
0443b3f4436321 Quentin Deslandes 2020-01-21  188   * occupancy before reading the length register and then the data. All these
0443b3f4436321 Quentin Deslandes 2020-01-21  189   * operations must be executed atomically, in order and one after the other
0443b3f4436321 Quentin Deslandes 2020-01-21  190   * without missing any.
0443b3f4436321 Quentin Deslandes 2020-01-21  191   *
0443b3f4436321 Quentin Deslandes 2020-01-21  192   * Returns the number of bytes read from the device or negative error code
0443b3f4436321 Quentin Deslandes 2020-01-21  193   *	on failure.
0443b3f4436321 Quentin Deslandes 2020-01-21  194   */
4a965c5f89decd Jacob Feder       2018-07-22  195  static ssize_t axis_fifo_read(struct file *f, char __user *buf,
4a965c5f89decd Jacob Feder       2018-07-22  196  			      size_t len, loff_t *off)
4a965c5f89decd Jacob Feder       2018-07-22  197  {
4a965c5f89decd Jacob Feder       2018-07-22  198  	struct axis_fifo *fifo = (struct axis_fifo *)f->private_data;
4a965c5f89decd Jacob Feder       2018-07-22  199  	size_t bytes_available;
4a965c5f89decd Jacob Feder       2018-07-22  200  	unsigned int words_available;
4a965c5f89decd Jacob Feder       2018-07-22  201  	unsigned int copied;
4a965c5f89decd Jacob Feder       2018-07-22  202  	unsigned int copy;
4a965c5f89decd Jacob Feder       2018-07-22 @203  	unsigned int i;
4a965c5f89decd Jacob Feder       2018-07-22  204  	int ret;
4a965c5f89decd Jacob Feder       2018-07-22  205  	u32 tmp_buf[READ_BUF_SIZE];
4a965c5f89decd Jacob Feder       2018-07-22  206  
89443a92c506dc Ovidiu Panait     2025-09-19  207  	if (f->f_flags & O_NONBLOCK) {
0443b3f4436321 Quentin Deslandes 2020-01-21  208  		/*
0443b3f4436321 Quentin Deslandes 2020-01-21  209  		 * Device opened in non-blocking mode. Try to lock it and then
0443b3f4436321 Quentin Deslandes 2020-01-21  210  		 * check if any packet is available.
4a965c5f89decd Jacob Feder       2018-07-22  211  		 */
0443b3f4436321 Quentin Deslandes 2020-01-21  212  		if (!mutex_trylock(&fifo->read_lock))
4a965c5f89decd Jacob Feder       2018-07-22  213  			return -EAGAIN;
0443b3f4436321 Quentin Deslandes 2020-01-21  214  
58e835695afaef Minu Jin          2026-01-13  215  		if (!axis_fifo_read_reg(fifo, XLLF_RDFO_OFFSET)) {
0443b3f4436321 Quentin Deslandes 2020-01-21  216  			ret = -EAGAIN;
0443b3f4436321 Quentin Deslandes 2020-01-21  217  			goto end_unlock;
0443b3f4436321 Quentin Deslandes 2020-01-21  218  		}
4a965c5f89decd Jacob Feder       2018-07-22  219  	} else {
4a965c5f89decd Jacob Feder       2018-07-22  220  		/* opened in blocking mode
4a965c5f89decd Jacob Feder       2018-07-22  221  		 * wait for a packet available interrupt (or timeout)
4a965c5f89decd Jacob Feder       2018-07-22  222  		 * if nothing is currently available
4a965c5f89decd Jacob Feder       2018-07-22  223  		 */
0443b3f4436321 Quentin Deslandes 2020-01-21  224  		mutex_lock(&fifo->read_lock);
0443b3f4436321 Quentin Deslandes 2020-01-21  225  		ret = wait_event_interruptible_timeout(fifo->read_queue,
58e835695afaef Minu Jin          2026-01-13  226  						       axis_fifo_read_reg(fifo, XLLF_RDFO_OFFSET),
752cbd8f191678 Khadija Kamran    2023-03-17  227  						       read_timeout);
4a965c5f89decd Jacob Feder       2018-07-22  228  
0443b3f4436321 Quentin Deslandes 2020-01-21  229  		if (ret <= 0) {
4a965c5f89decd Jacob Feder       2018-07-22  230  			if (ret == 0) {
0443b3f4436321 Quentin Deslandes 2020-01-21  231  				ret = -EAGAIN;
0443b3f4436321 Quentin Deslandes 2020-01-21  232  			} else if (ret != -ERESTARTSYS) {
4a965c5f89decd Jacob Feder       2018-07-22  233  				dev_err(fifo->dt_device, "wait_event_interruptible_timeout() error in read (ret=%i)\n",
4a965c5f89decd Jacob Feder       2018-07-22  234  					ret);
0443b3f4436321 Quentin Deslandes 2020-01-21  235  			}
0443b3f4436321 Quentin Deslandes 2020-01-21  236  
0443b3f4436321 Quentin Deslandes 2020-01-21  237  			goto end_unlock;
4a965c5f89decd Jacob Feder       2018-07-22  238  		}
4a965c5f89decd Jacob Feder       2018-07-22  239  	}
4a965c5f89decd Jacob Feder       2018-07-22  240  
58e835695afaef Minu Jin          2026-01-13  241  	bytes_available = axis_fifo_read_reg(fifo, XLLF_RLR_OFFSET);
82a051e2553b9e Ovidiu Panait     2025-09-12  242  	words_available = bytes_available / sizeof(u32);
4a965c5f89decd Jacob Feder       2018-07-22  243  	if (!bytes_available) {
c6e8d85fafa719 Gabriel Shahrouzi 2025-04-18  244  		dev_err(fifo->dt_device, "received a packet of length 0\n");
0443b3f4436321 Quentin Deslandes 2020-01-21  245  		ret = -EIO;
0443b3f4436321 Quentin Deslandes 2020-01-21  246  		goto end_unlock;
4a965c5f89decd Jacob Feder       2018-07-22  247  	}
4a965c5f89decd Jacob Feder       2018-07-22  248  
4a965c5f89decd Jacob Feder       2018-07-22  249  	if (bytes_available > len) {
c6e8d85fafa719 Gabriel Shahrouzi 2025-04-18  250  		dev_err(fifo->dt_device, "user read buffer too small (available bytes=%zu user buffer bytes=%zu)\n",
4a965c5f89decd Jacob Feder       2018-07-22  251  			bytes_available, len);
0443b3f4436321 Quentin Deslandes 2020-01-21  252  		ret = -EINVAL;
82a051e2553b9e Ovidiu Panait     2025-09-12  253  		goto err_flush_rx;
4a965c5f89decd Jacob Feder       2018-07-22  254  	}
4a965c5f89decd Jacob Feder       2018-07-22  255  
4a965c5f89decd Jacob Feder       2018-07-22  256  	if (bytes_available % sizeof(u32)) {
4a965c5f89decd Jacob Feder       2018-07-22  257  		/* this probably can't happen unless IP
4a965c5f89decd Jacob Feder       2018-07-22  258  		 * registers were previously mishandled
4a965c5f89decd Jacob Feder       2018-07-22  259  		 */
c6e8d85fafa719 Gabriel Shahrouzi 2025-04-18  260  		dev_err(fifo->dt_device, "received a packet that isn't word-aligned\n");
0443b3f4436321 Quentin Deslandes 2020-01-21  261  		ret = -EIO;
82a051e2553b9e Ovidiu Panait     2025-09-12  262  		goto err_flush_rx;
4a965c5f89decd Jacob Feder       2018-07-22  263  	}
4a965c5f89decd Jacob Feder       2018-07-22  264  
4a965c5f89decd Jacob Feder       2018-07-22  265  	/* read data into an intermediate buffer, copying the contents
4a965c5f89decd Jacob Feder       2018-07-22  266  	 * to userspace when the buffer is full
4a965c5f89decd Jacob Feder       2018-07-22  267  	 */
4a965c5f89decd Jacob Feder       2018-07-22  268  	copied = 0;
4a965c5f89decd Jacob Feder       2018-07-22  269  	while (words_available > 0) {
4a965c5f89decd Jacob Feder       2018-07-22  270  		copy = min(words_available, READ_BUF_SIZE);
4a965c5f89decd Jacob Feder       2018-07-22  271  
884090d9d589b8 Minu Jin          2026-01-13  272  		axis_fifo_read_data(fifo, tmp_buf, copy);
884090d9d589b8 Minu Jin          2026-01-13  273  
82a051e2553b9e Ovidiu Panait     2025-09-12  274  		words_available -= copy;
4a965c5f89decd Jacob Feder       2018-07-22  275  
4a965c5f89decd Jacob Feder       2018-07-22  276  		if (copy_to_user(buf + copied * sizeof(u32), tmp_buf,
4a965c5f89decd Jacob Feder       2018-07-22  277  				 copy * sizeof(u32))) {
0443b3f4436321 Quentin Deslandes 2020-01-21  278  			ret = -EFAULT;
82a051e2553b9e Ovidiu Panait     2025-09-12  279  			goto err_flush_rx;
4a965c5f89decd Jacob Feder       2018-07-22  280  		}
4a965c5f89decd Jacob Feder       2018-07-22  281  
4a965c5f89decd Jacob Feder       2018-07-22  282  		copied += copy;
4a965c5f89decd Jacob Feder       2018-07-22  283  	}
82a051e2553b9e Ovidiu Panait     2025-09-12  284  	mutex_unlock(&fifo->read_lock);
82a051e2553b9e Ovidiu Panait     2025-09-12  285  
82a051e2553b9e Ovidiu Panait     2025-09-12  286  	return bytes_available;
4a965c5f89decd Jacob Feder       2018-07-22  287  
82a051e2553b9e Ovidiu Panait     2025-09-12  288  err_flush_rx:
82a051e2553b9e Ovidiu Panait     2025-09-12  289  	while (words_available--)
82a051e2553b9e Ovidiu Panait     2025-09-12  290  		ioread32(fifo->base_addr + XLLF_RDFD_OFFSET);
0443b3f4436321 Quentin Deslandes 2020-01-21  291  
0443b3f4436321 Quentin Deslandes 2020-01-21  292  end_unlock:
0443b3f4436321 Quentin Deslandes 2020-01-21  293  	mutex_unlock(&fifo->read_lock);
0443b3f4436321 Quentin Deslandes 2020-01-21  294  
0443b3f4436321 Quentin Deslandes 2020-01-21  295  	return ret;
4a965c5f89decd Jacob Feder       2018-07-22  296  }
4a965c5f89decd Jacob Feder       2018-07-22  297  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-01-14 12:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-13 13:38 [PATCH 0/2] staging: axis-fifo: I/O accessor cleanups Minu Jin
2026-01-13 13:38 ` [PATCH 1/2] staging: axis-fifo: introduce helper functions for register access Minu Jin
2026-01-13 13:38 ` [PATCH 2/2] staging: axis-fifo: Use bulk I/O accessors for data transfers Minu Jin
2026-01-14 12:17   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®