Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp220747rdb; Mon, 22 Jan 2024 18:33:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IGKnc1LPm2j/cnvMuG/PiYwOtZT/wdNmVBsZusDN+0sYSl4NJ8/YGbEPmBd486Ut+YoGsPn X-Received: by 2002:a05:6808:1413:b0:3bd:7296:afd5 with SMTP id w19-20020a056808141300b003bd7296afd5mr7216145oiv.110.1705977200758; Mon, 22 Jan 2024 18:33:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705977200; cv=pass; d=google.com; s=arc-20160816; b=o56zlQH4ISDdHMBkTPjSsJcDL+jTLdASV1r1fdXWLhko0R5B+hZl4r2DtoohwB6VtO dqJnmrkQfNOgfwCi6gz0Ny4RMNHdnHIvQx8jSgrOJIKd3xJzucBFc5jEGTWVf1R2iFQx MdFCKMiBCGYvrJiBr9KnbIE2mE8cOBWplyd6BNmf1osMgliRNg3IElGxSqQse6RAoBxQ YUc6Jod8FR7/doLBP3XrgFuLxRfZ1rvr/8qhzze2G4OxpvH8QoZncYjaBriOSblnPsXj 7T7yMQR0FiQGJ0X4YdsLXH0BaYN0GUGRJmxRJbi0wS/80IPQzDMCERNGtFvn8p59Wflh /3+Q== 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=Z6lo1t0xIINgMF9rkW3F98A1LhixJMkR04sT2kjXH0U=; fh=myN5LfJ2m6aYM6I8Oi6Nr3UUtKPxvrYwr/lxwkni3dE=; b=CGnYHbWhRwLJxcmENlulNvCBFWdd/rOJvfeFRlOtMvj85YBAM+OvXUulMAt7UOPk9o oLOFZnDFwNT7KALOKOeBiQ/EEQ80AAIqxuF0dnyG7LGTmsRtb7SNGyr7MXEUxNUJpiWi tIIvDrfliQy75StlUy0nmic//eNL3szcBIGLR6JD6lNbXxNNO+pOoH/WPvU4wyfQbwCI ymNi0+pqVmtZAGBT2CRFDEjgbNSn6dRnIQm/PiEFjPSmakQma1xH+trLWlT8+UPdXCWW eaoz1dAMJp/YQ69oet2jajlZLcXQzpIZ5luy2sRilwxWkTLLnl9Czu4RfHKuS69htnrw GUMg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="iz/i3Y7f"; 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-34580-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34580-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 m13-20020a056a00080d00b006dbe009fcd4si2712903pfk.172.2024.01.22.18.33.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 18:33:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34580-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="iz/i3Y7f"; 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-34580-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34580-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 28967B25848 for ; Tue, 23 Jan 2024 02:11:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 91E6351C23; Tue, 23 Jan 2024 01:18:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iz/i3Y7f" 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 066924A1A for ; Tue, 23 Jan 2024 01:18:15 +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=1705972697; cv=none; b=QYSqIt2vCncVZH6Bb0796ZlD9RV0uR+6DouTHXf9pjRhkn19Gj9kOUi/NOs2P0XVwpgR9HcWzCxl+mTgCYPfvjYlrnfDxbWkj8lTBJRlL48tBf6I8TiIWwsXcfg23f8157GzZl9MqfMS0zdU48oJthwdzNHThLAW+dbGfY8jciA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705972697; c=relaxed/simple; bh=7OGpeO8bcvoJGD6aSk6hwBQ0SR8wEJaEQk7HVbaXwYo=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=DJPEdmOLRmIwa9wlPD8R0NBJ+VkN8yApGdU80K5E9wfIFEUitb7B2VbBs27lOWoO4ONLWsboZUKLFipbStYP/8gYqGwIe+4wtYtX5+5WK52zEnG+tE2I7JdmQCrta2r6yPVVaYWDPhZYOJc6gYk19RJbejHFO/PHAMWEuJNq5Is= 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=iz/i3Y7f; 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 Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-554fe147ddeso5156344a12.3 for ; Mon, 22 Jan 2024 17:18:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705972694; x=1706577494; 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=Z6lo1t0xIINgMF9rkW3F98A1LhixJMkR04sT2kjXH0U=; b=iz/i3Y7fFWM8IGsXaHfsB57b2Lga959AA/BKrxr+rwRK7isv0WL/CEG4Ru596+XPHV nvoxj8tfoMiJcEcRJXASi/kWeCV5nH7uysOisvt3g4lJz+0I9THTlY3/N8KvRmSAuKys U3FDbO33r8klBQqFViipr/TKz2AjP+fZKbZWXeOoxz/oBpM2Jj7khA18y27oCjhzHLJ0 P/DPpsIaKtwATy4uXchbJ45ll2md7CHoqaiQKfw+5QcRE6NbQ+4wNnEZmx/wHFSer0iC kQX7heE3R3IoZFPdILuhcOg+KUcAKEo5X4/6vF4ztVa/j8YsBltcxGpENcXfhXF3ABUF Song== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705972694; x=1706577494; 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=Z6lo1t0xIINgMF9rkW3F98A1LhixJMkR04sT2kjXH0U=; b=k0icTBOq6iDe+ArpfEbLQzZY/Cp/66H9qTTcGz1+gAor1f2K2crpNs14iCiX8h10ZN 4pLVr7EPtSiCbgsUq37zw+xuvjHTOe+/v+Y5a+STmI8HFoIhHTUDkzZGikEzvMKBzM1L Yxb4OqfCk0sJmhtef2hgd9bMj36Zd2mfF8AHSPiOmPgP1H0Ht5Z5g3JtfhAqzikpk9dS VIaOBJPuYZCTNXrVPzuolWqMw5KFh/Klj1CKxA1HMlfZxO+qdq9vk2iuicFHPHeXjBtq Vx4fo2u0oaquz7gx82gBBTFEtA+xw69Nbu+D6gbTSXfWPv/1IXmMJnjjNcnjqmy1lvlg v77A== X-Gm-Message-State: AOJu0YzLWqTOxxp3aPv8SkiINWqGVlfbQPhWBXcZw/62FIxGENXsHcCj q+9ZoBz1csHyvk4bxpH2xCtJp6SKUoou1h4dRWsvS3nKTBcKhOqlBNvMA6v7fesAmfjmwgLx2CE YUgx/bkP55843md76HKBzoNcyik4= X-Received: by 2002:a05:6402:3552:b0:556:cda3:469c with SMTP id f18-20020a056402355200b00556cda3469cmr258947edd.153.1705972693986; Mon, 22 Jan 2024 17:18:13 -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: Qiang Yu Date: Tue, 23 Jan 2024 09:18:02 +0800 Message-ID: Subject: Re: [PATCH v1 4/6] drm/lima: handle spurious timeouts due to high irq latency To: Erico Nunes 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 11:11=E2=80=AFPM Erico Nunes wrote: > > On Sun, Jan 21, 2024 at 12:20=E2=80=AFPM Qiang Yu wrot= e: > > > > On Sun, Jan 21, 2024 at 5:56=E2=80=AFPM Hillf Danton = wrote: > > > > > > On Wed, 17 Jan 2024 04:12:10 +0100 Erico Nunes > > > > > > > > @@ -401,9 +399,33 @@ static enum drm_gpu_sched_stat lima_sched_time= dout_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 timeou= t 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 defi= ne, > > > and stop selling bandaid like this because you have options like loca= ting > > > 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 be= tter > > 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. > This way should be much simpler and stable. > 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? > I'm OK with this. > Thanks all for the reviews > > Erico