From patchwork Fri Oct 28 23:40:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Wu X-Patchwork-Id: 9402841 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0928560231 for ; Sat, 29 Oct 2016 00:03:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE8CD2A8A8 for ; Sat, 29 Oct 2016 00:03:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE1202A8E7; Sat, 29 Oct 2016 00:03:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4AEC62A8A8 for ; Sat, 29 Oct 2016 00:03:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 27F276E086; Sat, 29 Oct 2016 00:03:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 1347 seconds by postgrey-1.35 at gabe; Sat, 29 Oct 2016 00:03:23 UTC Received: from mail.lekensteyn.nl (mail.lekensteyn.nl [IPv6:2a02:2308::360:1:25]) by gabe.freedesktop.org (Postfix) with ESMTPS id 59FD66E086 for ; Sat, 29 Oct 2016 00:03:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lekensteyn.nl; s=s2048-2015-q1; h=Message-Id:Date:Subject:Cc:To:From; bh=9OzMFep5FqcjAa5StAB8wkgPsmkBmX67QvDXuOSjlFo=; b=doJuew5bVWXk0gWBhR2wmop2d5hKHoCySHA1HukDt6Leu1riMe5llSOIdaNB7BwdCKP1olFGmxzsMxt5vaXD9A1uWMY47sIO0j0xYJj/mNyWhvSU+RVmWTqZ365bSThMLCU528dsRMKf/+WsWigGoZF7Daeca5nQxHdWkGSy3h7YxClzGg7AXLrQY5Oq58vy3YQaUMtAOUOtm/n4rbGO0QhpBSyZ/GGR+LfmUlfza4JTP7vasauxBHX/dpzlmC1pUbvGXk0DAmRUzUqGAFbxDaLks9AqnQgB+P1yXmWuN7fFcIH3DmUiXisvGFELhDhjmYn3qtmXCSOPNRO68KltsA==; Received: by lekensteyn.nl with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1c0GlC-0005OA-P0; Sat, 29 Oct 2016 01:40:51 +0200 From: Peter Wu To: Rick Kerkhof , Ben Skeggs Subject: [PATCH] drm/nouveau/acpi: fix check for power resources support Date: Sat, 29 Oct 2016 01:40:03 +0200 Message-Id: <20161028234003.21152-1-peter@lekensteyn.nl> X-Mailer: git-send-email 2.10.1 Cc: nouveau@lists.freedesktop.org, Mika Westerberg , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Check whether the kernel really supports power resources for a device, otherwise the power might not be removed when the device is runtime suspended (DSM should still work in these cases where PR does not). Link: https://bugs.freedesktop.org/show_bug.cgi?id=98398 Fixes: 692a17dcc292 ("drm/nouveau/acpi: fix lockup with PCIe runtime PM") Signed-off-by: Peter Wu Tested-by: Rick Kerkhof Reviewed-by: Mika Westerberg --- Hi, Maybe Cc: stable (4.8+)? Compile-tested only. Rick, can you test if this patch fixes the problem for you? This check was actually in the original patch, but it was changed: https://lists.freedesktop.org/archives/nouveau/2016-May/025125.html Re-adding the check as suggested by Mika. Kind regards, Peter --- drivers/gpu/drm/nouveau/nouveau_acpi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c index dc57b62..193573d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_acpi.c +++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c @@ -240,7 +240,8 @@ static bool nouveau_pr3_present(struct pci_dev *pdev) if (!parent_adev) return false; - return acpi_has_method(parent_adev->handle, "_PR3"); + return parent_adev->power.flags.power_resources && + acpi_has_method(parent_adev->handle, "_PR3"); } static void nouveau_dsm_pci_probe(struct pci_dev *pdev, acpi_handle *dhandle_out,