Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp142934rwe; Fri, 26 Aug 2022 02:18:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR4QO7rAbjvXDnpFvO0k4FicLOY+OlOVJQU+fZloh9j1Mv7NpJLNfQ5qoKAOQgq1ZXTiMTTS X-Received: by 2002:a05:6a00:e85:b0:52b:5db8:f3df with SMTP id bo5-20020a056a000e8500b0052b5db8f3dfmr3035017pfb.14.1661505492043; Fri, 26 Aug 2022 02:18:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661505492; cv=none; d=google.com; s=arc-20160816; b=zsDHRVYMm9aoNNL/BYMBC3ZraWQwqN9SCaXPobUSJDWjpas4ZJaqJk2w4mcKWRAQXk uVcAW1tTCWW3paSbKQO7y0kswXqZj36XbU+v9H4FVXUcb6A5lPa1pdiO5NCHokJCtRDI BvQOndxhX8V3TGdsiqQX9AUKialBX7C8URTpx3fCS8npvdtwFO8nxplye4kbzImGkVmR HjoJibnYeYPswH5qJk61lPwWZ6KEqAHbnVt6/zHNVRtSWksunTpo7S0LTMEGJ0KH3WpA OghCAtE0o+bkxXN7PNKMq1b5f5992lSmLKmxPUmhXPgSTwV+IJkP0OCDlU+0Vjkx1rvY stDg== 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 :message-id:date:subject:cc:to:from; bh=jWWqsuR/jiVsFSaL8ICmD+u8h2hbE9FbSQ9Y4TSa8/s=; b=oUjTLhmRiP3cn5aK46GStQ8snsZLFc7hZ9jyoHKMYPuSV2y2NRXEVJPqrByMkgfywv XnsEmQnEPGk+U/gSoZVmOWckP/wsfM3zhH+1Hyg7PWLbEh7gn5k0eHd8np4I968EpQFB cGXEzh5pKPkHXPZj/GFaqpfw3+j5IrtVCidNlHPFo2GUfM8mdX/nTpyJBeL2ZKuIqMcp pzkBOjqz19jY/FmrxV5bXuInhFNJxAS5OadIwPVipzgvx37c0hcrUYY2s+GksUSetFxe BfYzrhFrG66thpTlln9g1eZ0/ow8EdMgiiq0HEgS31u6/TDt65xX/1zdj+Gw1JNsMMdg QOAg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 20-20020a630114000000b00419facbc543si1210436pgb.691.2022.08.26.02.18.00; Fri, 26 Aug 2022 02:18:12 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245489AbiHZIuH (ORCPT + 99 others); Fri, 26 Aug 2022 04:50:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245472AbiHZIuF (ORCPT ); Fri, 26 Aug 2022 04:50:05 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BAFD23179 for ; Fri, 26 Aug 2022 01:50:03 -0700 (PDT) Received: from dggpemm500024.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MDYQD19QCzGplx; Fri, 26 Aug 2022 16:48:20 +0800 (CST) Received: from dggpemm500007.china.huawei.com (7.185.36.183) by dggpemm500024.china.huawei.com (7.185.36.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 26 Aug 2022 16:50:02 +0800 Received: from huawei.com (10.175.103.91) by dggpemm500007.china.huawei.com (7.185.36.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 26 Aug 2022 16:50:01 +0800 From: Yang Yingliang To: , , CC: , Subject: [PATCH -next] drm/amdgpu: add missing pci_disable_device() in amdgpu_pmops_runtime_resume() Date: Fri, 26 Aug 2022 16:57:54 +0800 Message-ID: <20220826085754.2296572-1-yangyingliang@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500007.china.huawei.com (7.185.36.183) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 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 --- 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 429fcdf28836..de7144b06e93 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -2563,8 +2563,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; -- 2.25.1