public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 01/10] staging: axis-fifo: fix alignment and line length in wait_event_interruptible
@ 2026-03-01 21:48 Josh Law
  2026-03-01 21:48 ` [PATCH v2 02/10] staging: axis-fifo: remove redundant goto end Josh Law
                   ` (10 more replies)
  0 siblings, 11 replies; 20+ messages in thread
From: Josh Law @ 2026-03-01 21:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Ovidiu Panait
  Cc: Gabriel Shahrouzi, linux-staging, linux-kernel, Josh Law

From: Josh Law <objecting@objecting.org>

Signed-off-by: Josh Law <objecting@objecting.org>
---
 drivers/staging/axis-fifo/axis-fifo.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
index aa90b27197cf..aac2c58ef9b3 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;
 	}
-- 
2.43.0


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

* [PATCH v2 02/10] staging: axis-fifo: remove redundant goto end
  2026-03-01 21:48 [PATCH v2 01/10] staging: axis-fifo: fix alignment and line length in wait_event_interruptible Josh Law
@ 2026-03-01 21:48 ` Josh Law
  2026-03-01 21:48 ` [PATCH v2 03/10] staging: axis-fifo: simplify resource mapping Josh Law
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 20+ messages in thread
From: Josh Law @ 2026-03-01 21:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Ovidiu Panait
  Cc: Gabriel Shahrouzi, linux-staging, linux-kernel, Josh Law

From: Josh Law <objecting@objecting.org>

Signed-off-by: Josh Law <objecting@objecting.org>
---
 drivers/staging/axis-fifo/axis-fifo.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
index aac2c58ef9b3..d83a0fd5b231 100644
--- a/drivers/staging/axis-fifo/axis-fifo.c
+++ b/drivers/staging/axis-fifo/axis-fifo.c
@@ -395,22 +395,22 @@ static int axis_fifo_parse_dt(struct axis_fifo *fifo)
 				   &value);
 	if (ret) {
 		dev_err(fifo->dt_device, "missing xlnx,axi-str-rxd-tdata-width property\n");
-		goto end;
+		return ret;
 	} else if (value != 32) {
 		dev_err(fifo->dt_device, "xlnx,axi-str-rxd-tdata-width only supports 32 bits\n");
 		ret = -EIO;
-		goto end;
+		return ret;
 	}
 
 	ret = of_property_read_u32(node, "xlnx,axi-str-txd-tdata-width",
 				   &value);
 	if (ret) {
 		dev_err(fifo->dt_device, "missing xlnx,axi-str-txd-tdata-width property\n");
-		goto end;
+		return ret;
 	} else if (value != 32) {
 		dev_err(fifo->dt_device, "xlnx,axi-str-txd-tdata-width only supports 32 bits\n");
 		ret = -EIO;
-		goto end;
+		return ret;
 	}
 
 	ret = of_property_read_u32(node, "xlnx,rx-fifo-depth",
@@ -418,7 +418,7 @@ static int axis_fifo_parse_dt(struct axis_fifo *fifo)
 	if (ret) {
 		dev_err(fifo->dt_device, "missing xlnx,rx-fifo-depth property\n");
 		ret = -EIO;
-		goto end;
+		return ret;
 	}
 
 	ret = of_property_read_u32(node, "xlnx,tx-fifo-depth",
@@ -426,7 +426,7 @@ static int axis_fifo_parse_dt(struct axis_fifo *fifo)
 	if (ret) {
 		dev_err(fifo->dt_device, "missing xlnx,tx-fifo-depth property\n");
 		ret = -EIO;
-		goto end;
+		return ret;
 	}
 
 	ret = of_property_read_u32(node, "xlnx,use-rx-data",
@@ -434,7 +434,7 @@ static int axis_fifo_parse_dt(struct axis_fifo *fifo)
 	if (ret) {
 		dev_err(fifo->dt_device, "missing xlnx,use-rx-data property\n");
 		ret = -EIO;
-		goto end;
+		return ret;
 	}
 
 	ret = of_property_read_u32(node, "xlnx,use-tx-data",
@@ -442,10 +442,9 @@ static int axis_fifo_parse_dt(struct axis_fifo *fifo)
 	if (ret) {
 		dev_err(fifo->dt_device, "missing xlnx,use-tx-data property\n");
 		ret = -EIO;
-		goto end;
+		return ret;
 	}
 
-end:
 	return ret;
 }
 
-- 
2.43.0


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

* [PATCH v2 03/10] staging: axis-fifo: simplify resource mapping
  2026-03-01 21:48 [PATCH v2 01/10] staging: axis-fifo: fix alignment and line length in wait_event_interruptible Josh Law
  2026-03-01 21:48 ` [PATCH v2 02/10] staging: axis-fifo: remove redundant goto end Josh Law
@ 2026-03-01 21:48 ` Josh Law
  2026-03-01 21:48 ` [PATCH v2 04/10] staging: axis-fifo: use dev_err_probe() for IRQ error handling Josh Law
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 20+ messages in thread
From: Josh Law @ 2026-03-01 21:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Ovidiu Panait
  Cc: Gabriel Shahrouzi, linux-staging, linux-kernel, Josh Law

From: Josh Law <objecting@objecting.org>

Use devm_platform_ioremap_resource() to simplify the code and remove the
unused struct resource pointer.

Signed-off-by: Josh Law <objecting@objecting.org>
---
 drivers/staging/axis-fifo/axis-fifo.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
index d83a0fd5b231..fc8e35696b31 100644
--- a/drivers/staging/axis-fifo/axis-fifo.c
+++ b/drivers/staging/axis-fifo/axis-fifo.c
@@ -450,7 +450,6 @@ static int axis_fifo_parse_dt(struct axis_fifo *fifo)
 
 static int axis_fifo_probe(struct platform_device *pdev)
 {
-	struct resource *r_mem;
 	struct device *dev = &pdev->dev;
 	struct axis_fifo *fifo = NULL;
 	int rc = 0; /* error return value */
@@ -469,7 +468,7 @@ static int axis_fifo_probe(struct platform_device *pdev)
 	mutex_init(&fifo->read_lock);
 	mutex_init(&fifo->write_lock);
 
-	fifo->base_addr = devm_platform_get_and_ioremap_resource(pdev, 0, &r_mem);
+	fifo->base_addr = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(fifo->base_addr))
 		return PTR_ERR(fifo->base_addr);
 
-- 
2.43.0


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

* [PATCH v2 04/10] staging: axis-fifo: use dev_err_probe() for IRQ error handling
  2026-03-01 21:48 [PATCH v2 01/10] staging: axis-fifo: fix alignment and line length in wait_event_interruptible Josh Law
  2026-03-01 21:48 ` [PATCH v2 02/10] staging: axis-fifo: remove redundant goto end Josh Law
  2026-03-01 21:48 ` [PATCH v2 03/10] staging: axis-fifo: simplify resource mapping Josh Law
@ 2026-03-01 21:48 ` Josh Law
  2026-03-01 21:48 ` [PATCH v2 05/10] staging: axis-fifo: improve IRQ handler Josh Law
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 20+ messages in thread
From: Josh Law @ 2026-03-01 21:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Ovidiu Panait
  Cc: Gabriel Shahrouzi, linux-staging, linux-kernel, Josh Law

From: Josh Law <objecting@objecting.org>

Simplify the error handling in the probe function by using
dev_err_probe() instead of dev_err() when devm_request_irq() fails.

Signed-off-by: Josh Law <objecting@objecting.org>
---
 drivers/staging/axis-fifo/axis-fifo.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
index fc8e35696b31..28268881cda2 100644
--- a/drivers/staging/axis-fifo/axis-fifo.c
+++ b/drivers/staging/axis-fifo/axis-fifo.c
@@ -484,11 +484,9 @@ static int axis_fifo_probe(struct platform_device *pdev)
 
 	rc = devm_request_irq(fifo->dt_device, irq, &axis_fifo_irq, 0,
 			      DRIVER_NAME, fifo);
-	if (rc) {
-		dev_err(fifo->dt_device, "couldn't allocate interrupt %i\n",
-			irq);
-		return rc;
-	}
+	if (rc)
+		return dev_err_probe(fifo->dt_device, rc,
+				     "couldn't allocate interrupt %i\n", irq);
 
 	fifo->id = ida_alloc(&axis_fifo_ida, GFP_KERNEL);
 	if (fifo->id < 0)
-- 
2.43.0


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

* [PATCH v2 05/10] staging: axis-fifo: improve IRQ handler
  2026-03-01 21:48 [PATCH v2 01/10] staging: axis-fifo: fix alignment and line length in wait_event_interruptible Josh Law
                   ` (2 preceding siblings ...)
  2026-03-01 21:48 ` [PATCH v2 04/10] staging: axis-fifo: use dev_err_probe() for IRQ error handling Josh Law
@ 2026-03-01 21:48 ` Josh Law
  2026-03-02  8:05   ` Dan Carpenter
  2026-03-03  6:58   ` Dan Carpenter
  2026-03-01 21:48 ` [PATCH v2 06/10] staging: axis-fifo: minimize lock duration in write Josh Law
                   ` (6 subsequent siblings)
  10 siblings, 2 replies; 20+ messages in thread
From: Josh Law @ 2026-03-01 21:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Ovidiu Panait
  Cc: Gabriel Shahrouzi, linux-staging, linux-kernel, Josh Law

From: Josh Law <objecting@objecting.org>

Return IRQ_NONE when no interrupts were triggered to avoid spurious
interrupt storms, and only clear the active interrupts instead of
blindly clearing all interrupts by writing 'intr' to the ISR instead of
XLLF_INT_CLEAR_ALL.

Signed-off-by: Josh Law <objecting@objecting.org>
---
 drivers/staging/axis-fifo/axis-fifo.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
index 28268881cda2..aad2206b481a 100644
--- a/drivers/staging/axis-fifo/axis-fifo.c
+++ b/drivers/staging/axis-fifo/axis-fifo.c
@@ -302,6 +302,9 @@ static irqreturn_t axis_fifo_irq(int irq, void *dw)
 	isr = ioread32(fifo->base_addr + XLLF_ISR_OFFSET);
 	intr = ier & isr;
 
+	if (!intr)
+		return IRQ_NONE;
+
 	if (intr & XLLF_INT_RC_MASK)
 		wake_up(&fifo->read_queue);
 
@@ -324,7 +327,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);
+	iowrite32(intr, fifo->base_addr + XLLF_ISR_OFFSET);
 
 	return IRQ_HANDLED;
 }
-- 
2.43.0


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

* [PATCH v2 06/10] staging: axis-fifo: minimize lock duration in write
  2026-03-01 21:48 [PATCH v2 01/10] staging: axis-fifo: fix alignment and line length in wait_event_interruptible Josh Law
                   ` (3 preceding siblings ...)
  2026-03-01 21:48 ` [PATCH v2 05/10] staging: axis-fifo: improve IRQ handler Josh Law
@ 2026-03-01 21:48 ` Josh Law
  2026-03-01 21:48 ` [PATCH v2 07/10] staging: axis-fifo: fix grammar in Kconfig help text Josh Law
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 20+ messages in thread
From: Josh Law @ 2026-03-01 21:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Ovidiu Panait
  Cc: Gabriel Shahrouzi, linux-staging, linux-kernel, Josh Law

From: Josh Law <objecting@objecting.org>

Memory allocation and copy from user space with vmemdup_user() is
relatively slow and can sleep. Move it outside the lock to minimize the
time the mutex is held, reducing contention for concurrent accesses.

Signed-off-by: Josh Law <objecting@objecting.org>
---
 drivers/staging/axis-fifo/axis-fifo.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
index aad2206b481a..d5533235cefc 100644
--- a/drivers/staging/axis-fifo/axis-fifo.c
+++ b/drivers/staging/axis-fifo/axis-fifo.c
@@ -233,9 +233,15 @@ static ssize_t axis_fifo_write(struct file *f, const char __user *buf,
 	    (words_to_write > (fifo->tx_fifo_depth - 4)))
 		return -EINVAL;
 
+	txbuf = vmemdup_user(buf, len);
+	if (IS_ERR(txbuf))
+		return PTR_ERR(txbuf);
+
 	if (f->f_flags & O_NONBLOCK) {
-		if (!mutex_trylock(&fifo->write_lock))
-			return -EAGAIN;
+		if (!mutex_trylock(&fifo->write_lock)) {
+			ret = -EAGAIN;
+			goto err_free;
+		}
 
 		if (words_to_write > ioread32(fifo->base_addr +
 					      XLLF_TDFV_OFFSET)) {
@@ -252,21 +258,17 @@ static ssize_t axis_fifo_write(struct file *f, const char __user *buf,
 			goto end_unlock;
 	}
 
-	txbuf = vmemdup_user(buf, len);
-	if (IS_ERR(txbuf)) {
-		ret = PTR_ERR(txbuf);
-		goto end_unlock;
-	}
-
 	for (int i = 0; i < words_to_write; ++i)
 		iowrite32(txbuf[i], fifo->base_addr + XLLF_TDFD_OFFSET);
 
 	iowrite32(len, fifo->base_addr + XLLF_TLR_OFFSET);
 
 	ret = len;
-	kvfree(txbuf);
+
 end_unlock:
 	mutex_unlock(&fifo->write_lock);
+err_free:
+	kvfree(txbuf);
 
 	return ret;
 }
-- 
2.43.0


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

* [PATCH v2 07/10] staging: axis-fifo: fix grammar in Kconfig help text
  2026-03-01 21:48 [PATCH v2 01/10] staging: axis-fifo: fix alignment and line length in wait_event_interruptible Josh Law
                   ` (4 preceding siblings ...)
  2026-03-01 21:48 ` [PATCH v2 06/10] staging: axis-fifo: minimize lock duration in write Josh Law
@ 2026-03-01 21:48 ` Josh Law
  2026-03-01 21:48 ` [PATCH v2 08/10] staging: axis-fifo: use lowercase hex constant for consistency Josh Law
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 20+ messages in thread
From: Josh Law @ 2026-03-01 21:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Ovidiu Panait
  Cc: Gabriel Shahrouzi, linux-staging, linux-kernel, Josh Law

From: Josh Law <objecting@objecting.org>

Use 'an' instead of 'a' before 'AXI' since it begins with a vowel sound.

Signed-off-by: Josh Law <objecting@objecting.org>
---
 drivers/staging/axis-fifo/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/axis-fifo/Kconfig b/drivers/staging/axis-fifo/Kconfig
index f180a8e9f58a..e618f275e283 100644
--- a/drivers/staging/axis-fifo/Kconfig
+++ b/drivers/staging/axis-fifo/Kconfig
@@ -7,6 +7,6 @@ config XIL_AXIS_FIFO
 	depends on OF && HAS_IOMEM
 	help
 	  This adds support for the Xilinx AXI-Stream FIFO IP core driver.
-	  The AXI Streaming FIFO allows memory mapped access to a AXI Streaming
+	  The AXI Streaming FIFO allows memory mapped access to an AXI Streaming
 	  interface. The Xilinx AXI-Stream FIFO IP core can be used to interface
 	  to the AXI Ethernet without the need to use DMA.
-- 
2.43.0


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

* [PATCH v2 08/10] staging: axis-fifo: use lowercase hex constant for consistency
  2026-03-01 21:48 [PATCH v2 01/10] staging: axis-fifo: fix alignment and line length in wait_event_interruptible Josh Law
                   ` (5 preceding siblings ...)
  2026-03-01 21:48 ` [PATCH v2 07/10] staging: axis-fifo: fix grammar in Kconfig help text Josh Law
@ 2026-03-01 21:48 ` Josh Law
  2026-03-01 21:48 ` [PATCH v2 09/10] staging: axis-fifo: remove unnecessary variable initializations Josh Law
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 20+ messages in thread
From: Josh Law @ 2026-03-01 21:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Ovidiu Panait
  Cc: Gabriel Shahrouzi, linux-staging, linux-kernel, Josh Law

From: Josh Law <objecting@objecting.org>

All other register offset defines use lowercase hex digits. Change
0x2C to 0x2c for XLLF_TDR_OFFSET to match the rest of the file.

Signed-off-by: Josh Law <objecting@objecting.org>
---
 drivers/staging/axis-fifo/axis-fifo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
index d5533235cefc..e154139831ea 100644
--- a/drivers/staging/axis-fifo/axis-fifo.c
+++ b/drivers/staging/axis-fifo/axis-fifo.c
@@ -46,7 +46,7 @@
 #define XLLF_RDFD_OFFSET	0x20 /* Receive Data */
 #define XLLF_RLR_OFFSET		0x24 /* Receive Length */
 #define XLLF_SRR_OFFSET		0x28 /* Local Link Reset */
-#define XLLF_TDR_OFFSET		0x2C /* Transmit Destination */
+#define XLLF_TDR_OFFSET		0x2c /* Transmit Destination */
 #define XLLF_RDR_OFFSET		0x30 /* Receive Destination */
 
 #define XLLF_RDFR_RESET_MASK	0xa5 /* Receive reset value */
-- 
2.43.0


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

* [PATCH v2 09/10] staging: axis-fifo: remove unnecessary variable initializations
  2026-03-01 21:48 [PATCH v2 01/10] staging: axis-fifo: fix alignment and line length in wait_event_interruptible Josh Law
                   ` (6 preceding siblings ...)
  2026-03-01 21:48 ` [PATCH v2 08/10] staging: axis-fifo: use lowercase hex constant for consistency Josh Law
@ 2026-03-01 21:48 ` Josh Law
  2026-03-01 21:48 ` [PATCH v2 10/10] staging: axis-fifo: simplify error returns in axis_fifo_parse_dt() Josh Law
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 20+ messages in thread
From: Josh Law @ 2026-03-01 21:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Ovidiu Panait
  Cc: Gabriel Shahrouzi, linux-staging, linux-kernel, Josh Law

From: Josh Law <objecting@objecting.org>

Remove the unnecessary initialization of 'fifo' to NULL and 'rc' to 0
in axis_fifo_probe(), as both variables are assigned before their first
use.

Signed-off-by: Josh Law <objecting@objecting.org>
---
 drivers/staging/axis-fifo/axis-fifo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
index e154139831ea..7ca0404b0875 100644
--- a/drivers/staging/axis-fifo/axis-fifo.c
+++ b/drivers/staging/axis-fifo/axis-fifo.c
@@ -456,8 +456,8 @@ static int axis_fifo_parse_dt(struct axis_fifo *fifo)
 static int axis_fifo_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	struct axis_fifo *fifo = NULL;
-	int rc = 0; /* error return value */
+	struct axis_fifo *fifo;
+	int rc;
 	int irq;
 
 	fifo = devm_kzalloc(dev, sizeof(*fifo), GFP_KERNEL);
-- 
2.43.0


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

* [PATCH v2 10/10] staging: axis-fifo: simplify error returns in axis_fifo_parse_dt()
  2026-03-01 21:48 [PATCH v2 01/10] staging: axis-fifo: fix alignment and line length in wait_event_interruptible Josh Law
                   ` (7 preceding siblings ...)
  2026-03-01 21:48 ` [PATCH v2 09/10] staging: axis-fifo: remove unnecessary variable initializations Josh Law
@ 2026-03-01 21:48 ` Josh Law
  2026-03-02  8:14 ` [PATCH v2 01/10] staging: axis-fifo: fix alignment and line length in wait_event_interruptible Dan Carpenter
  2026-03-02  8:42 ` Dan Carpenter
  10 siblings, 0 replies; 20+ messages in thread
From: Josh Law @ 2026-03-01 21:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Ovidiu Panait
  Cc: Gabriel Shahrouzi, linux-staging, linux-kernel, Josh Law

From: Josh Law <objecting@objecting.org>

Replace redundant 'ret = -EIO; return ret;' patterns with direct
'return -EIO;' statements, and change the final 'return ret;' to
'return 0;' since success is the only path that reaches it.

Signed-off-by: Josh Law <objecting@objecting.org>
---
 drivers/staging/axis-fifo/axis-fifo.c | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
index 7ca0404b0875..9aeb16d8a71f 100644
--- a/drivers/staging/axis-fifo/axis-fifo.c
+++ b/drivers/staging/axis-fifo/axis-fifo.c
@@ -403,8 +403,7 @@ static int axis_fifo_parse_dt(struct axis_fifo *fifo)
 		return ret;
 	} else if (value != 32) {
 		dev_err(fifo->dt_device, "xlnx,axi-str-rxd-tdata-width only supports 32 bits\n");
-		ret = -EIO;
-		return ret;
+		return -EIO;
 	}
 
 	ret = of_property_read_u32(node, "xlnx,axi-str-txd-tdata-width",
@@ -414,43 +413,38 @@ static int axis_fifo_parse_dt(struct axis_fifo *fifo)
 		return ret;
 	} else if (value != 32) {
 		dev_err(fifo->dt_device, "xlnx,axi-str-txd-tdata-width only supports 32 bits\n");
-		ret = -EIO;
-		return ret;
+		return -EIO;
 	}
 
 	ret = of_property_read_u32(node, "xlnx,rx-fifo-depth",
 				   &fifo->rx_fifo_depth);
 	if (ret) {
 		dev_err(fifo->dt_device, "missing xlnx,rx-fifo-depth property\n");
-		ret = -EIO;
-		return ret;
+		return -EIO;
 	}
 
 	ret = of_property_read_u32(node, "xlnx,tx-fifo-depth",
 				   &fifo->tx_fifo_depth);
 	if (ret) {
 		dev_err(fifo->dt_device, "missing xlnx,tx-fifo-depth property\n");
-		ret = -EIO;
-		return ret;
+		return -EIO;
 	}
 
 	ret = of_property_read_u32(node, "xlnx,use-rx-data",
 				   &fifo->has_rx_fifo);
 	if (ret) {
 		dev_err(fifo->dt_device, "missing xlnx,use-rx-data property\n");
-		ret = -EIO;
-		return ret;
+		return -EIO;
 	}
 
 	ret = of_property_read_u32(node, "xlnx,use-tx-data",
 				   &fifo->has_tx_fifo);
 	if (ret) {
 		dev_err(fifo->dt_device, "missing xlnx,use-tx-data property\n");
-		ret = -EIO;
-		return ret;
+		return -EIO;
 	}
 
-	return ret;
+	return 0;
 }
 
 static int axis_fifo_probe(struct platform_device *pdev)
-- 
2.43.0


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

* Re: [PATCH v2 05/10] staging: axis-fifo: improve IRQ handler
  2026-03-01 21:48 ` [PATCH v2 05/10] staging: axis-fifo: improve IRQ handler Josh Law
@ 2026-03-02  8:05   ` Dan Carpenter
  2026-03-02 15:55     ` Josh Law
  2026-03-03  6:58   ` Dan Carpenter
  1 sibling, 1 reply; 20+ messages in thread
From: Dan Carpenter @ 2026-03-02  8:05 UTC (permalink / raw)
  To: Josh Law
  Cc: Greg Kroah-Hartman, Ovidiu Panait, Gabriel Shahrouzi,
	linux-staging, linux-kernel, Josh Law

On Sun, Mar 01, 2026 at 09:48:10PM +0000, Josh Law wrote:
> From: Josh Law <objecting@objecting.org>
> 
> Return IRQ_NONE when no interrupts were triggered to avoid spurious
> interrupt storms, and only clear the active interrupts instead of
> blindly clearing all interrupts by writing 'intr' to the ISR instead of
> XLLF_INT_CLEAR_ALL.
> 

Is this something you actually experienced in real life?  The commit
message needs to be clearer about that.

regards,
dan carpenter


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

* Re: [PATCH v2 01/10] staging: axis-fifo: fix alignment and line length in wait_event_interruptible
  2026-03-01 21:48 [PATCH v2 01/10] staging: axis-fifo: fix alignment and line length in wait_event_interruptible Josh Law
                   ` (8 preceding siblings ...)
  2026-03-01 21:48 ` [PATCH v2 10/10] staging: axis-fifo: simplify error returns in axis_fifo_parse_dt() Josh Law
@ 2026-03-02  8:14 ` Dan Carpenter
  2026-03-02  8:42 ` Dan Carpenter
  10 siblings, 0 replies; 20+ messages in thread
From: Dan Carpenter @ 2026-03-02  8:14 UTC (permalink / raw)
  To: Josh Law
  Cc: Greg Kroah-Hartman, Ovidiu Panait, Gabriel Shahrouzi,
	linux-staging, linux-kernel, Josh Law

On Sun, Mar 01, 2026 at 09:48:06PM +0000, Josh Law wrote:
> From: Josh Law <objecting@objecting.org>
> 
> Signed-off-by: Josh Law <objecting@objecting.org>
> ---

There isn't a commit message here so we can't merge it.  But also I would
like to see a 0/10 header email which talks about how you have tested
these.

Most of these are straight forward to review but a couple are more
complicated.

regards,
dan carpenter


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

* Re: [PATCH v2 01/10] staging: axis-fifo: fix alignment and line length in wait_event_interruptible
  2026-03-01 21:48 [PATCH v2 01/10] staging: axis-fifo: fix alignment and line length in wait_event_interruptible Josh Law
                   ` (9 preceding siblings ...)
  2026-03-02  8:14 ` [PATCH v2 01/10] staging: axis-fifo: fix alignment and line length in wait_event_interruptible Dan Carpenter
@ 2026-03-02  8:42 ` Dan Carpenter
  10 siblings, 0 replies; 20+ messages in thread
From: Dan Carpenter @ 2026-03-02  8:42 UTC (permalink / raw)
  To: Josh Law
  Cc: Greg Kroah-Hartman, Ovidiu Panait, Gabriel Shahrouzi,
	linux-staging, linux-kernel, Josh Law

On Sun, Mar 01, 2026 at 09:48:06PM +0000, Josh Law wrote:
> From: Josh Law <objecting@objecting.org>
> 
> Signed-off-by: Josh Law <objecting@objecting.org>
> ---
>  drivers/staging/axis-fifo/axis-fifo.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
> index aa90b27197cf..aac2c58ef9b3 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;
>  	}

Btw, Greg already NAKed this patch from someone else.

https://lore.kernel.org/all/2026022711-showoff-bakery-8235@gregkh/

regards,
dan carpenter


> -- 
> 2.43.0
> 

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

* Re: [PATCH v2 05/10] staging: axis-fifo: improve IRQ handler
  2026-03-02  8:05   ` Dan Carpenter
@ 2026-03-02 15:55     ` Josh Law
  2026-03-03  6:10       ` Dan Carpenter
  0 siblings, 1 reply; 20+ messages in thread
From: Josh Law @ 2026-03-02 15:55 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Greg Kroah-Hartman, Ovidiu Panait, Gabriel Shahrouzi,
	linux-staging, linux-kernel, Josh Law

2 Mar 2026 08:14:53 Dan Carpenter <dan.carpenter@linaro.org>:

> On Sun, Mar 01, 2026 at 09:48:10PM +0000, Josh Law wrote:
>> From: Josh Law <objecting@objecting.org>
>>
>> Return IRQ_NONE when no interrupts were triggered to avoid spurious
>> interrupt storms, and only clear the active interrupts instead of
>> blindly clearing all interrupts by writing 'intr' to the ISR instead of
>> XLLF_INT_CLEAR_ALL.
>>
>
> Is this something you actually experienced in real life?  The commit
> message needs to be clearer about that.
>
> regards,
> dan carpenter

Hello Dan, It's just code optimizations, making it cleaner, etc, I also ran all of these latest V2 commits through check patch, to make sure they are compliant, I own this device so I hope I can be the maintainer of it one day, I'm learning this Linux system day by day, so I am sorry I have to annoy a professional linaro dev like you haha

V/R
V/R

Josh law

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

* Re: [PATCH v2 05/10] staging: axis-fifo: improve IRQ handler
  2026-03-02 15:55     ` Josh Law
@ 2026-03-03  6:10       ` Dan Carpenter
  2026-03-03  7:02         ` Josh Law
  0 siblings, 1 reply; 20+ messages in thread
From: Dan Carpenter @ 2026-03-03  6:10 UTC (permalink / raw)
  To: Josh Law
  Cc: Greg Kroah-Hartman, Ovidiu Panait, Gabriel Shahrouzi,
	linux-staging, linux-kernel, Josh Law

On Mon, Mar 02, 2026 at 03:55:36PM +0000, Josh Law wrote:
> 2 Mar 2026 08:14:53 Dan Carpenter <dan.carpenter@linaro.org>:
> 
> > On Sun, Mar 01, 2026 at 09:48:10PM +0000, Josh Law wrote:
> >> From: Josh Law <objecting@objecting.org>
> >>
> >> Return IRQ_NONE when no interrupts were triggered to avoid spurious
> >> interrupt storms, and only clear the active interrupts instead of
> >> blindly clearing all interrupts by writing 'intr' to the ISR instead of
> >> XLLF_INT_CLEAR_ALL.
> >>
> >
> > Is this something you actually experienced in real life?  The commit
> > message needs to be clearer about that.
> >
> > regards,
> > dan carpenter
> 
> Hello Dan, It's just code optimizations, making it cleaner, etc, I
> also ran all of these latest V2 commits through check patch, to make
> sure they are compliant, I own this device so I hope I can be the
> maintainer of it one day, I'm learning this Linux system day by day,
> so I am sorry I have to annoy a professional linaro dev like you haha
> 

I don't mind reviewing patches.  The cleanups are easy to review.  In
this case it's a behavior change and so I would want a clearer picture
the motivation and of how well these have been tested for that.

regards,
dan carpenter


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

* Re: [PATCH v2 05/10] staging: axis-fifo: improve IRQ handler
  2026-03-01 21:48 ` [PATCH v2 05/10] staging: axis-fifo: improve IRQ handler Josh Law
  2026-03-02  8:05   ` Dan Carpenter
@ 2026-03-03  6:58   ` Dan Carpenter
  1 sibling, 0 replies; 20+ messages in thread
From: Dan Carpenter @ 2026-03-03  6:58 UTC (permalink / raw)
  To: Josh Law
  Cc: Greg Kroah-Hartman, Ovidiu Panait, Gabriel Shahrouzi,
	linux-staging, linux-kernel, Josh Law

On Sun, Mar 01, 2026 at 09:48:10PM +0000, Josh Law wrote:
> From: Josh Law <objecting@objecting.org>
> 
> Return IRQ_NONE when no interrupts were triggered to avoid spurious
> interrupt storms, and only clear the active interrupts instead of
> blindly clearing all interrupts by writing 'intr' to the ISR instead of
> XLLF_INT_CLEAR_ALL.
> 

XLLF_ISR_OFFSET is the IRQs which are triggered and XLLF_IER_OFFSET
are the IRQs that we care about.  The intr variable is the IRQs which
are both, they are triggered and we care about them.  In the original
code it clears out all the IRQs that have triggered regardless of
whether or not we care about them.  You're saying clearing all the
IRQs "blindly" is wrong, but to me it feels like the correct
behavior.  In real life it probably doesn't matter at all since
we probably care about all the IRQs.  And apparently in your testing
it makes no difference either way...

I feel like leaving the flags set feels like it would be more likely
to trigger and IRQ storm.  But we're debating the number of angels
dancing on a pin.

Let's just leave it as-is unless we can show it helps.

regards,
dan carpenter


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

* Re: [PATCH v2 05/10] staging: axis-fifo: improve IRQ handler
  2026-03-03  6:10       ` Dan Carpenter
@ 2026-03-03  7:02         ` Josh Law
  2026-03-03  7:27           ` Dan Carpenter
  0 siblings, 1 reply; 20+ messages in thread
From: Josh Law @ 2026-03-03  7:02 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Greg Kroah-Hartman, Ovidiu Panait, Gabriel Shahrouzi,
	linux-staging, linux-kernel, Josh Law

3 Mar 2026 06:10:13 Dan Carpenter <dan.carpenter@linaro.org>:

> On Mon, Mar 02, 2026 at 03:55:36PM +0000, Josh Law wrote:
>> 2 Mar 2026 08:14:53 Dan Carpenter <dan.carpenter@linaro.org>:
>>
>>> On Sun, Mar 01, 2026 at 09:48:10PM +0000, Josh Law wrote:
>>>> From: Josh Law <objecting@objecting.org>
>>>>
>>>> Return IRQ_NONE when no interrupts were triggered to avoid spurious
>>>> interrupt storms, and only clear the active interrupts instead of
>>>> blindly clearing all interrupts by writing 'intr' to the ISR instead of
>>>> XLLF_INT_CLEAR_ALL.
>>>>
>>>
>>> Is this something you actually experienced in real life?  The commit
>>> message needs to be clearer about that.
>>>
>>> regards,
>>> dan carpenter
>>
>> Hello Dan, It's just code optimizations, making it cleaner, etc, I
>> also ran all of these latest V2 commits through check patch, to make
>> sure they are compliant, I own this device so I hope I can be the
>> maintainer of it one day, I'm learning this Linux system day by day,
>> so I am sorry I have to annoy a professional linaro dev like you haha
>>
>
> I don't mind reviewing patches.  The cleanups are easy to review.  In
> this case it's a behavior change and so I would want a clearer picture
> the motivation and of how well these have been tested for that.
>
> regards,
> dan carpenter

Lol, are you gonna approve ANY of my patches haha

V/R

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

* Re: [PATCH v2 05/10] staging: axis-fifo: improve IRQ handler
  2026-03-03  7:02         ` Josh Law
@ 2026-03-03  7:27           ` Dan Carpenter
  2026-03-03  7:30             ` Josh Law
  0 siblings, 1 reply; 20+ messages in thread
From: Dan Carpenter @ 2026-03-03  7:27 UTC (permalink / raw)
  To: Josh Law
  Cc: Greg Kroah-Hartman, Ovidiu Panait, Gabriel Shahrouzi,
	linux-staging, linux-kernel, Josh Law

On Tue, Mar 03, 2026 at 07:02:19AM +0000, Josh Law wrote:
> 
> Lol, are you gonna approve ANY of my patches haha
> 

The life of a kernel developer is full of heart-ache.  I recently had
to redo a v5 patchset because there was a O vs 0 typo in the
documentation.

I believe you resent all your patchse in this set, right?  But the first
patch is obviously auto-NAKed for not having a commit message so that
kills the whole thing.

regards,
dan carpenter

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

* Re: [PATCH v2 05/10] staging: axis-fifo: improve IRQ handler
  2026-03-03  7:27           ` Dan Carpenter
@ 2026-03-03  7:30             ` Josh Law
  2026-03-03  7:46               ` Dan Carpenter
  0 siblings, 1 reply; 20+ messages in thread
From: Josh Law @ 2026-03-03  7:30 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Greg Kroah-Hartman, Ovidiu Panait, Gabriel Shahrouzi,
	linux-staging, linux-kernel, Josh Law

3 Mar 2026 07:27:39 Dan Carpenter <dan.carpenter@linaro.org>:

> On Tue, Mar 03, 2026 at 07:02:19AM +0000, Josh Law wrote:
>>
>> Lol, are you gonna approve ANY of my patches haha
>>
>
> The life of a kernel developer is full of heart-ache.  I recently had
> to redo a v5 patchset because there was a O vs 0 typo in the
> documentation.
>
> I believe you resent all your patchse in this set, right?  But the first
> patch is obviously auto-NAKed for not having a commit message so that
> kills the whole thing.
>
> regards,
> dan carpenter

If you tell me the patch number I can do a commit message

V/R

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

* Re: [PATCH v2 05/10] staging: axis-fifo: improve IRQ handler
  2026-03-03  7:30             ` Josh Law
@ 2026-03-03  7:46               ` Dan Carpenter
  0 siblings, 0 replies; 20+ messages in thread
From: Dan Carpenter @ 2026-03-03  7:46 UTC (permalink / raw)
  To: Josh Law
  Cc: Greg Kroah-Hartman, Ovidiu Panait, Gabriel Shahrouzi,
	linux-staging, linux-kernel, Josh Law

On Tue, Mar 03, 2026 at 07:30:30AM +0000, Josh Law wrote:
> 3 Mar 2026 07:27:39 Dan Carpenter <dan.carpenter@linaro.org>:
> 
> > On Tue, Mar 03, 2026 at 07:02:19AM +0000, Josh Law wrote:
> >>
> >> Lol, are you gonna approve ANY of my patches haha
> >>
> >
> > The life of a kernel developer is full of heart-ache.  I recently had
> > to redo a v5 patchset because there was a O vs 0 typo in the
> > documentation.
> >
> > I believe you resent all your patchse in this set, right?  But the first
> > patch is obviously auto-NAKed for not having a commit message so that
> > kills the whole thing.
> >
> > regards,
> > dan carpenter
> 
> If you tell me the patch number I can do a commit message

Heh.

I mean you sent this patchset as a lot of individual patches and I replied
to those as well so the discussion is all spread out.  I can't find all the
things I said.

regards,
dan carpenter


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

end of thread, other threads:[~2026-03-03  7:46 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-01 21:48 [PATCH v2 01/10] staging: axis-fifo: fix alignment and line length in wait_event_interruptible Josh Law
2026-03-01 21:48 ` [PATCH v2 02/10] staging: axis-fifo: remove redundant goto end Josh Law
2026-03-01 21:48 ` [PATCH v2 03/10] staging: axis-fifo: simplify resource mapping Josh Law
2026-03-01 21:48 ` [PATCH v2 04/10] staging: axis-fifo: use dev_err_probe() for IRQ error handling Josh Law
2026-03-01 21:48 ` [PATCH v2 05/10] staging: axis-fifo: improve IRQ handler Josh Law
2026-03-02  8:05   ` Dan Carpenter
2026-03-02 15:55     ` Josh Law
2026-03-03  6:10       ` Dan Carpenter
2026-03-03  7:02         ` Josh Law
2026-03-03  7:27           ` Dan Carpenter
2026-03-03  7:30             ` Josh Law
2026-03-03  7:46               ` Dan Carpenter
2026-03-03  6:58   ` Dan Carpenter
2026-03-01 21:48 ` [PATCH v2 06/10] staging: axis-fifo: minimize lock duration in write Josh Law
2026-03-01 21:48 ` [PATCH v2 07/10] staging: axis-fifo: fix grammar in Kconfig help text Josh Law
2026-03-01 21:48 ` [PATCH v2 08/10] staging: axis-fifo: use lowercase hex constant for consistency Josh Law
2026-03-01 21:48 ` [PATCH v2 09/10] staging: axis-fifo: remove unnecessary variable initializations Josh Law
2026-03-01 21:48 ` [PATCH v2 10/10] staging: axis-fifo: simplify error returns in axis_fifo_parse_dt() Josh Law
2026-03-02  8:14 ` [PATCH v2 01/10] staging: axis-fifo: fix alignment and line length in wait_event_interruptible Dan Carpenter
2026-03-02  8:42 ` Dan Carpenter

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