From patchwork Sat Oct 22 07:23:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7768 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1121041wrr; Sat, 22 Oct 2022 02:27:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6hwvTPnIrcrOwMdXEbFQ1/w/Px44iwDdmQKs3FBINS3OnBpzbhY9O86SO/CUC8osJ3Rsmu X-Received: by 2002:a17:902:7c11:b0:178:a6ca:4850 with SMTP id x17-20020a1709027c1100b00178a6ca4850mr24264043pll.111.1666430838042; Sat, 22 Oct 2022 02:27:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666430838; cv=none; d=google.com; s=arc-20160816; b=frqsRlc6fEwqU3nxUatOI6NRDPuOVUpyNnquSzWTk+fewjypAjt7cWoIww3W7VCeUB oTtsH36mXDzNrOF0hY5SzDHO75cOpn9NcY+WTq4stNXrSfMn6mA8d3qs4TqmLr594liN 1MLZCC9xjWOWJL0F64twKb9Pebyio6vnM5FqEC+rRFPOe3oXrd+6KhS4VKa3/8iflEyU pilS7Mi/kXb1cwWFNouH1DeZQ7vrjs6g8XAz6AHgt3/kKr9rziRBIpWfhXFL5nNAEzEK ebE4LpY6UP1em3cL18EYleXWsFfll58K3dg6/0t/OAJMPyL+UmJXy/CEfPXuAFCaW1G+ YBAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hYr81rnz6b9axV9drCfEuwHsAti1mmV8bbWOF9tVjbA=; b=SEnRh8VLVnXu9BbCX1rHPKOECq2xP+oguvW+6dFc1n03orpljle9fGsseRLXF5c1RT FUkofLYHlHYyVi9FncETBE5gsMFyq610dIsx9pNlJo3bGglTWVqO5l/EwUMFJA0qmkhU bJ3ZYBozDV9U51wJofKDLGYbU67b56QC+NKLTXugIdHqN95JbvBf70MIegW6HaCQonZk hjUwhyScaDrsV0qmAs829ZR2sjAsqgTpHPSu1EemZs9oMg5js/McOv9wax3dAxOJxhEI 5A8aLS7iFGeiE2sCx85FLazBpmBeF9sgalyAJ2C+BIcSGTvIKGhWjpi2/JXntlmfDnkt 55lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=t38+x8Wk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q13-20020a17090311cd00b00172f8a4b3e1si30948246plh.81.2022.10.22.02.27.05; Sat, 22 Oct 2022 02:27:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=t38+x8Wk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233112AbiJVJFP (ORCPT + 99 others); Sat, 22 Oct 2022 05:05:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235102AbiJVJDq (ORCPT ); Sat, 22 Oct 2022 05:03:46 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEEB22FBDF6; Sat, 22 Oct 2022 01:18:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C409CB82E04; Sat, 22 Oct 2022 07:48:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 214A1C433D6; Sat, 22 Oct 2022 07:48:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424897; bh=pP2r2bExKP4Le3wtAbMnar0v4Dk3GywGU3NbELH8LRo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t38+x8WkoAe7YJOx4avhVAz6+MLQ+4pvrun6ks6zv9mzakIQXPuWWfbx8vPgy9XuM 3c1zcyMQvdYP3D0JNfGF7/6jNcuw96M9pveZ5GAz1mu2iE96C0lcM1WllhdayNt+WQ BkbsZ66TTqji7ffsaJOGruq9c8oIaKqgkd+EnZSc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yang Yingliang , Alex Deucher , Sasha Levin Subject: [PATCH 5.19 317/717] drm/amdgpu: add missing pci_disable_device() in amdgpu_pmops_runtime_resume() Date: Sat, 22 Oct 2022 09:23:16 +0200 Message-Id: <20221022072508.171109408@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747379382266389583?= X-GMAIL-MSGID: =?utf-8?q?1747379382266389583?= From: Yang Yingliang [ Upstream commit 6b11af6d1c8f5d4135332bb932baaa06e511173d ] Add missing pci_disable_device() if amdgpu_device_resume() fails. Fixes: 8e4d5d43cc6c ("drm/amdgpu: Handling of amdgpu_device_resume return value for graceful teardown") Signed-off-by: Yang Yingliang Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 8890300766a5..5e8ca32bc3a9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -2548,8 +2548,11 @@ static int amdgpu_pmops_runtime_resume(struct device *dev) amdgpu_device_baco_exit(drm_dev); } ret = amdgpu_device_resume(drm_dev, false); - if (ret) + if (ret) { + if (amdgpu_device_supports_px(drm_dev)) + pci_disable_device(pdev); return ret; + } if (amdgpu_device_supports_px(drm_dev)) drm_dev->switch_power_state = DRM_SWITCH_POWER_ON;