Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5287691rwp; Mon, 17 Jul 2023 00:58:27 -0700 (PDT) X-Google-Smtp-Source: APBJJlHJS/zRe0c3ur61T1NpDeuSl4gBE2fmivybg/n57NKwNGhB9VQHJXf6Kzk0ENJXXJD7TcPe X-Received: by 2002:aa7:8888:0:b0:682:e24c:f4e0 with SMTP id z8-20020aa78888000000b00682e24cf4e0mr16112264pfe.11.1689580707261; Mon, 17 Jul 2023 00:58:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689580707; cv=none; d=google.com; s=arc-20160816; b=fO4j5qUkgBwwXqb9S6m5qjPRd8qr+/YU8Ows3wwC2JIib0cvQ6xYwVW4pqLCA6Zgbn O3nuseQGIgLkpA+jzhoABe8hOELuP61QEEJhQubEcAYhh4h+poHg7HUkMQigZUdb2/A7 5RemJyYpXx5rs+Ck2Q1DyIIovOEQEZsVYauH+FektJabyKgDrARsjn/4r6mhPRsTdceE VlVfGTYK8XjdBY/F0BolrKxAB63yJ8UpXLk6AXCouZzwUp+rQr0+Kvznf7FJaLD2NRcp 9IG7x73EXuOx9tD7+5ZUDEBk4xfe7yXwi0JketnPGqewteGvcpsBG5HhVZz1bq8I+NDN ZAKw== 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=bbY4tQq2Zx8M/GugJ54A31X1FNoC5mMpN6zIyxT490E=; fh=uPbw9xH7W/iy/tMdTQBa1dlKOye5bv3hMi5k0Nxgku8=; b=vuXhNsTdvdFThu0gvJcFbSGGPZRenYJvSOjaC2+u2kSV8eqVqdWEwBJttDzdRdcxo9 2rgMfXRg8NzFz3YxI+2bDUIaViQBY8qX4wLo3uqlyOmQ46mR1pqfd5a53wlz9hH26Z1t egTfwgRaVUNs4Q3btotcpOWoOvVCP5r9n1ER28tDQYIWr/D1VKem2GJ1dROpdi/B83Hu 2P4umuYOOmLtY1yD/MSHgFxKIUPV326ArEmVDS3Y4TkptjxasR5M11lIteHFy4cWOanv bNXfTQZ+QbyS9yGHjIWpyLPwrCU/ORpAe04hOi8EEYzBUkV1l37o/j0MQp3JJuBHmY4j w6jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=GVyJjA7R; 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 j64-20020a638043000000b005578e44dfb6si11157676pgd.864.2023.07.17.00.58.14; Mon, 17 Jul 2023 00:58:27 -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=GVyJjA7R; 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 S230172AbjGQHt1 (ORCPT + 99 others); Mon, 17 Jul 2023 03:49:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229884AbjGQHtZ (ORCPT ); Mon, 17 Jul 2023 03:49:25 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C75D01705 for ; Mon, 17 Jul 2023 00:49:09 -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 0EF636603203; Mon, 17 Jul 2023 08:49:08 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1689580148; bh=yObxiZcHxzX5TeLYp8bl5WtcJZJkSQMr2izYqJlgGp8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GVyJjA7RGvEAWbuj+c3CFXrubnOwMnQxmKAcUDQeJNVknemhAfSMgixQwBdQY8nEo IM+kpEyK+FPhKf2VIlEi8+d7K4MwB4E6Wgsg506LTV4VWnXMS8QFXQsmedgOzMLSA7 pijbQm4F/LB4qnXsW6frQBVEWDhrE0uKH7RISjr7D/PDgXKnxnk12rQpXGtA9UFcRH xKbA2Shryh26p4kkE+FnvPAsrTtzOpeArW3M2GAW7YFxeFTH/J+2hI6LHxLi8qy8MJ TUC5yf3FGR26NrYY97cmEE0Y3U9ZHZf9DBauy34sEQIMVejPzI5dduuc0kJ9j/JcYO 9bUcos0QOoQ7g== Date: Mon, 17 Jul 2023 09:49:05 +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 v1] drm/panfrost: Sync IRQ by job's timeout handler Message-ID: <20230717094905.7a1ee007@collabora.com> In-Reply-To: <80de081a-e443-85a2-1a61-6a8885e8d529@collabora.com> References: <20230717065254.1061033-1-dmitry.osipenko@collabora.com> <20230717090506.2ded4594@collabora.com> <80de081a-e443-85a2-1a61-6a8885e8d529@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,RCVD_IN_DNSWL_BLOCKED, 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 Mon, 17 Jul 2023 10:20:02 +0300 Dmitry Osipenko wrote: > Hi, > > On 7/17/23 10:05, Boris Brezillon wrote: > > Hi Dmitry, > > > > On Mon, 17 Jul 2023 09:52:54 +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. > > > > Feels like the problem should be fixed in the HDMI encoder driver > > instead, so it doesn't stall the whole system when processing its > > IRQs (use threaded irqs, maybe). I honestly don't think blocking in the > > job timeout path to flush IRQs is a good strategy. > > The syncing is necessary to have for correctness regardless of whether > it's HDMI problem or something else, there could be other reasons for > CPU to delay IRQ processing. It's wrong to say that hw is hung, while > it's not. Well, hardware is effectively hung, if not indefinitely, at least temporarily. All you do here is block in the timeout handler path waiting for the GPU interrupt handlers to finish, handler that's probably waiting in the queue, because the raw HDMI handler is blocking it somehow. So, in the end, you might just be delaying the time of HWR a bit more. I know it's not GPU's fault in that case, and the job could have finished in time if the HDMI encoder hadn't stall the interrupt handling pipeline, but I'm not sure we should care for that specific situation. And more importantly, if it took more than 500ms to get a frame rendered (or, in that case, to get the event that a frame is rendered), you already lost, so I'm not sure correctness matters: rendering didn't make it in time, and the watchdog kicked in to try and unblock the situation. Feels like we're just papering over an HDMI encoder driver bug here, really.