public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] staging: axis-fifo: fix alignment and add DT binding documentation
@ 2026-03-04 11:08 Alexandru Hossu
  2026-03-04 12:30 ` Rob Herring (Arm)
  2026-03-04 12:32 ` Krzysztof Kozlowski
  0 siblings, 2 replies; 13+ messages in thread
From: Alexandru Hossu @ 2026-03-04 11:08 UTC (permalink / raw)
  To: robh
  Cc: krzk+dt, conor+dt, gregkh, jollys, devicetree, linux-kernel,
	linux-staging

[-- Attachment #1: Type: text/plain, Size: 171 bytes --]

Add YAML device tree binding documentation for the Xilinx
AXI-Stream FIFO IP core and fix code alignment issue.

Signed-off-by: Alexandru Hossu <hossu.alexandru@gmail.com>

[-- Attachment #2: 0001-staging-axis-fifo-fix-alignment-and-add-DT-binding-d.patch --]
[-- Type: text/plain, Size: 3453 bytes --]

From b94514738af787173717cbfa85637c53084284da Mon Sep 17 00:00:00 2001
From: Alexandru Hossu <hossu.alexandru@gmail.com>
Date: Wed, 4 Mar 2026 12:06:49 +0100
Subject: [PATCH] staging: axis-fifo: fix alignment and add DT binding
 documentation

Signed-off-by: Alexandru Hossu <hossu.alexandru@gmail.com>
---
 .../bindings/misc/xlnx,axi-fifo-mm-s.yaml     | 77 +++++++++++++++++++
 drivers/staging/axis-fifo/axis-fifo.c         |  5 +-
 2 files changed, 81 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/misc/xlnx,axi-fifo-mm-s.yaml

diff --git a/Documentation/devicetree/bindings/misc/xlnx,axi-fifo-mm-s.yaml b/Documentation/devicetree/bindings/misc/xlnx,axi-fifo-mm-s.yaml
new file mode 100644
index 000000000..6d1cd651e
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/xlnx,axi-fifo-mm-s.yaml
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/misc/xlnx,axi-fifo-mm-s.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Xilinx AXI-Stream FIFO
+
+description: |
+  The Xilinx AXI-Stream FIFO IP core has read and write AXI-Stream FIFOs,
+  the contents of which can be accessed from the AXI4 memory-mapped interface.
+  Currently supports only store-forward mode with a 32-bit AXI4-Lite interface.
+
+maintainers:
+  - Jolly Shah <jollys@xilinx.com>
+
+properties:
+  compatible:
+    enum:
+      - xlnx,axi-fifo-mm-s-4.1
+      - xlnx,axi-fifo-mm-s-4.2
+      - xlnx,axi-fifo-mm-s-4.3
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  interrupt-names:
+    items:
+      - const: interrupt
+
+  interrupt-parent: true
+
+  xlnx,use-rx-data:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1]
+    description: Set to 1 if RX FIFO is enabled, 0 otherwise.
+
+  xlnx,use-tx-data:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1]
+    description: Set to 1 if TX FIFO is enabled, 0 otherwise.
+
+  xlnx,rx-fifo-depth:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Depth of RX FIFO in words.
+
+  xlnx,tx-fifo-depth:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Depth of TX FIFO in words.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - interrupt-names
+  - interrupt-parent
+  - xlnx,use-rx-data
+  - xlnx,use-tx-data
+
+additionalProperties: true
+
+examples:
+  - |
+    axi_fifo_mm_s_0: axi_fifo_mm_s@43c00000 {
+      compatible = "xlnx,axi-fifo-mm-s-4.1";
+      interrupt-names = "interrupt";
+      interrupt-parent = <&intc>;
+      interrupts = <0 29 4>;
+      reg = <0x43c00000 0x10000>;
+      xlnx,use-rx-data = <0x0>;
+      xlnx,use-tx-data = <0x1>;
+      xlnx,rx-fifo-depth = <0x200>;
+      xlnx,tx-fifo-depth = <0x8000>;
+    };
diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
index aa90b2719..6ca2bf4d4 100644
--- a/drivers/staging/axis-fifo/axis-fifo.c
+++ b/drivers/staging/axis-fifo/axis-fifo.c
@@ -245,8 +245,11 @@ static ssize_t axis_fifo_write(struct file *f, const char __user *buf,
 	} else {
 		mutex_lock(&fifo->write_lock);
 
+		u32 free_space;
+
+		free_space = ioread32(fifo->base_addr + XLLF_TDFV_OFFSET);
 		ret = wait_event_interruptible(fifo->write_queue,
-			ioread32(fifo->base_addr + XLLF_TDFV_OFFSET) >= words_to_write);
+						       free_space >= words_to_write);
 		if (ret)
 			goto end_unlock;
 	}
-- 
2.43.0


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

end of thread, other threads:[~2026-03-04 14:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-04 11:08 [PATCH] staging: axis-fifo: fix alignment and add DT binding documentation Alexandru Hossu
2026-03-04 12:30 ` Rob Herring (Arm)
2026-03-04 12:32 ` Krzysztof Kozlowski
2026-03-04 12:46   ` [PATCH v2] dt-bindings: misc: xlnx,axi-fifo-mm-s: fix interrupt-parent property Alexandru Hossu
2026-03-04 12:51     ` Krzysztof Kozlowski
2026-03-04 12:52       ` Krzysztof Kozlowski
2026-03-04 13:16         ` [PATCH] " Alexandru Hossu
2026-03-04 13:22           ` Greg KH
2026-03-04 13:29             ` Conor Dooley
2026-03-04 14:08               ` Krzysztof Kozlowski
2026-03-04 14:22                 ` Conor Dooley
2026-03-04 13:24           ` Krzysztof Kozlowski
2026-03-04 14:12     ` [PATCH v2] " Dan Carpenter

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