diff --git a/.pick_status.json b/.pick_status.json index 2673d990024..6af1993c159 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -13,7 +13,7 @@ "description": "panfrost: Fix major flaw in BO cache", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": null }, diff --git a/src/panfrost/lib/pan_bo.c b/src/panfrost/lib/pan_bo.c index dbfce02e519..8e9e257a812 100644 --- a/src/panfrost/lib/pan_bo.c +++ b/src/panfrost/lib/pan_bo.c @@ -201,9 +201,11 @@ panfrost_bo_cache_fetch(struct panfrost_device *dev, if (entry->size < size || entry->flags != flags) continue; + /* If the oldest BO in the cache is busy, likely so is + * everything newer, so bail. */ if (!panfrost_bo_wait(entry, dontwait ? 0 : INT64_MAX, PAN_BO_ACCESS_RW)) - continue; + break; struct drm_panfrost_madvise madv = { .handle = entry->gem_handle,