Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3609608iob; Mon, 2 May 2022 00:30:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxi6gbJktwdcmS69jf8vJGwcXYzwKl8BSB3YzY8GwFqQF0koDgDMWMsznIQJdzpYI4oilSl X-Received: by 2002:a2e:84c8:0:b0:24b:50bb:de7d with SMTP id q8-20020a2e84c8000000b0024b50bbde7dmr6851254ljh.40.1651476623525; Mon, 02 May 2022 00:30:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651476623; cv=none; d=google.com; s=arc-20160816; b=RamPaPSn/A9a3MBpneN94vCIVS6xj8jRm6lbwAAQdQHkxc/QXHlSdKZqJfN7qRAnI8 IgvMZ3jnCulLYD8vq1VtukD+6LeToZwKgt9XTyJj64bUIOFHEjWg2hBcxOb/JmiAfeMw gkJgyV/pOsdO1h1VWSjD+JonAGmFUnsUIhPpzh1vbd5AniBelF4KOD+7rL9WLNA6Rgc6 TAiz3DAxq82ij8+bCCh5V9S/ogZVOt96xSbPkhzhNLEPBCswcLqOpXr8CfaAplOfZg8D +6qZrBL/T2ULbSFglIIqAN4ScnrToV4p7aRT5qkYTumRFNRAevgDt5Cm1RB/dMBMIIxn EURg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=z1rGv7kZp0yDOAaWzBdgoAXrxLPk0jisSwtCucM3UMk=; b=J4OidcOVcaIAAUUAtaj/lAADAaXGhRCUxN2GFGuoDbEY5Ww6JU4iccu/vNDJkGWYpI Mdq4pHaQfaTceId3JjgYqEfyn3I9hQP9Ak1A7OC7YXOnwqwwp4C3zCYeYEiwj84SBqKz dUaCWdrdyY4Huuset5HM22H/2MU9OMnzqfNiSXGZvnbcTfHJMCSYfZQuet9033K0PicS DyQHdERFgNEdWCMSy/bl1WDG2qc3o85RBsgRtOABr3ZQL7tk/WN4eySiALyV2unvo6Qu VCkfWGFFJR/LubKx0fHBasH9/wUhqodWoTvNh0D12BJUMQNrL4zw6Oe0QEPcadmvz4nz vNgQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h14-20020a2ea48e000000b0024f17824f52si14587834lji.507.2022.05.02.00.29.56; Mon, 02 May 2022 00:30:23 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243809AbiEAHSA (ORCPT + 99 others); Sun, 1 May 2022 03:18:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234593AbiEAHR6 (ORCPT ); Sun, 1 May 2022 03:17:58 -0400 Received: from mx1.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30DF840902 for ; Sun, 1 May 2022 00:14:34 -0700 (PDT) Received: from [192.168.0.2] (ip5f5aed6d.dynamic.kabel-deutschland.de [95.90.237.109]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 9AF5F61EA1923; Sun, 1 May 2022 09:14:32 +0200 (CEST) Message-ID: <232384f1-c888-33f7-07dd-b99545f1b115@molgen.mpg.de> Date: Sun, 1 May 2022 09:14:32 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCHv5] drm/amdgpu: vi: disable ASPM on Intel Alder Lake based systems Content-Language: en-US To: Richard Gong Cc: alexander.deucher@amd.com, christian.koenig@amd.com, xinhui.pan@amd.com, airlied@linux.ie, daniel@ffwll.ch, amd-gfx@lists.freedesktop.org, kernel test robot , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, mario.limonciello@amd.com References: <20220429160604.2608782-1-richard.gong@amd.com> From: Paul Menzel In-Reply-To: <20220429160604.2608782-1-richard.gong@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,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 Dear Richard, Am 29.04.22 um 18:06 schrieb Richard Gong: > Active State Power Management (ASPM) feature is enabled since kernel 5.14. > There are some AMD Volcanic Islands (VI) GFX cards, such as the WX3200 and > RX640, that do not work with ASPM-enabled Intel Alder Lake based systems. > Using these GFX cards as video/display output, Intel Alder Lake based > systems will freeze after suspend/resume. As replied in v4 just now, “freeze” is misleading if you can still run `dmesg` after resume. Kind regards, Paul > The issue was originally reported on one system (Dell Precision 3660 with > BIOS version 0.14.81), but was later confirmed to affect at least 4 > pre-production Alder Lake based systems. > > Add an extra check to disable ASPM on Intel Alder Lake based systems with > the problematic AMD Volcanic Islands GFX cards. > > Fixes: 0064b0ce85bb ("drm/amd/pm: enable ASPM by default") > Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1885 > Reported-by: kernel test robot > Signed-off-by: Richard Gong > --- > v5: added vi to commit header and updated commit message > rolled back guard with the preprocessor as did in v2 to correct build > error on non-x86 systems > v4: s/CONFIG_X86_64/CONFIG_X86 > enhanced check logic > v3: s/intel_core_aspm_chk/aspm_support_quirk_check > correct build error with W=1 option > v2: correct commit description > move the check from chip family to problematic platform > --- > drivers/gpu/drm/amd/amdgpu/vi.c | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c > index 039b90cdc3bc..45f0188c4273 100644 > --- a/drivers/gpu/drm/amd/amdgpu/vi.c > +++ b/drivers/gpu/drm/amd/amdgpu/vi.c > @@ -81,6 +81,10 @@ > #include "mxgpu_vi.h" > #include "amdgpu_dm.h" > > +#if IS_ENABLED(CONFIG_X86) > +#include > +#endif > + > #define ixPCIE_LC_L1_PM_SUBSTATE 0x100100C6 > #define PCIE_LC_L1_PM_SUBSTATE__LC_L1_SUBSTATES_OVERRIDE_EN_MASK 0x00000001L > #define PCIE_LC_L1_PM_SUBSTATE__LC_PCI_PM_L1_2_OVERRIDE_MASK 0x00000002L > @@ -1134,13 +1138,24 @@ static void vi_enable_aspm(struct amdgpu_device *adev) > WREG32_PCIE(ixPCIE_LC_CNTL, data); > } > > +static bool aspm_support_quirk_check(void) > +{ > +#if IS_ENABLED(CONFIG_X86) > + struct cpuinfo_x86 *c = &cpu_data(0); > + > + return !(c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE); > +#else > + return true; > +#endif > +} > + > static void vi_program_aspm(struct amdgpu_device *adev) > { > u32 data, data1, orig; > bool bL1SS = false; > bool bClkReqSupport = true; > > - if (!amdgpu_device_should_use_aspm(adev)) > + if (!amdgpu_device_should_use_aspm(adev) || !aspm_support_quirk_check()) > return; > > if (adev->flags & AMD_IS_APU ||