Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp1979565rdb; Sun, 21 Jan 2024 01:56:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IGqKY8ndqYVigGBXflj0oecdKG4xIbcpE3/I9obJXggcGv8s2EIPivwsB1IcjnikD9dQw+Y X-Received: by 2002:ac8:5fce:0:b0:42a:3c83:ce26 with SMTP id k14-20020ac85fce000000b0042a3c83ce26mr201562qta.105.1705830999883; Sun, 21 Jan 2024 01:56:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705830999; cv=pass; d=google.com; s=arc-20160816; b=C0M3SalROTidxjctHYJGXLju4hWdhC6rAPtQ9hvAa3TqHI7gagvmmXo9WK5AwOj1rT rkII5dp2pUs3oDQiAaARKFDV7cOZI//udGvCjPE9TfrfRNIllvMiDj4zEa5lTXMn6/ZA 6NTxLJiRslsvZP9wWfbagFEgLRJroe8ILXs10SNnH9B0ke7kFEyD6tqXZocjDUSmgVJR Zry6fPlQloJGFXHQB2SzwYqHAFPIA8XURv/BdE4fmhTvbAjAuZErajNfEu6K1AvPwxf9 qtcpsS9rgRJ45rec4697VPgnYDnpGSURv9/wD07POBDl47bBThdb8Au9suhnP5c0AuhH xXqw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=7VFhbtJxvjiJEO1rWixgTEhvKyttQaB/01JGlXVI900=; fh=Tk1a/Lm5PzF6ih4UuzM8HmikcRHYMkDRZWLxdFuttKI=; b=ucXEa5oX9B33caPnN38LU1uuS5dztrjDk6/xU9njm2TiPMYMxcd1qS3e6OCDLxlgwp 1/94YQoTiqDGwGtBBXrGqHm9nVtA/Oun/DG5vVfuiP6qNYIECnUJM3q9ol5l4cq8Uzo6 UyoQXGKFm4vkONkpSB9Q5EwdNo7yMSbg3NsgtvmYgaBPo/tazOFiagWkB2H97lKTR/f0 /0l/pJqBCbGuFQq1yEc3cZ+ErdId6vdY63zsEuuWEZgIs541Bb3A0MVbHHpONQ2AB1Bb 6RdBz8n8LrwPYqIeQXwtAU8XkmTU1PMsSPFoTuCjHbE16SJbyE/wmn+8iZL0gzxkhx1+ Pcmg== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-31996-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31996-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id n21-20020a05622a11d500b0042a3c639e58si196774qtk.116.2024.01.21.01.56.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Jan 2024 01:56:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31996-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-31996-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31996-linux.lists.archive=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 9F5161C2112F for ; Sun, 21 Jan 2024 09:56:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ECB88364BA; Sun, 21 Jan 2024 09:56:32 +0000 (UTC) Received: from mail115-118.sinamail.sina.com.cn (mail115-118.sinamail.sina.com.cn [218.30.115.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B9E71E497 for ; Sun, 21 Jan 2024 09:56:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=218.30.115.118 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705830992; cv=none; b=b0wUB6Xsa6+MRpoTCeEx441fMUDku0FGYbWM7CgLO1jKuAodCjV3604Wrx0SCBYpyfsxPE7yrTPVxoomeG6a55YeWGL8+YsT8BimpRjshNhfQHxokhwcdJrI7Rso8Yfu5uHNT/LG13+/kZ18fEeVBLzjCe5nye5D50N9jO/fNu4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705830992; c=relaxed/simple; bh=LUXkf4HBEF2S662S+V85kZbrzlmodKX7UJBgG76oifE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PRWsMvDXt+kO94greHteI51xH+VDcNKCkq4EcNnvsH8o1trdQepCqGOD5Dd0TNvzf8ImLvGhIJPZTWIOcNvi0yjTawN5Cgxu7/231ZcfTX5E7ZjReF2QcSFruq+uM8u+ooKdLL+m8S2H0+BcTkdsS+F2N6/JQsAB+aD9X2Cb39s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com; spf=pass smtp.mailfrom=sina.com; arc=none smtp.client-ip=218.30.115.118 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sina.com X-SMAIL-HELO: localhost.localdomain Received: from unknown (HELO localhost.localdomain)([116.24.10.125]) by sina.com (172.16.235.25) with ESMTP id 65ACEA3E000015B6; Sun, 21 Jan 2024 17:56:17 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com Authentication-Results: sina.com; spf=none smtp.mailfrom=hdanton@sina.com; dkim=none header.i=none; dmarc=none action=none header.from=hdanton@sina.com X-SMAIL-MID: 81253134210153 X-SMAIL-UIID: C909EB5828EA4A11A97D102167E10E39-20240121-175617-1 From: Hillf Danton To: Erico Nunes Cc: Qiang Yu , dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org, David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 4/6] drm/lima: handle spurious timeouts due to high irq latency Date: Sun, 21 Jan 2024 17:56:04 +0800 Message-Id: <20240121095604.2368-1-hdanton@sina.com> In-Reply-To: <20240117031212.1104034-5-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: 8bit On Wed, 17 Jan 2024 04:12:10 +0100 Erico Nunes > > @@ -401,9 +399,33 @@ 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]; > + > + /* > + * 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 locating the reasons behind timeout. > + > + /* > + * 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; > + } > > if (!pipe->error) > - DRM_ERROR("lima job timeout\n"); > + DRM_ERROR("%s lima job timeout\n", lima_ip_name(ip)); > > drm_sched_stop(&pipe->base, &task->base); >