- Jan 08, 2024
-
-
Stefan Wahren authored
Users report about the unexpected behavior for setting timeouts above 15 sec on Raspberry Pi. According to watchdog-api.rst the ioctl WDIOC_SETTIMEOUT shouldn't fail because of hardware limitations. But looking at the code shows that max_timeout based on the register value PM_WDOG_TIME_SET, which is the maximum. Since 664a3923 ("watchdog: Introduce hardware maximum heartbeat in watchdog core") the watchdog core is able to handle this problem. This fix has been tested with watchdog-test from selftests. Link: https://bugzilla.kernel.org/show_bug.cgi?id=217374 Fixes: 664a3923 ("watchdog: Introduce hardware maximum heartbeat in watchdog core") Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
-
Phil Elwell authored
As of 6.6, the names of the labels on the Pi LEDs was swapped to match the upstream code, i.e. led_act rather than act_led. Apply the same change to Pi 5. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Maíra Canal authored
Currently, when using non-blocking commits, we can see the following kernel warning: [ 110.908514] ------------[ cut here ]------------ [ 110.908529] refcount_t: underflow; use-after-free. [ 110.908620] WARNING: CPU: 0 PID: 1866 at lib/refcount.c:87 refcount_dec_not_one+0xb8/0xc0 [ 110.908664] Modules linked in: rfcomm snd_seq_dummy snd_hrtimer snd_seq snd_seq_device cmac algif_hash aes_arm64 aes_generic algif_skcipher af_alg bnep hid_logitech_hidpp vc4 brcmfmac hci_uart btbcm brcmutil bluetooth snd_soc_hdmi_codec cfg80211 cec drm_display_helper drm_dma_helper drm_kms_helper snd_soc_core snd_compress snd_pcm_dmaengine fb_sys_fops sysimgblt syscopyarea sysfillrect raspberrypi_hwmon ecdh_generic ecc rfkill libaes i2c_bcm2835 binfmt_misc joydev snd_bcm2835(C) bcm2835_codec(C) bcm2835_isp(C) v4l2_mem2mem videobuf2_dma_contig snd_pcm bcm2835_v4l2(C) raspberrypi_gpiomem bcm2835_mmal_vchiq(C) videobuf2_v4l2 snd_timer videobuf2_vmalloc videobuf2_memops videobuf2_common snd videodev vc_sm_cma(C) mc hid_logitech_dj uio_pdrv_genirq uio i2c_dev drm fuse dm_mod drm_panel_orientation_quirks backlight ip_tables x_tables ipv6 [ 110.909086] CPU: 0 PID: 1866 Comm: kodi.bin Tainted: G C 6.1.66-v8+ #32 [ 110.909104] Hardware name: Raspberry Pi 3 Model B Rev 1.2 (DT) [ 110.909114] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 110.909132] pc : refcount_dec_not_one+0xb8/0xc0 [ 110.909152] lr : refcount_dec_not_one+0xb4/0xc0 [ 110.909170] sp : ffffffc00913b9c0 [ 110.909177] x29: ffffffc00913b9c0 x28: 000000556969bbb0 x27: 000000556990df60 [ 110.909205] x26: 0000000000000002 x25: 0000000000000004 x24: ffffff8004448480 [ 110.909230] x23: ffffff800570b500 x22: ffffff802e03a7bc x21: ffffffecfca68c78 [ 110.909257] x20: ffffff8002b42000 x19: ffffff802e03a600 x18: 0000000000000000 [ 110.909283] x17: 0000000000000011 x16: ffffffffffffffff x15: 0000000000000004 [ 110.909308] x14: 0000000000000fff x13: ffffffed577e47e0 x12: 0000000000000003 [ 110.909333] x11: 0000000000000000 x10: 0000000000000027 x9 : c912d0d083728c00 [ 110.909359] x8 : c912d0d083728c00 x7 : 65646e75203a745f x6 : 746e756f63666572 [ 110.909384] x5 : ffffffed579f62ee x4 : ffffffed579eb01e x3 : 0000000000000000 [ 110.909409] x2 : 0000000000000000 x1 : ffffffc00913b750 x0 : 0000000000000001 [ 110.909434] Call trace: [ 110.909441] refcount_dec_not_one+0xb8/0xc0 [ 110.909461] vc4_bo_dec_usecnt+0x4c/0x1b0 [vc4] [ 110.909903] vc4_cleanup_fb+0x44/0x50 [vc4] [ 110.910315] drm_atomic_helper_cleanup_planes+0x88/0xa4 [drm_kms_helper] [ 110.910669] vc4_atomic_commit_tail+0x390/0x9dc [vc4] [ 110.911079] commit_tail+0xb0/0x164 [drm_kms_helper] [ 110.911397] drm_atomic_helper_commit+0x1d0/0x1f0 [drm_kms_helper] [ 110.911716] drm_atomic_commit+0xb0/0xdc [drm] [ 110.912569] drm_mode_atomic_ioctl+0x348/0x4b8 [drm] [ 110.913330] drm_ioctl_kernel+0xec/0x15c [drm] [ 110.914091] drm_ioctl+0x24c/0x3b0 [drm] [ 110.914850] __arm64_sys_ioctl+0x9c/0xd4 [ 110.914873] invoke_syscall+0x4c/0x114 [ 110.914897] el0_svc_common+0xd0/0x118 [ 110.914917] do_el0_svc+0x38/0xd0 [ 110.914936] el0_svc+0x30/0x8c [ 110.914958] el0t_64_sync_handler+0x84/0xf0 [ 110.914979] el0t_64_sync+0x18c/0x190 [ 110.914996] ---[ end trace 0000000000000000 ]--- This happens because, although `prepare_fb` and `cleanup_fb` are perfectly balanced, we cannot guarantee consistency in the check plane->state->fb == state->fb. This means that sometimes we can increase the refcount in `prepare_fb` and don't decrease it in `cleanup_fb`. The opposite can also be true. In fact, the struct drm_plane .state shouldn't be accessed directly but instead, the `drm_atomic_get_new_plane_state()` helper function should be used. So, we could stick to this check, but using `drm_atomic_get_new_plane_state()`. But actually, this check is not really needed. We can increase and decrease the refcount symmetrically without problems. This is going to make the code more simple and consistent. Signed-off-by: Maíra Canal <mcanal@igalia.com>
-
Phil Elwell authored
Add dtparams for adjusting the Pi 5 cooling fan speeds and temperature thresholds. See: https://github.com/raspberrypi/linux/issues/5820 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
Include the dtparams controlling the Ethernet jack LEDs, as used on other Pis. See: https://github.com/raspberrypi/linux/issues/5825 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Dave Stevenson authored
Raw 16bit formats didn't have a csi_dt value defined, which presumably would trip the WARN_ON(!fmt->csi_dt); in cfe_start_channel. The value is defined in CSI2 v2.0 as 0x2e, so set it accordingly. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
Seeing as we now have the CSI2 data types defined, make use of them instead of hardcoding the values. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
For CSI2 receivers that need to know the link frequency, add it as a control to the driver. Interlaced modes are 216Mbp/s or 108MHz, whilst going through the I2P to deinterlace gives 432Mb/s or 216MHz. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
CSI2 devices are meant to use the 1Xnn formats rather than 2Xnn such as MEDIA_BUS_FMT_UYVY8_2X8. For devices with ADV7180_FLAG_MIPI_CSI2 set, use MEDIA_BUS_FMT_UYVY8_1X16. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
Noted that if we get "node link is not enabled", then we also get the videobuf2 splat for the driver not cleaning up correctly on a failed start_streaming, and indeed we weren't returning the buffers. Checking the other error paths, noted that the "FE enabled, but FE_CONFIG node is not" path was not calling pm_runtime_put. Fix both paths. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
The frame count values moved within registers DISPSTAT1 and DISPSTAT2 with GEN5, so update the accessor function to accommodate that. Fixes: b51cd7ad ("drm/vc4: hvs: Fix frame count register readout") Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Phil Elwell authored
bclk_ratio is only a factor in clock producer mode, and needs to override the default value of num_channels * sample_size. Move the bclk_ratio handling into the hw_params method, only latching the value in set_bclk_ratio, to address both of those matters. See: https://github.com/raspberrypi/linux/issues/5817 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Yangyu Chen authored
This configuration hindered performance by ~74% measured from RPI 4B from ~680Mbps to ~390Mbps when benchmarking wireguard locally using netns and iperf3. Remove it by default for better performance. Signed-off-by: Yangyu Chen <cyy@cyyself.name>
-
Phil Elwell authored
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
The i2c-designware driver supports reading precise timing values from ACPI, but the Device Tree support relies on a combination of standard rise and fall times and hard-coded minimum timings. The result of this is that it is difficult to get optimum timings, particularly given that the values are bus speed-specific and only one set can be stored in DT at a time. Add support for initialisation from DT that is similar to that for ACPI. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
Add a dtparam "rtc", so that "dtparam=rtc=off" can be used to disable the Pi 5's onboard RTC. See: https://forums.raspberrypi.com/viewtopic.php?t=361813 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Dave Stevenson authored
HTS was still using the raw register ID. Fixes: dd26d43d ("media: i2c: imx219: make HBLANK r/w to allow longer exposures") Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Phil Elwell authored
The driver makes use of the fact that the firmware node is its parent, so we'd better make it so. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Naushir Patuck authored
Update the ISR logic to be more robust to sensors in problematic states where interrupts may start arriving overlapped and/or missing. 1) Test for cur_frame in the FE handler, and if present, dequeue it in an error state so that it does not get orphaned. 2) Move the sequence counter and timestamp variables to the node structures. This allows the ISR to track channels running ahead when interrupts arrive unordered. 3) Add a test to ensure we don't have a spurios (but harmlesS) call to the FE handler in some circumstances. Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
-
Naushir Patuck authored
Update the license tags on the pisp UAPI header files with the "Linux-syscall-note" clause. Also replace the "GPL-2.0" tag with the preferred "GPL-2.0-only" tag. Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
-
Dave Stevenson authored
snprintf takes the length of the array that we can print into, and has to fit the NULL terminator in there too. Printing the prefix is generally "12-3456 " which is 8 desired characters (the length of EDT_NAME_PREFIX_LEN) and the NULL. The space is therefore being truncated to fit the NULL in. Increase the length snprintf is allowed to use. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Nick Hollinghurst authored
Leave the camera's power supplies up, to prevent the camera clamping its 1.8V digital I/Os to ground. This may be useful when synchronizing multiple camera systems using XVS or XTRIG. Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
-
Nick Hollinghurst authored
Don't assume the camera has been reset each time we start streaming, but always write registers relating to trigger_mode, even in mode 0. IMX477: Stop driving XVS on stop streaming, to avoid spurious pulses. Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
-
Jonathan Bell authored
Set snps,parkmode-disable-ss-quirk for usb0 and usb1. Enabling this test/debug feature seems to prevent controller lockups with bidirectional SS bulk endpoints active. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
-
Phil Elwell authored
The Pi 400 only has one user-accessible LED (green), which is intended to be used as a power indication. Therefore there is no activity LED. However, a user may wish to remap the activity LED functionality to a GPIO in the 40-way header, so preserve the led-act node in a disabled state. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
Switch to warm reboot mode so that the partition number is preserved. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
Pi 5 uses BL31 as its armstub file, so the reset goes via PSCI. Parse any "reboot" parameter as a partition number to reboot into. N.B. This code path is only used if reboot mode has been set to warm or soft. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
eng33 authored
Fixed the screen stays white when the user restarts or shuts down Signed-off-by: eng33 <eng33@waveshare.com>
-
Phil Elwell authored
See: https://github.com/raspberrypi/linux/issues/5786 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Leon Anavi authored
Replace "Broadcom BCM2835 GPIO" with "Broadcom BCM2712 PINCONF" in the help message. This work was sponsored by GOVCERT.LU. Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
-
Phil Elwell authored
The logging timestamps depend on the existence of a bcm2835-system-timer node. If this node doesn't exist, leave the logging disabled rather than crashing. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
Increase #pwm-cells to 3 to allow for the extra polarity word. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
Newer kernels expect PWM references to include a polarity value as the third parameter. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Dom Cobley authored
Recent kernels (from 6.5) fail to boot on Pi0-3. This has been tracked down to the call to: ret = usb_get_std_status(hdev, USB_RECIP_DEVICE, 0, &hubstatus); returning garbage in hubstatus (it gets the uninitialised contents of a kmalloc buffer that is not overwritten as expected). As we don't have strong evidence that this code path has ever worked, and it is causing a clear problem currently, lets disable it to allow wider use of newer kernels. Signed-off-by: Dom Cobley <popcornmix@gmail.com>
-
Timon authored
Compile the TSC2007 touchscreen driver as a module and enable the optional IIO module. Signed-off-by: Timon Skerutsch <kernel@diodes-delight.com>
-
Tomi Valkeinen authored
Improve the link validation for metadata by: - Allowing capture buffers that are larger than the incoming frame (instead of requiring exact match). - Instead of assuming that a metadata unit ("pixel") is 8 bits, use find_format_by_code() to get the format and use the bit depth from there. E.g. bit depth for RAW10 metadata will be 10 bits, when we move to the upstream metadata formats. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
-
Tomi Valkeinen authored
The current pisp_fe_link_validate() skips some important checks. Let's rather use the standard v4l2_subdev_link_validate_default() as the link_validate hook. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
-
Tomi Valkeinen authored
The current csi2_link_validate() skips some important checks. Let's rather use the standard v4l2_subdev_link_validate_default() as the link_validate hook. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
-