Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3675809lfo; Mon, 23 May 2022 11:05:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAZBRexPut6peh0r/0x9yaXDspz1aJ/+EFdGhetxlBTdNK4eWCaeO+0nK5Spwl3a0yyx4b X-Received: by 2002:a63:2b11:0:b0:3f6:5f7f:9e67 with SMTP id r17-20020a632b11000000b003f65f7f9e67mr17097324pgr.492.1653329141679; Mon, 23 May 2022 11:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653329141; cv=none; d=google.com; s=arc-20160816; b=b6+WA+l/8X6YsU9cqkgr34cvOocqTcewnlSzOy4Dw9WqDKYdKT+4+9qNpYTOQhaLO9 rOgGV4E/SoXTZ6PNN+gYNJsnAPVqcV5AdNjbz6X11BKQ6/1kTpiCL5Hv/ucnq66JrMO9 mhbmqY+FQHmBtoc4QfOSAo8F+O80IxGKpV1SRwzwaX6JObspuJPfbCemNUK323G+d1Rb gGzPIuXLxQ9/NzOIGZVaZ7K+EnNPgB9ljaFxcE2hzMtl5fzTICTxmq1vgxdv86MuPSLe xbwjvKF5IXTzKslBvUO81fAHvLm0EVEF+MZHdJ0PG+ZCLjJLUQct/izN1xWlOv8gwN1c OAuw== 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=gVUNBzkuuhWMwaRay42BPsM+OQFw2QybhyaIYehXUvc=; b=GHkIacS40Kn3faB9rhOpNZfimNYhRfhlhw6Gh5t7JWUEkLJStbYK/hYPXWR+L5yJdl IH5OSCz9kkgMuCzOUsblPHwu6dbsEYGgheoiOdSW65vRIuuYCCu+V8D53ITI018d1kLD mbXdOrwFhWPgFctLogCmE7SMhCy9pU7LT81GfXmVYMkoJDX4Af2VEFiV48evOlSzlPZe Xg80zZbfNQho1/GnPqFcYcJx78TzxZZJeJBvfg+ovi03Apk+ueJwYtK+8UsJdjnNFA0/ TDM6W3eRZ2+sn4EA/ihUoeJomBGkTzzP5l7TuqwFV8/WmIfiWqWVqxhuDIDJrJeO6n5S u3kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XlFTOwx1; 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 a1-20020a056a000c8100b005183f5deeebsi14669662pfv.302.2022.05.23.11.05.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 11:05:41 -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=XlFTOwx1; 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 out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C3B9C1356B6; Mon, 23 May 2022 11:03:13 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243379AbiEWR4p (ORCPT + 99 others); Mon, 23 May 2022 13:56:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240700AbiEWRZ3 (ORCPT ); Mon, 23 May 2022 13:25:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8796826CA; Mon, 23 May 2022 10:21:00 -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 2A9F960B2C; Mon, 23 May 2022 17:19:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2CC80C385A9; Mon, 23 May 2022 17:19:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653326358; bh=kJQnIv0zbQ2WoIW59ZTVhkTxl3Pr7mNNhYzUc4U7vMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XlFTOwx1XdwcQ8U4PgAMYc7sIBcS+Y9Vq1M2pBAq8tBbfHca7rO1R/GvnmIZw9RaX O5FsGVSf2LoFoZbRt3vDHLWl8DZprcKX2heXDIuqcSAoy6n7a2/5W5EZ0llj7/z3MR kdJAhRc59RGkxkkX5O1923sHXSMorslJX+V7lJMY= 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.15 057/132] drm/amd: Dont reset dGPUs if the system is going to s2idle Date: Mon, 23 May 2022 19:04:26 +0200 Message-Id: <20220523165832.711355112@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165823.492309987@linuxfoundation.org> References: <20220523165823.492309987@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 @@ -1411,9 +1411,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 @@ -2259,7 +2259,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;