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: 11094641 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 58E04112C for ; Wed, 14 Aug 2019 21:31:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 474CF209CD for ; Wed, 14 Aug 2019 21:31:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B91E2880C; Wed, 14 Aug 2019 21:31:49 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 EAF83209CD for ; Wed, 14 Aug 2019 21:31:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2AE426E85A; Wed, 14 Aug 2019 21:31:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by gabe.freedesktop.org (Postfix) with ESMTPS id 02E976E856 for ; Wed, 14 Aug 2019 21:31:42 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id z23so523870wmf.2 for ; Wed, 14 Aug 2019 14:31:41 -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=N2YrEp3nKZTIiLhVbuHe4Q+ctfV7Un8rVAeSESR2W9QPaCDtBBpVqZtSYnERal0Svl +DG176DVEQcCDGE0z7sWT8gECr5SO5oKToNoIU8jbDuvOfMNVdHlPvqv/xGac4sjA6ZS sIjQ8dfcIK4ybeiEH5+j4B2h/Fc0V5zl6IUyRk6Fmz+Hpiilg8+Jgmkcxacnv/Dej34w s+j5fCdr3aBv4GQdW6I5BBaw6YG3d+dWulh/Nvm97K4Hu91nriox5sqiDiOKu6mFZ6mO Sx5+UUl4fvzs5XG8hq2qgaRr4Ma0nf2udJPdEc0FCAVvkozUxjvVbxS5+Ba8cNCLMAzo Si3Q== X-Gm-Message-State: APjAAAViLa8acjnlrPvtwclCF4gWctTn2Aebj/2JT7jw/HQ5+9Gu9zkJ OVa2w+ZZ/sLM5otjsxTtfNXCLQ== 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 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 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: Karol Herbst , "Rafael J . Wysocki" , Alex Hung , Ben Skeggs , Dave Airlie Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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);