Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_PATCH,MAILING_LIST_MULTI, MIME_HTML_MOSTLY,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E91CC32771 for ; Thu, 9 Jan 2020 10:29:55 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D1EC420678 for ; Thu, 9 Jan 2020 10:29:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BLYu+BBm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D1EC420678 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=amd-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 839696E8F5; Thu, 9 Jan 2020 10:29:54 +0000 (UTC) Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id D6B7D6E8F5 for ; Thu, 9 Jan 2020 10:29:53 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id y11so6797535wrt.6 for ; Thu, 09 Jan 2020 02:29:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=reply-to:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=o3tna6Ixj0WJNcZ09UJ5xYbesyEqFzWhaK5H1+sdZRo=; b=BLYu+BBmdc+d95jwg4NKG2v9yHvCW1HXq++eUQbzgsFPedUz1jEevwyFoS1EPqTbDa p+mV+IcJitigB3ICXMwQaYZkx9Ssis5YfXbJAi1VJeclZIbBdJF0F9Y7PPm3xt4MqL0H +UBB9n/xXS+s12NBDMn60MRAd4TXKkegJMLqLIMqtZiR7BZNe028JZPaTvyLyrbGKmEv fgbgSSbgM8ZkmQKpMLLQBwjJtWwAN63UdPOyNMO5pb6Sz9Nucx1yhWI1cupsfsgox0Y4 yirDpKcYJZeaiGP3wLsL82j/kMYRp5HCgnv+rD46Od3sY6S2FpbeVshBCqC1c7P/UaPl jmlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language; bh=o3tna6Ixj0WJNcZ09UJ5xYbesyEqFzWhaK5H1+sdZRo=; b=JYmi22D6o535PenNa3jzSS5Gh4eLb71DYTYRFRE5mI83mwSUxddOrCjQiKWCd9XJOu 9m8pbYelCk8aK0hQm2WjWY/Mq85GXzO7fPn1IIjogALyUslMJrLQGee2hkuOWAJrcxGm A0F3u0NJPYxwp2PCxD/DTUkZ6q2z7h7Ot0oULROTPquWxz3lzH/2Hcto086VsSmpmegt hKf+fmv2AZRKN4YsaktDRxIoQ0WUWtZ+bxqD6e5qm1Gm3JJWpXsxM39urSbQ6CJVjhko 2ld/BfnCSeCiRUBraTpKGavXvUOrXBzzIIeZra3s3PtZ1LZN/WmjCpDscfsAvA9goG4i fnsg== X-Gm-Message-State: APjAAAW+mrJ7zOgIDEJEH0jkVRbTOuHzuQrbs+sz+MxBc6SLoYPB1ufN rSkBsiYqDxeo9zucn7SKSqU= X-Google-Smtp-Source: APXvYqz5so+JhvT5hZMV6WREBTerKkPWC0HspCuVAZSfB8VS9y+blO3fIkg3UoD4Mhn3OxL/Z9MvDw== X-Received: by 2002:a05:6000:cf:: with SMTP id q15mr9896204wrx.393.1578565792461; Thu, 09 Jan 2020 02:29:52 -0800 (PST) Received: from ?IPv6:2a02:908:1252:fb60:be8a:bd56:1f94:86e7? ([2a02:908:1252:fb60:be8a:bd56:1f94:86e7]) by smtp.gmail.com with ESMTPSA id b68sm2479365wme.6.2020.01.09.02.29.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jan 2020 02:29:52 -0800 (PST) Subject: Re: [PATCH] drm/amdgpu: fix modprobe failure of the 2nd GPU when GDDR6 training enabled To: "Yin, Tianci (Rico)" , Alex Deucher References: <20200108123648.7422-1-tianci.yin@amd.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= Message-ID: <99978066-87ed-9533-0cfb-44cddb7c9226@gmail.com> Date: Thu, 9 Jan 2020 11:29:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US 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: , Reply-To: christian.koenig@amd.com Cc: "Long, Gang" , "Xu, Feifei" , "Wang, Kevin\(Yang\)" , amd-gfx list , "Tuikov, Luben" , "Deucher, Alexander" , "Zhang, Hawking" , "Koenig, Christian" , "Yuan, Xiaojie" Content-Type: multipart/mixed; boundary="===============1847616660==" Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" This is a multi-part message in MIME format. --===============1847616660== Content-Type: multipart/alternative; boundary="------------00AC4A693FE023FF0CA3C231" Content-Language: en-US This is a multi-part message in MIME format. --------------00AC4A693FE023FF0CA3C231 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Hi Rico, maybe it is a good idea to look into the git history and/or google the mailing list history a bit more. I do briefly remember that we disabled freeing up the stolen VGA memory on some hardware generations because somebody was accessing that memory even after VGA was turned off. At that time we couldn't figure out what was going wrong, but it is perfectly possible that those memory training fixes your are working on here are related to that issue. On the other hand if you can't find anything immediately feel free to go with Alex suggestion, if something goes wrong we can still revert the change. Regards, Christian. Am 09.01.20 um 04:15 schrieb Yin, Tianci (Rico): > > [AMD Official Use Only - Internal Distribution Only] > > > Ok, thanks very much Alex! > ------------------------------------------------------------------------ > *From:* Alex Deucher > *Sent:* Thursday, January 9, 2020 11:12 > *To:* Yin, Tianci (Rico) > *Cc:* Christian König ; Koenig, > Christian ; Long, Gang ; > Wang, Kevin(Yang) ; Xu, Feifei > ; amd-gfx list ; > Tuikov, Luben ; Deucher, Alexander > ; Yuan, Xiaojie ; > Zhang, Hawking > *Subject:* Re: [PATCH] drm/amdgpu: fix modprobe failure of the 2nd GPU > when GDDR6 training enabled > On Wed, Jan 8, 2020 at 10:07 PM Yin, Tianci (Rico) > wrote: > > > > [AMD Official Use Only - Internal Distribution Only] > > > > > > Thanks Alex and Christian! > > > > Hi Christian, > > > > On ASICs with gmc v10, I find amdgpu_bo_late_init() is not invoked, > so stolen memory never get free, on other ASICs with gmc v9/v8/v7/v6, > stolen memory was freed in gmc_v*_0_late_init(). I don't know why, are > there some special reasons or just missed by coding? > > > > Looks like it should be added.  Possibly got lost when we merged the > navi code from the topic branch. > > Alex > > > Thanks! > > > > Rico > > > > ________________________________ > > From: Christian König > > Sent: Wednesday, January 8, 2020 23:04 > > To: Alex Deucher ; Koenig, Christian > > > Cc: Long, Gang ; Wang, Kevin(Yang) > ; Xu, Feifei ; Yin, Tianci > (Rico) ; amd-gfx list > ; Tuikov, Luben ; > Deucher, Alexander ; Yuan, Xiaojie > ; Zhang, Hawking > > Subject: Re: [PATCH] drm/amdgpu: fix modprobe failure of the 2nd GPU > when GDDR6 training enabled > > > > Am 08.01.20 um 15:49 schrieb Alex Deucher: > > > On Wed, Jan 8, 2020 at 7:52 AM Christian König > wrote: > > >> Am 08.01.20 um 13:36 schrieb Tianci Yin: > > >>> From: "Tianci.Yin" > > >>> > > >>> [why] > > >>> In dual GPUs scenario, stolen_size is assigned to zero on the > 2nd GPU, > > >>> then the bottom region of VRAM was allocated as GTT, unfortunately > > >>> a small region of bottom VRAM was encroached by UMC firmware during > > >>> GDDR6 BIST training, this cause pagefault. > > >> What I'm missing here is why is the stolen size zero on the 2nd GPU? > > >> > > >> Maybe we need to read the stolen size after posting the GPU instead? > > > There is no stolen memory on secondary GPUs because there is no pre-OS > > > console using that memory. > > > > Ah! Yeah that makes sense. > > > > But in this case I would say we should change the patch like the > following: > > > > adev->gmc.stolen_size = min(adev->gmc.stolen_size, > > AMDGPU_STOLEN_VGA_DEFAULT_SIZE); > > > > And in amdgpu_ttm_late_init(): > > > > /* Can't free the stolen VGA memory when it might be used for memory > > training again. */ > > if (!adev->fw_vram_usage.mem_train_support) > >      amdgpu_bo_free_kernel(.... > > > > > > Regards, > > Christian. > > > > > > > > > > Alex > > > > > >> Regards, > > >> Christian. > > >> > > >>> [how] > > >>> Forcing stolen_size to 3MB, then the bottom region of VRAM was > > >>> allocated as stolen memory, GTT corruption avoid. > > >>> The stolen memory of the 2nd GPU will be free in late_init phase, > > >>> no memory wasted. > > >>> > > >>> Change-Id: Icd0ad7de41333282949bb1e3e676c6c307ddd081 > > >>> Signed-off-by: Tianci.Yin > > >>> --- > > >>> drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h |  6 ++++++ > > >>> drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c  | 21 +++++++++++++++++++++ > > >>>    2 files changed, 27 insertions(+) > > >>> > > >>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h > b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h > > >>> index c91dd602d5f1..440b793316df 100644 > > >>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h > > >>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h > > >>> @@ -60,6 +60,11 @@ > > >>>     */ > > >>>    #define AMDGPU_GMC_FAULT_TIMEOUT 5000ULL > > >>> > > >>> +/* > > >>> + * Default stolen memory size, 1024 * 768 * 4 > > >>> + */ > > >>> +#define AMDGPU_STOLEN_VGA_DEFAULT_SIZE       0x300000 > > >>> + > > >>>    struct firmware; > > >>> > > >>>    /* > > >>> @@ -192,6 +197,7 @@ struct amdgpu_gmc { > > >>>        uint32_t srbm_soft_reset; > > >>>        bool prt_warning; > > >>>        uint64_t stolen_size; > > >>> +     bool stolen_temp_reserved; > > >>>        /* apertures */ > > >>>        u64 shared_aperture_start; > > >>>        u64 shared_aperture_end; > > >>> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c > b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c > > >>> index 7dc8c068c62a..0c96b67d6ca7 100644 > > >>> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c > > >>> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c > > >>> @@ -566,6 +566,11 @@ static int gmc_v10_0_late_init(void *handle) > > >>>        struct amdgpu_device *adev = (struct amdgpu_device *)handle; > > >>>        int r; > > >>> > > >>> +     if (adev->gmc.stolen_temp_reserved) { > > >>> + amdgpu_bo_late_init(adev); > > >>> + adev->gmc.stolen_temp_reserved = false; > > >>> +     } > > >>> + > > >>>        r = amdgpu_gmc_allocate_vm_inv_eng(adev); > > >>>        if (r) > > >>>                return r; > > >>> @@ -756,6 +761,22 @@ static int gmc_v10_0_sw_init(void *handle) > > >>>                return r; > > >>> > > >>>        adev->gmc.stolen_size = gmc_v10_0_get_vbios_fb_size(adev); > > >>> +     /* > > >>> +      * In dual GPUs scenario, stolen_size is assigned to zero > on the 2nd GPU, > > >>> +      * then the bottom region of VRAM was allocated as GTT, > unfortunately > > >>> +      * a small region of bottom VRAM was encroached by UMC > firmware during > > >>> +      * GDDR6 BIST training, this cause pagefault. > > >>> +      * The page fault can be fixed by forcing stolen_size to > 3MB, then the bottom > > >>> +      * region of VRAM was allocated as stolen memory, GTT > corruption avoid. > > >>> +      * The stolen memory of the 2nd GPU will be free in > late_init phase, > > >>> +      * no memory wasted. > > >>> +      */ > > >>> +     if (adev->fw_vram_usage.mem_train_support && > > >>> +             adev->gmc.stolen_size == 0) { > > >>> +             adev->gmc.stolen_size = > AMDGPU_STOLEN_VGA_DEFAULT_SIZE; > > >>> + adev->gmc.stolen_temp_reserved = true; > > >>> +     } else > > >>> + adev->gmc.stolen_temp_reserved = false; > > >>> > > >>>        /* Memory manager */ > > >>>        r = amdgpu_bo_init(adev); > > >> _______________________________________________ > > >> amd-gfx mailing list > > >> amd-gfx@lists.freedesktop.org > > >> > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7CTianci.Yin%40amd.com%7Cb9b1622ed60e4ab36c6408d794b1d75e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637141363862418597&sdata=YT8zKlbLX0XdzqcLrZQaV6sKFWXS5nQTNMAMT9BMK70%3D&reserved=0 > > > _______________________________________________ > > > amd-gfx mailing list > > > amd-gfx@lists.freedesktop.org > > > > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7CTianci.Yin%40amd.com%7Cb9b1622ed60e4ab36c6408d794b1d75e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637141363862428589&sdata=LLVRzFBxFKqTltpvsK%2F2l9CwnlUFzFKmDoPPHdO5e1I%3D&reserved=0 > > --------------00AC4A693FE023FF0CA3C231 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 8bit
Hi Rico,

maybe it is a good idea to look into the git history and/or google the mailing list history a bit more.

I do briefly remember that we disabled freeing up the stolen VGA memory on some hardware generations because somebody was accessing that memory even after VGA was turned off.

At that time we couldn't figure out what was going wrong, but it is perfectly possible that those memory training fixes your are working on here are related to that issue.

On the other hand if you can't find anything immediately feel free to go with Alex suggestion, if something goes wrong we can still revert the change.

Regards,
Christian.

Am 09.01.20 um 04:15 schrieb Yin, Tianci (Rico):

[AMD Official Use Only - Internal Distribution Only]


Ok, thanks very much Alex!

From: Alex Deucher <alexdeucher@gmail.com>
Sent: Thursday, January 9, 2020 11:12
To: Yin, Tianci (Rico) <Tianci.Yin@amd.com>
Cc: Christian König <ckoenig.leichtzumerken@gmail.com>; Koenig, Christian <Christian.Koenig@amd.com>; Long, Gang <Gang.Long@amd.com>; Wang, Kevin(Yang) <Kevin1.Wang@amd.com>; Xu, Feifei <Feifei.Xu@amd.com>; amd-gfx list <amd-gfx@lists.freedesktop.org>; Tuikov, Luben <Luben.Tuikov@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com>; Yuan, Xiaojie <Xiaojie.Yuan@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com>
Subject: Re: [PATCH] drm/amdgpu: fix modprobe failure of the 2nd GPU when GDDR6 training enabled
 
On Wed, Jan 8, 2020 at 10:07 PM Yin, Tianci (Rico) <Tianci.Yin@amd.com> wrote:
>
> [AMD Official Use Only - Internal Distribution Only]
>
>
> Thanks Alex and Christian!
>
> Hi Christian,
>
> On ASICs with gmc v10, I find amdgpu_bo_late_init() is not invoked, so stolen memory never get free, on other ASICs with gmc v9/v8/v7/v6, stolen memory was freed in gmc_v*_0_late_init(). I don't know why, are there some special reasons or just missed by coding?
>

Looks like it should be added.  Possibly got lost when we merged the
navi code from the topic branch.

Alex

> Thanks!
>
> Rico
>
> ________________________________
> From: Christian König <ckoenig.leichtzumerken@gmail.com>
> Sent: Wednesday, January 8, 2020 23:04
> To: Alex Deucher <alexdeucher@gmail.com>; Koenig, Christian <Christian.Koenig@amd.com>
> Cc: Long, Gang <Gang.Long@amd.com>; Wang, Kevin(Yang) <Kevin1.Wang@amd.com>; Xu, Feifei <Feifei.Xu@amd.com>; Yin, Tianci (Rico) <Tianci.Yin@amd.com>; amd-gfx list <amd-gfx@lists.freedesktop.org>; Tuikov, Luben <Luben.Tuikov@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com>; Yuan, Xiaojie <Xiaojie.Yuan@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com>
> Subject: Re: [PATCH] drm/amdgpu: fix modprobe failure of the 2nd GPU when GDDR6 training enabled
>
> Am 08.01.20 um 15:49 schrieb Alex Deucher:
> > On Wed, Jan 8, 2020 at 7:52 AM Christian König <christian.koenig@amd.com> wrote:
> >> Am 08.01.20 um 13:36 schrieb Tianci Yin:
> >>> From: "Tianci.Yin" <tianci.yin@amd.com>
> >>>
> >>> [why]
> >>> In dual GPUs scenario, stolen_size is assigned to zero on the 2nd GPU,
> >>> then the bottom region of VRAM was allocated as GTT, unfortunately
> >>> a small region of bottom VRAM was encroached by UMC firmware during
> >>> GDDR6 BIST training, this cause pagefault.
> >> What I'm missing here is why is the stolen size zero on the 2nd GPU?
> >>
> >> Maybe we need to read the stolen size after posting the GPU instead?
> > There is no stolen memory on secondary GPUs because there is no pre-OS
> > console using that memory.
>
> Ah! Yeah that makes sense.
>
> But in this case I would say we should change the patch like the following:
>
> adev->gmc.stolen_size = min(adev->gmc.stolen_size,
> AMDGPU_STOLEN_VGA_DEFAULT_SIZE);
>
> And in amdgpu_ttm_late_init():
>
> /* Can't free the stolen VGA memory when it might be used for memory
> training again. */
> if (!adev->fw_vram_usage.mem_train_support)
>      amdgpu_bo_free_kernel(....
>
>
> Regards,
> Christian.
>
>
> >
> > Alex
> >
> >> Regards,
> >> Christian.
> >>
> >>> [how]
> >>> Forcing stolen_size to 3MB, then the bottom region of VRAM was
> >>> allocated as stolen memory, GTT corruption avoid.
> >>> The stolen memory of the 2nd GPU will be free in late_init phase,
> >>> no memory wasted.
> >>>
> >>> Change-Id: Icd0ad7de41333282949bb1e3e676c6c307ddd081
> >>> Signed-off-by: Tianci.Yin <tianci.yin@amd.com>
> >>> ---
> >>>    drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h |  6 ++++++
> >>>    drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c  | 21 +++++++++++++++++++++
> >>>    2 files changed, 27 insertions(+)
> >>>
> >>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h
> >>> index c91dd602d5f1..440b793316df 100644
> >>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h
> >>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h
> >>> @@ -60,6 +60,11 @@
> >>>     */
> >>>    #define AMDGPU_GMC_FAULT_TIMEOUT    5000ULL
> >>>
> >>> +/*
> >>> + * Default stolen memory size, 1024 * 768 * 4
> >>> + */
> >>> +#define AMDGPU_STOLEN_VGA_DEFAULT_SIZE       0x300000
> >>> +
> >>>    struct firmware;
> >>>
> >>>    /*
> >>> @@ -192,6 +197,7 @@ struct amdgpu_gmc {
> >>>        uint32_t                srbm_soft_reset;
> >>>        bool                    prt_warning;
> >>>        uint64_t                stolen_size;
> >>> +     bool                    stolen_temp_reserved;
> >>>        /* apertures */
> >>>        u64                     shared_aperture_start;
> >>>        u64                     shared_aperture_end;
> >>> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
> >>> index 7dc8c068c62a..0c96b67d6ca7 100644
> >>> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
> >>> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
> >>> @@ -566,6 +566,11 @@ static int gmc_v10_0_late_init(void *handle)
> >>>        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> >>>        int r;
> >>>
> >>> +     if (adev->gmc.stolen_temp_reserved) {
> >>> +             amdgpu_bo_late_init(adev);
> >>> +             adev->gmc.stolen_temp_reserved = false;
> >>> +     }
> >>> +
> >>>        r = amdgpu_gmc_allocate_vm_inv_eng(adev);
> >>>        if (r)
> >>>                return r;
> >>> @@ -756,6 +761,22 @@ static int gmc_v10_0_sw_init(void *handle)
> >>>                return r;
> >>>
> >>>        adev->gmc.stolen_size = gmc_v10_0_get_vbios_fb_size(adev);
> >>> +     /*
> >>> +      * In dual GPUs scenario, stolen_size is assigned to zero on the 2nd GPU,
> >>> +      * then the bottom region of VRAM was allocated as GTT, unfortunately
> >>> +      * a small region of bottom VRAM was encroached by UMC firmware during
> >>> +      * GDDR6 BIST training, this cause pagefault.
> >>> +      * The page fault can be fixed by forcing stolen_size to 3MB, then the bottom
> >>> +      * region of VRAM was allocated as stolen memory, GTT corruption avoid.
> >>> +      * The stolen memory of the 2nd GPU will be free in late_init phase,
> >>> +      * no memory wasted.
> >>> +      */
> >>> +     if (adev->fw_vram_usage.mem_train_support &&
> >>> +             adev->gmc.stolen_size == 0) {
> >>> +             adev->gmc.stolen_size = AMDGPU_STOLEN_VGA_DEFAULT_SIZE;
> >>> +             adev->gmc.stolen_temp_reserved = true;
> >>> +     } else
> >>> +             adev->gmc.stolen_temp_reserved = false;
> >>>
> >>>        /* Memory manager */
> >>>        r = amdgpu_bo_init(adev);
> >> _______________________________________________
> >> amd-gfx mailing list
> >> amd-gfx@lists.freedesktop.org
> >> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CTianci.Yin%40amd.com%7Cb9b1622ed60e4ab36c6408d794b1d75e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637141363862418597&amp;sdata=YT8zKlbLX0XdzqcLrZQaV6sKFWXS5nQTNMAMT9BMK70%3D&amp;reserved=0
> > _______________________________________________
> > amd-gfx mailing list
> > amd-gfx@lists.freedesktop.org
> > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CTianci.Yin%40amd.com%7Cb9b1622ed60e4ab36c6408d794b1d75e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637141363862428589&amp;sdata=LLVRzFBxFKqTltpvsK%2F2l9CwnlUFzFKmDoPPHdO5e1I%3D&amp;reserved=0
>

--------------00AC4A693FE023FF0CA3C231-- --===============1847616660== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx --===============1847616660==--