From patchwork Wed Aug 14 21:31:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karol Herbst X-Patchwork-Id: 11094643 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 64303112C for ; Wed, 14 Aug 2019 21:31:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D1E2209CD for ; Wed, 14 Aug 2019 21:31:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3ED162880C; Wed, 14 Aug 2019 21:31:54 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE24F209CD for ; Wed, 14 Aug 2019 21:31:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730016AbfHNVbm (ORCPT ); Wed, 14 Aug 2019 17:31:42 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:34514 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729982AbfHNVbl (ORCPT ); Wed, 14 Aug 2019 17:31:41 -0400 Received: by mail-wm1-f67.google.com with SMTP id e8so4173751wme.1 for ; Wed, 14 Aug 2019 14:31:40 -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=JS9FDqsk2E6RQCD4HkMjbuys2g4pNRCG7WFODU185bI=; b=WP7qTGhc5r5DTZn4z5uIV/vYPFO5L67bxY3M2zZ3jFENipGJh1FZENkRWpg5xhNBgx irRPbcwcgu6Syn0Vu1nEPdq5rHRnzcrMOwrKXaqUXOvCfylgvCwECkEy0NWnRECyYkq3 nCGR+Qb2D2xqeb5sHtISAObCIn7BuBunVqTEj2G2/IWsJMA4NPQtEwgT3TmBbUemwvV4 XO62F54u48i74TmSScJg5KlbZ86qy/rCSwe2bFn0omqHDDQLTilyZ0Pz6ZsAo+JsDy8g UBXaqvsMPefpIftL9fL+X9PbBVPR7c8ApKcIdZwtpvTzV5uKSrsth2PPrrg1tOmaT6eh 64Ww== X-Gm-Message-State: APjAAAWfNURpoPI1k1CIIwqIfXo8NH50qsIq5oY2C4a2dNreItEoq/te VSdyzcfcsGx2fXKSJz1rL2wn2Q== X-Google-Smtp-Source: APXvYqzHDWQhfPJ6We27I1c01VEHmcH6AedqLJLeDfuYhTAnIpxtfMqyBLvyHd9LxsMu3eLuFy5VVA== X-Received: by 2002:a7b:cf21:: with SMTP id m1mr949715wmg.150.1565818300170; Wed, 14 Aug 2019 14:31:40 -0700 (PDT) Received: from kherbst.pingu.com ([2a02:8108:453f:d1a0:28d1:9d88:57f6:f95b]) by smtp.gmail.com with ESMTPSA id r17sm2095134wrg.93.2019.08.14.14.31.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2019 14:31:39 -0700 (PDT) From: Karol Herbst To: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org Cc: Karol Herbst , Alex Hung , "Rafael J . Wysocki" , Dave Airlie , Lyude Paul , Ben Skeggs Subject: [PATCH 7/7] drm/nouveau: abort runtime suspend if we hit an error Date: Wed, 14 Aug 2019 23:31:18 +0200 Message-Id: <20190814213118.28473-8-kherbst@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190814213118.28473-1-kherbst@redhat.com> References: <20190814213118.28473-1-kherbst@redhat.com> MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Karol Herbst CC: Alex Hung CC: Rafael J. Wysocki CC: Dave Airlie CC: Lyude Paul CC: Ben Skeggs --- drivers/gpu/drm/nouveau/nouveau_drm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index 16441c5bf29c..b16157a9c736 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -910,6 +910,7 @@ nouveau_pmops_runtime_suspend(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); struct drm_device *drm_dev = pci_get_drvdata(pdev); + struct nouveau_drm *drm = nouveau_drm(drm_dev); int ret; if (!nouveau_pmops_runtime()) { @@ -919,6 +920,10 @@ nouveau_pmops_runtime_suspend(struct device *dev) nouveau_switcheroo_optimus_dsm(); ret = nouveau_do_suspend(drm_dev, true); + if (ret) { + NV_ERROR(drm, "suspend failed with: %d\n", ret); + return ret; + } pci_save_state(pdev); pci_disable_device(pdev); pci_ignore_hotplug(pdev);