Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp2879646rwo; Mon, 24 Jul 2023 02:47:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlHA04Zwn+WQHgXtFjO7bbR7+R8Tn/Vsc/T58I+L47somqyaiGSwQV3FQvhMJ/dZVjp2Be6a X-Received: by 2002:a05:6512:3e11:b0:4fb:8939:d95c with SMTP id i17-20020a0565123e1100b004fb8939d95cmr6088883lfv.30.1690192030539; Mon, 24 Jul 2023 02:47:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690192030; cv=none; d=google.com; s=arc-20160816; b=RB+PsRaWAxdVIUMZsobnaY8Pa8P3RYSvP5AvLj4vxoa0kR6oTQy1TdHSnq6M3nWEzX 4+LcNl5m+7ysvV3wyGzzss6/DU8xhOukWzHa0UZx4AewpIOKntrf4SxHeZ4LjDCqU0VN /DCMWkdu9Nnp+neUTIzcMIvix4faTjUASWocep6QfPQcpoI6A6LlqNgI7YE16+awlSDp NFlWuYwiVR0H0+zuwXOLeYArrUQYphfhOhuNLCPXN91r+QUzq4cpZj8s+1xnIU4eEq85 HlDUFlOqChEvhyVeBu4Cs7GhSjSABzvXJuGG19GEQ0eAQK2/akSKGg++KAZXHCRXxWHu EYPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=O5cg3aX/tEvy6Od89JFezsGBspoxj7YebViffAhKKH0=; fh=9cM6KW2zNDSAzKfLm5SE6uFhH6DhM9m3UbyBCaEnLkk=; b=zg7GNU+NDo+VWAAVYvJy+4ygUTTYTqXhILFbvnpsuqCHGh/NdfV8/rTioXtry0OpPt o0ewJzDN+6nJNPdWDbWCkqKXpY3+0F4h77CTL/9NeuCrjOj2FLyIDhdEN4zmUB08LysR Tksinb7BgNCKKWlATGOyhHCA72BPhlpPcTgYEANiGx7mNVdWKpjVIy9TKj+6UwzQZcHa AVUddWftHZ9vCwTFT56RK5BUCYv7HhSo22dlZK4iL0Pad+GrI7KW4TYxYzbitElOPFGX 7tnF3GKHKTpK054POsUNzVUWGn0n1gOstmLRmIBFEfDwzRK3GuCjxW95q/lsJ7SNSB9G a3yA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f15-20020aa7d84f000000b00521cb669a89si6446215eds.135.2023.07.24.02.46.46; Mon, 24 Jul 2023 02:47:10 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231889AbjGXIvI (ORCPT + 99 others); Mon, 24 Jul 2023 04:51:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231881AbjGXIvH (ORCPT ); Mon, 24 Jul 2023 04:51:07 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1AE48ED for ; Mon, 24 Jul 2023 01:51:06 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E5CC6DE0; Mon, 24 Jul 2023 01:51:48 -0700 (PDT) Received: from [10.57.34.62] (unknown [10.57.34.62]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 03B6F3F6C4; Mon, 24 Jul 2023 01:51:01 -0700 (PDT) Message-ID: Date: Mon, 24 Jul 2023 09:51:02 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v2] drm/panfrost: Sync IRQ by job's timeout handler To: Boris Brezillon , Dmitry Osipenko Cc: Rob Herring , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel@collabora.com References: <20230723000142.206908-1-dmitry.osipenko@collabora.com> <20230724085723.5e574bff@collabora.com> Content-Language: en-GB From: Steven Price In-Reply-To: <20230724085723.5e574bff@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,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 24/07/2023 07:57, Boris Brezillon wrote: > 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? Agreed, with a comment added: Reviewed-by: Steven Price >> + >> + 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)), >