All of lore.kernel.org
 help / color / mirror / Atom feed
* PROM vbios fetching issues
@ 2014-03-24 18:59 Martin Peres
       [not found] ` <533080A2.6020501-GANU6spQydw@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Peres @ 2014-03-24 18:59 UTC (permalink / raw)
  To: gpu-public-documentation
  Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org

Hello,

One of my GPU (GK107/NVE7) fails to properly fetch its vbios from PROM 
at boot time but, if I blacklist the module and load it myself later on, 
it always succeeds. To make things weirder, the same card works great on 
another computer.

Here is the relevant code in Nouveau to fetch the vbios from PROM:
http://code.woboq.org/linux/linux/drivers/gpu/drm/nouveau/core/subdev/bios/base.c.html#nouveau_bios_shadow_prom

The only solution I found to this problem is to try up to 16 times in a 
row to fetch the vbios using PROM. If the 16 tries yield a bad signature 
or checksum, I just give up and let it try other techniques. Here is the 
patch[1].

With this hack in place, the number of retries needed to be able to 
correctly fetch the vbios ranges from 0 to 13. I see no consistency in 
this. I tried reading the vbios 32 bits by 32 bits (instead of 8 by 8), 
disabling local IRQs and generating more activity on the PCIe port 
before fetching (and making sure the value read is always the same), all 
solutions yielded no improvement.

It could be a brownout problem but this would be the only manifestation 
of this problem. Moreover, some cards are known to have problems with
PROM[2] so mine is definitely not the only one.

I'm at a loss here, should we wait on anything before reading from PROM? 
The mmiotrace I have doesn't seem to suggest we should :s I wonder if 
you have had this issue before and what the nvkm does here.

Thanks,
Martin

[1] http://lists.freedesktop.org/archives/nouveau/2014-March/016590.html
[2] 
http://code.woboq.org/linux/linux/drivers/gpu/drm/nouveau/core/subdev/bios/base.c.html#144

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PROM vbios fetching issues
       [not found] ` <533080A2.6020501-GANU6spQydw@public.gmane.org>
@ 2014-03-25 16:17   ` Christian Zander
       [not found]     ` <20140325161720.GB8282-JA3VlGzg3tsMOYszX5p1ytBPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Zander @ 2014-03-25 16:17 UTC (permalink / raw)
  To: Martin Peres
  Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	gpu-public-documentation

On Mon, Mar 24, 2014 at 11:59:46AM -0700, Martin Peres wrote:
>
> Hello,
> 
> One of my GPU (GK107/NVE7) fails to properly fetch its vbios from PROM 
> at boot time but, if I blacklist the module and load it myself later on, 
> it always succeeds. To make things weirder, the same card works great on 
> another computer.
> 
> Here is the relevant code in Nouveau to fetch the vbios from PROM:
> http://code.woboq.org/linux/linux/drivers/gpu/drm/nouveau/core/subdev/bios/base.c.html#nouveau_bios_shadow_prom
> 
> The only solution I found to this problem is to try up to 16 times in a 
> row to fetch the vbios using PROM. If the 16 tries yield a bad signature 
> or checksum, I just give up and let it try other techniques. Here is the 
> patch[1].
> 
> With this hack in place, the number of retries needed to be able to 
> correctly fetch the vbios ranges from 0 to 13. I see no consistency in 
> this. I tried reading the vbios 32 bits by 32 bits (instead of 8 by 8), 
> disabling local IRQs and generating more activity on the PCIe port 
> before fetching (and making sure the value read is always the same), all 
> solutions yielded no improvement.
> 
> It could be a brownout problem but this would be the only manifestation 
> of this problem. Moreover, some cards are known to have problems with
> PROM[2] so mine is definitely not the only one.
> 
> I'm at a loss here, should we wait on anything before reading from PROM? 
> The mmiotrace I have doesn't seem to suggest we should :s I wonder if 
> you have had this issue before and what the nvkm does here.
> 

Hi Martin,

a functional regression in GK10x prevents your GK107 GPU
from properly decoding 8-bit and 16-bit accesses to
the PROM registers. While these unaligned accesses work on
most GPUs, it is best not to rely on them. You can ensure
reliable retrieval of the VBIOS via the PROM registers
by using 32-bit register accesses across all GPUs.

Thank you, Christian.


> Thanks,
> Martin
> 
> [1] http://lists.freedesktop.org/archives/nouveau/2014-March/016590.html
> [2] http://code.woboq.org/linux/linux/drivers/gpu/drm/nouveau/core/subdev/bios/base.c.html#144

-- 
christian zander
ch?zander-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PROM vbios fetching issues
       [not found]     ` <20140325161720.GB8282-JA3VlGzg3tsMOYszX5p1ytBPR1lH4CV8@public.gmane.org>
@ 2014-03-25 22:33       ` Martin Peres
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Peres @ 2014-03-25 22:33 UTC (permalink / raw)
  To: Christian Zander
  Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	gpu-public-documentation

On 25/03/2014 17:17, Christian Zander wrote:
> On Mon, Mar 24, 2014 at 11:59:46AM -0700, Martin Peres wrote:
>> Hello,
>>
>> One of my GPU (GK107/NVE7) fails to properly fetch its vbios from PROM
>> at boot time but, if I blacklist the module and load it myself later on,
>> it always succeeds. To make things weirder, the same card works great on
>> another computer.
>>
>> Here is the relevant code in Nouveau to fetch the vbios from PROM:
>> http://code.woboq.org/linux/linux/drivers/gpu/drm/nouveau/core/subdev/bios/base.c.html#nouveau_bios_shadow_prom
>>
>> The only solution I found to this problem is to try up to 16 times in a
>> row to fetch the vbios using PROM. If the 16 tries yield a bad signature
>> or checksum, I just give up and let it try other techniques. Here is the
>> patch[1].
>>
>> With this hack in place, the number of retries needed to be able to
>> correctly fetch the vbios ranges from 0 to 13. I see no consistency in
>> this. I tried reading the vbios 32 bits by 32 bits (instead of 8 by 8),
>> disabling local IRQs and generating more activity on the PCIe port
>> before fetching (and making sure the value read is always the same), all
>> solutions yielded no improvement.
>>
>> It could be a brownout problem but this would be the only manifestation
>> of this problem. Moreover, some cards are known to have problems with
>> PROM[2] so mine is definitely not the only one.
>>
>> I'm at a loss here, should we wait on anything before reading from PROM?
>> The mmiotrace I have doesn't seem to suggest we should :s I wonder if
>> you have had this issue before and what the nvkm does here.
>>
> Hi Martin,
>
> a functional regression in GK10x prevents your GK107 GPU
> from properly decoding 8-bit and 16-bit accesses to
> the PROM registers. While these unaligned accesses work on
> most GPUs, it is best not to rely on them. You can ensure
> reliable retrieval of the VBIOS via the PROM registers
> by using 32-bit register accesses across all GPUs.
>
> Thank you, Christian.

Hi Christian,

Thanks, that was what went wrong. I thought I had tested 32-bit accesses 
only but
Imust have forgotten to update the vbios size read...

Thanks again for this quick answer,

Martin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-25 22:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-24 18:59 PROM vbios fetching issues Martin Peres
     [not found] ` <533080A2.6020501-GANU6spQydw@public.gmane.org>
2014-03-25 16:17   ` Christian Zander
     [not found]     ` <20140325161720.GB8282-JA3VlGzg3tsMOYszX5p1ytBPR1lH4CV8@public.gmane.org>
2014-03-25 22:33       ` Martin Peres

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.