Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 23A8FECAAA1 for ; Tue, 6 Sep 2022 15:56:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BAFD710E045; Tue, 6 Sep 2022 15:56:55 +0000 (UTC) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2069.outbound.protection.outlook.com [40.107.243.69]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8F8FF10E045 for ; Tue, 6 Sep 2022 15:56:52 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EU9yltqEtJMQ1vkN/WyESXfsGFENYYE50o6o+UCj/6FjMdAk+4JJ+YmIdbiKHJ0sGmVethxbIZI2c2pXacBYy5GRJopiygqG8SksniGdNZqV0jEGGf7zL4QVlPN+TR0TCUlnBaagHeyvccB2aIi1WXmI3YB3ittseaT/DaWVobrMIjxGD2IloIWVxfuzAxzNRkgjwF2nItvLZnHmSATSc9ExcbLPTX8wOva+A1r7fnpsPHuD/cUGWFSFUfIsnQ/OJZi0vxN7rPCcvJUM5ogr4Z2852Udp5CzPs4iPFHH86eUwlN33ubgEdsUO0FBDuqbtSLYDuNqciRBziw7xDBneg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=piq2GV3S+vg2FO/Dy3qDVudvBXd+j32ovQDYQvMMxQc=; b=R8y7uhiK/H+nG/0ku5Vtbdn9xdVZOVbjTfIZKvmUH0+3I4vF0VK6IYLPGeAxosV9tfH8HlxYM4/OyIujd4wuaGSo7535QD0k6csB+1thkWWLdf8bF5ouNFHS/57lste4iVZD79sLgiC/sFr9pFNLyjVwbY/P85a2rNNsfHYvu8Sl7KGys2wzj2RbgQp6Oz3Oki4mXj9Hhukjk+pYCA+0+0Z+bfqFwysUBrIPImwusBaqmR+sGPb0jUT8YWr/bf3lATHG0gfZ2IMF3s8v1d9JndsYd8a01Sdf3qMUMn4vaocXxvrXImVeVEohZeNA6I4e3VjYQziZhM99GO9BVAgFDA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=piq2GV3S+vg2FO/Dy3qDVudvBXd+j32ovQDYQvMMxQc=; b=IlzJvzfFG9uj0Oyh9XT1RA9HlExx6HvqatZ8ofgWeDrK8x3D50PRUFOixId6+20rpr1METEVi+pvJMJUHDNENcNWI06SoDloAusP/38UYpTktnSK91Dp6dkJ/xPlHg6/ahotx4qNmZ8eLs4vAQhkWYw3wUnhLnyDbyCdFEXZAt0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BYAPR12MB4614.namprd12.prod.outlook.com (2603:10b6:a03:a6::22) by PH8PR12MB6868.namprd12.prod.outlook.com (2603:10b6:510:1cb::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10; Tue, 6 Sep 2022 15:56:50 +0000 Received: from BYAPR12MB4614.namprd12.prod.outlook.com ([fe80::2925:100a:f0b9:9ad8]) by BYAPR12MB4614.namprd12.prod.outlook.com ([fe80::2925:100a:f0b9:9ad8%3]) with mapi id 15.20.5588.016; Tue, 6 Sep 2022 15:56:50 +0000 Message-ID: <9c0f87b0-b336-989c-b339-ac92c83b1fc1@amd.com> Date: Tue, 6 Sep 2022 21:26:37 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: [PATCH v2 1/2] drm/amdgpu: Move HDP remapping earlier during init Content-Language: en-US To: Alex Deucher References: <20220829081752.1258274-1-lijo.lazar@amd.com> <3b2a9a8f-dedf-2781-0023-d6bd64f16d65@amd.com> <1890aec6-a92d-e9b7-a782-fd6b0e8f8595@amd.com> <9ef0287a-e463-d440-58fe-0323a6eca94a@amd.com> From: "Lazar, Lijo" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PN3PR01CA0170.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:de::12) To BYAPR12MB4614.namprd12.prod.outlook.com (2603:10b6:a03:a6::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5030b712-907a-4512-8c44-08da90206869 X-MS-TrafficTypeDiagnostic: PH8PR12MB6868:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jfjAbW88/gWPuhY6NfnkyZ+T5f9ho54j6tZ+wvmRVrX9C8qRNVa6DD4Cggqybygjf3ULahbkMTiInH33PViz6zoVHq7ofPTNiaUP1yQb7FBPk3uuwf7wepVZByZur1TI9XChmJBH9Ggt1YZnsk2sxn5zX0A9aDg2LRLTnc4Pm6mEpwPiDVwjK64sOtbMd2Nn5QHHi+bu9CLP+vs+t4btx1UJ1hrOmHGQ3NfyGJNoTTR5coOyoy3yLUdZIWKddAjzjdJNf9rRt/HyPd/rUCTPoi5elsO0tydUFpOsTPe6DMhR0hSyqBhP9hFZR0CH1HabVUlZIfaEfDL713YnGQq5zN8AoKvWN6E2infgE8essdFJthmvwYgMKIHTDhXZntpzPuIUhtwfapKyzm5z1WBm3qVb/cjOMH4MiQVgyZm+biO1ji+Rh61HsfIGIRcfec+b56IyxgODh8BKvP4bYKDheKwAv8pWPt6nIihVRXhZgsaiK65Ox7tCqYJNZESvhFVaPiKOIm1lCElDdv9EhBd+P45ZxmQs4uSeYNklA5h7sPwxAv6KiVg4gugqvzwCLgHyFIolnzKmF8612ASSRFABu9sn8wCsRowvTI/EBSKAf9UIxLqP83vNzxNCdtUnjreAR1xUJp0ynS6AkNN+0VwDPXvxyyu8NE+twukNJGBNK/hVsiFCuwaYPhOZJQN+I0OPnzG0bWpG9wYo5/pBfjllI4DxGP0/uBJux3A2C+a8Y2IsDGmF7mEFO4dT/ZTcGSEtGLTDTXNw1v69uiDYhhKDlwkhN8BpIov9BAePowMr0dX7eWU088QsKK7rJEXk6nTwr8jygjsQ1c5pfkrm1hgHOg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR12MB4614.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(396003)(376002)(366004)(346002)(136003)(39860400002)(36756003)(66476007)(478600001)(30864003)(8936002)(66556008)(8676002)(4326008)(6916009)(316002)(966005)(66946007)(2906002)(31686004)(41300700001)(45080400002)(6486002)(2616005)(53546011)(186003)(6506007)(86362001)(6512007)(31696002)(6666004)(83380400001)(26005)(5660300002)(38100700002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dlYyNzJCZlFOZGIyWDBPeGxaTGlkTWVSV3l0aVBQd3NYZ29DK1pKRlpHS1lx?= =?utf-8?B?OFJtUkFZd0Ruby91YXpIc0ZtMlRIUmk1SUdyQnZlTzJQVHQzQ1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ZDBPYnBWL1M1Y1hsNVpnbFl5c0lNdGJycWQvL0p5?= =?utf-8?B?b3VOdUZ0Y1FEa29uSDduejFKSnVTYkZQc0lDSXJvYlJrYnZyZWdHZitRUzhJ?= =?utf-8?B?cGNhUUk4TW5GYUpqakFtQ0ZjTkRuS2pmREhpU0ZVUld5TDhKZ2tNTnRlVnNW?= =?utf-8?B?dWRxcGx1WVVXTm1xa01SQWZqUHZURlhOODhMNzBZMktYU0pyYjJ6ZWR5WWRu?= =?utf-8?Q?za+sD2Oi7u0CeQrNIBsUxceZh?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5030b712-907a-4512-8c44-08da90206869 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB4614.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2022 15:56:50.0821 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: iIICLKL8NrckwFapu1uHbjgtRyP1qH/eth1ONlU4zwBFAEEKOQX+zPAPuFnY2yv8 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6868 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Felix.Kuehling@amd.com, stable@vger.kernel.org, tseewald@gmail.com, helgaas@kernel.org, amd-gfx@lists.freedesktop.org, Alexander.Deucher@amd.com, sr@denx.de, Christian.Koenig@amd.com, Hawking.Zhang@amd.com Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" On 9/6/2022 8:55 PM, Alex Deucher wrote: > On Mon, Sep 5, 2022 at 1:27 AM Lazar, Lijo wrote: >> >> >> >> On 9/2/2022 1:09 AM, Alex Deucher wrote: >>> How about this? We should just move HDP remap to gmc hw_init since >>> that is mainly what uses it anyway. >>> >> >> Sorry, I missed to R-B the previous version. Did you find any problem >> when common block is initialized first? >> > > One of the users on the bug report reported an issue with that patch, > that said, that user seems to be seeing a slightly different issue > since he is on a gfx9 card and the original reporter was on gfx10. > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.kernel.org%2Fshow_bug.cgi%3Fid%3D216373&data=05%7C01%7Clijo.lazar%40amd.com%7C5d6d4da1be4a4194b7cc08da901c0bb4%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637980747398632310%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=hHoh2YpQ2vpjsRTEqI1vIRY4YQmzfFi5%2FG%2Fnh6vNuds%3D&reserved=0 > Yes, I see Bjorn already pointed to another potential issue in LTR enablement. So regardless of init-common-first patch, the new error will be reported and that is unrelated to the original reported error through AER. I still think init-common-first patch is good. Thanks, Lijo > Alex > > >> I think that patch provides a consistent IP init sequence during cold >> init and resume. >> >> Thanks, >> Lijo >> >>> Alex >>> >>> On Tue, Aug 30, 2022 at 2:05 PM Alex Deucher wrote: >>>> >>>> On Tue, Aug 30, 2022 at 12:06 PM Lazar, Lijo wrote: >>>>> >>>>> >>>>> >>>>> On 8/30/2022 8:39 PM, Alex Deucher wrote: >>>>>> On Tue, Aug 30, 2022 at 10:45 AM Lazar, Lijo wrote: >>>>>>> >>>>>>> >>>>>>> >>>>>>> On 8/30/2022 7:18 PM, Alex Deucher wrote: >>>>>>>> On Tue, Aug 30, 2022 at 12:05 AM Lazar, Lijo wrote: >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> On 8/29/2022 10:20 PM, Alex Deucher wrote: >>>>>>>>>> On Mon, Aug 29, 2022 at 4:18 AM Lijo Lazar wrote: >>>>>>>>>>> >>>>>>>>>>> HDP flush is used early in the init sequence as part of memory controller >>>>>>>>>>> block initialization. Hence remapping of HDP registers needed for flush >>>>>>>>>>> needs to happen earlier. >>>>>>>>>>> >>>>>>>>>>> This also fixes the Unsupported Request error reported through AER during >>>>>>>>>>> driver load. The error happens as a write happens to the remap offset >>>>>>>>>>> before real remapping is done. >>>>>>>>>>> >>>>>>>>>>> Link: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.kernel.org%2Fshow_bug.cgi%3Fid%3D216373&data=05%7C01%7Clijo.lazar%40amd.com%7C5d6d4da1be4a4194b7cc08da901c0bb4%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637980747398632310%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=hHoh2YpQ2vpjsRTEqI1vIRY4YQmzfFi5%2FG%2Fnh6vNuds%3D&reserved=0 >>>>>>>>>>> >>>>>>>>>>> The error was unnoticed before and got visible because of the commit >>>>>>>>>>> referenced below. This doesn't fix anything in the commit below, rather >>>>>>>>>>> fixes the issue in amdgpu exposed by the commit. The reference is only >>>>>>>>>>> to associate this commit with below one so that both go together. >>>>>>>>>>> >>>>>>>>>>> Fixes: 8795e182b02d ("PCI/portdrv: Don't disable AER reporting in get_port_device_capability()") >>>>>>>>>>> >>>>>>>>>>> Reported-by: Tom Seewald >>>>>>>>>>> Signed-off-by: Lijo Lazar >>>>>>>>>>> Cc: stable@vger.kernel.org >>>>>>>>>> >>>>>>>>>> How about something like the attached patch rather than these two >>>>>>>>>> patches? It's a bit bigger but seems cleaner and more defensive in my >>>>>>>>>> opinion. >>>>>>>>>> >>>>>>>>> >>>>>>>>> Whenever device goes to suspend/reset and then comes back, remap offset >>>>>>>>> has to be set back to 0 to make sure it doesn't use the wrong offset >>>>>>>>> when the register assumes default values again. >>>>>>>>> >>>>>>>>> To avoid the if-check in hdp_flush (which is more frequent), another way >>>>>>>>> is to initialize the remap offset to default offset during early init >>>>>>>>> and hw fini/suspend sequences. It won't be obvious (even with this >>>>>>>>> patch) as to when remap offset vs default offset is used though. >>>>>>>> >>>>>>>> On resume, the common IP is resumed first so it will always be set. >>>>>>>> The only case that is a problem is init because we init GMC out of >>>>>>>> order. We could init common before GMC in amdgpu_device_ip_init(). I >>>>>>>> think that should be fine, but I wasn't sure if there might be some >>>>>>>> fallout from that on certain cards. >>>>>>>> >>>>>>> >>>>>>> There are other places where an IP order is forced like in >>>>>>> amdgpu_device_ip_reinit_early_sriov(). This also may not affect this >>>>>>> case as remapping is not done for VF. >>>>>>> >>>>>>> Agree that a better way is to have the common IP to be inited first. >>>>>> >>>>>> How about these patches? >>>>>> >>>>> >>>>> Looks good to me. BTW, is nbio 7.7 for an APU (in which case hdp flush >>>>> is not expected to be used)? >>>> >>>> It would be used in some cases, e.g., GPU VM passthrough where we use >>>> the BAR rather than the carve out. >>>> >>>> Alex >>>> >>>> >>>>> >>>>> Thanks, >>>>> Lijo >>>>> >>>>>> Alex >>>>>> >>>>>> >>>>>>> >>>>>>> Thanks, >>>>>>> Lijo >>>>>>> >>>>>>>> Alex >>>>>>>> >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> Lijo >>>>>>>>> >>>>>>>>>> Alex >>>>>>>>>> >>>>>>>>>>> --- >>>>>>>>>>> v2: >>>>>>>>>>> Take care of IP resume cases (Alex Deucher) >>>>>>>>>>> Add NULL check to nbio.funcs to cover older (GFXv8) ASICs (Felix Kuehling) >>>>>>>>>>> Add more details in commit message and associate with AER patch (Bjorn >>>>>>>>>>> Helgaas) >>>>>>>>>>> >>>>>>>>>>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 24 ++++++++++++++++++++++ >>>>>>>>>>> drivers/gpu/drm/amd/amdgpu/nv.c | 6 ------ >>>>>>>>>>> drivers/gpu/drm/amd/amdgpu/soc15.c | 6 ------ >>>>>>>>>>> drivers/gpu/drm/amd/amdgpu/soc21.c | 6 ------ >>>>>>>>>>> 4 files changed, 24 insertions(+), 18 deletions(-) >>>>>>>>>>> >>>>>>>>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c >>>>>>>>>>> index ce7d117efdb5..e420118769a5 100644 >>>>>>>>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c >>>>>>>>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c >>>>>>>>>>> @@ -2334,6 +2334,26 @@ static int amdgpu_device_init_schedulers(struct amdgpu_device *adev) >>>>>>>>>>> return 0; >>>>>>>>>>> } >>>>>>>>>>> >>>>>>>>>>> +/** >>>>>>>>>>> + * amdgpu_device_prepare_ip - prepare IPs for hardware initialization >>>>>>>>>>> + * >>>>>>>>>>> + * @adev: amdgpu_device pointer >>>>>>>>>>> + * >>>>>>>>>>> + * Any common hardware initialization sequence that needs to be done before >>>>>>>>>>> + * hw init of individual IPs is performed here. This is different from the >>>>>>>>>>> + * 'common block' which initializes a set of IPs. >>>>>>>>>>> + */ >>>>>>>>>>> +static void amdgpu_device_prepare_ip(struct amdgpu_device *adev) >>>>>>>>>>> +{ >>>>>>>>>>> + /* Remap HDP registers to a hole in mmio space, for the purpose >>>>>>>>>>> + * of exposing those registers to process space. This needs to be >>>>>>>>>>> + * done before hw init of ip blocks to take care of HDP flush >>>>>>>>>>> + * operations through registers during hw_init. >>>>>>>>>>> + */ >>>>>>>>>>> + if (adev->nbio.funcs && adev->nbio.funcs->remap_hdp_registers && >>>>>>>>>>> + !amdgpu_sriov_vf(adev)) >>>>>>>>>>> + adev->nbio.funcs->remap_hdp_registers(adev); >>>>>>>>>>> +} >>>>>>>>>>> >>>>>>>>>>> /** >>>>>>>>>>> * amdgpu_device_ip_init - run init for hardware IPs >>>>>>>>>>> @@ -2376,6 +2396,8 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev) >>>>>>>>>>> DRM_ERROR("amdgpu_vram_scratch_init failed %d\n", r); >>>>>>>>>>> goto init_failed; >>>>>>>>>>> } >>>>>>>>>>> + >>>>>>>>>>> + amdgpu_device_prepare_ip(adev); >>>>>>>>>>> r = adev->ip_blocks[i].version->funcs->hw_init((void *)adev); >>>>>>>>>>> if (r) { >>>>>>>>>>> DRM_ERROR("hw_init %d failed %d\n", i, r); >>>>>>>>>>> @@ -3058,6 +3080,7 @@ static int amdgpu_device_ip_reinit_early_sriov(struct amdgpu_device *adev) >>>>>>>>>>> AMD_IP_BLOCK_TYPE_IH, >>>>>>>>>>> }; >>>>>>>>>>> >>>>>>>>>>> + amdgpu_device_prepare_ip(adev); >>>>>>>>>>> for (i = 0; i < adev->num_ip_blocks; i++) { >>>>>>>>>>> int j; >>>>>>>>>>> struct amdgpu_ip_block *block; >>>>>>>>>>> @@ -3139,6 +3162,7 @@ static int amdgpu_device_ip_resume_phase1(struct amdgpu_device *adev) >>>>>>>>>>> { >>>>>>>>>>> int i, r; >>>>>>>>>>> >>>>>>>>>>> + amdgpu_device_prepare_ip(adev); >>>>>>>>>>> for (i = 0; i < adev->num_ip_blocks; i++) { >>>>>>>>>>> if (!adev->ip_blocks[i].status.valid || adev->ip_blocks[i].status.hw) >>>>>>>>>>> continue; >>>>>>>>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c >>>>>>>>>>> index b3fba8dea63c..3ac7fef74277 100644 >>>>>>>>>>> --- a/drivers/gpu/drm/amd/amdgpu/nv.c >>>>>>>>>>> +++ b/drivers/gpu/drm/amd/amdgpu/nv.c >>>>>>>>>>> @@ -1032,12 +1032,6 @@ static int nv_common_hw_init(void *handle) >>>>>>>>>>> nv_program_aspm(adev); >>>>>>>>>>> /* setup nbio registers */ >>>>>>>>>>> adev->nbio.funcs->init_registers(adev); >>>>>>>>>>> - /* remap HDP registers to a hole in mmio space, >>>>>>>>>>> - * for the purpose of expose those registers >>>>>>>>>>> - * to process space >>>>>>>>>>> - */ >>>>>>>>>>> - if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev)) >>>>>>>>>>> - adev->nbio.funcs->remap_hdp_registers(adev); >>>>>>>>>>> /* enable the doorbell aperture */ >>>>>>>>>>> nv_enable_doorbell_aperture(adev, true); >>>>>>>>>>> >>>>>>>>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c >>>>>>>>>>> index fde6154f2009..a0481e37d7cf 100644 >>>>>>>>>>> --- a/drivers/gpu/drm/amd/amdgpu/soc15.c >>>>>>>>>>> +++ b/drivers/gpu/drm/amd/amdgpu/soc15.c >>>>>>>>>>> @@ -1240,12 +1240,6 @@ static int soc15_common_hw_init(void *handle) >>>>>>>>>>> soc15_program_aspm(adev); >>>>>>>>>>> /* setup nbio registers */ >>>>>>>>>>> adev->nbio.funcs->init_registers(adev); >>>>>>>>>>> - /* remap HDP registers to a hole in mmio space, >>>>>>>>>>> - * for the purpose of expose those registers >>>>>>>>>>> - * to process space >>>>>>>>>>> - */ >>>>>>>>>>> - if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev)) >>>>>>>>>>> - adev->nbio.funcs->remap_hdp_registers(adev); >>>>>>>>>>> >>>>>>>>>>> /* enable the doorbell aperture */ >>>>>>>>>>> soc15_enable_doorbell_aperture(adev, true); >>>>>>>>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/soc21.c b/drivers/gpu/drm/amd/amdgpu/soc21.c >>>>>>>>>>> index 55284b24f113..16b447055102 100644 >>>>>>>>>>> --- a/drivers/gpu/drm/amd/amdgpu/soc21.c >>>>>>>>>>> +++ b/drivers/gpu/drm/amd/amdgpu/soc21.c >>>>>>>>>>> @@ -660,12 +660,6 @@ static int soc21_common_hw_init(void *handle) >>>>>>>>>>> soc21_program_aspm(adev); >>>>>>>>>>> /* setup nbio registers */ >>>>>>>>>>> adev->nbio.funcs->init_registers(adev); >>>>>>>>>>> - /* remap HDP registers to a hole in mmio space, >>>>>>>>>>> - * for the purpose of expose those registers >>>>>>>>>>> - * to process space >>>>>>>>>>> - */ >>>>>>>>>>> - if (adev->nbio.funcs->remap_hdp_registers) >>>>>>>>>>> - adev->nbio.funcs->remap_hdp_registers(adev); >>>>>>>>>>> /* enable the doorbell aperture */ >>>>>>>>>>> soc21_enable_doorbell_aperture(adev, true); >>>>>>>>>>> >>>>>>>>>>> -- >>>>>>>>>>> 2.25.1 >>>>>>>>>>>