From patchwork Wed Jan 24 02:59:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erico Nunes X-Patchwork-Id: 13528463 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 CFDC5C47258 for ; Wed, 24 Jan 2024 03:01:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EA3DC10F5C8; Wed, 24 Jan 2024 03:01:11 +0000 (UTC) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id E35DD10F5AE; Wed, 24 Jan 2024 03:01:10 +0000 (UTC) Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-40e5afc18f5so54498605e9.3; Tue, 23 Jan 2024 19:01:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706065209; x=1706670009; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2lKvsANFUcNVxLXJxZjgiBTj8Zdtr64bBDmNrQ/dGYc=; b=cA7a270f8WUGOIPUsQ5BDpPMPKja8Y0wJbZ/3xjaDDu8k74QH7xxWM0FSrumOTFQdI h++9UHSAO3Ii/prIN8RNZia5KB9fzBcddqtH0A8HVmVQBeJtQSxJLpQyiKtukgoZbO19 +DsM7UlodB/24aH4ALgT18ylXXXgOEBoDAIBAAlC2WJ3xpvDE+gNRH1xR6xKwEi/wg8V vXkim6uNM+90qk4wEgA/zXwG2MGbA9Xhg/OK+Kz03GD2Fo2y/fU4He96t4w/cqfDIhwv +86N/w6AIeQZIgOU2pTGSLKF4jm3bq/PAxLkHSFImDf7K+nj3EpiNrEWokzSHgmE7bBZ WWOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706065209; x=1706670009; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2lKvsANFUcNVxLXJxZjgiBTj8Zdtr64bBDmNrQ/dGYc=; b=Jb0F0LH+5+bfKfDSpY5bDXsTygm9hxCqObjiA3eZSHYcn1+7ca/mAI1HJoULesSd+A 82/iPMOnDbeGyq+HM1+L0aLeh8ivjD2lWMUmQ2m+s2qBN/fBEzWvPRJuArUkXCFpffnf l7Q0h28cmz2S3SlKcjnxiZrS8nB61knzuUOad+dIG41NT9F/zQ9l5Y8+tm2xik7j599w Ee6T9wpTfXXUl6jLegle9rGI8DOLt1ESDxQI5RaQ4t4r/ZsWTgMcwI+hIR6hdBLNOMw+ rP2/eFfEdBol+1Q4jDIy+asUqt4CQOdP0zZFkfSE84C3qeTioraRixSYEVJtEWEggEf5 Rgwg== X-Gm-Message-State: AOJu0YyaHTv0GJtV8rmNfRvCbZ+aEqKEW4iykRwJakJzwG8M28UYjenw hFQCYhU4dS3kZhk1Ic9PWw+38BjRgog00bARogo8X3dZ9jfBMPLI X-Google-Smtp-Source: AGHT+IFZ8JyJ3TC2xfMqcNV5Q5aHuhj3gsNkRM4/2otX+tMjwjVWKRVsJK9h8YN3NMi+Ch1oqtildg== X-Received: by 2002:a05:600c:5399:b0:40e:9675:8416 with SMTP id hg25-20020a05600c539900b0040e96758416mr721099wmb.169.1706065209410; Tue, 23 Jan 2024 19:00:09 -0800 (PST) Received: from mosaic.enunes.eu (ip-78-45-66-209.bb.vodafone.cz. [78.45.66.209]) by smtp.gmail.com with ESMTPSA id dj17-20020a05640231b100b00559bb146ecbsm9637914edb.6.2024.01.23.19.00.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 19:00:08 -0800 (PST) From: Erico Nunes To: Qiang Yu , anarsoul@gmail.com, christian.koenig@amd.com, dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org Subject: [PATCH v2 1/8] drm/lima: reset async_reset on pp hard reset Date: Wed, 24 Jan 2024 03:59:40 +0100 Message-ID: <20240124025947.2110659-2-nunes.erico@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240124025947.2110659-1-nunes.erico@gmail.com> References: <20240124025947.2110659-1-nunes.erico@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Zimmermann , linux-kernel@vger.kernel.org, Maxime Ripard , Daniel Vetter , David Airlie , Sumit Semwal , Erico Nunes Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Lima pp jobs use an async reset to avoid having to wait for the soft reset right after a job. The soft reset is done at the end of a job and a reset_complete flag is expected to be set at the next job. However, in case the user runs into a job timeout from any application, a hard reset is issued to the hardware. This hard reset clears the reset_complete flag, which causes an error message to show up before the next job. This is probably harmless for the execution but can be very confusing to debug, as it blames a reset timeout on the next application to submit a job. Reset the async_reset flag when doing the hard reset so that we don't get that message. Signed-off-by: Erico Nunes Reviewed-by: Vasily Khoruzhick --- drivers/gpu/drm/lima/lima_pp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/lima/lima_pp.c b/drivers/gpu/drm/lima/lima_pp.c index a5c95bed08c0..a8f8f63b8295 100644 --- a/drivers/gpu/drm/lima/lima_pp.c +++ b/drivers/gpu/drm/lima/lima_pp.c @@ -191,6 +191,13 @@ static int lima_pp_hard_reset(struct lima_ip *ip) pp_write(LIMA_PP_PERF_CNT_0_LIMIT, 0); pp_write(LIMA_PP_INT_CLEAR, LIMA_PP_IRQ_MASK_ALL); pp_write(LIMA_PP_INT_MASK, LIMA_PP_IRQ_MASK_USED); + + /* + * if there was an async soft reset queued, + * don't wait for it in the next job + */ + ip->data.async_reset = false; + return 0; } From patchwork Wed Jan 24 02:59:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erico Nunes X-Patchwork-Id: 13528465 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 9F994C47258 for ; Wed, 24 Jan 2024 03:01:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E4ABC10F5C9; Wed, 24 Jan 2024 03:01:12 +0000 (UTC) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id E888C10F5C3; Wed, 24 Jan 2024 03:01:11 +0000 (UTC) Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-40ec32453d5so8142555e9.2; Tue, 23 Jan 2024 19:01:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706065210; x=1706670010; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BaTJtCWzAa42d+m/EougaGDz2r//03gZrDKzLfNv26E=; b=lxYV3hwHYHV+KCkLopZgy9ENJWBov3L/Md0d93T8ntSUZ0/D98E2A8EZGOzLvkF/Y2 6yXzAyNnvnvzZNQgv4C0+Chf+84ffG7BUPeTeAIaETdAJe82ZtO0sr9U0ibM/4x9ioch jHEMb+ZZE+WHnAeTLNJrPRTimjLp1de60JxwcC0Jm/6JjFX9/zJ+hFO0LecuBrITQqxB 2VmPWqYiNJLkyibMtCRfCCy00esThZUWbaOE3QDUI8tiDFg6ykEXnwTS+5a5kT1VVkIE hTml50wM+sKQ4OzRFkkOBnRC0ctR870767CLUCeaZm8+mWjmJG/Gu0jRmzswmdibdIBW ixAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706065210; x=1706670010; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BaTJtCWzAa42d+m/EougaGDz2r//03gZrDKzLfNv26E=; b=wgJIwVupMuGCIUR8738+KE0wg+3/ocDFfcw1Qa/tvd56cxIzRvFWgg26CvM8H11Hex ingKk1pkXXsvx9dsZYXlAaqGIFBhjJMsJYR0PF0jT5BYo/ZAOndJxKQTyWWJ9gWSQ+Og iGjUz/EKqQRLmy87vQwwlZe9PHagaUiQUrqA65Zf3rSR4zBHdWbbfSBAHyrZqtpV2ZGo M3mVlz2RjF+yNbVTZwrHZKTixFjYU4r9e+Q0dYqimLd9y5YkI1QulzGBGfqneBcPgWcD xvfLJyJsOlRJcI6tk0bdI7/qHy4hB4MLGH2BKBx6ImCrFrH70/wIet9zfK3tDNkMUmds HTrA== X-Gm-Message-State: AOJu0YzTLnlEyI5lSjR/INZdQaN8WtK0EkIW2gfPhQTh8UncdTnndpAk Vgv8vTmx+MpzxooPO8OzuhIqg6w6i7u9zxNNwdIHJpU/xIndkp9M X-Google-Smtp-Source: AGHT+IFwR+0PHlmlGEWSlXVj5MQPq5ymiWct8wa0quwiQCc/blJhRIrth30UAoMURGBv8vL3XTjvRA== X-Received: by 2002:a05:600c:5115:b0:40e:b6d0:82d8 with SMTP id o21-20020a05600c511500b0040eb6d082d8mr1030534wms.88.1706065210383; Tue, 23 Jan 2024 19:00:10 -0800 (PST) Received: from mosaic.enunes.eu (ip-78-45-66-209.bb.vodafone.cz. [78.45.66.209]) by smtp.gmail.com with ESMTPSA id dj17-20020a05640231b100b00559bb146ecbsm9637914edb.6.2024.01.23.19.00.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 19:00:09 -0800 (PST) From: Erico Nunes To: Qiang Yu , anarsoul@gmail.com, christian.koenig@amd.com, dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org Subject: [PATCH v2 2/8] drm/lima: reset async_reset on gp hard reset Date: Wed, 24 Jan 2024 03:59:41 +0100 Message-ID: <20240124025947.2110659-3-nunes.erico@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240124025947.2110659-1-nunes.erico@gmail.com> References: <20240124025947.2110659-1-nunes.erico@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Zimmermann , linux-kernel@vger.kernel.org, Maxime Ripard , Daniel Vetter , David Airlie , Sumit Semwal , Erico Nunes Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Lima gp jobs use an async reset to avoid having to wait for the soft reset right after a job. The soft reset is done at the end of a job and a reset_complete flag is expected to be set at the next job. However, in case the user runs into a job timeout from any application, a hard reset is issued to the hardware. This hard reset clears the reset_complete flag, which causes an error message to show up before the next job. This is probably harmless for the execution but can be very confusing to debug, as it blames a reset timeout on the next application to submit a job. Reset the async_reset flag when doing the hard reset so that we don't get that message. Signed-off-by: Erico Nunes --- drivers/gpu/drm/lima/lima_gp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/lima/lima_gp.c b/drivers/gpu/drm/lima/lima_gp.c index 8dd501b7a3d0..b9a06e701a33 100644 --- a/drivers/gpu/drm/lima/lima_gp.c +++ b/drivers/gpu/drm/lima/lima_gp.c @@ -189,6 +189,13 @@ static int lima_gp_hard_reset(struct lima_ip *ip) gp_write(LIMA_GP_PERF_CNT_0_LIMIT, 0); gp_write(LIMA_GP_INT_CLEAR, LIMA_GP_IRQ_MASK_ALL); gp_write(LIMA_GP_INT_MASK, LIMA_GP_IRQ_MASK_USED); + + /* + * if there was an async soft reset queued, + * don't wait for it in the next job + */ + ip->data.async_reset = false; + return 0; } From patchwork Wed Jan 24 02:59:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erico Nunes X-Patchwork-Id: 13528466 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 57831C47258 for ; Wed, 24 Jan 2024 03:01:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 74A2310F5B9; Wed, 24 Jan 2024 03:01:13 +0000 (UTC) Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0A86A10F5D2; Wed, 24 Jan 2024 03:01:13 +0000 (UTC) Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-55c33773c0aso2807742a12.1; Tue, 23 Jan 2024 19:01:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706065211; x=1706670011; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oZ2AGx4llgOQpbQHqy+lTWRZ3MYwi41F2EIG/DZLPtI=; b=Oms15XGX6qeB58KHCi1iGYjZbsaF2J+Qzyro0gH2cCES9DCcDHPyLCs/mdR3r39Y/u 6g74HRt8uv0G5DobSC7hbaZXD/pzcHjJh5+YwbmjXmUPUBk0Ejp+DV7Vs+hR+s5xRNVr tCakMXZ2lNqr9Y9RAide49aaskeoHt9Dm2tcDyVbxE14qhXVX9s4w0T6yZ6lbgl/edc/ 2glXRu4pa2XYjf1UkIV1Nd9yRi85FseOfvgFdWmT0ENsXXAATPHsp8wMpMUJBej4xtsP 2tl/nukAOsPaa8AVuYa7ROXV/vWoL6DdMia83yzY3vJ8AmwG7JS4elT8B5jQbygkjI4U seEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706065211; x=1706670011; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oZ2AGx4llgOQpbQHqy+lTWRZ3MYwi41F2EIG/DZLPtI=; b=rmnKfBeRE5BUdEsEFqd6Dwyhjwz8DxTRGLjECbJ5bOr1mTh82AeHd0akoK/ZcODhFU /QHwj5jSjzXLd5p5ubjdmhl4I4N17ExbTX3GmImv/jVaRF7LAdTChdsiR+0GgteDPZeB MiraEHPmbCFSlVzlqS7VT81/4YHvQmEgvTxergRkfqs7WtBKxb0gcCeE6HpgFkVqgzTc ZA2dpcJa7liyDKfDDE8xv1ChhTVeHSOGDzkCGWvImVmWzA2wdLL/ze0KcX8teY5337vh wKR5HMp71IlkcdU+OT/WiSByP3RexVtWwrTBo3qobpgVogTjIpAgVO54ixct4uYaQd3i mXWw== X-Gm-Message-State: AOJu0Yz1xkoVmvzTAY1V+W171MBKZyuxmthCqSfDSZHXHBStTComa809 7uePZNMNzz3ETXAx9N2ODha0lsAaZUInciH+/2bsYGAGYQ9YjrjhXVbfyzzBTCg= X-Google-Smtp-Source: AGHT+IFY/xUjRd5C81Nvba31ogUlvGsjSOuyHLhEZHoYYl7MqACrgkHcV+dOKD+vbkGVhH1TYy4G0w== X-Received: by 2002:a50:ee03:0:b0:559:70d5:5dd9 with SMTP id g3-20020a50ee03000000b0055970d55dd9mr1494752eds.67.1706065211426; Tue, 23 Jan 2024 19:00:11 -0800 (PST) Received: from mosaic.enunes.eu (ip-78-45-66-209.bb.vodafone.cz. [78.45.66.209]) by smtp.gmail.com with ESMTPSA id dj17-20020a05640231b100b00559bb146ecbsm9637914edb.6.2024.01.23.19.00.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 19:00:10 -0800 (PST) From: Erico Nunes To: Qiang Yu , anarsoul@gmail.com, christian.koenig@amd.com, dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org Subject: [PATCH v2 3/8] drm/lima: set pp bus_stop bit before hard reset Date: Wed, 24 Jan 2024 03:59:42 +0100 Message-ID: <20240124025947.2110659-4-nunes.erico@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240124025947.2110659-1-nunes.erico@gmail.com> References: <20240124025947.2110659-1-nunes.erico@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Zimmermann , linux-kernel@vger.kernel.org, Maxime Ripard , Daniel Vetter , David Airlie , Sumit Semwal , Erico Nunes Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This is required for reliable hard resets. Otherwise, doing a hard reset while a task is still running (such as a task which is being stopped by the drm_sched timeout handler) may result in random mmu write timeouts or lockups which cause the entire gpu to hang. Signed-off-by: Erico Nunes Reviewed-by: Vasily Khoruzhick --- drivers/gpu/drm/lima/lima_pp.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/gpu/drm/lima/lima_pp.c b/drivers/gpu/drm/lima/lima_pp.c index a8f8f63b8295..ac097dd75072 100644 --- a/drivers/gpu/drm/lima/lima_pp.c +++ b/drivers/gpu/drm/lima/lima_pp.c @@ -168,6 +168,11 @@ static void lima_pp_write_frame(struct lima_ip *ip, u32 *frame, u32 *wb) } } +static int lima_pp_bus_stop_poll(struct lima_ip *ip) +{ + return !!(pp_read(LIMA_PP_STATUS) & LIMA_PP_STATUS_BUS_STOPPED); +} + static int lima_pp_hard_reset_poll(struct lima_ip *ip) { pp_write(LIMA_PP_PERF_CNT_0_LIMIT, 0xC01A0000); @@ -181,6 +186,14 @@ static int lima_pp_hard_reset(struct lima_ip *ip) pp_write(LIMA_PP_PERF_CNT_0_LIMIT, 0xC0FFE000); pp_write(LIMA_PP_INT_MASK, 0); + + pp_write(LIMA_PP_CTRL, LIMA_PP_CTRL_STOP_BUS); + ret = lima_poll_timeout(ip, lima_pp_bus_stop_poll, 10, 100); + if (ret) { + dev_err(dev->dev, "pp %s bus stop timeout\n", lima_ip_name(ip)); + return ret; + } + pp_write(LIMA_PP_CTRL, LIMA_PP_CTRL_FORCE_RESET); ret = lima_poll_timeout(ip, lima_pp_hard_reset_poll, 10, 100); if (ret) { From patchwork Wed Jan 24 02:59:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erico Nunes X-Patchwork-Id: 13528468 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 48096C47DDB for ; Wed, 24 Jan 2024 03:01:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0A01010F5D7; Wed, 24 Jan 2024 03:01:19 +0000 (UTC) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id 00B6610F5D2; Wed, 24 Jan 2024 03:01:13 +0000 (UTC) Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-40eac352733so31149245e9.0; Tue, 23 Jan 2024 19:01:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706065212; x=1706670012; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xsH0t0Mo3703I7xwFyS+NhUyDq/CWLVJL75Yu+tXQAA=; b=ErnbZcDbC0exoKCupNVo93ZRy8uoqhLjw0vOkbgtwz0AIV6vn+Leni82xAjg1t5eBg ut9ka1IsKBLTydxjDNOpIgvkX91O3X53lcIX60nyApMyeu5CJNOS+bK28eM8hq+KNBMk 85Js/rdWs1EbZtwRY8WWY/xAPJaGubS4sj+0E7J9aEmU9FS4txA/lPMgM4WJIprEXsg8 pCc/49+xItGrE1Nv5rqbqmGW2pqEy1dcabVaI7Zr9v+TGajFKW8ZWx8CWjA0Qu6XNzBN /RHt6e0taD2py0lyT4gKFtOr7e2hcKSMd+9PP6Dyl5pB3aULeQJrjnJIbVK235mlAvk0 qPqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706065212; x=1706670012; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xsH0t0Mo3703I7xwFyS+NhUyDq/CWLVJL75Yu+tXQAA=; b=T7Q429PhL+inKy6YI0en3im/DIumMf3WQ0j3OtSQcpoD8dX9/6NPR9B59jaXP5dVQX J3RZ/quSMFAU7R2hh8oAjrWDn0AL/0g6paioXIhvCEiVOEVRR7w9P9itWOdMSVAlypZI 0JffWUH73Ht9+uQKiDeQrSWib3atWBLj6BFdVcvuYOkPE/z5A6OO7dzdEb9zoWu3MnL9 mSxeDhHfL+gOMPnCf4I+9zDxTzq0ydLZVls9Krb/KuMl/xK1FjTHVVgRvZ/8Y7y+b5fx IOmJQC/LpI5dSvJHgAMmRLjoBcLAkIp6vEc18WbUBh2ylZvZyioRqC7ZdluyaUFqCilK kSUw== X-Gm-Message-State: AOJu0YxEUAC0NIMaXW3K4CUEgMNB1izoWpTQwTuVYArbdRRFflhSSPSu TPsxNw0gBtZuBD7zLc4PQdSAmFvaZSl8CAKaicotpcSyAyL5bJ6U X-Google-Smtp-Source: AGHT+IG56fGRQ4TmapP4DZAXI1KdXrMXihzbtQnGB0VIMwwJOsKunjx1HQl/TwRycRUsmO8GmBJLiw== X-Received: by 2002:a05:600c:4214:b0:40e:afa6:5e00 with SMTP id x20-20020a05600c421400b0040eafa65e00mr620087wmh.168.1706065212421; Tue, 23 Jan 2024 19:00:12 -0800 (PST) Received: from mosaic.enunes.eu (ip-78-45-66-209.bb.vodafone.cz. [78.45.66.209]) by smtp.gmail.com with ESMTPSA id dj17-20020a05640231b100b00559bb146ecbsm9637914edb.6.2024.01.23.19.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 19:00:11 -0800 (PST) From: Erico Nunes To: Qiang Yu , anarsoul@gmail.com, christian.koenig@amd.com, dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org Subject: [PATCH v2 4/8] drm/lima: set gp bus_stop bit before hard reset Date: Wed, 24 Jan 2024 03:59:43 +0100 Message-ID: <20240124025947.2110659-5-nunes.erico@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240124025947.2110659-1-nunes.erico@gmail.com> References: <20240124025947.2110659-1-nunes.erico@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Zimmermann , linux-kernel@vger.kernel.org, Maxime Ripard , Daniel Vetter , David Airlie , Sumit Semwal , Erico Nunes Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This is required for reliable hard resets. Otherwise, doing a hard reset while a task is still running (such as a task which is being stopped by the drm_sched timeout handler) may result in random mmu write timeouts or lockups which cause the entire gpu to hang. Signed-off-by: Erico Nunes --- drivers/gpu/drm/lima/lima_gp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/lima/lima_gp.c b/drivers/gpu/drm/lima/lima_gp.c index b9a06e701a33..4355fa7b17f4 100644 --- a/drivers/gpu/drm/lima/lima_gp.c +++ b/drivers/gpu/drm/lima/lima_gp.c @@ -166,6 +166,11 @@ static void lima_gp_task_run(struct lima_sched_pipe *pipe, gp_write(LIMA_GP_CMD, cmd); } +static int lima_gp_bus_stop_poll(struct lima_ip *ip) +{ + return !!(gp_read(LIMA_GP_STATUS) & LIMA_GP_STATUS_BUS_STOPPED); +} + static int lima_gp_hard_reset_poll(struct lima_ip *ip) { gp_write(LIMA_GP_PERF_CNT_0_LIMIT, 0xC01A0000); @@ -179,6 +184,13 @@ static int lima_gp_hard_reset(struct lima_ip *ip) gp_write(LIMA_GP_PERF_CNT_0_LIMIT, 0xC0FFE000); gp_write(LIMA_GP_INT_MASK, 0); + + gp_write(LIMA_GP_CMD, LIMA_GP_CMD_STOP_BUS); + ret = lima_poll_timeout(ip, lima_gp_bus_stop_poll, 10, 100); + if (ret) { + dev_err(dev->dev, "%s bus stop timeout\n", lima_ip_name(ip)); + return ret; + } gp_write(LIMA_GP_CMD, LIMA_GP_CMD_RESET); ret = lima_poll_timeout(ip, lima_gp_hard_reset_poll, 10, 100); if (ret) { From patchwork Wed Jan 24 02:59:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erico Nunes X-Patchwork-Id: 13528469 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 875E5C47DDB for ; Wed, 24 Jan 2024 03:01:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0602A10F5D6; Wed, 24 Jan 2024 03:01:19 +0000 (UTC) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by gabe.freedesktop.org (Postfix) with ESMTPS id EE24910F5D4; Wed, 24 Jan 2024 03:01:14 +0000 (UTC) Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-40eb2f392f0so17771315e9.1; Tue, 23 Jan 2024 19:01:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706065213; x=1706670013; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=opZYreiEG2AcFzWD38eEu/SQH9nltnXulQyDLOx9jXo=; b=FByo0PL15usCHPNOTtIqCCLliQgH8wKqdYO/Mj4kgVOE85wTEki0u7hQTTd/xKyIe4 mpOSP2qtdiLzfdnzjM643UMkOdEfM1/emiBFbpRXSecKTMh5zxgmFepqd0DknBukJSFG otnk+xC81EaCf+c4O5WJKvSfx/sE9kWVA1/BQEC8w3viS6BfelHFAl/DI5JSrh2CjMOk L74BsyZKIW2pBDK9klccnNRuZlZOgfp4N9OJVdknMNgp2qqzsvuL1n6SDft+aQBo7EfO LCvUDUQSIjnnDc3LUy31teHmyzMT0zIneEheeiw37yysa17C/n2z5kCXUV9qLekx7qov VKlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706065213; x=1706670013; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=opZYreiEG2AcFzWD38eEu/SQH9nltnXulQyDLOx9jXo=; b=JTlEBC7G27IxOKjYR5vYBkNrUL6ccVlQHVbJ/BmEEVg15I1s6EW5o5EE9R2qQjX+9l 2xALtAhlO4HImfomkmpjcjWiSLxeS5Rp+o4bBTdYsbTnQOiE2FkRIMkYXeV2uBkozH6G bOAUJ9Y8/9458BII0NrnCuN93EAiqQdPGKfXJPdm/0jFpPlLA3eKJBem9UfSkDLH7WCG Zt17xzuJN0gmHaEhPJGRzlxdXbKy1U+aaDFEfCDlUrvfKq5I8MqIDG4nVijzNzo1UTKN pLdvdhVvAvPJRxeKXyDFL5JfFxopw7WGiI6152utGmTPRGPmqFZH5hvjktUHd7UMdZYU 5XXg== X-Gm-Message-State: AOJu0Yw7evwo9B/BD4Imh+QfGa2SK7EmrJ+AGd10kwjFSLFKpcdf//mY NDeUy/jyvlA5Mavx6oXnhdzEpwLT2cfGZChR7s5VjBc/zSStH0qWdQmE2p4Nm+E= X-Google-Smtp-Source: AGHT+IFSHthVhbNG0Qfb0DDYrPsBvJwa1h3gBSGkCx5GOfjIWDgE++7W0fC/TiEr/1O0wANexbQlPQ== X-Received: by 2002:a05:600c:1705:b0:40e:ab2a:25a0 with SMTP id c5-20020a05600c170500b0040eab2a25a0mr683615wmn.181.1706065213437; Tue, 23 Jan 2024 19:00:13 -0800 (PST) Received: from mosaic.enunes.eu (ip-78-45-66-209.bb.vodafone.cz. [78.45.66.209]) by smtp.gmail.com with ESMTPSA id dj17-20020a05640231b100b00559bb146ecbsm9637914edb.6.2024.01.23.19.00.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 19:00:12 -0800 (PST) From: Erico Nunes To: Qiang Yu , anarsoul@gmail.com, christian.koenig@amd.com, dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org Subject: [PATCH v2 5/8] drm/lima: handle spurious timeouts due to high irq latency Date: Wed, 24 Jan 2024 03:59:44 +0100 Message-ID: <20240124025947.2110659-6-nunes.erico@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240124025947.2110659-1-nunes.erico@gmail.com> References: <20240124025947.2110659-1-nunes.erico@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Zimmermann , linux-kernel@vger.kernel.org, Maxime Ripard , Daniel Vetter , David Airlie , Sumit Semwal , Erico Nunes Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" There are several unexplained and unreproduced cases of rendering timeouts with lima, for which one theory is high IRQ latency coming from somewhere else in the system. This kind of occurrence may cause applications to trigger unnecessary resets of the GPU or even applications to hang if it hits an issue in the recovery path. Panfrost already does some special handling to account for such "spurious timeouts", it makes sense to have this in lima too to reduce the chance that it hit users. Signed-off-by: Erico Nunes --- drivers/gpu/drm/lima/lima_sched.c | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/lima/lima_sched.c b/drivers/gpu/drm/lima/lima_sched.c index c3bf8cda8498..814428564637 100644 --- a/drivers/gpu/drm/lima/lima_sched.c +++ b/drivers/gpu/drm/lima/lima_sched.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 OR MIT /* Copyright 2017-2019 Qiang Yu */ +#include #include #include #include @@ -401,9 +402,35 @@ static enum drm_gpu_sched_stat lima_sched_timedout_job(struct drm_sched_job *job struct lima_sched_pipe *pipe = to_lima_pipe(job->sched); struct lima_sched_task *task = to_lima_task(job); struct lima_device *ldev = pipe->ldev; + struct lima_ip *ip = pipe->processor[0]; + int i; + + /* + * If the GPU managed to complete this jobs fence, the timeout is + * spurious. Bail out. + */ + if (dma_fence_is_signaled(task->fence)) { + DRM_WARN("%s spurious timeout\n", lima_ip_name(ip)); + return DRM_GPU_SCHED_STAT_NOMINAL; + } + + /* + * Lima IRQ handler may take a long time to process an interrupt + * if there is another IRQ handler hogging the processing. + * In order to catch such cases and not report spurious Lima job + * timeouts, synchronize the IRQ handler and re-check the fence + * status. + */ + for (i = 0; i < pipe->num_processor; i++) + synchronize_irq(pipe->processor[i]->irq); + + if (dma_fence_is_signaled(task->fence)) { + DRM_WARN("%s unexpectedly high interrupt latency\n", lima_ip_name(ip)); + return DRM_GPU_SCHED_STAT_NOMINAL; + } if (!pipe->error) - DRM_ERROR("lima job timeout\n"); + DRM_ERROR("%s job timeout\n", lima_ip_name(ip)); drm_sched_stop(&pipe->base, &task->base); @@ -417,8 +444,6 @@ static enum drm_gpu_sched_stat lima_sched_timedout_job(struct drm_sched_job *job if (pipe->bcast_mmu) lima_mmu_page_fault_resume(pipe->bcast_mmu); else { - int i; - for (i = 0; i < pipe->num_mmu; i++) lima_mmu_page_fault_resume(pipe->mmu[i]); } From patchwork Wed Jan 24 02:59:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Erico Nunes X-Patchwork-Id: 13528467 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 90685C47DDB for ; Wed, 24 Jan 2024 03:01:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B77AB10F5D5; Wed, 24 Jan 2024 03:01:18 +0000 (UTC) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id EAFA010F5D4; Wed, 24 Jan 2024 03:01:15 +0000 (UTC) Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-40e7065b692so54393765e9.3; Tue, 23 Jan 2024 19:01:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706065214; x=1706670014; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CPOuKECiwusygEzLYMH/0TGCGdxpS/EWgBvieVarlTc=; b=fwpbw2QL19AE6zHPOoj9KkEjQph6x3wR1s6AWIq1OJsaCPbtEwXS4TI8duFjNeS48t CWhj+U7qTYrKTJ3j5eNZ5jWNEb0ZKtpvo+RyYZWTq/GcVrARnCBvXAvx0EeOHwCT7B2x YkA/swSeg5BIM7f7boTz1uK7BC+ofDMSCdRNN/uyHj7m8rbmrTi/JvWbu9EDQ58Urz+w zVM72MGYGThp2ouSqxOj5YV/ELsig/fNWlw2ZJseh7HmVrqt64oBN590ZUmWghXwCUDG THI0VdMpBA+jVn9JDazJUzBjbiwigNR3UaWfqrH08ca6gX2TRkSbxFBBXVTvR7pBJXqT DrBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706065214; x=1706670014; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CPOuKECiwusygEzLYMH/0TGCGdxpS/EWgBvieVarlTc=; b=C4ZWHEqkVBCfJY2UTsordnVBbv+SuiVVfHERkHnkXo5eFVpW+ZIFE2PKp/WcH4bqt0 UgUMsAK7GsNG4lLKZU5xNiZ4JJs5vXOsAfg2/FpcunKeWu2F+m+zNugnAzYwzZfDbJWK WfCMo9o9s3dD+KF5N2HdvfZTYUZGDIFhzem4mKmPsq/HWwE4DHXeLU24+rEYMRVSDOMN thKAE3AOKFQ9+tBII/GeoLkbKF7JUld3bLQU3mKvECZXEiSXEW14fItZYYkqC5/YvtmU /Xh48zuO3mUWWWknShQLu6PKmpykw1pzLg5GmMUs4/zRU/mJ+TnLh7LJs0wkNXi27D4V q56Q== X-Gm-Message-State: AOJu0Yw8j/dTvcAT6vJuhwPbVazvDdrZzIt/VSwIW/poWQFAxh2yvQOq 8WffjBARL2vTXcTvUj04RwZzK4+gTVbNXULdVg7RfABDW4jzirR/ X-Google-Smtp-Source: AGHT+IH9nwxT639jdbbzp4/DS6PQHGpdpzVCBa61wucVXmalZ7SmRPk+J63hGBQfS46wwyrTbkMVXQ== X-Received: by 2002:a05:600c:45c9:b0:40e:6238:e9e8 with SMTP id s9-20020a05600c45c900b0040e6238e9e8mr642304wmo.1.1706065214435; Tue, 23 Jan 2024 19:00:14 -0800 (PST) Received: from mosaic.enunes.eu (ip-78-45-66-209.bb.vodafone.cz. [78.45.66.209]) by smtp.gmail.com with ESMTPSA id dj17-20020a05640231b100b00559bb146ecbsm9637914edb.6.2024.01.23.19.00.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 19:00:13 -0800 (PST) From: Erico Nunes To: Qiang Yu , anarsoul@gmail.com, christian.koenig@amd.com, dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org Subject: [PATCH v2 6/8] drm/lima: remove guilty drm_sched context handling Date: Wed, 24 Jan 2024 03:59:45 +0100 Message-ID: <20240124025947.2110659-7-nunes.erico@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240124025947.2110659-1-nunes.erico@gmail.com> References: <20240124025947.2110659-1-nunes.erico@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Zimmermann , linux-kernel@vger.kernel.org, Maxime Ripard , Daniel Vetter , David Airlie , Sumit Semwal , Erico Nunes Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Marking the context as guilty currently only makes the application which hits a single timeout problem to stop its rendering context entirely. All jobs submitted later are dropped from the guilty context. Lima runs on fairly underpowered hardware for modern standards and it is not entirely unreasonable that a rendering job may time out occasionally due to high system load or too demanding application stack. In this case it would be generally preferred to report the error but try to keep the application going. Other similar embedded GPU drivers don't make use of the guilty context flag. Now that there are reliability improvements to the lima timeout recovery handling, drop the guilty contexts to let the application keep running in this case. Signed-off-by: Erico Nunes Acked-by: Christian König Reviewed-by: Vasily Khoruzhick --- drivers/gpu/drm/lima/lima_ctx.c | 2 +- drivers/gpu/drm/lima/lima_ctx.h | 1 - drivers/gpu/drm/lima/lima_sched.c | 5 ++--- drivers/gpu/drm/lima/lima_sched.h | 3 +-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/lima/lima_ctx.c b/drivers/gpu/drm/lima/lima_ctx.c index 8389f2d7d021..0e668fc1e0f9 100644 --- a/drivers/gpu/drm/lima/lima_ctx.c +++ b/drivers/gpu/drm/lima/lima_ctx.c @@ -19,7 +19,7 @@ int lima_ctx_create(struct lima_device *dev, struct lima_ctx_mgr *mgr, u32 *id) kref_init(&ctx->refcnt); for (i = 0; i < lima_pipe_num; i++) { - err = lima_sched_context_init(dev->pipe + i, ctx->context + i, &ctx->guilty); + err = lima_sched_context_init(dev->pipe + i, ctx->context + i); if (err) goto err_out0; } diff --git a/drivers/gpu/drm/lima/lima_ctx.h b/drivers/gpu/drm/lima/lima_ctx.h index 74e2be09090f..5b1063ce968b 100644 --- a/drivers/gpu/drm/lima/lima_ctx.h +++ b/drivers/gpu/drm/lima/lima_ctx.h @@ -13,7 +13,6 @@ struct lima_ctx { struct kref refcnt; struct lima_device *dev; struct lima_sched_context context[lima_pipe_num]; - atomic_t guilty; /* debug info */ char pname[TASK_COMM_LEN]; diff --git a/drivers/gpu/drm/lima/lima_sched.c b/drivers/gpu/drm/lima/lima_sched.c index 814428564637..c2e78605e43e 100644 --- a/drivers/gpu/drm/lima/lima_sched.c +++ b/drivers/gpu/drm/lima/lima_sched.c @@ -154,13 +154,12 @@ void lima_sched_task_fini(struct lima_sched_task *task) } int lima_sched_context_init(struct lima_sched_pipe *pipe, - struct lima_sched_context *context, - atomic_t *guilty) + struct lima_sched_context *context) { struct drm_gpu_scheduler *sched = &pipe->base; return drm_sched_entity_init(&context->base, DRM_SCHED_PRIORITY_NORMAL, - &sched, 1, guilty); + &sched, 1, NULL); } void lima_sched_context_fini(struct lima_sched_pipe *pipe, diff --git a/drivers/gpu/drm/lima/lima_sched.h b/drivers/gpu/drm/lima/lima_sched.h index 6a11764d87b3..6bd4f3b70109 100644 --- a/drivers/gpu/drm/lima/lima_sched.h +++ b/drivers/gpu/drm/lima/lima_sched.h @@ -91,8 +91,7 @@ int lima_sched_task_init(struct lima_sched_task *task, void lima_sched_task_fini(struct lima_sched_task *task); int lima_sched_context_init(struct lima_sched_pipe *pipe, - struct lima_sched_context *context, - atomic_t *guilty); + struct lima_sched_context *context); void lima_sched_context_fini(struct lima_sched_pipe *pipe, struct lima_sched_context *context); struct dma_fence *lima_sched_context_queue_task(struct lima_sched_task *task); From patchwork Wed Jan 24 02:59:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erico Nunes X-Patchwork-Id: 13528470 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 17DD0C47258 for ; Wed, 24 Jan 2024 03:01:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 547BE10F5C2; Wed, 24 Jan 2024 03:01:28 +0000 (UTC) Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id 031C610F5D5; Wed, 24 Jan 2024 03:01:16 +0000 (UTC) Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-554fe147ddeso6617257a12.3; Tue, 23 Jan 2024 19:01:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706065215; x=1706670015; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gUjnB5UXcV+HhJdRxnmUySO0sKgHXE4jTknvXI2h7ds=; b=SVw6EwtQXxNO+cAQ6sRlGUlhTzAGbxU0R186afNyMzqO8SLq/fAhUqPAumX2++9NrW DmimWh5zqfa88ugq0pmlbbhaR6tpmgNsATQZin+8Ffi9ZEAYV1QkLGH5sCIheDAGMBRG rse+JOLmOHaoKzykZuiyDpShMWGO7qivkTi10VycWokgSPyok1oKWeKHyt1soA/aot6o UH6BPazMjS7gwSuVil0/eBJ14eU3+CkRgQYDEbxlbjd/klS7qTe4qKwsVh9CcC1V994a J6VQYvhPSdHvZrvfCYwN1cHpacBBEM3Kjs8oIBmCPQu88QjMCigEaFNh6S56jGhNLAfZ C3KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706065215; x=1706670015; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gUjnB5UXcV+HhJdRxnmUySO0sKgHXE4jTknvXI2h7ds=; b=JbjbTgHsD7W6Qe7k8HaJiX2t1p4rYnjCNjHqnU/6pRi+a+tG8xqgJqbhY6fI8a4E1k zn3KvacYvvRcKaQkpmoMeVc5xEDpPQ0lE3W/WpBA1VW+LITPsAY6X1M494HS6L3K8X4l Y5Ha5f+lUjDGOBnvj83cyDAj30mIEmF9PsdYn9hFGgpF9t39J4rdhFS36VrCNL2ffXdv u6aBo1ahN0o5LJGwDAa98/xaBsBf1kEh2DPgAes3Vy3sCWMPnbM5xX0dxm4sr6N7KPU5 TNq+NPA0K0nUUef0zESUl32axd+yLw//mcsOtzn6eqR+tfjFbAa+/LJ9f5m4dqmjDYH+ JxGg== X-Gm-Message-State: AOJu0Yxxa+z+SWKLCI4I7PVQjrASjq7AkXGifB54j+6EfelNhijUtR73 +toJ4z4MZkmbObrXJmZ1566W19vHU9A6vJN4d5qwMfNakQMQKXaO X-Google-Smtp-Source: AGHT+IHg5LrHSVYVuCNSXsc0+hEAvO6xwpPVT8afKP9CgCtUEsSJwOjoz5XuLPsY9rpygEFUeDJYEw== X-Received: by 2002:a05:6402:358c:b0:55c:74f2:44de with SMTP id y12-20020a056402358c00b0055c74f244demr846902edc.108.1706065215429; Tue, 23 Jan 2024 19:00:15 -0800 (PST) Received: from mosaic.enunes.eu (ip-78-45-66-209.bb.vodafone.cz. [78.45.66.209]) by smtp.gmail.com with ESMTPSA id dj17-20020a05640231b100b00559bb146ecbsm9637914edb.6.2024.01.23.19.00.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 19:00:14 -0800 (PST) From: Erico Nunes To: Qiang Yu , anarsoul@gmail.com, christian.koenig@amd.com, dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org Subject: [PATCH v2 7/8] drm/lima: increase default job timeout to 10s Date: Wed, 24 Jan 2024 03:59:46 +0100 Message-ID: <20240124025947.2110659-8-nunes.erico@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240124025947.2110659-1-nunes.erico@gmail.com> References: <20240124025947.2110659-1-nunes.erico@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Zimmermann , linux-kernel@vger.kernel.org, Maxime Ripard , Daniel Vetter , David Airlie , Sumit Semwal , Erico Nunes Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The previous 500ms default timeout was fairly optimistic and could be hit by real world applications. Many distributions targeting devices with a Mali-4xx already bumped this timeout to a higher limit. We can be generous here with a high value as 10s since this should mostly catch buggy jobs like infinite loop shaders, and these don't seem to happen very often in real applications. Signed-off-by: Erico Nunes --- drivers/gpu/drm/lima/lima_sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/lima/lima_sched.c b/drivers/gpu/drm/lima/lima_sched.c index c2e78605e43e..00b19adfc888 100644 --- a/drivers/gpu/drm/lima/lima_sched.c +++ b/drivers/gpu/drm/lima/lima_sched.c @@ -505,7 +505,7 @@ static void lima_sched_recover_work(struct work_struct *work) int lima_sched_pipe_init(struct lima_sched_pipe *pipe, const char *name) { unsigned int timeout = lima_sched_timeout_ms > 0 ? - lima_sched_timeout_ms : 500; + lima_sched_timeout_ms : 10000; pipe->fence_context = dma_fence_context_alloc(1); spin_lock_init(&pipe->fence_lock); From patchwork Wed Jan 24 02:59:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erico Nunes X-Patchwork-Id: 13528471 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 3A7A1C47258 for ; Wed, 24 Jan 2024 03:01:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9BF4810F5D1; Wed, 24 Jan 2024 03:01:41 +0000 (UTC) Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 01D9910F5C0; Wed, 24 Jan 2024 03:01:18 +0000 (UTC) Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-559f92bf7b6so9075720a12.0; Tue, 23 Jan 2024 19:01:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706065216; x=1706670016; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7t4g0dsSRdpeLCYs8MxmtMoFxRmps4SUlUHmKsZELwE=; b=DWR8UrCUWPWECGwfoGpvczkVVvxfgVKZbcnTvmb+459C7ZPANkOal1JJanSQ8Gdi4I hvtlsPm5r29jr1jC/coz8S3+muMo+1ePI2ZM39LqVAxCf+h1MdgerRTbe4mee/rIkTHH AAlOYqSUZrJfnG/mz1i92oEb+PxLLqTZGf5qZX/lruaia5RBTndnVdFl0huBcLBvzkXY 0pANi2IrQw2HBGtpt0j2zMSJ190H5dvZHV9Ct7crdEQP1EuYuaAlSSiLAYhXO0/d6xr9 GDxUtYgQ0UOkx0BHG39qOGDAnVTB/7c1sXrCq1XfA9WsgFiNRev98pi0x2eyTqh5FjR7 o3FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706065216; x=1706670016; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7t4g0dsSRdpeLCYs8MxmtMoFxRmps4SUlUHmKsZELwE=; b=t2HuT7tJQyPBRcWTkW3xYERS/tYSonPk3uUsEjUIwugqLN7eXGriMZ3Mg10BwerrUD de0CCyhRoGUKsr2ZnAflEgI1CaqKuaw22hoCyFOzL2j7fzJi6ASz/jhl0tNZsybdGzjM nz/EcvGM5WzvhFd4Bk5P2uMwj1AFT8IrC5xiCxXICaslBKBhO+VOZuT/zHmd1ItxrkyW EqZMQDnjER6zv6bVnMcxMKEtJ9+L/YNkbMILDHLFYTXJiAH3XvjjkqVUD67uerpY8OSX Ql8LfOfbacE0J9+Iebtj2YsGS2Gn0juV5mP6+s9uFoDaFsGhecUvOi/Fyd1bw+RcRCP8 rtHQ== X-Gm-Message-State: AOJu0Yxf9rkEKuqhxYmaf2Cfho1BXpsIl+Z6kA58creIwfAncAqANBPq TACcWIwmmJ7SnU6lCEohAidpZDE8ZkhEB3BEByeLC3OIsuwL5ND9 X-Google-Smtp-Source: AGHT+IEqm4FeloylkgEyETEhp1HlT+xVHaBlzFpBrcRgGswpJ3yK7Jf9LdlNlQ1dmrLktikKiUiZ/w== X-Received: by 2002:a50:fc04:0:b0:55c:7d37:7d9d with SMTP id i4-20020a50fc04000000b0055c7d377d9dmr481849edr.2.1706065216428; Tue, 23 Jan 2024 19:00:16 -0800 (PST) Received: from mosaic.enunes.eu (ip-78-45-66-209.bb.vodafone.cz. [78.45.66.209]) by smtp.gmail.com with ESMTPSA id dj17-20020a05640231b100b00559bb146ecbsm9637914edb.6.2024.01.23.19.00.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 19:00:15 -0800 (PST) From: Erico Nunes To: Qiang Yu , anarsoul@gmail.com, christian.koenig@amd.com, dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org Subject: [PATCH v2 8/8] drm/lima: standardize debug messages by ip name Date: Wed, 24 Jan 2024 03:59:47 +0100 Message-ID: <20240124025947.2110659-9-nunes.erico@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240124025947.2110659-1-nunes.erico@gmail.com> References: <20240124025947.2110659-1-nunes.erico@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Zimmermann , linux-kernel@vger.kernel.org, Maxime Ripard , Daniel Vetter , David Airlie , Sumit Semwal , Erico Nunes Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Some debug messages carried the ip name, or included "lima", or included both the ip name and then the numbered ip name again. Make the messages more consistent by always looking up and showing the ip name first. Signed-off-by: Erico Nunes --- drivers/gpu/drm/lima/lima_gp.c | 20 +++++++++++--------- drivers/gpu/drm/lima/lima_l2_cache.c | 6 ++++-- drivers/gpu/drm/lima/lima_mmu.c | 18 +++++++++--------- drivers/gpu/drm/lima/lima_pmu.c | 3 ++- drivers/gpu/drm/lima/lima_pp.c | 19 ++++++++++--------- 5 files changed, 36 insertions(+), 30 deletions(-) diff --git a/drivers/gpu/drm/lima/lima_gp.c b/drivers/gpu/drm/lima/lima_gp.c index 4355fa7b17f4..6b354e2fb61d 100644 --- a/drivers/gpu/drm/lima/lima_gp.c +++ b/drivers/gpu/drm/lima/lima_gp.c @@ -34,11 +34,11 @@ static irqreturn_t lima_gp_irq_handler(int irq, void *data) if (state & LIMA_GP_IRQ_MASK_ERROR) { if ((state & LIMA_GP_IRQ_MASK_ERROR) == LIMA_GP_IRQ_PLBU_OUT_OF_MEM) { - dev_dbg(dev->dev, "gp out of heap irq status=%x\n", - status); + dev_dbg(dev->dev, "%s out of heap irq status=%x\n", + lima_ip_name(ip), status); } else { - dev_err(dev->dev, "gp error irq state=%x status=%x\n", - state, status); + dev_err(dev->dev, "%s error irq state=%x status=%x\n", + lima_ip_name(ip), state, status); if (task) task->recoverable = false; } @@ -89,7 +89,8 @@ static int lima_gp_soft_reset_async_wait(struct lima_ip *ip) v & LIMA_GP_IRQ_RESET_COMPLETED, 0, 100); if (err) { - dev_err(dev->dev, "gp soft reset time out\n"); + dev_err(dev->dev, "%s soft reset time out\n", + lima_ip_name(ip)); return err; } @@ -194,7 +195,7 @@ static int lima_gp_hard_reset(struct lima_ip *ip) gp_write(LIMA_GP_CMD, LIMA_GP_CMD_RESET); ret = lima_poll_timeout(ip, lima_gp_hard_reset_poll, 10, 100); if (ret) { - dev_err(dev->dev, "gp hard reset timeout\n"); + dev_err(dev->dev, "%s hard reset timeout\n", lima_ip_name(ip)); return ret; } @@ -220,8 +221,9 @@ static void lima_gp_task_error(struct lima_sched_pipe *pipe) { struct lima_ip *ip = pipe->processor[0]; - dev_err(ip->dev->dev, "gp task error int_state=%x status=%x\n", - gp_read(LIMA_GP_INT_STAT), gp_read(LIMA_GP_STATUS)); + dev_err(ip->dev->dev, "%s task error int_state=%x status=%x\n", + lima_ip_name(ip), gp_read(LIMA_GP_INT_STAT), + gp_read(LIMA_GP_STATUS)); lima_gp_hard_reset(ip); } @@ -324,7 +326,7 @@ int lima_gp_init(struct lima_ip *ip) err = devm_request_irq(dev->dev, ip->irq, lima_gp_irq_handler, IRQF_SHARED, lima_ip_name(ip), ip); if (err) { - dev_err(dev->dev, "gp %s fail to request irq\n", + dev_err(dev->dev, "%s fail to request irq\n", lima_ip_name(ip)); return err; } diff --git a/drivers/gpu/drm/lima/lima_l2_cache.c b/drivers/gpu/drm/lima/lima_l2_cache.c index c4080a02957b..184106ce55f8 100644 --- a/drivers/gpu/drm/lima/lima_l2_cache.c +++ b/drivers/gpu/drm/lima/lima_l2_cache.c @@ -21,7 +21,8 @@ static int lima_l2_cache_wait_idle(struct lima_ip *ip) !(v & LIMA_L2_CACHE_STATUS_COMMAND_BUSY), 0, 1000); if (err) { - dev_err(dev->dev, "l2 cache wait command timeout\n"); + dev_err(dev->dev, "%s wait command timeout\n", + lima_ip_name(ip)); return err; } return 0; @@ -83,7 +84,8 @@ int lima_l2_cache_init(struct lima_ip *ip) spin_lock_init(&ip->data.lock); size = l2_cache_read(LIMA_L2_CACHE_SIZE); - dev_info(dev->dev, "l2 cache %uK, %u-way, %ubyte cache line, %ubit external bus\n", + dev_info(dev->dev, "%s %uK, %u-way, %ubyte cache line, %ubit external bus\n", + lima_ip_name(ip), 1 << (((size >> 16) & 0xff) - 10), 1 << ((size >> 8) & 0xff), 1 << (size & 0xff), diff --git a/drivers/gpu/drm/lima/lima_mmu.c b/drivers/gpu/drm/lima/lima_mmu.c index a1ae6c252dc2..e18317c5ca8c 100644 --- a/drivers/gpu/drm/lima/lima_mmu.c +++ b/drivers/gpu/drm/lima/lima_mmu.c @@ -22,7 +22,8 @@ cond, 0, 100); \ if (__ret) \ dev_err(dev->dev, \ - "mmu command %x timeout\n", cmd); \ + "%s command %x timeout\n", \ + lima_ip_name(ip), cmd); \ __ret; \ }) @@ -40,14 +41,13 @@ static irqreturn_t lima_mmu_irq_handler(int irq, void *data) if (status & LIMA_MMU_INT_PAGE_FAULT) { u32 fault = mmu_read(LIMA_MMU_PAGE_FAULT_ADDR); - dev_err(dev->dev, "mmu page fault at 0x%x from bus id %d of type %s on %s\n", - fault, LIMA_MMU_STATUS_BUS_ID(status), - status & LIMA_MMU_STATUS_PAGE_FAULT_IS_WRITE ? "write" : "read", - lima_ip_name(ip)); + dev_err(dev->dev, "%s page fault at 0x%x from bus id %d of type %s\n", + lima_ip_name(ip), fault, LIMA_MMU_STATUS_BUS_ID(status), + status & LIMA_MMU_STATUS_PAGE_FAULT_IS_WRITE ? "write" : "read"); } if (status & LIMA_MMU_INT_READ_BUS_ERROR) - dev_err(dev->dev, "mmu %s irq bus error\n", lima_ip_name(ip)); + dev_err(dev->dev, "%s irq bus error\n", lima_ip_name(ip)); /* mask all interrupts before resume */ mmu_write(LIMA_MMU_INT_MASK, 0); @@ -102,14 +102,14 @@ int lima_mmu_init(struct lima_ip *ip) mmu_write(LIMA_MMU_DTE_ADDR, 0xCAFEBABE); if (mmu_read(LIMA_MMU_DTE_ADDR) != 0xCAFEB000) { - dev_err(dev->dev, "mmu %s dte write test fail\n", lima_ip_name(ip)); + dev_err(dev->dev, "%s dte write test fail\n", lima_ip_name(ip)); return -EIO; } err = devm_request_irq(dev->dev, ip->irq, lima_mmu_irq_handler, IRQF_SHARED, lima_ip_name(ip), ip); if (err) { - dev_err(dev->dev, "mmu %s fail to request irq\n", lima_ip_name(ip)); + dev_err(dev->dev, "%s fail to request irq\n", lima_ip_name(ip)); return err; } @@ -152,7 +152,7 @@ void lima_mmu_page_fault_resume(struct lima_ip *ip) u32 v; if (status & LIMA_MMU_STATUS_PAGE_FAULT_ACTIVE) { - dev_info(dev->dev, "mmu resume\n"); + dev_info(dev->dev, "%s resume\n", lima_ip_name(ip)); mmu_write(LIMA_MMU_INT_MASK, 0); mmu_write(LIMA_MMU_DTE_ADDR, 0xCAFEBABE); diff --git a/drivers/gpu/drm/lima/lima_pmu.c b/drivers/gpu/drm/lima/lima_pmu.c index e397e1146e96..113cb9b215cd 100644 --- a/drivers/gpu/drm/lima/lima_pmu.c +++ b/drivers/gpu/drm/lima/lima_pmu.c @@ -21,7 +21,8 @@ static int lima_pmu_wait_cmd(struct lima_ip *ip) v, v & LIMA_PMU_INT_CMD_MASK, 100, 100000); if (err) { - dev_err(dev->dev, "timeout wait pmu cmd\n"); + dev_err(dev->dev, "%s timeout wait pmu cmd\n", + lima_ip_name(ip)); return err; } diff --git a/drivers/gpu/drm/lima/lima_pp.c b/drivers/gpu/drm/lima/lima_pp.c index ac097dd75072..d0d2db0ef1ce 100644 --- a/drivers/gpu/drm/lima/lima_pp.c +++ b/drivers/gpu/drm/lima/lima_pp.c @@ -26,8 +26,8 @@ static void lima_pp_handle_irq(struct lima_ip *ip, u32 state) if (state & LIMA_PP_IRQ_MASK_ERROR) { u32 status = pp_read(LIMA_PP_STATUS); - dev_err(dev->dev, "pp error irq state=%x status=%x\n", - state, status); + dev_err(dev->dev, "%s error irq state=%x status=%x\n", + lima_ip_name(ip), state, status); pipe->error = true; @@ -125,7 +125,7 @@ static int lima_pp_soft_reset_async_wait_one(struct lima_ip *ip) ret = lima_poll_timeout(ip, lima_pp_soft_reset_poll, 0, 100); if (ret) { - dev_err(dev->dev, "pp %s reset time out\n", lima_ip_name(ip)); + dev_err(dev->dev, "%s reset time out\n", lima_ip_name(ip)); return ret; } @@ -190,14 +190,14 @@ static int lima_pp_hard_reset(struct lima_ip *ip) pp_write(LIMA_PP_CTRL, LIMA_PP_CTRL_STOP_BUS); ret = lima_poll_timeout(ip, lima_pp_bus_stop_poll, 10, 100); if (ret) { - dev_err(dev->dev, "pp %s bus stop timeout\n", lima_ip_name(ip)); + dev_err(dev->dev, "%s bus stop timeout\n", lima_ip_name(ip)); return ret; } pp_write(LIMA_PP_CTRL, LIMA_PP_CTRL_FORCE_RESET); ret = lima_poll_timeout(ip, lima_pp_hard_reset_poll, 10, 100); if (ret) { - dev_err(dev->dev, "pp hard reset timeout\n"); + dev_err(dev->dev, "%s hard reset timeout\n", lima_ip_name(ip)); return ret; } @@ -274,7 +274,7 @@ int lima_pp_init(struct lima_ip *ip) err = devm_request_irq(dev->dev, ip->irq, lima_pp_irq_handler, IRQF_SHARED, lima_ip_name(ip), ip); if (err) { - dev_err(dev->dev, "pp %s fail to request irq\n", + dev_err(dev->dev, "%s fail to request irq\n", lima_ip_name(ip)); return err; } @@ -309,7 +309,7 @@ int lima_pp_bcast_init(struct lima_ip *ip) err = devm_request_irq(dev->dev, ip->irq, lima_pp_bcast_irq_handler, IRQF_SHARED, lima_ip_name(ip), ip); if (err) { - dev_err(dev->dev, "pp %s fail to request irq\n", + dev_err(dev->dev, "%s fail to request irq\n", lima_ip_name(ip)); return err; } @@ -423,8 +423,9 @@ static void lima_pp_task_error(struct lima_sched_pipe *pipe) for (i = 0; i < pipe->num_processor; i++) { struct lima_ip *ip = pipe->processor[i]; - dev_err(ip->dev->dev, "pp task error %d int_state=%x status=%x\n", - i, pp_read(LIMA_PP_INT_STATUS), pp_read(LIMA_PP_STATUS)); + dev_err(ip->dev->dev, "%s task error %d int_state=%x status=%x\n", + lima_ip_name(ip), i, pp_read(LIMA_PP_INT_STATUS), + pp_read(LIMA_PP_STATUS)); lima_pp_hard_reset(ip); }