dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Michel Dänzer" <michel@daenzer.net>
To: "Christian König" <deathsimple@vodafone.de>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 2/3] drm/radeon: Restore GART table contents after pinning it in VRAM
Date: Thu, 22 Jan 2015 18:59:53 +0900	[thread overview]
Message-ID: <54C0CA19.60205@daenzer.net> (raw)
In-Reply-To: <54C0BD8C.8090908@vodafone.de>

On 22.01.2015 18:06, Christian König wrote:
> Am 22.01.2015 um 08:30 schrieb Michel Dänzer:
>> From: Michel Dänzer <michel.daenzer@amd.com>
>>
>> The GART table BO has to be moved out of VRAM for suspend/resume. Any
>> updates to the GART table during that time were silently dropped without
>> this change. This caused GPU lockups on resume in some cases, see the bug
>> reports referenced below.
>>
>> This might also make GPU reset more robust in some cases, as we no longer
>> rely on the GART table in VRAM being preserved across the GPU
>> lockup/reset.
>>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85204
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86267
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
>> ---
>>
>> v2: Add logic to radeon_gart_table_vram_pin directly instead of
>> reinstating
>>      radeon_gart_restore function
>>
>>   drivers/gpu/drm/radeon/radeon_gart.c | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/radeon/radeon_gart.c
>> b/drivers/gpu/drm/radeon/radeon_gart.c
>> index a530932..0c8c739 100644
>> --- a/drivers/gpu/drm/radeon/radeon_gart.c
>> +++ b/drivers/gpu/drm/radeon/radeon_gart.c
>> @@ -163,6 +163,14 @@ int radeon_gart_table_vram_pin(struct
>> radeon_device *rdev)
>>       r = radeon_bo_kmap(rdev->gart.robj, &rdev->gart.ptr);
>>       if (r)
>>           radeon_bo_unpin(rdev->gart.robj);
>> +    else {
> 
> I would add a comment why we do this here.

Added in v3.


>> +        int i;
>> +
>> +        for (i = 0; i < rdev->gart.num_gpu_pages; i++)
>> +            radeon_gart_set_page(rdev, i, rdev->gart.pages_entry[i]);
>> +        mb();
>> +        radeon_gart_tlb_flush(rdev);
> 
> That TLB flush won't work correctly because the table_addr isn't up to
> date yet.

Ugh, thanks for the catch.

>> +    }
>>       radeon_bo_unreserve(rdev->gart.robj);
>>       rdev->gart.table_addr = gpu_addr;
> It's updated here instead. Maybe completely drop the local gpu_addr
> variable and update the table_addr directly instead.

I chose the less invasive fix in v3.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2015-01-22  9:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21  8:36 [PATCH 1/3] drm/radeon: Split off gart_get_page_entry ASIC hook from set_page_entry Michel Dänzer
2015-01-21  8:36 ` [PATCH 2/3] drm/radeon: Reinstate radeon_gart_restore for GART table in VRAM Michel Dänzer
2015-01-21  9:22   ` Christian König
2015-01-22  7:30     ` [PATCH v2 2/3] drm/radeon: Restore GART table contents after pinning it " Michel Dänzer
2015-01-22  9:06       ` Christian König
2015-01-22  9:58         ` [PATCH 2/3] drm/radeon: Restore GART table contents after pinning it in VRAM v3 Michel Dänzer
2015-01-22 10:40           ` Christian König
2015-01-22  9:59         ` Michel Dänzer [this message]
2015-01-22  7:31     ` [PATCH 2/3] drm/radeon: Reinstate radeon_gart_restore for GART table in VRAM Michel Dänzer
2015-01-22  9:08       ` Christian König
2015-01-22  9:28         ` Michel Dänzer
2015-01-22  9:52           ` Michel Dänzer
2015-01-21  8:36 ` [PATCH 3/3] drm/radeon: Remove rdev->gart.pages_addr array Michel Dänzer
2015-01-22 16:49 ` [PATCH 1/3] drm/radeon: Split off gart_get_page_entry ASIC hook from set_page_entry Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54C0CA19.60205@daenzer.net \
    --to=michel@daenzer.net \
    --cc=deathsimple@vodafone.de \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox