Repository navigation
Conversation
Some Goodix controllers report the buffer isn't ready continuously when there are no touch points to report. That triggers the retry mechanism within the driver required as supposedly the data can be 10ms after the interrupt occurs. Seeing as we don't have an interrupt there is little point in retrying, and we can wait for the next poll event. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
BCM2711 fixes PLLC, so there's no need to avoid it. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
fs/btrfs/discard.c:591:60: error: ‘discard_state’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
591 | if (discard_state == BTRFS_DISCARD_BITMAPS ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
592 | discard_state == BTRFS_DISCARD_FULLY_REMAPPED) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Host Memory Buffer allocation algorithm interacts badly with arm64 platforms with no IOMMU for PCIe devices, such as BCM2711/BCM2712. The discontiguous VA allocation in nvme_host_mem_alloc_single() always fails, so nvme_alloc_host_mem_multi() falls back to the DMA coherent allocation scheme. On arm64, this will come out of CMA by default. Recent DRAM-less SSDs will request significant amounts of host memory - up to 128MB. As NVMe devices are set up early in boot, CMA is mostly-free so it ends up being claimed by a driver using it for opaque device-exclusive buffers. The divide-and-conquer allocation strategy also paradoxically results in increased CMA pressure if portions are already reserved. PCIe NVMe controllers implement a variably-sized HMB descriptor table, typically ranging from 32 to 256 entries in size. Therefore, aside from implementation-specific costs in the controller doing more granular look-ups, providing smaller orders is acceptable. Failing to provide a HMB does not prevent the controller from functioning. Create an alternate implementation for arm64 that creates a scatterlist and directly assigns contiguous pages from the buddy allocator, retrying with smaller orders on failure. This will avoid CMA by default. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com> nvme: pci: use LE accessors for HMB segment table entries on arm64 Align with the non-arm64 code, as it's technically possible to run the cpu in BE mode. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
Drivers like gpio-brcmstb register multiple gpio_chips per DT node (one per hardware bank), each with a different chip->offset. When a hog is defined on the shared parent node, every gpiochip sees it during registration but only the chip whose offset range covers the hog's GPIO should apply it. Since 'gpio: move hogs into GPIO core' (d1d564e) gpiochip_add_hog calls of_gpiochip_get_lflags on every hog, which invokes the driver's of_xlate. brcmstb_gpio_of_xlate returns -EINVAL for GPIOs outside the bank, and that error now propagates up and fails gpiochip_add_data(). The pre-refactor of_gpiochip_add_hog used to silently break out of the hog loop on this error. For Pi 5, this bricks bank 1 of gio_aon (and via deferred-probe cascade, the LED, sd-io regulators, and emmc), because the rp1_run_hog defined inside &gio_aon refers to bank 0 GPIO 2. Restore the previous behaviour by skipping hogs where the xlate signals out-of-range.
devm_platform_get_and_ioremap_resource() prints sdhci-brcmstb 1001100000.mmc: error -EINVAL: invalid resource (null) whenever the optional 'boot_regs' resource (index 2) isn't present. Pi 5 sdio2 (WLAN) declares only 'host'+'cfg' so this fires every boot even though the driver intentionally treats the missing resource as non-fatal. Use platform_get_resource() to probe for the resource first and only ioremap when it exists.
Since [1], the fbdev deferred IO framework is careful to cancel pending updates on close to prevent dirty pages being accessed after they may have been reused. However, this is not necessary in the case that the pagelist is empty, and drivers that don't make use of the pagelist may have wanted updates cancelled for no good reason. Avoid penalising fbdev drivers that don't make use of the pagelist by making the cancelling of deferred IO on close conditional on there being a non-empty pagelist. See: raspberrypi#5398 Signed-off-by: Phil Elwell <phil@raspberrypi.com> [1] 3efc61d ("fbdev: Fix invalid page access after closing deferred I/O devices")
The existing driver claims AHT20 support in i2c_device_id, but fails to omit AHT10_MODE_CYC, which AHT20 doesn't support/require Add proper initialization sequence to fully support the AHT20. [ Adapted to fit the version in the 7.1 kernel ] Signed-off-by: Josh Martinez <8892161+joshermar@users.noreply.github.com> Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Not all implementations of the V2 regulator support reading back the value of registers, which makes the GPIO control fail. Enable the regmap caching to avoid this. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Allow DT aliases of eg DSI2 to force make DRM allocate the display with the requested name. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
macb_start_xmit() and macb_tx_restart() kick transmission by
OR-ing MACB_BIT(TSTART) into NCR. On PCIe-attached macb instances
(BCM2712 + RP1 PCIe south bridge on Raspberry Pi 5 is the setup we
have in front of us), writes to NCR are posted PCIe writes: they
are not guaranteed to reach the device before the issuing CPU
returns. An existing source-level comment at the TSTART site
acknowledges that such writes can be lost under some conditions:
/* TSTART write might get dropped, so make the IRQ retrigger
* a buffer read */
and arms a recovery handshake via queue->tx_pending /
queue->txubr_pending that runs on the next TCOMP interrupt. That
recovery path depends on a subsequent TCOMP actually firing. If
the TSTART write never reaches the MAC, no TX begins, no TCOMP
completion arrives, and the ring remains quiescent without any
kernel-visible indication.
Add a read-back of NCR after each TSTART write in macb_start_xmit()
and macb_tx_restart(). The read is an architected PCIe read
barrier for earlier posted writes on the same path; it ensures the
doorbell has reached the MAC before the functions return.
The existing tx_pending / txubr_pending handshake is left in place
unchanged -- it remains the correct recovery for any other reason
the MAC could silently fail to start TX.
We do not have direct hardware evidence that TSTART is being lost
on the RP1 path. This patch is one of a three-patch series
("candidate fixes for silent TX stall on BCM2712/RP1"); see the
cover letter for context. We have verified it compiles and
applies cleanly; runtime verification is pending.
Link: cilium/cilium#43198
Link: https://bugs.launchpad.net/ubuntu/+source/linux-raspi/+bug/2133877
Signed-off-by: Lukasz Raczylo <lukasz@raczylo.com>
These cards have a known-good CQ implementation and are based on a Silicon Motion controller. Add the MID and filter on appropriate CID fields. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
We use regmap mmio so should select it Signed-off-by: Dom Cobley <popcornmix@gmail.com>
This partially reverts commit 105c425. Between [1] and this partial reversion, all users of the JMB582/JMB585 on Raspberry Pi 5 have been forced to use the pcie-32bit-dma overlay. The reasoning behind the patch is either inherently flawed or does not apply on a Pi 5, since all inbound memory accesses are by default above 4GB and yet seem to work. See: raspberrypi#7355 https://forums.raspberrypi.com/viewtopic.php?p=2374573&sid=a9d90a55d42694d4f24bf03946e44a4f#p2374573 Signed-off-by: Phil Elwell <phil@raspberrypi.com> [1] commit 105c425 ("ata: ahci: force 32-bit DMA for JMicron JMB582/JMB585")
In commit df289f8 ("pcie-brcmstb: move the unilateral disable of CLKREQ# before link-up") the clkreq_cntl ending up being initialised to zero instead of the read/reset value of the hardware register. Preserve non-clkreq related bits by restoring the read. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
With the jump to the 6.18 kernel we dropped a patch that had been overriding #size-cells in the upstream bcm2712 dts files. The result is cleaner, but only Pi 5 and CM5 EEPROMs since February 2025 are compatible with it. Apply a few hacks to the kernel's early DT parsing and to the 2712 dts so that the EEPROM is able to update the CMA section and the kernel is able to read the result, despite the fact that it is malformed. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add support for the edatec 101c (800x1280) DSI panel. This panel uses the ILI9881C driver IC and is compatible with the existing initialization sequence defined in the driver. Signed-off-by: FrankLeeEDA <Fli@edatec.cn>
This driver provides support for controlling the panel's power supply, including the necessary voltage and current regulation for proper backlight and LCD operation. Signed-off-by: FrankLeeEDA <Fli@edatec.cn>
The TPZ filter wants ideally 3 lines of image to give good quality downscaling. More than that leads to excessive SDRAM bandwidth for no gain. If the downsample factor allows for it, reduce the programmed image height and increase the pitch to compensate. This currently does not handle T-format images where we need to configure it slightly differently. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
pitch*height does not necessarily equate to buffer size if the buffer is non-linear, so the buffer validation is invalid. Disable it for non-linear buffers. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
The user of the packet_ram_enabled was removed, but the flag itself wasn't. Clean up. Fixes: b47a72f ("drm/vc4: hdmi: Switch to HDMI connector") Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
The CoreChips SR9900 (0x0fe6:0x9900) is a USB 2.0 10/100 Ethernet adapter. Testing shows it works correctly with the r8152 driver, reaching wire speed (94 Mbps) with zero packet loss on both TCP and UDP. Tested on Raspberry Pi, including hotplug and extended data transfer. Signed-off-by: zjzhao-eda <zjzhao@edatec.cn>
Commit 8f040b5 ("leds: class: Use firmware nodes for device lookup") reworked the LED lookup to use firmware nodes. For a named lookup it does: index = fwnode_property_match_string(fwnode, "led-names", name); led_node = fwnode_find_reference(fwnode, "leds", index); When the consumer has no "led-names" property, fwnode_property_match_string() returns a negative error (-EINVAL) which is then passed as the index to fwnode_find_reference(), so the lookup fails with -EINVAL instead of the -ENOENT that the old of_led_get() returned (of_parse_phandle() returned NULL for any failure). Optional LED consumers rely on -ENOENT to mean "no LED present". In particular v4l2_subdev_get_privacy_led() treats anything other than -ENOENT as fatal, so every camera sensor without a privacy LED now fails to probe: imx219 10-0010: error -EINVAL: getting privacy LED imx219 10-0010: error -EINVAL: failed to register sensor sub-device imx219 10-0010: probe with driver imx219 failed with error -22 If the named LED cannot be matched, return -ENOENT instead of propagating the match error as an index. Fixes: 8f040b5 ("leds: class: Use firmware nodes for device lookup") Signed-off-by: Dom Cobley <dom@raspberrypi.com>
Endpoint stalling is a feature, not an error; the mass storage gadget driver makes use of it in the course of normal operation. The dwc2 gadget driver has some info- and warning-level messages that look like messages added during the driver's development and never cleaned up. Demote those message to the debug level to reduce log spam and avoid users wasting time worrying about them. See: raspberrypi#7452 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
External authentication during WPA3 SAE exchange ignores the PMKID and passes garbage (whatever is on the stack) downstream. This causes latent bugs (bogus entries in the firmware's lookup tables) that lead to connectivity issues. For example, in AP mode, a client that includes a PMKID in association frames will be rejected. The fix sets the PMKID either to zeros or the correct value if present, ensuring no bogus entries are used downstream. Signed-off-by: Bogdan Nicolae (bogdan.nicolae@acm.org)
Without a valid cookie to distinguish pending concurrent completion events, mismatches occur under concurrency that crash the firmware. This fix uses a monotonous atomic counter that guarantees unique ids. Signed-off-by: Bogdan Nicolae <bogdan.nicolae@acm.org>
V4L2_CID_HBLANK / LLP was a read-only control that set min/ max/default all to the same value. The datasheet does state "H-sync timing is fixed in order to avoid the sensor internal interference (FPN) in IMX355 by line_length". No interference has currently been observed, and the default is always to leave it at the minimum (and approved) value. Allowing it to be controllable therefore has no effect unless a frame period longer than can be achieved just through VBLANK is requested. Exposure times up to 14.9s/frame can be achieved when combined with the max FLL / VBLANK value. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
If the fan controller has detected any errors it responds on the SMBus Alert Response Address (0x0c). As the driver doesn't currently handle SMBus Alert, acknowledge all errors on probe so that the fan controller is doesn't respond to that address. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
This is a tty driver that implements a UART using RP1's PIO block, ported from pico-examples/pio/uart_dma. Like that example, it is limited to 8N1, with no hardware flow control. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
libinput uses the input device name alone. If you have two identical input devices, then there is no way to differentiate between them, and in the case of touchscreens that means no way to associate them with the appropriate display device. Add the I2C bus and address to the start of the input device name so that the name is always unique within the system. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Commit 2c46f19 ("gpio: brcmstb: allow parent_irq to wake") only sets priv->suspended when there is a parent IRQ, but suspend_noirq returns -EBUSY whenever it is clear. A block with no interrupts, such as gio_aon on BCM2712, therefore aborts every system suspend. Only treat a clear flag as a pending wakeup when there is a parent IRQ. Fixes: 2c46f19 ("gpio: brcmstb: allow parent_irq to wake") Signed-off-by: Dom Cobley <popcornmix@gmail.com>
Commit 645dde2 ("drm/bridge: tc358762: revert move ops to enable") moved tc358762_init() from tc358762_enable() back into tc358762_pre_enable() and dropped the "ctx->pre_enabled = true" assignment that ended the old pre_enable. Mainline still has it. pre_enabled now stays false, so tc358762_post_disable() always returns early: the vddc regulator is enabled on every pre_enable but never disabled, and the reset GPIO is never asserted again. Unbinding the driver while the display is enabled then warns in _regulator_put(): WARNING: ... at drivers/regulator/core.c:2460 _regulator_put+0x58/0x68 ... devm_regulator_release+0x1c/0x30 ... tc358762_driver_exit+0x18/0x38a0 [tc358762] Set pre_enabled again at the end of tc358762_pre_enable(). Fixes: 645dde2 ("drm/bridge: tc358762: revert move ops to enable") Signed-off-by: Henry Zhang <henryzhang62@gmail.com>
The VC4_NUM_TXP_OVERLAY_PLANES (32) overlay planes for the writeback CRTC are created with a default zpos of i + 1, so 1 to 32, but with the zpos range of the normal overlay planes, 1 to VC4_NUM_OVERLAY_PLANES + 1 (17). Planes 17 to 31 of that loop therefore start with a zpos outside their own range, and writing the current value back fails with EINVAL. On a Pi 5, 15 of the 56 planes have a zpos above their maximum, and the igt test kms_properties fails on it: (kms_properties) CRITICAL: Failed assertion: value <= values[1] (kms_properties) CRITICAL: error: 0x12 > 0x11 Subtest get_properties-sanity-non-atomic: FAIL Subtest get_properties-sanity-atomic: FAIL Use VC4_NUM_TXP_OVERLAY_PLANES + 1 as the maximum for those planes. Tested on a Pi 5 (6.18.39) with the patched vc4 module loaded from the initramfs: - planes with a zpos outside their range: 15 of 56 -> 0 of 56 - kms_properties: 8 pass / 2 fail -> 10 pass / 0 fail - the other KMS tests run (kms_atomic, kms_addfb_basic, kms_getfb, kms_prop_blob, kms_lease, kms_writeback, kms_atomic_transition, ...) give the same results as before. kms_flip has the same set of timing-dependent failures on HDMI-A-1 with and without this change; each of those subtests passes and fails on reruns. The failure was found with igt-gpu-tools. The fix and this changelog were written with the help of an AI coding assistant (Claude), and the testing above was run on real hardware. Fixes: 5c85a4b ("drm/vc4: Assign 32 overlay planes to writeback only") Signed-off-by: Roy <rongh7426@gmail.com>
tile_entry_fill will not fulfil its stated guarantee to leave one slot free if its loop never runs. Fix that. Signed-off-by: John Cox <jc@kynesim.co.uk>
If there is a concurrent decode and streamoff request there is a theoretical window in which the streamoff can complete before the decode. Close it. Signed-off-by: John Cox <jc@kynesim.co.uk>
frame_slot and rpi_currpoc are used in the error path before they are set. Fix this. Signed-off-by: John Cox <jc@kynesim.co.uk>
Typo after checking if PPS has changed. Fix it Signed-off-by: John Cox <jc@kynesim.co.uk>
…e started Starting the h/w and therefore keeping decode context based only on OUTPUT streaming state allows CAPTURE formats to change without the context changing. This allows for missized buffers. Fix so the h/w is shutdown if either stream is off. Signed-off-by: John Cox <jc@kynesim.co.uk>
Remove device serialization of G_FMT and S_FMT and use the per context lock instead for these ops. Signed-off-by: John Cox <jc@kynesim.co.uk>
Does NOT include the clock and IRQ changes. Signed-off-by: John Cox <jc@kynesim.co.uk>
Add code to invalidate a capture buffer slot if the buffer is removed Also change sync to use wait_for_completion which is both neater and safer than the existing wait_queue logic Signed-off-by: John Cox <jc@kynesim.co.uk>
min_queued_buffers = 1 is unneeded and Claude asserts that it can cause a (unlikely) race such that a job can be started before _start has completed so remove it. (Hantro doesn't have this line) Signed-off-by: John Cox <jc@kynesim.co.uk>
Requests are manually completed. Fix cleanup code to complete them. Signed-off-by: John Cox <jc@kynesim.co.uk>
Take the control lock whilst h265_setup is in progress to avoid inconsistent values whilst in use. Signed-off-by: John Cox <jc@kynesim.co.uk>
Control setup errors ignored, v4l2_fh_exit missing on error path. Fix these. Signed-off-by: John Cox <jc@kynesim.co.uk>
Tighten up value checking so we cannot program wrong values into the h/w Signed-off-by: John Cox <jc@kynesim.co.uk>
Tiles must turn up in the correct order. Enforce this. Signed-off-by: John Cox <jc@kynesim.co.uk>
It is possible to remove all CAPTURE buffers whilst streaming. This allows format change as that makes it no longer busy. Check for streaming too. Signed-off-by: John Cox <jc@kynesim.co.uk>
Setup checks the vb2_v4l2_buffer plane length member which may not be correct for dmabufs as that is just what the user passed not the actual size - use vb2_plane_size on the vb2_buf instead Signed-off-by: John Cox <jc@kynesim.co.uk>
Separate unregister and device release functions so we behave correctly if unbound whilst running. Signed-off-by: John Cox <jc@kynesim.co.uk>
Pick a format that matches the SPS (if set) in hevc_d_try_fmt_vid_cap if what the user set is unsupported or bad rather than leaving bad and always fixing up to NV12MT_COL128 Signed-off-by: John Cox <jc@kynesim.co.uk>
…ration It is possible to flood the log with warning messages by setting bad values in SPS, PPS etc. It is valuable to have this info when debugging so reduce the level to debug. Reported-by: Roy <rongh7426@gmail.com> Closes: raspberrypi#7796 Signed-off-by: John Cox <jc@kynesim.co.uk>
Contributor
Author
|
@jc-kynesim Can you cast your eye over this? |
Contributor
|
I can have a look, but the best way forward might be to wait for @6by9 to produce our next attempt at an upstream set of patches, wipe everything that we have in hevc_d and apply that + whatever patches we want to fix up clocks and old formats? |
Contributor
Author
|
I'm happy to leave these here unmerged for now. |
pelwell
marked this pull request as draft
November 27, 2026 09:25
Contributor
|
I'll note that there are two commits at the start of the sequence that seem to have nothing to do with hevc_d that you still might want to merge. |
Contributor
Author
|
Thanks - I have already merged them, and I find it strange that the GUI isn't allowing an update or rebase to reflect the fact. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The forward-port of #7780 didn't go smoothly. This PR is Claude's attempt - it builds cleanly, but I can't say beyond that.
The notes: