From patchwork Mon Oct 24 11:29:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9737 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp548562wru; Mon, 24 Oct 2022 09:41:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Tv/mB9AvEQpI/XI8ebOVorpb7c11Lw3OoyYs+4XJXbl7gau/O1pXw/KOIgD0+cGWpa4At X-Received: by 2002:a17:902:7598:b0:178:3f96:4ffc with SMTP id j24-20020a170902759800b001783f964ffcmr35434665pll.53.1666629711145; Mon, 24 Oct 2022 09:41:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666629711; cv=none; d=google.com; s=arc-20160816; b=PIFP0wfJ7JF3iPwkTHEl0KoVDPrlM/UzAj27j+0kApFcujZGnl3NdhrnMelPr1kN2T Qa7eZztJkg6LA/Di0GysbVeUc2PODkl50Z1c+hcu0S7hfWzeAEn5CG3CK0ivBS3+8bWL Lpj4vvMpL/+COzfUqnVPsuidAoffaI17j5g4RnT1Dy+1Qg3mOM0isuoxt8ErAPjTTWtN giNQMzWOcAO7SW8oLXKJmfKDyyjhQhpeIaw1J8QWdKdozTDdO8POFKGJDKZVAuy6BD1Z j2KIBBsiO3jNQGsHiuowX0O1YfSPNFeEbVtqUEKGPyjoBveZyv0b9ud5CjXl4z6lHsBF mmYA== 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=1yQOtgydmUl2nPvjzvehK95tBOz8pJKQIKJiQsnoNNc=; b=hHOi6303cMUUH75sGX05yj9kGv5iEr5nkWVPHFML2RLsKGpvBY1Ybn74MegzTtVazr 8PUVzHqSh2o8k+WRk3mD97VdQSh4sr8IJTo5uC6DvcNMi2FtBGp0/YUeEPYVzfvt/wGA 4z2bLpJLJqbSKfZxeq5vPhcs3r0usiRtPT2P/OEJBN+dFzqVwOUd7EY8dXlhRepHNFaJ oefH89FybDA5vgPFqSaKN3Xf1QO5FoakW3xiKcVyggy/hPV2Gel2myA6NLtWQsNe2+ig 586XtEsEHTbBgaA4Bii74SuKI7jiIsRydgvoz2Shg4f19ttPpZ/iGmIHiHEaWsuCUPTz 29Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=k2A3GJDA; 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 l3-20020a170902f68300b001865f96f6f7si18209622plg.104.2022.10.24.09.41.37; Mon, 24 Oct 2022 09:41:51 -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=k2A3GJDA; 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 S232869AbiJXQlD (ORCPT + 99 others); Mon, 24 Oct 2022 12:41:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234469AbiJXQk0 (ORCPT ); Mon, 24 Oct 2022 12:40:26 -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 81744C897E; Mon, 24 Oct 2022 08:27:40 -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 9CB64B8199D; Mon, 24 Oct 2022 12:42:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0794AC433D6; Mon, 24 Oct 2022 12:42:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615374; bh=JPKDlQyX1Or2SBLLYAGOShYpJEat7kKOamVfIL6mTxE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k2A3GJDAweXGWSsB6gLsHUkEhC3H1abonswXTI+zI6iqnrTEql7r9/Xe0M1X853Pi Qc/9jS84l1iUxMeP0CSKX8SiQeqIWBnGxqI3JgFryaCrmAFwEq49HQu7F7mOsfiem2 FhOcz8WqSP4x0HJXaIHjUA/6NPifkOvbky+7gHgY= 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.15 225/530] drm/amdgpu: add missing pci_disable_device() in amdgpu_pmops_runtime_resume() Date: Mon, 24 Oct 2022 13:29:29 +0200 Message-Id: <20221024113055.272733791@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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?1747587915739318975?= X-GMAIL-MSGID: =?utf-8?q?1747587915739318975?= 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 f65b4b233ffb..28dea2eb61c7 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -2415,8 +2415,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;