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=-11.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham 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 7C761C2D0A3 for ; Tue, 3 Nov 2020 08:45:09 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 35DCD22275 for ; Tue, 3 Nov 2020 08:45:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 35DCD22275 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 274B66E85D; Tue, 3 Nov 2020 08:45:08 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2C91A6E85D for ; Tue, 3 Nov 2020 08:45:07 +0000 (UTC) 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 AEACD1F45388; Tue, 3 Nov 2020 08:45:05 +0000 (GMT) Date: Tue, 3 Nov 2020 09:45:02 +0100 From: Boris Brezillon To: Steven Price Subject: Re: [PATCH] drm/panfrost: Fix module unload Message-ID: <20201103094502.70de59c9@collabora.com> In-Reply-To: <20201030145833.29006-1-steven.price@arm.com> References: <20201030145833.29006-1-steven.price@arm.com> Organization: Collabora X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomeu Vizoso , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Alyssa Rosenzweig Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, 30 Oct 2020 14:58:33 +0000 Steven Price wrote: > When unloading the call to pm_runtime_put_sync_suspend() will attempt to > turn the GPU cores off, however panfrost_device_fini() will have turned > the clocks off. This leads to the hardware locking up. > > Instead don't call pm_runtime_put_sync_suspend() and instead simply mark > the device as suspended using pm_runtime_set_suspended(). And also > include this on the error path in panfrost_probe(). > > Fixes: aebe8c22a912 ("drm/panfrost: Fix possible suspend in panfrost_remove") > Signed-off-by: Steven Price Queued to drm-misc-fixes. Thanks, Boris > --- > drivers/gpu/drm/panfrost/panfrost_drv.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c > index 23513869500c..0ac8ad18fdc6 100644 > --- a/drivers/gpu/drm/panfrost/panfrost_drv.c > +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c > @@ -627,6 +627,7 @@ static int panfrost_probe(struct platform_device *pdev) > err_out1: > pm_runtime_disable(pfdev->dev); > panfrost_device_fini(pfdev); > + pm_runtime_set_suspended(pfdev->dev); > err_out0: > drm_dev_put(ddev); > return err; > @@ -641,9 +642,9 @@ static int panfrost_remove(struct platform_device *pdev) > panfrost_gem_shrinker_cleanup(ddev); > > pm_runtime_get_sync(pfdev->dev); > - panfrost_device_fini(pfdev); > - pm_runtime_put_sync_suspend(pfdev->dev); > pm_runtime_disable(pfdev->dev); > + panfrost_device_fini(pfdev); > + pm_runtime_set_suspended(pfdev->dev); > > drm_dev_put(ddev); > return 0; _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel 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=-11.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham 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 CF2BAC388F7 for ; Tue, 3 Nov 2020 08:45:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8A9C322275 for ; Tue, 3 Nov 2020 08:45:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727527AbgKCIpI (ORCPT ); Tue, 3 Nov 2020 03:45:08 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:45492 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727864AbgKCIpH (ORCPT ); Tue, 3 Nov 2020 03:45:07 -0500 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 AEACD1F45388; Tue, 3 Nov 2020 08:45:05 +0000 (GMT) Date: Tue, 3 Nov 2020 09:45:02 +0100 From: Boris Brezillon To: Steven Price Cc: Daniel Vetter , David Airlie , Rob Herring , Tomeu Vizoso , Alyssa Rosenzweig , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/panfrost: Fix module unload Message-ID: <20201103094502.70de59c9@collabora.com> In-Reply-To: <20201030145833.29006-1-steven.price@arm.com> References: <20201030145833.29006-1-steven.price@arm.com> Organization: Collabora X-Mailer: Claws Mail 3.17.7 (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: linux-kernel@vger.kernel.org On Fri, 30 Oct 2020 14:58:33 +0000 Steven Price wrote: > When unloading the call to pm_runtime_put_sync_suspend() will attempt to > turn the GPU cores off, however panfrost_device_fini() will have turned > the clocks off. This leads to the hardware locking up. > > Instead don't call pm_runtime_put_sync_suspend() and instead simply mark > the device as suspended using pm_runtime_set_suspended(). And also > include this on the error path in panfrost_probe(). > > Fixes: aebe8c22a912 ("drm/panfrost: Fix possible suspend in panfrost_remove") > Signed-off-by: Steven Price Queued to drm-misc-fixes. Thanks, Boris > --- > drivers/gpu/drm/panfrost/panfrost_drv.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c > index 23513869500c..0ac8ad18fdc6 100644 > --- a/drivers/gpu/drm/panfrost/panfrost_drv.c > +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c > @@ -627,6 +627,7 @@ static int panfrost_probe(struct platform_device *pdev) > err_out1: > pm_runtime_disable(pfdev->dev); > panfrost_device_fini(pfdev); > + pm_runtime_set_suspended(pfdev->dev); > err_out0: > drm_dev_put(ddev); > return err; > @@ -641,9 +642,9 @@ static int panfrost_remove(struct platform_device *pdev) > panfrost_gem_shrinker_cleanup(ddev); > > pm_runtime_get_sync(pfdev->dev); > - panfrost_device_fini(pfdev); > - pm_runtime_put_sync_suspend(pfdev->dev); > pm_runtime_disable(pfdev->dev); > + panfrost_device_fini(pfdev); > + pm_runtime_set_suspended(pfdev->dev); > > drm_dev_put(ddev); > return 0;