From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 00C7744E67C for ; Thu, 13 Aug 2026 10:57:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786618631; cv=none; b=m3IusskQ2PPoWIpt4LEIDZ1CE8AGF+hftVBMwMbVnrjELarV20HM8Vkp7mxmZUqAhs4G4falaUqaWv7IC+SKVvZx4dCzuOO/JevvTVLymOZkw0R7xV5kThtrFMhMAB4EKb1HTWNFDe4ZBQZU1z8hCdBbwiNDhkp5FHGZxWeeAas= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786618631; c=relaxed/simple; bh=EHCETmmaBKY4tlCFOl7DXmSmcJX3/lRHG/Z0dhkCCBI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qKqjpnF0DHHn9QPHLdoSKNRGe0aiFjLPDFtdW/QTNqdcH6UlF9gvk1sg30I6xZ2FbachlFydb/nmXjOiKc5hi6nwszeMDGy6xc5ip6YsGvR43HZJE7eluUOrdo9eyIcRpzFqVb1oEMrypocmVzFMObxi0Fmms1fhWt8wlCXvYaU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=dCiRGtYa; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="dCiRGtYa" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1786618624; bh=EHCETmmaBKY4tlCFOl7DXmSmcJX3/lRHG/Z0dhkCCBI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=dCiRGtYapTiehGuf3TK0ETgAZgK7QLB5897Oln4X/SElVwy8WM7TIde/37AoswLMl 92DP3sX5zbPxXaKcOB5vkOVCkQq5j4N1vnB5BRPpmYxclCmHgfWz3Mr6hUcsXlVUgw qcECujPKkaHOcZrPG1dLFdMLCFwraFZKvLanHVzzF3mnKZHbHmE5BU3s95eDEgMi4x My+z0drnfHOVWRRK9CSGRDUwLEKgiWAdU9kvdCfg80b04oOPm73R2GjyWB3k2Fhnjn kcKKP131fnVuY+XmA4G5GycTbuIwL6jX5r60mxvaoxlk7oG+sNF3KP+QfqJ8XhIHnt Y1HMoXX6ZGXrA== Received: from fedora-21.home (unknown [100.64.0.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by bali.collaboradmins.com (Postfix) with ESMTPSA id 48FB317E0FE2; Thu, 13 Aug 2026 12:57:04 +0200 (CEST) From: Boris Brezillon Date: Thu, 13 Aug 2026 12:57:01 +0200 Subject: [PATCH v3 03/17] drm/panthor: Make sure reset requests in the resume path are not lost Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260813-panthor-unplug-fixes-v3-3-3ed4e961bbe7@collabora.com> References: <20260813-panthor-unplug-fixes-v3-0-3ed4e961bbe7@collabora.com> In-Reply-To: <20260813-panthor-unplug-fixes-v3-0-3ed4e961bbe7@collabora.com> To: Steven Price , Liviu Dudau Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Boris Brezillon , sashiko-bot@kernel.org X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1786618621; l=1748; i=boris.brezillon@collabora.com; s=20260429; h=from:subject:message-id; bh=EHCETmmaBKY4tlCFOl7DXmSmcJX3/lRHG/Z0dhkCCBI=; b=8oiVHgawooU/wPCe2cx8tk8l4PkTHAWIhtEnN0I+mju2AVvu1CXK2DzOU2w9x7Qlp16dbnox9 4GKWUbq/QFXB/lmkSHxZYPqIsku8uSyHyrBjXygJWjPlFMZiDOMtADA X-Developer-Key: i=boris.brezillon@collabora.com; a=ed25519; pk=eN+ORdOgQY7d5U+0kA8h5bf67XdD8bhKbjD/TCHexSY= A reset might have been queued while we were resuming. Make sure it's not lost by rescheduling it. Fixes: 5fe909cae118 ("drm/panthor: Add the device logical block") Reported-by: sashiko-bot@kernel.org Closes: https://sashiko.dev/#/patchset/20260804-panthor-unplug-fixes-v1-0-abbbd2d41b13@collabora.com?part=2 Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panthor/panthor_device.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/gpu/drm/panthor/panthor_device.c b/drivers/gpu/drm/panthor/panthor_device.c index 47dc7faf9728..1a8f5ac24399 100644 --- a/drivers/gpu/drm/panthor/panthor_device.c +++ b/drivers/gpu/drm/panthor/panthor_device.c @@ -569,7 +569,24 @@ int panthor_device_resume(struct device *dev) unmap_mapping_range(ptdev->base.anon_inode->i_mapping, DRM_PANTHOR_USER_MMIO_OFFSET, 0, 1); atomic_set(&ptdev->pm.state, PANTHOR_DEVICE_PM_STATE_ACTIVE); + + /* The smp_mb__after_atomic() is here to make sure the pm.state update + * is flushed before we check the reset.pending bit, otherwise, + * according to Sashiko, there's a with the checks that exist in + * panthor_device_schedule_reset(). + * Not sure how real this is, because the try_cmpxchg_release() in + * the mutex_unlock() path also acts as a barrier, but it's not a + * fast-path anyway, so better safe than sorry. + */ + smp_mb__after_atomic(); mutex_unlock(&ptdev->pm.mmio_lock); + + /* A reset might have been queued while we were resuming. Make sure + * it's not lost by rescheduling it. + */ + if (atomic_read(&ptdev->reset.pending)) + queue_work(ptdev->reset.wq, &ptdev->reset.work); + return 0; err_suspend_devfreq: -- 2.55.0