Repository navigation
Fixes for IGT crashes - #5022
Conversation
clk_get_rate_range() is missing the proper locks, making lockdep complain. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
The vc4 planes are setup in hardware by creating a hardware descriptor in a dedicated RAM. As part of the process to setup a plane in KMS, we thus need to allocate some part of that dedicated RAM to store our descriptor there. The async update path will just reuse the descriptor already allocated for that plane and will modify it directly in RAM to match whatever has been asked for. In order to do that, it will compare the descriptor for the old plane state and the new plane state, will make sure they fit in the same size, and check that only the position or buffer address have changed. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
I've been running with this on Pi4 with kms over weekend without issue. |
Blacklist |
|
Thanks for your comments, I'll address them.
Alternatively, we can disable the fbdev emulation in Kconfig (CONFIG_DRM_FBDEV_EMULATION), and then try to set a mode by hand. |
Excellent. That works for finding this hang.
Yes, this also works. My scheme was adding a |
|
Spot those of us who have also been hunting this style of NULL deref or lockup in the past :-) |
|
I think this is just waiting for the fkms-proofing changes that @popcornmix suggested. |
A new generation of controller has been introduced with the BCM2711/RaspberryPi4. This generation needs a bunch of quirks, and over time we've piled on a number of checks in most parts of the drivers. All these checks are performed several times, and are not always consistent. Let's create a single, global, variable to hold it and use it everywhere. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
We're going to add a new variant of the dumb BO allocation function, so let's rename vc4_dumb_create() to something a bit more specific. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
The vc4_bo_dumb_create() both fixes up the allocation arguments to match the hardware constraints and actually performs the allocation. Since we're going to introduce a new function that uses a different allocator, let's split the arguments fixup to a separate function we will be able to reuse. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Prior to the BCM2711/RaspberryPi4, the GPU was a part of the display components of the SoC. It was thus a part of the vc4 driver. However, with the BCM2711, it got split out and thus the v3d driver was created. The vc4 driver now only handles the display part. We didn't properly split out the code when doing the BCM2711 support though, and most of the code around buffer allocations is still involved, even though it doesn't have the backing hardware anymore. Let's start the split out by creating a new drm_driver that only reports and uses what we support on the BCM2711. The ioctl were properly filtered already, but we were still exposing a .gem_create_object hook, as well as having an .open and .postclose hooks which are only relevant on older generations. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
On the BCM2711, our current definition of drm_mode_config_funcs uses the custom vc4_fb_create(). However, that function relies on the buffer allocation path that was relying on the GPU, and is no longer relevant. Let's create another drm_mode_config_funcs structure that we will register on the BCM2711. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
On the BCM2711, our current definition of drm_plane_helper_funcs uses the custom vc4_prepare_fb() and vc4_cleanup_fb(). Those functions rely on the buffer allocation path that was relying on the GPU, and is no longer relevant. Let's create another drm_plane_helper_funcs structure that we will register on the BCM2711. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
On the BCM2711, we currently call the vc4_bo_cache_init() and vc4_gem_init() functions. These functions initialize the BO and GEM backends. However, this code was initially created to accomodate the requirements of the GPU on the older SoCs, while the BCM2711 has a separate driver for it. So let's just skip these calls when we're on a newer hardware. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
We'll need to extend the vc4_async_flip_state structure to rely on another callback implementation, so let's move the current one into a union. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
We'll soon introduce another completion callback source that won't need to use the BO reference counting, so let's move it around to create a function we will be able to share between both callbacks. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
The function vc4_async_page_flip() handles asynchronous page-flips in the vc4 driver. However, it mixes some generic code with code that should only be run on older generations that have the GPU handled by the vc4 driver. Let's split the generic part out of vc4_async_page_flip() and into a common function that we be reusable by an handler made for the BCM2711. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
…2711 The BCM2711 doesn't have a v3d GPU so we don't want to call into its BO management code. Let's create an asynchronous page-flip handler for the BCM2711 that just calls into the common code. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
The BCM2711 has a separate driver for the v3d, and thus we can't call into any of the driver entrypoints that rely on the v3d being there. Let's add a bunch of checks and complain loudly if that ever happen. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
6176fea to
21c5de5
Compare
|
I just pushed a new version with the changes @popcornmix requested |
|
Thanks! |
See: raspberrypi/linux#5026 kernel: Fixes for IGT crashes See: raspberrypi/linux#5022
See: raspberrypi/linux#5026 kernel: Fixes for IGT crashes See: raspberrypi/linux#5022
Hi,
Here's a collection of fixes related to the IGT crashes @popcornmix reported. It turns out many of them were actually due to the fact that even though the BCM2711 doesn't have the v3d handled by the vc4 driver anymore, we were still using some of the code backed by the v3d.
This PR properly splits everything away, and adds a warning to all the v3d-related entrypoints so that we notice if that it ever happens again.