summaryrefslogtreecommitdiffstats
path: root/drivers/staging/axis-fifo
AgeCommit message (Collapse)AuthorLines
2026-01-27staging: axis-fifo: Fix indentationGeet Singhi-1/+1
Check reported by checkpatch.pl CHECK: Alignment should match open parenthesis Signed-off-by: Geet Singhi <singhigeet1729@gmail.com> Link: https://patch.msgid.link/20260123205905.37717-1-singhigeet1729@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-11staging: axis-fifo: Clean up register and mask definitionsOvidiu Panait-27/+25
Improve readability and consistency of hardware register definitions: - Remove unnecessary leading zeros from register offset values - Use BIT() macro for single-bit interrupt mask definitions - Align values and comments for better readability No functional change. Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Link: https://patch.msgid.link/20251227212640.3321310-9-ovidiu.panait.oss@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-11staging: axis-fifo: Remove redundant commentsOvidiu Panait-95/+10
Drop banner-style section header comments and also remove comments around self-explanatory code to reduce clutter and improve readability. No functional changes. Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Link: https://patch.msgid.link/20251227212640.3321310-8-ovidiu.panait.oss@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-11staging: axis-fifo: Remove noisy error messages for user errorsOvidiu Panait-15/+2
Remove dev_err() calls for conditions caused by invalid userspace input. Logging them clutters the kernel log, especially if userspace repeatedly makes invalid calls. Also, consolidate the write validation checks into a single condition. Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Link: https://patch.msgid.link/20251227212640.3321310-7-ovidiu.panait.oss@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-11staging: axis-fifo: Remove unnecessary zero-length packet checkOvidiu Panait-5/+0
Remove the check for zero-length packets as this condition cannot occur during normal operation. According to the Xilinx AXI4-Stream FIFO Product Guide (PG080), in the Receive Length Register (RLR) description: "The smallest packet that can be received is 1 byte." A zero-length packet would indicate a bug in the IP core itself. Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Link: https://patch.msgid.link/20251227212640.3321310-6-ovidiu.panait.oss@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-11staging: axis-fifo: Remove unnecessary casts from file->private_dataOvidiu Panait-2/+2
Drop explicit casts when accessing file->private_data in the read() and write() paths, as they are not needed. Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Link: https://patch.msgid.link/20251227212640.3321310-5-ovidiu.panait.oss@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-11staging: axis-fifo: Drop unneeded release callbackOvidiu Panait-8/+0
The release function only clears file->private_data, which is not needed. Remove the callback. Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Link: https://patch.msgid.link/20251227212640.3321310-4-ovidiu.panait.oss@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-11staging: axis-fifo: Use devm_kasprintf for device name allocationOvidiu Panait-8/+7
Replace manual kzalloc + snprintf with devm_kasprintf, which is cleaner and purpose-built for this use case. Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Link: https://patch.msgid.link/20251227212640.3321310-3-ovidiu.panait.oss@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-11staging: axis-fifo: Add poll() supportOvidiu Panait-1/+25
Implement poll() file operation to allow userspace applications to wait for FIFO readiness using select()/poll()/epoll(). This replaces the module parameter-based timeouts removed in the previous commit. Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Link: https://patch.msgid.link/20251227212640.3321310-2-ovidiu.panait.oss@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-11staging: axis-fifo: Remove read/write timeout module parametersOvidiu Panait-56/+6
Module parameters for timeouts are a poor interface choice as they affect all device instances globally rather than being configurable per file descriptor. The current implementation also returns -EAGAIN on timeout, requiring userspace to implement retry loops around blocking operations. Remove the read_timeout and write_timeout module parameters. The next commit adds poll() support, allowing applications to implement timeout handling using standard poll()/select() interfaces. Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Link: https://patch.msgid.link/20251227212640.3321310-1-ovidiu.panait.oss@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-13staging: axis-fifo: drop debug print of remapped base addressOvidiu Panait-2/+0
The probe function prints the remapped base address with dev_dbg(). This message is not useful and printing kernel addresses is discouraged, so remove the debug print. Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Link: https://lore.kernel.org/r/20250919195400.3180039-6-ovidiu.panait.oss@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-13staging: axis-fifo: drop redundant read/write_flags from axis_fifoOvidiu Panait-22/+8
The driver stores file flags (read_flags/write_flags) in the axis_fifo struct, duplicating information already available in struct file. Switch to using f->f_flags directly in read/write paths and open(), removing the unnecessary fields. Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Link: https://lore.kernel.org/r/20250919195400.3180039-5-ovidiu.panait.oss@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-13staging: axis-fifo: remove get_dts_property() helperOvidiu Panait-26/+13
The get_dts_property() wrapper around of_property_read_u32() adds no real value and duplicates error handling. Inline the calls directly in axis_fifo_parse_dt() to reduce indirection and simplify the code. Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Link: https://lore.kernel.org/r/20250919195400.3180039-4-ovidiu.panait.oss@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-13staging: axis-fifo: remove unneeded irq field from struct axis_fifoOvidiu Panait-7/+6
The irq number returned by platform_get_irq() is stored in struct axis_fifo during probe but it is never used afterwards. Drop the redundant irq field and use a local variable instead. Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Link: https://lore.kernel.org/r/20250919195400.3180039-3-ovidiu.panait.oss@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-13staging: axis-fifo: simplify interrupt handlingOvidiu Panait-111/+33
The irq handler iterates through the interrupt bits one by one in a while() loop, clearing one bit at a time. This is unnecessary and inefficient, as the 'Interrupt Status Register' can be cleared with a single write operation. Also the irq handler checks for some interrupts that are masked out in the 'Interrupt Enable Register', so they are never triggered. Simplify the irq handler by removing the checks for interrupts that are masked out and clear the whole 'Interrupt Status Register' in one go. The macros that are no longer relevant are also removed. Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Link: https://lore.kernel.org/r/20250919195400.3180039-2-ovidiu.panait.oss@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-13staging: axis-fifo: add compatible strings for v4.2 and v4.3Ovidiu Panait-2/+7
The driver is compatible with both v4.2 and v4.3 versions of the Xilinx AXI4-Stream FIFO, so add compatible strings for them. Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Link: https://lore.kernel.org/r/20250919195400.3180039-1-ovidiu.panait.oss@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-07Merge tag 'staging-6.18-rc1-2' of ↵Linus Torvalds-37/+31
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver fixes from Greg KH: "Here are some staging driver fixes that missed 6.17-final due to my travel schedule. They fix a number of reported issues in the axis-fifo driver, one of which was just independently discovered by someone else today so someone is looking at this code. All of these fixes have been in linux-next for many weeks with no reported issues" * tag 'staging-6.18-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: axis-fifo: flush RX FIFO on read errors staging: axis-fifo: fix TX handling on copy_from_user() failure staging: axis-fifo: fix maximum TX packet length check
2025-09-12staging: axis-fifo: flush RX FIFO on read errorsOvidiu Panait-7/+11
Flush stale data from the RX FIFO in case of errors, to avoid reading old data when new packets arrive. Commit c6e8d85fafa7 ("staging: axis-fifo: Remove hardware resets for user errors") removed full FIFO resets from the read error paths, which fixed potential TX data losses, but introduced this RX issue. Fixes: c6e8d85fafa7 ("staging: axis-fifo: Remove hardware resets for user errors") Cc: stable@vger.kernel.org Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Link: https://lore.kernel.org/r/20250912101322.1282507-2-ovidiu.panait.oss@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-12staging: axis-fifo: fix TX handling on copy_from_user() failureOvidiu Panait-26/+10
If copy_from_user() fails, write() currently returns -EFAULT, but any partially written data leaves the TX FIFO in an inconsistent state. Subsequent write() calls then fail with "transmit length mismatch" errors. Once partial data is written to the hardware FIFO, it cannot be removed without a TX reset. Commit c6e8d85fafa7 ("staging: axis-fifo: Remove hardware resets for user errors") removed a full FIFO reset for this case, which fixed a potential RX data loss, but introduced this TX issue. Fix this by introducing a bounce buffer: copy the full packet from userspace first, and write to the hardware FIFO only if the copy was successful. Fixes: c6e8d85fafa7 ("staging: axis-fifo: Remove hardware resets for user errors") Cc: stable@vger.kernel.org Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Link: https://lore.kernel.org/r/20250912101322.1282507-1-ovidiu.panait.oss@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-08-18staging: axis-fifo: fix maximum TX packet length checkOvidiu Panait-4/+10
Since commit 2ca34b508774 ("staging: axis-fifo: Correct handling of tx_fifo_depth for size validation"), write() operations with packets larger than 'tx_fifo_depth - 4' words are no longer rejected with -EINVAL. Fortunately, the packets are not actually getting transmitted to hardware, otherwise they would be raising a 'Transmit Packet Overrun Error' interrupt, which requires a reset of the TX circuit to recover from. Instead, the request times out inside wait_event_interruptible_timeout() and always returns -EAGAIN, since the wake up condition can never be true for these packets. But still, they unnecessarily block other tasks from writing to the FIFO and the EAGAIN return code signals userspace to retry the write() call, even though it will always fail and time out. According to the AXI4-Stream FIFO reference manual (PG080), the maximum valid packet length is 'tx_fifo_depth - 4' words, so attempting to send larger packets is invalid and should not be happening in the first place: > The maximum packet that can be transmitted is limited by the size of > the FIFO, which is (C_TX_FIFO_DEPTH–4)*(data interface width/8) bytes. Therefore, bring back the old behavior and outright reject packets larger than 'tx_fifo_depth - 4' with -EINVAL. Add a comment to explain why the check is necessary. The dev_err() message was removed to avoid cluttering the dmesg log if an invalid packet is received from userspace. Fixes: 2ca34b508774 ("staging: axis-fifo: Correct handling of tx_fifo_depth for size validation") Cc: stable@vger.kernel.org Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Link: https://lore.kernel.org/r/20250817171350.872105-1-ovidiu.panait.oss@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-08-13staging: axis-fifo: use unique identifiers in device namesOvidiu Panait-5/+13
Axis-fifo devices use physical addresses in their name, for example 'axis_fifo_0x43c00000'. This is generally frowned upon and it does not follow the usual naming scheme that uses unique identifiers. Therefore, use ida_alloc()/ida_free() to implement unique identifiers for axis-fifo device names (i.e. axis_fifo0, axis_fifo1, etc.). Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Link: https://lore.kernel.org/r/20250811085417.2641674-2-ovidiu.panait.oss@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-08-11staging: axis-fifo: remove unnecessary dev_set_drvdata() callsOvidiu Panait-13/+6
Remove unnecessary dev_set_drvdata() calls - driver_data will be set to NULL in device_unbind_cleanup() at driver exit time. This allows us to remove the 'err_initial' label, simplifying the probe function a bit. Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Link: https://lore.kernel.org/r/20250808204831.2618122-1-ovidiu.panait.oss@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-07-24staging: axis-fifo: add debugfs interface for dumping fifo registersOvidiu Panait-0/+44
For debugging purposes, add a simple, read-only debugfs interface to dump the following fifo registers: ISR - Interrupt Status Register IER - Interrupt Enable Register TDFV - Transmit Data FIFO Vacancy RDFO - Receive Data FIFO Occupancy $ cat /sys/kernel/debug/43c00000.axi_fifo_mm_s/regs isr: 0x00000000 ier: 0xfe000000 tdfv: 0x000001fc rdfo: 0x00000000 Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Link: https://lore.kernel.org/r/20250720183833.3570345-2-ovidiu.panait.oss@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-07-24staging: axis-fifo: remove sysfs interfaceOvidiu Panait-175/+0
Unhandled fault: imprecise external abort (0x1406) at 0xaec8d000 [aec8d000] *pgd=03f74831, *pte=0525c75f, *ppte=0525cc7f Internal error: Oops - BUG: 1406 [#1] SMP ARM Hardware name: Xilinx Zynq Platform PC is at sysfs_read+0xc4/0xd8 LR is at dev_attr_show+0x6c/0xc0 pc : [<c0ff9298>] lr : [<c0adad38>] psr: 60070013 sp : e09abd18 ip : c3193000 fp : c0adaccc r10: 00000000 r9 : c3192000 r8 : 183abab5 r7 : c1d5d5a8 r6 : c2d71440 r5 : 00000024 r4 : c3192000 r3 : e0a60024 r2 : 00000000 r1 : c3192000 r0 : c2d71444 ... Call trace: sysfs_read from dev_attr_show+0x6c/0xc0 dev_attr_show from sysfs_kf_seq_show+0x270/0x360 sysfs_kf_seq_show from seq_read_iter+0x7f4/0x10bc seq_read_iter from vfs_read+0x350/0x3d0 vfs_read from ksys_read+0x104/0x194 ksys_read from ret_fast_syscall+0x0/0x54 The same abort is triggered if a read is attempted on RDFD register when the fifo is empty. Therefore, remove the sysfs interface and only let read()/write() modify the fifo registers. For debugging purposes, a simple read-only debugfs interface is added in the next patch. Fixes: 4a965c5f89de ("staging: add driver for Xilinx AXI-Stream FIFO v4.1 IP core") Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Link: https://lore.kernel.org/r/20250720183833.3570345-1-ovidiu.panait.oss@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-04-25staging: axis-fifo: Remove hardware resets for user errorsGabriel Shahrouzi-8/+3
The axis-fifo driver performs a full hardware reset (via reset_ip_core()) in several error paths within the read and write functions. This reset flushes both TX and RX FIFOs and resets the AXI-Stream links. Allow the user to handle the error without causing hardware disruption or data loss in other FIFO paths. Fixes: 4a965c5f89de ("staging: add driver for Xilinx AXI-Stream FIFO v4.1 IP core") Cc: stable@vger.kernel.org Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.com> Link: https://lore.kernel.org/r/20250419004306.669605-1-gshahrouzi@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-04-25staging: axis-fifo: Correct handling of tx_fifo_depth for size validationGabriel Shahrouzi-3/+0
Remove erroneous subtraction of 4 from the total FIFO depth read from device tree. The stored depth is for checking against total capacity, not initial vacancy. This prevented writes near the FIFO's full size. The check performed just before data transfer, which uses live reads of the TDFV register to determine current vacancy, correctly handles the initial Depth - 4 hardware state and subsequent FIFO fullness. Fixes: 4a965c5f89de ("staging: add driver for Xilinx AXI-Stream FIFO v4.1 IP core") Cc: stable@vger.kernel.org Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.com> Link: https://lore.kernel.org/r/20250419012937.674924-1-gshahrouzi@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-09staging: Switch back to struct platform_driver::remove()Sergio Paracuellos-1/+1
After commit 0edb555a65d1 ("platform: Make platform_driver::remove() return void") .remove() is (again) the right callback to implement for platform drivers. Convert all staging drivers to use .remove(), with the eventual goal to drop struct platform_driver::remove_new(). As .remove() and .remove_new() have the same prototypes, conversion is done by just changing the structure member name in the driver initializer. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Link: https://lore.kernel.org/r/20241001085751.282113-1-sergio.paracuellos@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-04-09staging: axis-fifo: Fix indentationUri Arev-5/+5
Warning reported by checkpatch.pl script: CHECK: Alignment should match open parenthesis Signed-off-by: Uri Arev <me@wantyapps.xyz> Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com> Link: https://lore.kernel.org/r/20240305211416.755911-1-me@wantyapps.xyz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-02-17staging: axis-fifo: Use sysfs_emit()Christophe JAILLET-6/+1
sysfs_read() is anly called from _show() functions declared by DEVICE_ATTR_RW(). Using sysfs_emit() is the preferred style and here, it saves a useless copy and a temporary buffer in the stack. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/588327734f374b5f5cb5c4d5725d884fdc83663e.1707654406.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-27staging: Explicitly include correct DT includesRob Herring-4/+2
The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # tegra-video Acked-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com> Acked-by: Alex Elder <elder@linaro.org> Link: https://lore.kernel.org/r/20230714175002.4064428-1-robh@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-27staging: axis-fifo: Use devm_platform_get_and_ioremap_resource()Yangtao Li-10/+2
Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <frank.li@vivo.com> Link: https://lore.kernel.org/r/20230704095543.32812-1-frank.li@vivo.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-17axis-fifo: remove the unnecessary dev_info()Prathu Baronia-3/+0
This dev_info() statement is not needed since drivers need to be quiet under normal operation and its not a good idea to print addresses in kernel log. Signed-off-by: Prathu Baronia <prathubaronia2011@gmail.com> Message-ID: <20230616152602.33232-2-prathubaronia2011@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-04-03staging: axis-fifo: Convert to platform remove callback returning voidUwe Kleine-König-4/+2
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20230403154014.2564054-2-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-17staging: axis-fifo: initialize timeouts in init onlyKhadija Kamran-11/+17
Initialize the module parameters, read_timeout and write_timeout once in init(). Module parameters can only be set once and cannot be modified later, so we don't need to evaluate them again when passing the parameters to wait_event_interruptible_timeout(). Convert datatype of {read,write}_timeout from 'int' to 'long int' because implicit conversion of 'long int' to 'int' in statement '{read,write}_timeout = MAX_SCHEDULE_TIMEOUT' results in an overflow. Change format specifier for {read,write}_timeout from %i to %li. Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Khadija Kamran <kamrankhadijadj@gmail.com> Link: https://lore.kernel.org/r/ZBN3XAsItCiTk7CV@khadija-virtual-machine Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-30staging: axis-fifo: Use platform_get_irq() to get the interruptLad Prabhakar-8/+3
platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Link: https://lore.kernel.org/r/20211224161334.31123-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-13staging: axis-fifo: convert to use miscdeviceGreg Kroah-Hartman-62/+26
Using a struct class, a cdev, and another device just for a single minor device is total overkill. Just use a dynamic misc device instead, saving lots of logic and memory. Cc: Jacob Feder <jacobsfeder@gmail.com> Cc: Lee Jones <lee.jones@linaro.org> Cc: Muhammad Usama Anjum <musamaanjum@gmail.com> Link: https://lore.kernel.org/r/YTdPvBgKW6cKYrvb@kroah.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-10staging: axis-fifo: axis-fifo: Fix function naming in the documentationLee Jones-1/+1
Fixes the following W=1 kernel build warning(s): drivers/staging/axis-fifo/axis-fifo.c:356: warning: expecting prototype for axis_fifo_write(). Prototype was for axis_fifo_read() instead Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jacob Feder <jacobsfeder@gmail.com> Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20210414181129.1628598-52-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-10staging: axis-fifo: axis-fifo: Fix some formatting issuesLee Jones-8/+8
Fixes the following W=1 kernel build warning(s): drivers/staging/axis-fifo/axis-fifo.c:356: warning: Function parameter or member 'f' not described in 'axis_fifo_read' drivers/staging/axis-fifo/axis-fifo.c:356: warning: Function parameter or member 'buf' not described in 'axis_fifo_read' drivers/staging/axis-fifo/axis-fifo.c:356: warning: Function parameter or member 'len' not described in 'axis_fifo_read' drivers/staging/axis-fifo/axis-fifo.c:356: warning: Function parameter or member 'off' not described in 'axis_fifo_read' drivers/staging/axis-fifo/axis-fifo.c:356: warning: expecting prototype for axis_fifo_write(). Prototype was for axis_fifo_read() instead drivers/staging/axis-fifo/axis-fifo.c:478: warning: Function parameter or member 'f' not described in 'axis_fifo_write' drivers/staging/axis-fifo/axis-fifo.c:478: warning: Function parameter or member 'buf' not described in 'axis_fifo_write' drivers/staging/axis-fifo/axis-fifo.c:478: warning: Function parameter or member 'len' not described in 'axis_fifo_write' drivers/staging/axis-fifo/axis-fifo.c:478: warning: Function parameter or member 'off' not described in 'axis_fifo_write' Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: "John B. Wyatt IV" <jbwyatt4@gmail.com> Cc: Jacob Feder <jacobsfeder@gmail.com> Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20210414181129.1628598-37-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-08staging: axis-fifo: remove redundant dev_err callMuhammad Usama Anjum-1/+0
devm_ioremap_resource() prints error message in itself. Remove the dev_err call to avoid redundant error message. Signed-off-by: Muhammad Usama Anjum <musamaanjum@gmail.com> Link: https://lore.kernel.org/r/20210407161202.GA1505056@LEGION Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: axis-fifo: Fix parenthesis alignmentJohn B. Wyatt IV-5/+7
Fix 2 parenthesis alignment issues. Reported by checkpatch. Signed-off-by: John B. Wyatt IV <jbwyatt4@gmail.com> Link: https://lore.kernel.org/r/20200402015008.728612-1-jbwyatt4@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-22staging: axis-fifo: replace spinlock with mutexQuentin Deslandes-59/+101
Following the device's documentation guidance, reading a packet from the device or writing a packet to it must be atomic. Previously, only reading device's vacancy (before writing on it) or occupancy (before reading from it) was locked. Hence, effectively reading the packet or writing the packet wasn't locked at all. However, reading a packet (and writing one, to a lesser extent) requires to read 3 different registers in a specific order, without missing one or else we should reset the device. This patch fixes the device's locking mechanism on the FIFO character device. As the device was using copy_from_user() and copy_to_user(), we need to replace spinlocks with mutexes. Signed-off-by: Quentin Deslandes <quentin.deslandes@itdev.co.uk> Link: https://lore.kernel.org/r/20200121103958.12941-1-quentin.deslandes@itdev.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-17staging: axis-fifo: add unspecified HAS_IOMEM dependencyBrendan Higgins-1/+1
Currently CONFIG_XIL_AXIS_FIFO=y implicitly depends on CONFIG_HAS_IOMEM=y; consequently, on architectures without IOMEM we get the following build error: ld: drivers/staging/axis-fifo/axis-fifo.o: in function `axis_fifo_probe': drivers/staging/axis-fifo/axis-fifo.c:809: undefined reference to `devm_ioremap_resource' Fix the build error by adding the unspecified dependency. Reported-by: Brendan Higgins <brendanhiggins@google.com> Signed-off-by: Brendan Higgins <brendanhiggins@google.com> Link: https://lore.kernel.org/r/20191211192742.95699-7-brendanhiggins@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-03staging: axis-fifo: remove unused pointer to memory resourceQuentin Deslandes-7/+4
Remove unused resource pointer from the device's internal structure. Signed-off-by: Quentin Deslandes <quentin.deslandes@itdev.co.uk> Link: https://lore.kernel.org/r/20191101214232.16960-4-quentin.deslandes@itdev.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-03staging: axis-fifo: request resources using managed functionsQuentin Deslandes-32/+13
Request device's resources (memory, interrupt...) using managed function. Signed-off-by: Quentin Deslandes <quentin.deslandes@itdev.co.uk> Link: https://lore.kernel.org/r/20191101214232.16960-3-quentin.deslandes@itdev.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-03staging: axis-fifo: avoid parsing ignored device tree propertiesQuentin Deslandes-191/+74
Some properties were parsed from the device tree and then ignored by the driver. Some would return an error if absent from the device tree, then return an error if they were found because they are unsupported by the driver. Avoid parsing unused properties and clearly explain in the documentation the ignored / unsupported properties. Signed-off-by: Quentin Deslandes <quentin.deslandes@itdev.co.uk> Link: https://lore.kernel.org/r/20191101214232.16960-2-quentin.deslandes@itdev.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16staging: remove redundant 'default n' from KconfigBartlomiej Zolnierkiewicz-1/+0
'default n' is the default value for any bool or tristate Kconfig setting so there is no need to write it explicitly. Also since commit f467c5640c29 ("kconfig: only write '# CONFIG_FOO is not set' for visible symbols") the Kconfig behavior is the same regardless of 'default n' being present or not: ... One side effect of (and the main motivation for) this change is making the following two definitions behave exactly the same: config FOO bool config FOO bool default n With this change, neither of these will generate a '# CONFIG_FOO is not set' line (assuming FOO isn't selected/implied). That might make it clearer to people that a bare 'default n' is redundant. ... Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16staging: axis-fifo: Add elaborate description in KconfigMoses Christopher-2/+4
- The Xilinx AXI-Stream FIFO IP core driver description is elaborated. - References: Xilinx PG080 document, axis-fifo.txt Signed-off-by: Moses Christopher <moseschristopherb@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-03staging: add missing SPDX lines to Makefile filesGreg Kroah-Hartman-0/+1
There are a few remaining drivers/staging/*/Makefile files that do not have SPDX identifiers in them. Add the correct GPL-2.0 identifier to them to make scanning tools happy. Reviewed-by: Mukesh Ojha <mojha@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-03staging: add missing SPDX lines to Kconfig filesGreg Kroah-Hartman-0/+1
There are a few remaining drivers/staging/*/Kconfig files that do not have SPDX identifiers in them. Add the correct GPL-2.0 identifier to them to make scanning tools happy. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: axis-fifo: add CONFIG_OF dependencyArnd Bergmann-0/+1
When building without CONFIG_OF, the compiler loses track of the flow control in axis_fifo_probe(), and thinks that many variables are used without an initialization even though we actually leave the function before the first use: drivers/staging/axis-fifo/axis-fifo.c: In function 'axis_fifo_probe': drivers/staging/axis-fifo/axis-fifo.c:900:5: error: 'rxd_tdata_width' may be used uninitialized in this function [-Werror=maybe-uninitialized] if (rxd_tdata_width != 32) { ^ drivers/staging/axis-fifo/axis-fifo.c:907:5: error: 'txd_tdata_width' may be used uninitialized in this function [-Werror=maybe-uninitialized] if (txd_tdata_width != 32) { ^ drivers/staging/axis-fifo/axis-fifo.c:914:5: error: 'has_tdest' may be used uninitialized in this function [-Werror=maybe-uninitialized] if (has_tdest) { ^ drivers/staging/axis-fifo/axis-fifo.c:919:5: error: 'has_tid' may be used uninitialized in this function [-Werror=maybe-uninitialized] When CONFIG_OF is set, this does not happen, and since the driver cannot work without it, just add that option as a Kconfig dependency. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>