Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4225419pxb; Mon, 21 Feb 2022 15:18:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZwLtUY7MU/8wyVMienwg4t9EclMXczf1/DlOvjkVHiyTx6FlGaLhc/uesB3FgJXXRv0b6 X-Received: by 2002:a17:902:9898:b0:14f:18b7:f04a with SMTP id s24-20020a170902989800b0014f18b7f04amr20673291plp.127.1645485539737; Mon, 21 Feb 2022 15:18:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645485539; cv=none; d=google.com; s=arc-20160816; b=AslEtQbZNx0wIx9sdoSNZFvHqYP3I7ZF80H5XlxuSFwkZwCGwO6FxoDYkcWRBfa7So 8iIgl7WI4Y0aaL1/xQGe73zhuHFXj/IuscFclewCy6LWGL1c4CSWAGhw408YV/BFNqYd CYqbSF/gyVDP1KcjE9JdHi5HdMTlz/aAFSmogHplvpNAZoR8bRTDxv9m2zhlfn4AFv9H KA9Ka2uGBNCU/cl7ZNNoiW7BuD9TsfuAf4cyJAujp2dt4LiyVUhbGbQYUPwWlpVVuvfK OZeUdEPUIgNvW1+hh9579QFs90VmsnmhMx5m7yvMpP52+XWhJsbEIFue2Am4Lbs49ns3 plPg== 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=j9HtjdGD16IN3wF9VAMBlFcuhxM/DomCD/vab25vQuw=; b=Vs9fmcP5AOg9vCidpAVbqUaI9S/97a27+zAUZjaCuMZKz8gRwttWWty5uh7CPTZW1L /9alcRHlcgKN2c38dFVESs+EsZRY2A+vmWx+oc9al9FJJdSZLDRcpt4jEP9BPwbg+TID SgLx6+HfUVmwvzoXINZrlgsr/y5F0ar0+qW8tuhUtv+azuQbtsK9ay3EMDDv5tJkVJgZ QYCDBmKU3VlxalSnZ9G6QDMQH0d2//4uk/toaegsWgT36vf7uQAvQChVWYJCH8mFV0uc pDUJ3TmrZjLoWpkNo1wIVG2LCeb4SYzApPANF5tyGCNcP8FJbGNBw1tgMBQ2solBysw5 GS8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Bp1w0gNN; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z17si10714015pfh.116.2022.02.21.15.18.44; Mon, 21 Feb 2022 15:18:59 -0800 (PST) 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=Bp1w0gNN; 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 S1354304AbiBUJ6W (ORCPT + 99 others); Mon, 21 Feb 2022 04:58:22 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352293AbiBUJrT (ORCPT ); Mon, 21 Feb 2022 04:47:19 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8235026572; Mon, 21 Feb 2022 01:19:22 -0800 (PST) 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 sin.source.kernel.org (Postfix) with ESMTPS id 015B7CE0E76; Mon, 21 Feb 2022 09:19:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E87A9C340E9; Mon, 21 Feb 2022 09:19:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645435159; bh=+qyjXe69TfewTByTir3dxcvjKuJiAOpcbb+rC9WdSJA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bp1w0gNN/o5CoTiXy6+/0AuD8B2/Wslw7g1QtQH5ArbsnZskDlyzLmEejb/yxqLps 4hxq3rr+6/QHkNpvGQj1qM+oGHXyUPPwA6CPdbJOOBm8sTarHFf60PUQ3f/WhDdwhH UBOhM3VYkX6DJKlcWLt3Abj1KwF42OAhQWAFZg+o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mario Limonciello , Alex Deucher , Sasha Levin Subject: [PATCH 5.16 065/227] drm/amd: Only run s3 or s0ix if system is configured properly Date: Mon, 21 Feb 2022 09:48:04 +0100 Message-Id: <20220221084937.032051177@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084934.836145070@linuxfoundation.org> References: <20220221084934.836145070@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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,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 From: Mario Limonciello [ Upstream commit 04ef860469fda6a646dc841190d05b31fae68e8c ] This will cause misconfigured systems to not run the GPU suspend routines. * In APUs that are properly configured system will go into s2idle. * In APUs that are intended to be S3 but user selects s2idle the GPU will stay fully powered for the suspend. * In APUs that are intended to be s2idle and system misconfigured the GPU will stay fully powered for the suspend. * In systems that are intended to be s2idle, but AMD dGPU is also present, the dGPU will go through S3 Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index c811161ce9f09..ab3851c26f71c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -2236,6 +2236,7 @@ static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work) static int amdgpu_pmops_prepare(struct device *dev) { struct drm_device *drm_dev = dev_get_drvdata(dev); + struct amdgpu_device *adev = drm_to_adev(drm_dev); /* Return a positive number here so * DPM_FLAG_SMART_SUSPEND works properly @@ -2243,6 +2244,13 @@ static int amdgpu_pmops_prepare(struct device *dev) if (amdgpu_device_supports_boco(drm_dev)) return pm_runtime_suspended(dev); + /* if we will not support s3 or s2i for the device + * then skip suspend + */ + if (!amdgpu_acpi_is_s0ix_active(adev) && + !amdgpu_acpi_is_s3_active(adev)) + return 1; + return 0; } -- 2.34.1