From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F3136C54E58 for ; Tue, 12 Mar 2024 19:47:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AF61310E248; Tue, 12 Mar 2024 19:47:51 +0000 (UTC) Received: from 8e613ede5ea5 (emeril.freedesktop.org [131.252.210.167]) by gabe.freedesktop.org (Postfix) with ESMTPS id D1AB510E3F2; Tue, 12 Mar 2024 19:47:50 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: =?utf-8?q?=E2=9C=93_CI=2Echeckpatch=3A_success_for_drm/xe=3A_Always_check_fo?= =?utf-8?q?rce=5Fwake=5Fget_return_code?= From: Patchwork To: "Daniele Ceraolo Spurio" Cc: intel-xe@lists.freedesktop.org Date: Tue, 12 Mar 2024 19:47:50 -0000 Message-ID: <171027287086.714563.4606933362160873568@8e613ede5ea5> X-Patchwork-Hint: ignore References: <20240312194256.965685-1-daniele.ceraolospurio@intel.com> In-Reply-To: <20240312194256.965685-1-daniele.ceraolospurio@intel.com> X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: intel-xe@lists.freedesktop.org Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" == Series Details == Series: drm/xe: Always check force_wake_get return code URL : https://patchwork.freedesktop.org/series/131045/ State : success == Summary == + KERNEL=/kernel + git clone https://gitlab.freedesktop.org/drm/maintainer-tools mt Cloning into 'mt'... warning: redirecting to https://gitlab.freedesktop.org/drm/maintainer-tools.git/ + git -C mt rev-list -n1 origin/master a9eb1ac8298ef9f9146567c29fa762d8e9efa1ef + cd /kernel + git config --global --add safe.directory /kernel + git log -n1 commit 964b543647f22cdc5df975d1a8857ce955dd56f1 Author: Daniele Ceraolo Spurio Date: Tue Mar 12 12:42:56 2024 -0700 drm/xe: Always check force_wake_get return code A force_wake_get failure means that the HW might not be awake for the access we're doing; this can lead to an immediate error or it can be a more subtle problem (e.g. a register read might return an incorrect value that is still valid, leading the driver to make a wrong choice instead of flagging an error). We avoid an error from the force_wake function because callers might handle or tolerate the error, but this only works if all callers are checking the error code. The majority already do, but a few are not. These are mainly falling into 3 categories, which are each handled differently: 1) error capture: in this case we want to continue the capture, but we log an info message in dmesg to notify the user that the capture might have incorrect data. 2) ioctl: in this case we return a -EIO error to userspace 3) unabortable actions: these are scenarios where we can't simply abort and retry and so it's better to just try it anyway because there is a chance the HW is awake even with the failure. In this case we throw a warning so we know there was a forcewake problem if something fails down the line. Signed-off-by: Daniele Ceraolo Spurio Cc: Tejas Upadhyay + /mt/dim checkpatch 1dfbf3ced62236dd318c701e3f21f5a33c226d0d drm-intel 964b543647f2 drm/xe: Always check force_wake_get return code