Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp2093705rdb; Sun, 21 Jan 2024 07:12:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IEw6Xciu/1/giRGbQ2iGgfMYljOAuKvb9JvZ8iCt85UlCoQojSQMRt5pSb3f2EAq7LPUdYV X-Received: by 2002:a05:6a00:2905:b0:6db:c9d2:12d4 with SMTP id cg5-20020a056a00290500b006dbc9d212d4mr1120655pfb.17.1705849932271; Sun, 21 Jan 2024 07:12:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705849932; cv=pass; d=google.com; s=arc-20160816; b=QV9TGuMO4vw4PtKB7eGofaYtgJMSUetiQZh1fzEWu/t8l6MuQKkISp13vmwCO8ASXr YQM/vbxKqNykTmVC1hvuloStQa7+9raNlFWqbeErLBstryDEFxXTTIwuWMnFmE/nkesu LOkr50erxnzAx3y1Foz04NWAkB+srcpGFJsZ1Rc4I0ktByY/6i0rif+PL+syppDHLTfr nt9/Q8ziim5NNDj0ArVvG5PAYO1ddj/HJHXSKIkIpA4LlJnvLSQ95neA8JDst2kiR9wS KRwIxpOlEQ91J3Ub6xx4CMfMAYy880+x2mcMHY0pY2RbmhnA9x/HE/YiMVlvZ4TnIrkU RVvg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=d+yj1AHvkEM0T6peXvl2abVUiirRYEugftyA4GeUYHQ=; fh=UUNRbR++VzKQm8z1PDv9M3uu0oMV+hchN7uyEwPv21k=; b=YGrYJ4kZoSA1iWyHyjZjxZwGVaxeCVVJ3QyF8j/FRU3dT66bWcF/b0W6llVTA8yf9x gJkQHnQE3wF7HW0NznA1R+HYgeMnxKCQaIyHoUCkd+si+CN9cdYLmUy06++kmoae2Npm GAlWsw788IgDijphw5317/US+LITyqBbaSmymNgfHw/QAnEnodud0SVzk+AZuaxkO0y6 7/HidwDwXP6FVKonhicch1MY9DTEZwtVm94geUyw/Ttdd0chsomtMzwXW5VNG4hyElMj 0zUmB4/TBItD6nSm7+QaD9Yz9baKfZr3dfA39Bf4ubiK4GW1lqeoPtvS2l0Ybf0zJkSk J6FA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=jCA7S9cy; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-32079-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32079-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id fi39-20020a056a0039a700b006d96368c41esi9004931pfb.192.2024.01.21.07.12.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Jan 2024 07:12:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-32079-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=jCA7S9cy; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-32079-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32079-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B016CB22884 for ; Sun, 21 Jan 2024 15:12:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1E471374FC; Sun, 21 Jan 2024 15:11:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jCA7S9cy" Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (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 48968374E3 for ; Sun, 21 Jan 2024 15:11:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705849918; cv=none; b=REPu+yziuuLfnYIZcxGdoUOgz6Fbjf/LgLUtRUrgkriey2Funu31kstyNqkcc+evrLvgxtdOM3I6+Xu5XDb46yBF4Ot6O6VjJa9xBsY4yjr5RPSz0EMCJ14ovDEMxdLme8k3nUh1pFTWaNmEcHbCJIVhABqq0V1gizgPFxZrU1o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705849918; c=relaxed/simple; bh=IW2tNpqRtWukPmnZrLV5bI9vGtftSglMUWS4rmTJWqA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=D2hSNRW45JIdddx8F4Gl7uSaJ4LFxKcLPpddPpNqsH2tTLQjrdlBxSWZasRgoduweaqSoV6RTlzx6gdo9eQ2tXK6k5Yq5PAjpkSJcnq7Huyo0Nh0olTgUJgxAU28zleQ+PODcodEuyiP3UC3SJt2e3ms3IanA7AmBpePRuXg5k4= 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=jCA7S9cy; arc=none smtp.client-ip=209.85.167.52 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 Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-50eab4bf47aso1738543e87.0 for ; Sun, 21 Jan 2024 07:11:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705849914; x=1706454714; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=d+yj1AHvkEM0T6peXvl2abVUiirRYEugftyA4GeUYHQ=; b=jCA7S9cyOso1zdAMjlXaCVs8AvBUC5o/3YREcRDSI8vXlZzCQAOx7KfA3AdUT/wAA8 F7ZvULA4wbNWmVX+wwF781Trycv3kiFPbe3FYcTI0FTXEQjQXDnz1tsgxRlhu+vjiIHj WPKVjx4TNXk2bmHaHv0Y++PD8k4WSWICdS30WlQWsNnhPvl0hS2lqfU7p8gpmJZ1pBm6 m4YKnaQLmjO/uWydm4+S5IuFTdGT041qLdGj4qHwVUQErlBYh6XQc/xvuk438oX9VXv9 aEyzRYJh6I9Q/+X/2jAyo4h0HZFsWHZ9oV+Dk4ie1dUo3+WS/slJAqo3lD9VXbY+YWRV 543w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705849914; x=1706454714; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d+yj1AHvkEM0T6peXvl2abVUiirRYEugftyA4GeUYHQ=; b=WhQsq3zCvDAjvkcqbAso2L4NjLabIHMUDBMuHWV2iTKCQjAeXa0L1WB2/dlgrnEyML u8bS53I5nJxvXUnFq2UlR+N0BHRo2ek+vFdcNLZEcZCjEfDauHS/h7C1OKp9YJZlEs5E covIJkRblCK6BHExGi3NN0YzkNURSYlUObgY79aFNLvnpYen5vICRwUyOQGgDIPK4lGn D058+0c3D18Ajc8F66mtc8hWzEcq8nK5b2v9cnIJuBCIrIzEl8XE8ehin6rdDGWkUqi7 MuhsNsB6pCQxVvpB4REwFq9Jv0qZj6/TgliPIlqz6SP9U9LnFAm8FqbUmOMOfYfTPpxW ZZ/Q== X-Gm-Message-State: AOJu0YzoSTmailJpTE2lXqIUDtlUonYRPlHoxeehCyrD/2rEruvhVfI1 rfsdxDXsR1TTy/Gqz6qnxet1VO20DgtX6ihtWg8GyXaunsPywFMy63yrb9naNf4wmOO3mIReHcG zG3d61baXtiIuai4GwXshi5Em8PM= X-Received: by 2002:a05:6512:3f23:b0:50f:c24:39f8 with SMTP id y35-20020a0565123f2300b0050f0c2439f8mr2133641lfa.6.1705849914011; Sun, 21 Jan 2024 07:11:54 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240117031212.1104034-1-nunes.erico@gmail.com> <20240117031212.1104034-5-nunes.erico@gmail.com> <20240121095604.2368-1-hdanton@sina.com> In-Reply-To: From: Erico Nunes Date: Sun, 21 Jan 2024 16:11:41 +0100 Message-ID: Subject: Re: [PATCH v1 4/6] drm/lima: handle spurious timeouts due to high irq latency To: Qiang Yu Cc: Hillf Danton , dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org, David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Jan 21, 2024 at 12:20=E2=80=AFPM Qiang Yu wrote: > > On Sun, Jan 21, 2024 at 5:56=E2=80=AFPM Hillf Danton w= rote: > > > > On Wed, 17 Jan 2024 04:12:10 +0100 Erico Nunes > > > > > > @@ -401,9 +399,33 @@ static enum drm_gpu_sched_stat lima_sched_timedo= ut_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; > > > + } > > > > Given 500ms in lima_sched_pipe_init(), no timeout is spurious by define= , > > and stop selling bandaid like this because you have options like locati= ng > > the reasons behind timeout. > > This chang do look like to aim for 2FPS apps. Maybe 500ms is too short > for week mali4x0 gpus (2FPS apps appear more likely). AMD/NV GPU uses > 10s timeout. So increasing the timeout seems to be an equivalent and bett= er > way? Indeed 500ms might be too optimistic for the sort of applications that users expect to run on this hardware currently. For a more similar reference though, other embedded drivers like v3d and panfrost do still set it to 500ms. Note that this patch is just exactly the same as exists in Panfrost today and was already discussed with some common arguments in the patches of this series: https://patchwork.freedesktop.org/series/120820/ But I would agree to bump the timeout to a higher value for lima. Some distributions are already doing this with module parameters anyway to even be able to run some more demanding application stacks on a Mali 400. Another thing we might consider (probably in a followup patchset to not delay these fixes forever for the people hitting this issue) is to configure the Mali hardware watchdog to the value that we would like as a timeout. That way we would get timeout jobs going through the same error irq path as other hardware error jobs and might be able to delete(?)/simplify this software timeout code. In the meantime for v2 of this series I'll make the change to account for the multiple pp irqs. So do you agree it is ok to leave drm_sched_stop() as it is at least for this series? Thanks all for the reviews Erico