From patchwork Fri Aug 23 02:12:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 11110433 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E3A3E14DB for ; Fri, 23 Aug 2019 02:12:28 +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 CC84623404 for ; Fri, 23 Aug 2019 02:12:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC84623404 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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 626A66EBA3; Fri, 23 Aug 2019 02:12:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-oi1-f195.google.com (mail-oi1-f195.google.com [209.85.167.195]) by gabe.freedesktop.org (Postfix) with ESMTPS id D0C256EAAA for ; Fri, 23 Aug 2019 02:12:20 +0000 (UTC) Received: by mail-oi1-f195.google.com with SMTP id q8so5637206oij.5 for ; Thu, 22 Aug 2019 19:12:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CtVv9KmOH1uY8onE46Ao79LAatPRJtfqcOsRBmR2M9Q=; b=lm7NrdhvRCY0ZW8DYbYnmfw1iRUuCluNcwJFuHNbL96EkrCXtu42+sOfrdQ0Dil6Rd ClV5kppI0iM3yQUUDQImHO+dsWcmgCJJ6Nq/3oqykQt8OcwJQgrCXHN6XzsUaCSZ0twS AuRU3mcFxPOFhzAlkLLdZQJvuofpOcWlrjdfLkz3ICkdYyXd1IbKI23dX/13k+8S7y9W MvKhfD+jcNjukB9JxJGwWRJDQScYTbDXPwfCUYnMreqvmNRjkxHMk4QvYk+BFQvmrXm5 ++vQ3O52l7shgpTwJ71xUeS/cC2Uc9WWOZDTi6g+/9JNy78373S/7G2vFsCdV+a0rnR0 DJ8w== X-Gm-Message-State: APjAAAXEf44elJACY+t3qMEidkjMpTQX58g6oanrZ44ZrC9UK3Yt3FYG DETiry1arIJ+CyoaHUd62eHZ36U= X-Google-Smtp-Source: APXvYqzir6uWwX94/snHpAlAtSJKbbjaTQv3ggyGaYdZVf4/BH/JtPzHVSvvgX6k9Rn2YOmXNyPtow== X-Received: by 2002:aca:dc88:: with SMTP id t130mr1435568oig.43.1566526339704; Thu, 22 Aug 2019 19:12:19 -0700 (PDT) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id c1sm457747oic.31.2019.08.22.19.12.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Aug 2019 19:12:19 -0700 (PDT) From: Rob Herring To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 1/8] drm/panfrost: Fix possible suspend in panfrost_remove Date: Thu, 22 Aug 2019 21:12:09 -0500 Message-Id: <20190823021216.5862-2-robh@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190823021216.5862-1-robh@kernel.org> References: <20190823021216.5862-1-robh@kernel.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxime Ripard , Tomeu Vizoso , David Airlie , Sean Paul , Steven Price , Boris Brezillon , Alyssa Rosenzweig , Robin Murphy Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Calls to panfrost_device_fini() access the h/w, but we already done a pm_runtime_put_sync_autosuspend() beforehand. This only works if the autosuspend delay is long enough. A 0ms delay will hang the system when removing the device. Fix this by moving the pm_runtime_put_sync_suspend() after the panfrost_device_fini() call. Cc: Tomeu Vizoso Cc: Steven Price Cc: Alyssa Rosenzweig Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Rob Herring Reviewed-by: Steven Price --- v2: new patch drivers/gpu/drm/panfrost/panfrost_drv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index 44a558c6e17e..d74442d71048 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -570,11 +570,13 @@ static int panfrost_remove(struct platform_device *pdev) drm_dev_unregister(ddev); panfrost_gem_shrinker_cleanup(ddev); + pm_runtime_get_sync(pfdev->dev); - pm_runtime_put_sync_autosuspend(pfdev->dev); - pm_runtime_disable(pfdev->dev); panfrost_devfreq_fini(pfdev); panfrost_device_fini(pfdev); + pm_runtime_put_sync_suspend(pfdev->dev); + pm_runtime_disable(pfdev->dev); + drm_dev_put(ddev); return 0; }