Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2161960ioo; Mon, 23 May 2022 11:33:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHcQ6DqqQEspJmeK2IIHQpMj/LQe9hc2I8C0xO34FXWHqpUXJYn4TP5by5br/rTaILqS6t X-Received: by 2002:a17:902:c643:b0:161:5c77:dad2 with SMTP id s3-20020a170902c64300b001615c77dad2mr24425414pls.76.1653330815567; Mon, 23 May 2022 11:33:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653330815; cv=none; d=google.com; s=arc-20160816; b=QzGz8sH0twVYTM6xkrh0bZyOq16x/a3xyCLZCqgSMRo6qDk7/c1QiW5HE5zPWNtRR/ Cwp1nVJfRFrdslnrNjWKkHS6az+vf/Lwo4rteff8T8kDviJ9ugvnNQt0wh589ewGwaSR cTvzuNmBzIaNb/pW8V5IkvSFfSYFGcDe9yErZmPxjW9a/zRsI68w9nT0n126poDjf1Cu 27UTJIfd9+W97vWUYk0q8WpYlkHnZSlGLVSCKW/b8eyWEcyHVuqugZCNWMCf2+P5tQlF JXIdeptu0HA7H24utpGTvzVlfPejde2nnxRfht/Pq+ovNHIq3p6yRQ2ngGIkxnu/boJY W4hw== 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=HXFpBNNnMLu5f6ZmZW6J1xJZHDoNOeGifQOouDtLC2c=; b=VwkGaql9zlB02KWAtZZwXZr6N0i4vCcxOOgzjYXTWmoPQbWMtj0UcRt/bkiS/svOvi 0P+GbKfwwcIIzGKraPHcW06YYWrJi3CZ45y6it1TqsUJV+hQPh1S+pM64gn6I3iMW6sx LPB8XgBZeQV8X0Nz0y7v02MsWQgNIOeNVA1fUg6ca6sK7ioyR/DGPItkYTUzZPabc3q2 W4xqefZ8mdtC1yVACHvXkbkRs3cHznLy8Og7XZBVu3jPNsbrJvP0ILKmPtZnUNgFUZpy fdwvGLL5v4V38k1/HjpCnnAHJU5+6NxXqHyoyhTU6xfgf1iClylLSrPQE2E8pjPREfPA vwmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LR6xZwlR; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id z16-20020aa78890000000b00518c539ce57si47435pfe.303.2022.05.23.11.33.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 11:33:35 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LR6xZwlR; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9F16713F92C; Mon, 23 May 2022 11:31:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244859AbiEWSLz (ORCPT + 99 others); Mon, 23 May 2022 14:11:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242302AbiEWRhc (ORCPT ); Mon, 23 May 2022 13:37:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0806344C1; Mon, 23 May 2022 10:31:17 -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 dfw.source.kernel.org (Postfix) with ESMTPS id E364261148; Mon, 23 May 2022 17:28:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA945C36AE3; Mon, 23 May 2022 17:28:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653326906; bh=uve6lQG0Rs3spEl1DAnzTI4/k9kptoBOUPHVS5a98SY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LR6xZwlRFcOEYFCS9+sHfqD7tl6TGV6QRYcCKEIvzOsY1tY4l7TLMl2BEu9JroU1W 7BHs1QuVlvGeXxx/YHbz8LvFc7cIFlGRt4XUd8rLIJpVR88QD3C+sE6nzoWdNwHDCk cwRat+uEoHC9RTxzLhQpjc4N7DVJESmQp4lzQ0K0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alex Deucher , Mario Limonciello Subject: [PATCH 5.17 063/158] drm/amd: Dont reset dGPUs if the system is going to s2idle Date: Mon, 23 May 2022 19:03:40 +0200 Message-Id: <20220523165841.302682275@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165830.581652127@linuxfoundation.org> References: <20220523165830.581652127@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=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 commit 7123d39dc24dcd21ff23d75f46f926b15269b9da upstream. An A+A configuration on ASUS ROG Strix G513QY proves that the ASIC reset for handling aborted suspend can't work with s2idle. This functionality was introduced in commit daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)"). A few other commits have gone on top of the ASIC reset, but this still doesn't work on the A+A configuration in s2idle. Avoid doing the reset on dGPUs specifically when using s2idle. Fixes: daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)") Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2008 Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 14 ++++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -1422,9 +1422,11 @@ static inline int amdgpu_acpi_smart_shif #if defined(CONFIG_ACPI) && defined(CONFIG_SUSPEND) bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev); +bool amdgpu_acpi_should_gpu_reset(struct amdgpu_device *adev); bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev); #else static inline bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) { return false; } +static inline bool amdgpu_acpi_should_gpu_reset(struct amdgpu_device *adev) { return false; } static inline bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev) { return false; } #endif --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c @@ -1046,6 +1046,20 @@ bool amdgpu_acpi_is_s3_active(struct amd } /** + * amdgpu_acpi_should_gpu_reset + * + * @adev: amdgpu_device_pointer + * + * returns true if should reset GPU, false if not + */ +bool amdgpu_acpi_should_gpu_reset(struct amdgpu_device *adev) +{ + if (adev->flags & AMD_IS_APU) + return false; + return pm_suspend_target_state != PM_SUSPEND_TO_IDLE; +} + +/** * amdgpu_acpi_is_s0ix_active * * @adev: amdgpu_device_pointer --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -2289,7 +2289,7 @@ static int amdgpu_pmops_suspend_noirq(st struct drm_device *drm_dev = dev_get_drvdata(dev); struct amdgpu_device *adev = drm_to_adev(drm_dev); - if (!adev->in_s0ix) + if (amdgpu_acpi_should_gpu_reset(adev)) return amdgpu_asic_reset(adev); return 0;