From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 344C1C4363D for ; Fri, 2 Oct 2020 12:06:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0615120663 for ; Fri, 2 Oct 2020 12:06:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387815AbgJBMGe (ORCPT ); Fri, 2 Oct 2020 08:06:34 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:49024 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725964AbgJBMGd (ORCPT ); Fri, 2 Oct 2020 08:06:33 -0400 Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 1D954291181; Fri, 2 Oct 2020 13:06:32 +0100 (BST) Date: Fri, 2 Oct 2020 14:06:29 +0200 From: Boris Brezillon To: Rob Herring , Tomeu Vizoso , Alyssa Rosenzweig , Robin Murphy Cc: Steven Price , dri-devel@lists.freedesktop.org, stable@vger.kernel.org Subject: Re: [PATCH v2] drm/panfrost: Fix job timeout handling Message-ID: <20201002140629.79174b26@collabora.com> In-Reply-To: <20201002071032.1225267-1-boris.brezillon@collabora.com> References: <20201002071032.1225267-1-boris.brezillon@collabora.com> Organization: Collabora X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Fri, 2 Oct 2020 09:10:32 +0200 Boris Brezillon wrote: > @@ -392,19 +411,41 @@ static void panfrost_job_timedout(struct drm_sched_job *sched_job) > job_read(pfdev, JS_TAIL_LO(js)), > sched_job); > > + /* Scheduler is already stopped, nothing to do. */ > + if (!panfrost_scheduler_stop(&pfdev->js->queue[js], sched_job)) > + return; > + > if (!mutex_trylock(&pfdev->reset_lock)) > return; > > + mutex_lock(&pfdev->sched_lock); Oops, sched_lock shouldn't be acquired here, I switched to a per-queue lock instead.