From nobody Tue Dec 16 23:46:37 2025 Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D50B4685 for ; Wed, 17 Jan 2024 03:12:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705461143; cv=none; b=A7N6P99xxbs3o7LyMLL1rF6ExC21mAzn9+6WNcNcUAOkqXdNoBOwDNm0OWp8pt1Jfwa9tFW/8tWC3mbVA0a0IlNWAHTMLg9Gftmw8OXsREXcAoAHlkcgbfIubfR8av7qZJDdiiR6uNHHMuBAUR5Nv54JHGnm62O64KVY07geg2I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705461143; c=relaxed/simple; bh=0eihfCcmnCD/Dyd/H3GOL9PYZj+H93161DBErVHEJZs=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received:From: To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; b=XFFlAJVBNoq1KnZ+hlWeU5Bv7w2VQo00BoN3nPyCD4dmiuRH0OGKDQlvpRDctYpfI/laUQLrdOu2rLR5OzJFu6BggSa9SHPc+kGiJnxK0KCXFfjxVzNDgiheGK+xRISwbRAv5forAyC1pmUCoihYq777fzH3K1EfPp1v4RVfxTI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=iMy9i6tU; arc=none smtp.client-ip=209.85.208.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iMy9i6tU" Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-559d0ef3fb5so329486a12.3 for ; Tue, 16 Jan 2024 19:12:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705461140; x=1706065940; darn=vger.kernel.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=przBstviTKeMKG8hsGaQhziOmoZ/mS6n5cQDIFTsogA=; b=iMy9i6tUoanuFX1Mk4LuPISzJdXg9Kt53cIlc6ACEy+syeMUl6v1Pnt/zqlj0dgaMR Liw3AzPn4YjHBSQuePWG4QHNsqF9Vo8dbqBPPQ64q307R2h1iSpKA8qzjE/bZqxh9a4o G+1Fmhjuf8sEJeW6GAOI9fpzFd4bop95x8lCyLHKeZBibzgk/qrZ0jwJifxZ68JLdJwa v1cUP+LvuB2aABDQzUro4nCVZuIa/yqjjjVx+2rVHpAUKtVsY+iC/qTlYmZlZlEntPr4 prvdqSUKwSP8qx/WJ01l+/iUGX1vVKrFgeuItq/dQUFQ4ZA3BW9S402IW++tdDb7bBAj AjPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705461140; x=1706065940; 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=przBstviTKeMKG8hsGaQhziOmoZ/mS6n5cQDIFTsogA=; b=bAAtxOVx2eFmLWGlJgtpMAChCITZ4jrcVpVe77WHRSpj3qr+88BspUQUqWuqtd+XYU L/jm47Njk01llBgTW1R5ZBfHdPoalzewlkmW6aKTdcjemaKKdViOEfSKAm4X/daI944W xNWf90a58kI/uOXcD7iCXX6WsrIshoyb+lVLEF7U24mwsR8mZ8gJwlSKgWcChybbT0NN EJklrx+bGNvmcHTaqmNdBaBy1jQopSOLGITv9zkKHCbUSLrhYb2KtE4KYbH+OZMj5wvG oN/NOR/3MI3cvSDxv7Pl9mh9utg0Y24fk5Ghfr5do9NmzRvQqynYi9wYxRSMLsfz1Jtf lIEw== X-Gm-Message-State: AOJu0YwbVKqjDbG0/reC+bmFDb8mJFLFfVc9sWtC1fQ9FzjoIddhKAhY X9LJWXTm2NDdZZGf06icJiM= X-Google-Smtp-Source: AGHT+IH4g37ccsIH+5nDtEbHrV7ecTiL8sxw2zhnvaeOkN2UzCLivl5+Qf3In+6yBdstgOn6oOKFFQ== X-Received: by 2002:a50:9fc8:0:b0:559:ba97:7219 with SMTP id c66-20020a509fc8000000b00559ba977219mr1010135edf.48.1705461139900; Tue, 16 Jan 2024 19:12:19 -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 n13-20020a05640204cd00b0055971af7a23sm2258418edw.95.2024.01.16.19.12.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 19:12:19 -0800 (PST) From: Erico Nunes To: Qiang Yu , dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org Cc: anarsoul@gmail.com, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Sumit Semwal , christian.koenig@amd.com, linux-kernel@vger.kernel.org, Erico Nunes Subject: [PATCH v1 1/6] drm/lima: fix devfreq refcount imbalance for job timeouts Date: Wed, 17 Jan 2024 04:12:07 +0100 Message-ID: <20240117031212.1104034-2-nunes.erico@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240117031212.1104034-1-nunes.erico@gmail.com> References: <20240117031212.1104034-1-nunes.erico@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In case a task manages to complete but it took just long enough to also trigger the timeout handler, the current code results in a refcount imbalance on lima_pm_idle. While this can be a rare occurrence, when it happens it may fill user logs with stack traces such as: [10136.669170] WARNING: CPU: 0 PID: 0 at drivers/gpu/drm/lima/lima_devfreq.= c:205 lima_devfreq_record_idle+0xa0/0xb0 ... [10136.669459] pc : lima_devfreq_record_idle+0xa0/0xb0 ... [10136.669628] Call trace: [10136.669634] lima_devfreq_record_idle+0xa0/0xb0 [10136.669646] lima_sched_pipe_task_done+0x5c/0xb0 [10136.669656] lima_gp_irq_handler+0xa8/0x120 [10136.669666] __handle_irq_event_percpu+0x48/0x160 [10136.669679] handle_irq_event+0x4c/0xc0 The imbalance happens because lima_sched_pipe_task_done() already calls lima_pm_idle for this case if there was no error. Check the error flag in the timeout handler to ensure we can never run into this case. Signed-off-by: Erico Nunes Reviewed-by: Vasily Khoruzhick --- drivers/gpu/drm/lima/lima_sched.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/lima/lima_sched.c b/drivers/gpu/drm/lima/lima_= sched.c index c3bf8cda8498..66317296d831 100644 --- a/drivers/gpu/drm/lima/lima_sched.c +++ b/drivers/gpu/drm/lima/lima_sched.c @@ -427,7 +427,8 @@ static enum drm_gpu_sched_stat lima_sched_timedout_job(= struct drm_sched_job *job pipe->current_vm =3D NULL; pipe->current_task =3D NULL; =20 - lima_pm_idle(ldev); + if (pipe->error) + lima_pm_idle(ldev); =20 drm_sched_resubmit_jobs(&pipe->base); drm_sched_start(&pipe->base, true); --=20 2.43.0 From nobody Tue Dec 16 23:46:37 2025 Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D07B85247 for ; Wed, 17 Jan 2024 03:12:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705461144; cv=none; b=oU6pV7vNQHvYoZDJkk7SCY5WBIxEiQmWkIU+rNhENoLyeUw9i/oYG6OUjQAH2t7vAPLtDzmM5hFsGvXoIY1PVtwlz8RV8q2cjPJyLEeaMTBV7N8GWqM5A/VuOyh2OqGQ/x0ssqmlgxS8caeU/9Qbt6xJ6wqHxdXF5sIj3y95qrU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705461144; c=relaxed/simple; bh=jQeqyLpTjYK+a2u6oMjAU4jsTR7Olg9YLIxfKKrTlwE=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received:From: To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; b=ITdldcOD9+hIx1qNZ07PeEOrKrtRp98LNJZ6wSuopxEMp2mXPqTR9HHhMiMQZGY54RAhTgvIySRnLWDmGI50LrcPXSa0lp8lIptSsBudWWMDrb7qvin+gY6AUJdzrU1XBVfWhsAjFtgZy8mjx/G8T4wkIwkb0UFE3kMx1S3BjlY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Cm+kDHnl; arc=none smtp.client-ip=209.85.208.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Cm+kDHnl" Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-5578485fc0eso9863531a12.1 for ; Tue, 16 Jan 2024 19:12:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705461141; x=1706065941; darn=vger.kernel.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=WgEOXnBwtjV0DRgAs0TONH+yAncBHjvW7O8dDZAmbmY=; b=Cm+kDHnlIxH4HbJ90FeB3C4x/FLi8cGabgUSBzFeUCGasqqRHsUoRUoyWFJEohk4Vx JdUm/mbvWWHR6LaatFzt4aYlmKD3hfLRbnmYMdQF2xPsQmCSZeyEClPVUqXtNAz4RqXe fIkAixOFhhzEXHgqCk1hUvIKenqMobrI3FGPPFwVe4e+mqp6B0UoI5tlmrn/jv9NjVuQ 9cL9sJE4vkkMGdvj/uG2wMC6FvJvu7jpHi2yMuQgQMZOUcaRRyUzJlysJY2eJYC+vDtn ukYdckUcQzjrO6c7y56JgNgEGSJdjZYZ4lNTWudtn9NmZie+Kur+WeCTEha4N/WW+okG rIUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705461141; x=1706065941; 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=WgEOXnBwtjV0DRgAs0TONH+yAncBHjvW7O8dDZAmbmY=; b=KkGiefHdFswbfxgytART4NOdDPcFQSHIg03nhygD5xxj1qsHvXn6Y5ioIOiAYSpz9k KNzZm4nWHkHVKPZJqWPu5goVRcCIE8mDyRyrMUzLeq2tW72GBXLcg+pJ9U+QyQEi092p sy0/0Dwz+Kg1pN4ovsqytTOV6xh+3rY+aB15YI3wCRoFb/gaYpDdbYj8o1Bn3Bf3oLJ/ LiTDteiiv/6cSwWTc/GxzwmdcF8A0WFCFnmrYtJ0mlM3UJsg1bCGmO8sdEsH3Lo++CWp Pa6+D6JBdahw6tO/d8xDx1E0ZDDb8kzWvTnjOcF0O+7pfLc0cCzTflORwZmJbQzXA14H +fuA== X-Gm-Message-State: AOJu0YwK9JBXd2pkXwFKW0Z/Pq37QaG98KKi7iso32qz1vN2udc2+bnG LAd/k2yC1qC9Pgup9Xar+YA= X-Google-Smtp-Source: AGHT+IFbr8FIXBAVFLQAm0BnJme9prl4lYGU0GNZbLVZDPfrnNKHuH2dSlYobzkRpW1IT5DgI99FTA== X-Received: by 2002:aa7:d389:0:b0:558:9126:5673 with SMTP id x9-20020aa7d389000000b0055891265673mr4261820edq.39.1705461140983; Tue, 16 Jan 2024 19:12:20 -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 n13-20020a05640204cd00b0055971af7a23sm2258418edw.95.2024.01.16.19.12.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 19:12:20 -0800 (PST) From: Erico Nunes To: Qiang Yu , dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org Cc: anarsoul@gmail.com, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Sumit Semwal , christian.koenig@amd.com, linux-kernel@vger.kernel.org, Erico Nunes Subject: [PATCH v1 2/6] drm/lima: reset async_reset on pp hard reset Date: Wed, 17 Jan 2024 04:12:08 +0100 Message-ID: <20240117031212.1104034-3-nunes.erico@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240117031212.1104034-1-nunes.erico@gmail.com> References: <20240117031212.1104034-1-nunes.erico@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 =3D false; + return 0; } =20 --=20 2.43.0 From nobody Tue Dec 16 23:46:37 2025 Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 10129747C for ; Wed, 17 Jan 2024 03:12:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705461145; cv=none; b=GlNk+8B6p211COcX/TUldP6Q20yzRwOhxnZrSeWRG2bWJBEnKG6YVq0a9xchFftX7eKdC3hduITh7kyj0uubTyY4tao9/9AgeBHBnJMJllAu6+LkVw0MAejR+4RVlLbZHfDT1fu874E0JWuvs6yi3zgrIIhGN/JbScL5euzB3HA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705461145; c=relaxed/simple; bh=djlcKgyEyqOlS1ZcosV4oA+RPSmY4qGvY5oxUuQxO/A=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received:From: To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; b=jq37CYr7bkTgIlZ2J2Ir0/gDt+GcDsAcWQTQXvOs6nxajQywgQUGDsodEt6hRqXXM0JtHwmiBfOWKTaSN3A4yEHT32WkwyQOXx4QQlOhcfFZbEHYhFH0haGXjAb3ERoL6baHVUKBpsnEYCabwcV5WYw6GqyQbMy1ieDmA6YgW6g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RnQvR32z; arc=none smtp.client-ip=209.85.208.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RnQvR32z" Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2ccb4adbffbso119606591fa.0 for ; Tue, 16 Jan 2024 19:12:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705461142; x=1706065942; darn=vger.kernel.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=ADVa6dhhX6uOMOvbI9YDxuD3rJvLmpM0F1zxHrfGnwk=; b=RnQvR32zXpuzNZiLFIEX1+08oXZAIkN6jWbD3BDWBjzNJU/GPj1HryAvxUnv4NXsnC JugDcJyc9yq6tqjYTW2bmOoyfVBkSF4FxtACFxcUjy9T6bkPX0jULqqGPTzqZcBrrFYY TM8llUPOH/lg+r+31oaeK0mERp7Gs/2f109Lso1y8ojg/18rzGbO/c2ka6onpOlrCNr5 D0xZm9BFidqs+7pm3eSkSxQRr0mn9JI95/PrjL/5Q61bztGaANdrWRCzxUZz3hzPmWlf 26ZFEi2FPVr9sGQoT59vvnjJINynelT/K2HFUTorc2HSdh7ejVDTl6FQJyWfrS7zdB/i olTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705461142; x=1706065942; 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=ADVa6dhhX6uOMOvbI9YDxuD3rJvLmpM0F1zxHrfGnwk=; b=IBYflR0eMhEJkOoB7fYXqtyZpc55JXyqoCJ1Tp8alKnCWTdLBnBmlSw78mxbehJf7Q MUDVpkgGrlU8DcNtKhMT7CCy8I5V5SDzIcsmroJ25rO5x3TMEy23WXFgrqtdgf9nzIPy Adqot3ntMjNB/JYptbjL3peYOmn9/dKo1NcO/O3xeBgl5t7vZNmPFCaoQijcxsNKremL TF/LPcL2gyiobCtSLmiDVaGCduOiZ6DCqvQxd44/wmxAm0W9+jaHhayd9hpsg9OMWch8 n+Lmw/lgkBAXEUJAi582hh9g8WYJ0Kr6aSrozs0uZb2TcikhucMBwU+Zrqn7BHSlRqHv NBCw== X-Gm-Message-State: AOJu0YwEQp+EUqHgFlOb2M6Ve8Z9O4yaTogdSxWQSIX9I5QgBZuZiXq6 nkzx0+jYupZkEXU0OgPVqD0= X-Google-Smtp-Source: AGHT+IGCAEkQUMLR8zU3CI9B7qiwHLI4EvlgyFIpxwO2sNzIS13NtZgB6xC9DpCIDhBUMxK9jw7ADQ== X-Received: by 2002:a2e:3a12:0:b0:2cd:fea:65bd with SMTP id h18-20020a2e3a12000000b002cd0fea65bdmr3776646lja.28.1705461142008; Tue, 16 Jan 2024 19:12:22 -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 n13-20020a05640204cd00b0055971af7a23sm2258418edw.95.2024.01.16.19.12.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 19:12:21 -0800 (PST) From: Erico Nunes To: Qiang Yu , dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org Cc: anarsoul@gmail.com, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Sumit Semwal , christian.koenig@amd.com, linux-kernel@vger.kernel.org, Erico Nunes Subject: [PATCH v1 3/6] drm/lima: set bus_stop bit before hard reset Date: Wed, 17 Jan 2024 04:12:09 +0100 Message-ID: <20240117031212.1104034-4-nunes.erico@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240117031212.1104034-1-nunes.erico@gmail.com> References: <20240117031212.1104034-1-nunes.erico@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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, u3= 2 *frame, u32 *wb) } } =20 +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) =20 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 =3D 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 =3D lima_poll_timeout(ip, lima_pp_hard_reset_poll, 10, 100); if (ret) { --=20 2.43.0 From nobody Tue Dec 16 23:46:37 2025 Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C1E3883C for ; Wed, 17 Jan 2024 03:12:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705461146; cv=none; b=lRFOy9om0A8v036c8+vpG4lnT3WvBp9wqpqnHJQ/Zkcx3HdHokAGDUHlCq9y/DUVJyJXbZrBkj4zYr9fXIgVtJqgSo07wr33YK5GRFp8L79ZZkhRJn7UnYb3jEz5IY+e5O6G7n/PqKZsC/NdHQkTM/Sz+gcICU0XQ1KeGMdHoNY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705461146; c=relaxed/simple; bh=o8hW3J2/oOQV2jYyvMuhZMTvx2GwUSDxyrpGj6TLrhA=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received:From: To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; b=oUYxB3l6G1zIYfeDtC+A1gOKEwnoXTLfqvTncLXKVSChQZlisVz/Xq5fdzV3gY2V/ioxueKI2G1gG1VEVr3LP8v/jXlmWKzJRyEQxBne8KQHsBAcONUgalOwLSWB7MIl6MCucDBQ4X0bOu3QW9vMNxw99Y0i3FSW/pfGPlwEM+0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HxuGW0P3; arc=none smtp.client-ip=209.85.208.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HxuGW0P3" Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2cd8b64a52dso63005881fa.2 for ; Tue, 16 Jan 2024 19:12:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705461143; x=1706065943; darn=vger.kernel.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=9wbzi3EnFlPT7VHx8X0cPGf7wGavBuju6JI8nYElqQU=; b=HxuGW0P3uL8rySgqRYtcsPoHYMX4Mk80V03NoqJWWHRbHeVNQRqlhzkRbRTPd2FALY rV1D7EZibTxfyBP9cAeXMflnr4q/VC9+jmorJIHhMvrOTXenbcj6et+eqC4S8z3IryfJ wg7GIIWwKwtHonPSjafonmJ1oNC78oHJFsBVTKlltNljuRswIZdqrq29We0pNRRvXohZ rDL7YmlM6njcYvMAsdoC6AvWH3rGY0oX192Sl2XjMVqEFParJ5oR3B/8RZRqQxRqsHlq Gux5AERYzj2AIzfWRswYndpQC1M+SdWq7Wmi1gCGXvD4fxPhRbU2SxFUXSgiGbIsZJ3J rsVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705461143; x=1706065943; 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=9wbzi3EnFlPT7VHx8X0cPGf7wGavBuju6JI8nYElqQU=; b=jkUnX6vv4ey9br0uBI4JgJCR/RQeMo/FYF+Ws4JG3gIGgJJYZBPh6Ya+gDuEJGjUiq N/srNNlXrQ0UREpmbkLVykViSKPy/D1zTgS/TauKJlKmyKLSTjurDAlmRIMKX7BxN02A +k02pbioDlapnkq1rd8OH/TSRuBU3W/6YX8lMCzvzyRmuHg8x6q21dRVhJ/3Qs9kcSgD FNHncNzf+Sud3mwbH6LrloaTVxokJYZ9PyJvbyYHumTZUJc5QL1pMf5Px9SaoU64r4YF FJNkBUGySbzFRr75VJnFpOM8P0NyFQ76QZtNjTHIwbTuEevOT9779/XYb+M1NacG89ru tu4w== X-Gm-Message-State: AOJu0YxO5h/6yBvltwYPNEIJ4mMWZKiia2pA2OEjnMdZ8MtVE3fdpyO3 sXPnnO7ZThF2OrqUWqj5RCU= X-Google-Smtp-Source: AGHT+IELPdudRcRB5rbBm58TIPpk4jrqXQSMiUsaBUYpCfikolg1o0C7SeNXHZ8nFtI+R+1PiVTd0g== X-Received: by 2002:a2e:978a:0:b0:2cd:2838:78d with SMTP id y10-20020a2e978a000000b002cd2838078dmr3639516lji.63.1705461143092; Tue, 16 Jan 2024 19:12:23 -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 n13-20020a05640204cd00b0055971af7a23sm2258418edw.95.2024.01.16.19.12.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 19:12:22 -0800 (PST) From: Erico Nunes To: Qiang Yu , dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org Cc: anarsoul@gmail.com, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Sumit Semwal , christian.koenig@amd.com, linux-kernel@vger.kernel.org, Erico Nunes Subject: [PATCH v1 4/6] drm/lima: handle spurious timeouts due to high irq latency Date: Wed, 17 Jan 2024 04:12:10 +0100 Message-ID: <20240117031212.1104034-5-nunes.erico@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240117031212.1104034-1-nunes.erico@gmail.com> References: <20240117031212.1104034-1-nunes.erico@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Vasily Khoruzhick --- drivers/gpu/drm/lima/lima_sched.c | 32 ++++++++++++++++++++++++++----- drivers/gpu/drm/lima/lima_sched.h | 2 ++ 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/lima/lima_sched.c b/drivers/gpu/drm/lima/lima_= sched.c index 66317296d831..9449b81bcd5b 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 */ =20 +#include #include #include #include @@ -223,10 +224,7 @@ static struct dma_fence *lima_sched_run_job(struct drm= _sched_job *job) =20 task->fence =3D &fence->base; =20 - /* for caller usage of the fence, otherwise irq handler - * may consume the fence before caller use it - */ - dma_fence_get(task->fence); + task->done_fence =3D dma_fence_get(task->fence); =20 pipe->current_task =3D task; =20 @@ -401,9 +399,33 @@ static enum drm_gpu_sched_stat lima_sched_timedout_job= (struct drm_sched_job *job struct lima_sched_pipe *pipe =3D to_lima_pipe(job->sched); struct lima_sched_task *task =3D to_lima_task(job); struct lima_device *ldev =3D pipe->ldev; + struct lima_ip *ip =3D pipe->processor[0]; + + /* + * If the GPU managed to complete this jobs fence, the timeout is + * spurious. Bail out. + */ + if (dma_fence_is_signaled(task->done_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. + */ + synchronize_irq(ip->irq); + + if (dma_fence_is_signaled(task->done_fence)) { + DRM_WARN("%s unexpectedly high interrupt latency\n", lima_ip_name(ip)); + return DRM_GPU_SCHED_STAT_NOMINAL; + } =20 if (!pipe->error) - DRM_ERROR("lima job timeout\n"); + DRM_ERROR("%s lima job timeout\n", lima_ip_name(ip)); =20 drm_sched_stop(&pipe->base, &task->base); =20 diff --git a/drivers/gpu/drm/lima/lima_sched.h b/drivers/gpu/drm/lima/lima_= sched.h index 6a11764d87b3..34050facb110 100644 --- a/drivers/gpu/drm/lima/lima_sched.h +++ b/drivers/gpu/drm/lima/lima_sched.h @@ -29,6 +29,8 @@ struct lima_sched_task { bool recoverable; struct lima_bo *heap; =20 + struct dma_fence *done_fence; + /* pipe fence */ struct dma_fence *fence; }; --=20 2.43.0 From nobody Tue Dec 16 23:46:37 2025 Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D76EB8F5F for ; Wed, 17 Jan 2024 03:12:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705461147; cv=none; b=qWSthIXjYbsc8OPPwsj6tCmseQzujQGAiheZxGiduuW2QIQG3q9l30veT9T2mjwO2jrLIWtEJIfnRhjVovC04uie+mvr2BQoGCr2XXvo/Y5BhQu4JwM9VmWEicn0lB7Issib935uw09LiExMe6QnSnVLR+v6VZMfiTY4t9aUKYw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705461147; c=relaxed/simple; bh=kBQHWvJeg/cN7D9wVq31Z/qnvPhBjHrVZP82wVlIrAc=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received:From: To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; b=L6kcTty/XW2VrH7veRjc4ocqYxwHjqmSmXOfOcsBITjWoHfD6PbAQJOZgNEvVU51sLVvOUNUCm/K7g6j+uJOlbn6IRsMuZNSILMmbRZWe7eEtrHjc7//T+x36WUb4Nue+eIWTQcbZsjFJuzGLo4b237WTSlpiR5N60LcOVArNf4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=D6FczG8S; arc=none smtp.client-ip=209.85.208.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="D6FczG8S" Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-559cef15db5so657641a12.0 for ; Tue, 16 Jan 2024 19:12:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705461144; x=1706065944; darn=vger.kernel.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=TurR4TSqa7pH4YQLivqIMoaxRqWtz6E/dts/c6GuzZE=; b=D6FczG8SPQ2B8Bx/1pF4LYhQe0R3sK1RTqO+wLgxQDrhi5HaE5Zz5hlmGYWQMZslZK uGOQjxyNQX/kGw5QHaEG0UOQ9qJiFVpx0qrDArenCwA8NyUFnbxPoQCUgcVRLhJPS7+Y eB6Dq2f2x/D+BmP9C5lCCiQHjcYCBrko1IeMH/qhFG82voOOLRZNTmIQIKMj/DhkI8u4 Qcu7pkLLwxUdNVmnRyvhrEaTtTllrWAg4ap8S/W5HIxsWLVy8EVUMPQG+/whB1WMXEXc QzfTJ9oytWkxfIMu6dOuMP9M8Y7F1SJ4yfk2WvhFqmlXsuHyUbcDs1432fUGmeErIyiF kAgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705461144; x=1706065944; 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=TurR4TSqa7pH4YQLivqIMoaxRqWtz6E/dts/c6GuzZE=; b=UwLyBLzWQV+wo+eOuQMmaGdgG0oQs5B+QRSyddQUew7SFtVrxsKoNG7lrWCsx3ev43 uspQJ6ibK/AgyvsV7+JoqwfO1Jwc9r4I6QOGJYBLI6xSSO24FBnMxfQdDBgOFHclwSg7 3z7x/12yCsuwrRWtFGBC42h/EyYCIJX48/kKpZboGEULbVVTDU5GxPaRznG6D8j3Ix3K jYjdjGn5LfvyROqXVZOcWl8i+JEKgYusx07yZI+0mhim1yvalZ2cHr4Gq1PO2PLc2arL OObLNgvrtqF7Tu/WowHAG8clK8H3eoHpxH1+vK+rzIizBapOEgcQCFY417XBskaHIn/8 TkKA== X-Gm-Message-State: AOJu0YwbsOPxRcvgNa9ccRG3KSn/p/fN3Fp0VUrdvoli12noazf3lMfB tJzrneq40EDHJ2BIHJ5cx5Q= X-Google-Smtp-Source: AGHT+IGetluui/FySPGgoTIPulAjmlBnWc8jvnBGs+ZlVHD0WYWX+lScQaqSVrFsrUDD1HER0F64yg== X-Received: by 2002:aa7:d84d:0:b0:558:308f:db04 with SMTP id f13-20020aa7d84d000000b00558308fdb04mr153546eds.18.1705461144164; Tue, 16 Jan 2024 19:12:24 -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 n13-20020a05640204cd00b0055971af7a23sm2258418edw.95.2024.01.16.19.12.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 19:12:23 -0800 (PST) From: Erico Nunes To: Qiang Yu , dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org Cc: anarsoul@gmail.com, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Sumit Semwal , christian.koenig@amd.com, linux-kernel@vger.kernel.org, Erico Nunes Subject: [PATCH v1 5/6] drm/lima: remove guilty drm_sched context handling Date: Wed, 17 Jan 2024 04:12:11 +0100 Message-ID: <20240117031212.1104034-6-nunes.erico@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240117031212.1104034-1-nunes.erico@gmail.com> References: <20240117031212.1104034-1-nunes.erico@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 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_ct= x.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); =20 for (i =3D 0; i < lima_pipe_num; i++) { - err =3D lima_sched_context_init(dev->pipe + i, ctx->context + i, &ctx->g= uilty); + err =3D 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_ct= x.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; =20 /* 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 9449b81bcd5b..496c79713fe8 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 *tas= k) } =20 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 =3D &pipe->base; =20 return drm_sched_entity_init(&context->base, DRM_SCHED_PRIORITY_NORMAL, - &sched, 1, guilty); + &sched, 1, NULL); } =20 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 34050facb110..677e908b53f8 100644 --- a/drivers/gpu/drm/lima/lima_sched.h +++ b/drivers/gpu/drm/lima/lima_sched.h @@ -93,8 +93,7 @@ int lima_sched_task_init(struct lima_sched_task *task, void lima_sched_task_fini(struct lima_sched_task *task); =20 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 *ta= sk); --=20 2.43.0 From nobody Tue Dec 16 23:46:37 2025 Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA74BB642 for ; Wed, 17 Jan 2024 03:12:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705461148; cv=none; b=WbQNAtYiP7HbX5i7E8n2Cy0motHButDFKCzxUVQ4o7xN6u1prBp7LMWRmb/VTC7poeyOtkYRv8qeln7J92VJOhg4/FIeeCy4NcxuZcQyUpGX8LRppaXJc4+6Yujgpm8h9aXWwBYrGJeEGcsz664jEI/I3MCgigtJvYZ6cWjKMbc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705461148; c=relaxed/simple; bh=VICQkZ3AboV52RhoDU3TsfC68unKvLe48saOLuiFWlU=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received:From: To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; b=H6ysNtAKZNkGiWQo6zUxmWoK9jCw6PNYsFzc8Nna4ombPzfwo9/d8lrG56tMhCPlrLJ8cX138G06//UGyneqD9k6GBSmG7CqmWjaEgkkiyhP6DSZCfxggQD10oKic6v7vZ96m0rPJh9CojOV1/l+rSdOTT5F8UxPn/99GWpWS9Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gF7jexBT; arc=none smtp.client-ip=209.85.208.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gF7jexBT" Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-553ba2f0c8fso11768134a12.1 for ; Tue, 16 Jan 2024 19:12:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705461145; x=1706065945; darn=vger.kernel.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=dWLq4aGpb7f9s5ZfnYqz3MCWQjdIg4mIg649H1i2jNs=; b=gF7jexBTUpVDiPV+yb7ONDuy8Bz0FkyEN8dpB1bD+yJ5WHucfzI/TDoC44qr9zZDGd 6nzdHTbJoav+jYd2k4MhnOo4GnkNsySypOwkCY+dmgynoI174Z53JGxpKKkkCvdF87vU QQrWeqW1KaG5IcAnOqB1Mk2etFuhmXL8krrh4TE7JuAXYLiq/k0Of1lFBWwHtfpQ/p40 AbSob4e1L/qJh7peEHYC98AThbgrU58Y9wDGNON26CVnACv1qfQr/IYvzZC/O6RVU0wQ r0fynkY6lwSNE5yOBEwzrqvJ663vwx01ITm7dB97gFKiQGgW2cqw78yxsj2QHzeKDrbk dulA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705461145; x=1706065945; 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=dWLq4aGpb7f9s5ZfnYqz3MCWQjdIg4mIg649H1i2jNs=; b=OScY9+9WjEU5/bmpldM+rZHuqtV1/ISAwlQW8PRv6/HX3F9kHoruxsYUsTw3X104pE bLSlkMiI5s4u2ZepvhVHVWtCzQcKma1ZXX5Jvr1wzcXCI1BDpB1lSAqAxWrfv6gcXd4y bvqnSDFnNx2rnJGETT2rK3lumwIRfS6zVNx7wNHrtrgBQDdtE37F0YtjueFnIT+T3CkJ ENz9JQ0v/8VTDHMPRPB3HJeBFT8na2SyX4RSq4Fe1NY/ztspfXZjBXwpXmu93S7scUG4 Wbv8MdJp1zw4YpOuw6PKfnAQb9LtloZW+/BcdvTQwdIy6pAHJMxiKW/QqPLB1CDmEZgS Xueg== X-Gm-Message-State: AOJu0YyAKzBWbgUdO/VELq5PWhjOGmgCyZ1LQQwy5D5IcEK+pRCg6AFf +YRoLnsYD/DUwuSG/rvfqpY= X-Google-Smtp-Source: AGHT+IEmjP59OWSgsLUizwfI6NeAlYbd3r1WGISp0XSIEokfoWGm9jE1WbdrHhf6/lWKig7M+VYPKA== X-Received: by 2002:a05:6402:74e:b0:559:b3fe:5cbf with SMTP id p14-20020a056402074e00b00559b3fe5cbfmr433485edy.7.1705461145176; Tue, 16 Jan 2024 19:12:25 -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 n13-20020a05640204cd00b0055971af7a23sm2258418edw.95.2024.01.16.19.12.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 19:12:24 -0800 (PST) From: Erico Nunes To: Qiang Yu , dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org Cc: anarsoul@gmail.com, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Sumit Semwal , christian.koenig@amd.com, linux-kernel@vger.kernel.org, Erico Nunes Subject: [PATCH v1 6/6] drm/lima: improve some pp debug messages Date: Wed, 17 Jan 2024 04:12:12 +0100 Message-ID: <20240117031212.1104034-7-nunes.erico@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240117031212.1104034-1-nunes.erico@gmail.com> References: <20240117031212.1104034-1-nunes.erico@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Make the messages more consistent by showing the pp name. Signed-off-by: Erico Nunes Reviewed-by: Vasily Khoruzhick --- drivers/gpu/drm/lima/lima_pp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/lima/lima_pp.c b/drivers/gpu/drm/lima/lima_pp.c index ac097dd75072..d9e178d6645d 100644 --- a/drivers/gpu/drm/lima/lima_pp.c +++ b/drivers/gpu/drm/lima/lima_pp.c @@ -197,7 +197,7 @@ static int lima_pp_hard_reset(struct lima_ip *ip) pp_write(LIMA_PP_CTRL, LIMA_PP_CTRL_FORCE_RESET); ret =3D 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, "pp %s hard reset timeout\n", lima_ip_name(ip)); return ret; } =20 @@ -423,8 +423,8 @@ static void lima_pp_task_error(struct lima_sched_pipe *= pipe) for (i =3D 0; i < pipe->num_processor; i++) { struct lima_ip *ip =3D pipe->processor[i]; =20 - dev_err(ip->dev->dev, "pp task error %d int_state=3D%x status=3D%x\n", - i, pp_read(LIMA_PP_INT_STATUS), pp_read(LIMA_PP_STATUS)); + dev_err(ip->dev->dev, "pp %s task error int_state=3D%x status=3D%x\n", + lima_ip_name(ip), pp_read(LIMA_PP_INT_STATUS), pp_read(LIMA_PP_STATUS)); =20 lima_pp_hard_reset(ip); } --=20 2.43.0