Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp2805774rwo; Mon, 24 Jul 2023 01:15:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlEhNDiwWEaAvbNEsqZ7S9q1TMtb2r8EKSycXGl9PoJeMZIbCPz12GfTdDk4vIhzUf/zUN0Q X-Received: by 2002:a05:6358:4285:b0:135:afe6:4f83 with SMTP id s5-20020a056358428500b00135afe64f83mr3206337rwc.29.1690186511389; Mon, 24 Jul 2023 01:15:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690186511; cv=none; d=google.com; s=arc-20160816; b=qBNI/bqEWAO+oeGQzhsjPbrgUO4Nv4TTq3Gm0cftwTOMAc6nZJoudEniM90RPx6mJ5 8/RmmT7lFZOxww7N3R3LBf3/Hju2PGP4f5vbMnCvsNju3IB1p9VkoCeUFQ444/Wi1MK3 Hx6yf4sLzgDLpPS6UBhbZJfeOz5gajtZD23EDOIxe+PFaCgxCSbqGcQLNxb6DOxRfL+S 6De7ZUGOtk18sYxMjJDxke3a32vlwFw+HVnbpKsWZ947mlkr+RltCn/MUEd7WTBAJ/gB bW/0K0mJPL170A+Phq8zNbhEBXChzSPaO60ynG60QXCg/rn9nbmAaIoIal+nyygP1ILK rRjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=GZd/MKROXHgLzMveheS8ve5XQcg1tj4Of7a5PhgOQkE=; fh=uPbw9xH7W/iy/tMdTQBa1dlKOye5bv3hMi5k0Nxgku8=; b=nIEfoEeaz7mfY8mKIXLIoVaaYKTb+tPDEWC9lzjnVVyw5rp0u7KqZJmThSAYKlNINu 8SaSMFLQlKjQHqLlcleoSUk17TAeyRzHSHqLZDhqc+73XnybqYea4OcQxfVzrsNRUEPC ep8G1ZkyvS2a4UFB6a8KgfFWxoX3GZQ7AfgINfhHODiJQlu0nQES01ovWXSO32Vczz7Q ljAH59vpBJEpH511TQJAaI3FmOLXkV/kFJ0NY4RnK38fYJ799AGm/IR58pwKQz3dYTmI tWql2J9XcCUjogk3BUIEbkPKcog/rvxVUqcBF/3HvUwIZMD8QOhTHkcMQApT8dSuejBV vswg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=RJTdfn8B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u191-20020a6385c8000000b005573b42d9e3si8651354pgd.593.2023.07.24.01.14.58; Mon, 24 Jul 2023 01:15:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=RJTdfn8B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230035AbjGXG5f (ORCPT + 99 others); Mon, 24 Jul 2023 02:57:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229634AbjGXG53 (ORCPT ); Mon, 24 Jul 2023 02:57:29 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1A56F4 for ; Sun, 23 Jul 2023 23:57:28 -0700 (PDT) Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by madras.collabora.co.uk (Postfix) with ESMTPSA id 917E36606FC0; Mon, 24 Jul 2023 07:57:25 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1690181845; bh=DDr7h7mny8AZCBOnyjGhWJoPL9V0rTYC+Qaptxd3CCo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=RJTdfn8B2N0JPy1aeTMf8a1BAbSMK5ufX/7M+lc3rm6jzAkWeoQOYASLD20RBzTqR rgnIP9f9YRgsJegVdPLFUMp2wD11//O4nxujlfOo05BirgcsCpp7urh04qIbT1LYss VxMzycv22QzBSV9rfpXbd7lLiMiM3fqSxMoQPYAZ35VYKPwYscPgvoa0N9wjy/fYEG k+I0NzQRRbjv2AwdUKGnhKYk5H1bv/5A4zmYPTNkliAEX5Ho3BSiqMZQAiwLL/lfEh o16Xo7XqSuMz+rpJQVYbWTxG6ggC98lQZd/AwEci+r3CBTl9ZqLvTyKhr4o3bbBTUT J21QIlsffBN1Q== Date: Mon, 24 Jul 2023 08:57:23 +0200 From: Boris Brezillon To: Dmitry Osipenko Cc: Rob Herring , Steven Price , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel@collabora.com Subject: Re: [PATCH v2] drm/panfrost: Sync IRQ by job's timeout handler Message-ID: <20230724085723.5e574bff@collabora.com> In-Reply-To: <20230723000142.206908-1-dmitry.osipenko@collabora.com> References: <20230723000142.206908-1-dmitry.osipenko@collabora.com> Organization: Collabora X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 23 Jul 2023 03:01:42 +0300 Dmitry Osipenko wrote: > Panfrost IRQ handler may stuck for a long time, for example this happens > when there is a bad HDMI connection and HDMI handler takes a long time to > finish processing, holding Panfrost. Make Panfrost's job timeout handler > to sync IRQ before checking fence signal status in order to prevent > spurious job timeouts due to a slow IRQ processing. > > Signed-off-by: Dmitry Osipenko > --- > > Changelog: > > v2: - Moved synchronize_irq() after first signal-check to avoid unnecessary > blocking on syncing. > > - Added warn message about high interrupt latency. > > drivers/gpu/drm/panfrost/panfrost_job.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c > index dbc597ab46fb..a7663d7847a2 100644 > --- a/drivers/gpu/drm/panfrost/panfrost_job.c > +++ b/drivers/gpu/drm/panfrost/panfrost_job.c > @@ -720,6 +720,13 @@ static enum drm_gpu_sched_stat panfrost_job_timedout(struct drm_sched_job > if (dma_fence_is_signaled(job->done_fence)) > return DRM_GPU_SCHED_STAT_NOMINAL; > > + synchronize_irq(pfdev->js->irq); Can we add a comment here explaining why we're doing that? > + > + if (dma_fence_is_signaled(job->done_fence)) { > + dev_warn(pfdev->dev, "unexpectedly high interrupt latency\n"); > + return DRM_GPU_SCHED_STAT_NOMINAL; > + } > + > dev_err(pfdev->dev, "gpu sched timeout, js=%d, config=0x%x, status=0x%x, head=0x%x, tail=0x%x, sched_job=%p", > js, > job_read(pfdev, JS_CONFIG(js)),