Re: [Nouveau] [PATCH v5 0/3] drm/nouveau: set DMA mask before mapping scratch page

2016-10-17 Thread Alexandre Courbot
On Mon, Oct 17, 2016 at 5:12 AM, Ard Biesheuvel
 wrote:
> On 7 October 2016 at 09:12, Alexandre Courbot  wrote:
>> On Fri, Oct 7, 2016 at 12:49 AM, Ard Biesheuvel
>>  wrote:
>>> This v4 is now a 3 piece series (since v4), after Alexandre pointed out that
>>> both GF 100 and NV50 are affected by the same issue, and that a related 
>>> issue
>>> has been solved already for Tegra in commit 9d0394c6bed5
>>> ("drm/nouveau/instmem/gk20a: set DMA mask early").
>>>
>>> The issue that this series addresses is the fact that the Nouveau driver
>>> invokes the DMA API before setting the DMA mask. In both cases addressed
>>> here, these are simply static bidirectional mappings of scratch pages whose
>>> purpose is not well understood, and in most cases, it does not matter that
>>> these pages are always allocated below 4 GB even if the hardware can access
>>> memory much higher up.
>>>
>>> However, on platforms without any RAM below 4 GB, the preliminary DMA mask
>>> of 32 is preventing the nouveau driver from loading on GF100 and NV50
>>> hardware with an error like the following one:
>>>
>>>nouveau :02:00.0: enabling device ( -> 0003)
>>>nouveau :02:00.0: NVIDIA GT218 (0a8280b1)
>>>nouveau :02:00.0: bios: version 70.18.a6.00.00
>>>nouveau :02:00.0: fb ctor failed, -14
>>>nouveau: probe of :02:00.0 failed with error -14
>>>
>>> So fix this by setting a preliminary DMA mask based on the MMU device 
>>> 'dma_bits'
>>> property (patch #1), and postpone mapping the scratch pages to the 
>>> respective
>>> FB .init() hooks. (#2 and #3)
>>>
>>> v5: move setting of preliminary DMA mask to nvkm_device_pci_new() (#1)
>>> move allocation and DMA mapping of scratch pages to .oneinit hooks (#2, 
>>> #3)
>>> v4: split and move dma_set_mask to probe hook (Alexander)
>>> v3: rework code to get rid of DMA_ERROR_CODE references, which is not
>>> defined on all architectures
>>> v2: replace incorrect comparison of dma_addr_t type var against NULL
>>>
>>> Ard Biesheuvel (3):
>>>   drm/nouveau: set streaming DMA mask early
>>>   drm/nouveau/fb/gf100: defer DMA mapping of scratch page to oneinit()
>>> hook
>>>   drm/nouveau/fb/nv50: defer DMA mapping of scratch page to oneinit()
>>> hook
>>
>> The series,
>>
>> Reviewed-by: Alexandre Courbot 
>>
>
> Thank you Alexandre.
>
> So is there a nouveau subtree this should go into? Or is it up to Dave
> to pull it into drm?

Ben already merged your patches into
https://github.com/skeggsb/nouveau/commits/master (and forgot to add
my Reviewed-by ;)). This repository will be merged into the next
kernel release.
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau


Re: [Nouveau] [PATCH v5 0/3] drm/nouveau: set DMA mask before mapping scratch page

2016-10-17 Thread Karol Herbst
Hi Ard,

the official nouveau tree is here: https://github.com/skeggsb/nouveau

But ben usually takes care of everything if you post the patches on the ML.
No idea what you discussed internally though, but alex also posts his suff
here.

On 16 Oct 2016 22:12, "Ard Biesheuvel"  wrote:

On 7 October 2016 at 09:12, Alexandre Courbot  wrote:
> On Fri, Oct 7, 2016 at 12:49 AM, Ard Biesheuvel
>  wrote:
>> This v4 is now a 3 piece series (since v4), after Alexandre pointed out
that
>> both GF 100 and NV50 are affected by the same issue, and that a related
issue
>> has been solved already for Tegra in commit 9d0394c6bed5
>> ("drm/nouveau/instmem/gk20a: set DMA mask early").
>>
>> The issue that this series addresses is the fact that the Nouveau driver
>> invokes the DMA API before setting the DMA mask. In both cases addressed
>> here, these are simply static bidirectional mappings of scratch pages
whose
>> purpose is not well understood, and in most cases, it does not matter
that
>> these pages are always allocated below 4 GB even if the hardware can
access
>> memory much higher up.
>>
>> However, on platforms without any RAM below 4 GB, the preliminary DMA
mask
>> of 32 is preventing the nouveau driver from loading on GF100 and NV50
>> hardware with an error like the following one:
>>
>>nouveau :02:00.0: enabling device ( -> 0003)
>>nouveau :02:00.0: NVIDIA GT218 (0a8280b1)
>>nouveau :02:00.0: bios: version 70.18.a6.00.00
>>nouveau :02:00.0: fb ctor failed, -14
>>nouveau: probe of :02:00.0 failed with error -14
>>
>> So fix this by setting a preliminary DMA mask based on the MMU device
'dma_bits'
>> property (patch #1), and postpone mapping the scratch pages to the
respective
>> FB .init() hooks. (#2 and #3)
>>
>> v5: move setting of preliminary DMA mask to nvkm_device_pci_new() (#1)
>> move allocation and DMA mapping of scratch pages to .oneinit hooks
(#2, #3)
>> v4: split and move dma_set_mask to probe hook (Alexander)
>> v3: rework code to get rid of DMA_ERROR_CODE references, which is not
>> defined on all architectures
>> v2: replace incorrect comparison of dma_addr_t type var against NULL
>>
>> Ard Biesheuvel (3):
>>   drm/nouveau: set streaming DMA mask early
>>   drm/nouveau/fb/gf100: defer DMA mapping of scratch page to oneinit()
>> hook
>>   drm/nouveau/fb/nv50: defer DMA mapping of scratch page to oneinit()
>> hook
>
> The series,
>
> Reviewed-by: Alexandre Courbot 
>

Thank you Alexandre.

So is there a nouveau subtree this should go into? Or is it up to Dave
to pull it into drm?

Regards,
Ard.
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau


Re: [Nouveau] [PATCH v5 0/3] drm/nouveau: set DMA mask before mapping scratch page

2016-10-16 Thread Ard Biesheuvel
On 7 October 2016 at 09:12, Alexandre Courbot  wrote:
> On Fri, Oct 7, 2016 at 12:49 AM, Ard Biesheuvel
>  wrote:
>> This v4 is now a 3 piece series (since v4), after Alexandre pointed out that
>> both GF 100 and NV50 are affected by the same issue, and that a related issue
>> has been solved already for Tegra in commit 9d0394c6bed5
>> ("drm/nouveau/instmem/gk20a: set DMA mask early").
>>
>> The issue that this series addresses is the fact that the Nouveau driver
>> invokes the DMA API before setting the DMA mask. In both cases addressed
>> here, these are simply static bidirectional mappings of scratch pages whose
>> purpose is not well understood, and in most cases, it does not matter that
>> these pages are always allocated below 4 GB even if the hardware can access
>> memory much higher up.
>>
>> However, on platforms without any RAM below 4 GB, the preliminary DMA mask
>> of 32 is preventing the nouveau driver from loading on GF100 and NV50
>> hardware with an error like the following one:
>>
>>nouveau :02:00.0: enabling device ( -> 0003)
>>nouveau :02:00.0: NVIDIA GT218 (0a8280b1)
>>nouveau :02:00.0: bios: version 70.18.a6.00.00
>>nouveau :02:00.0: fb ctor failed, -14
>>nouveau: probe of :02:00.0 failed with error -14
>>
>> So fix this by setting a preliminary DMA mask based on the MMU device 
>> 'dma_bits'
>> property (patch #1), and postpone mapping the scratch pages to the respective
>> FB .init() hooks. (#2 and #3)
>>
>> v5: move setting of preliminary DMA mask to nvkm_device_pci_new() (#1)
>> move allocation and DMA mapping of scratch pages to .oneinit hooks (#2, 
>> #3)
>> v4: split and move dma_set_mask to probe hook (Alexander)
>> v3: rework code to get rid of DMA_ERROR_CODE references, which is not
>> defined on all architectures
>> v2: replace incorrect comparison of dma_addr_t type var against NULL
>>
>> Ard Biesheuvel (3):
>>   drm/nouveau: set streaming DMA mask early
>>   drm/nouveau/fb/gf100: defer DMA mapping of scratch page to oneinit()
>> hook
>>   drm/nouveau/fb/nv50: defer DMA mapping of scratch page to oneinit()
>> hook
>
> The series,
>
> Reviewed-by: Alexandre Courbot 
>

Thank you Alexandre.

So is there a nouveau subtree this should go into? Or is it up to Dave
to pull it into drm?

Regards,
Ard.
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau


Re: [Nouveau] [PATCH v5 0/3] drm/nouveau: set DMA mask before mapping scratch page

2016-10-07 Thread Alexandre Courbot
On Fri, Oct 7, 2016 at 12:49 AM, Ard Biesheuvel
 wrote:
> This v4 is now a 3 piece series (since v4), after Alexandre pointed out that
> both GF 100 and NV50 are affected by the same issue, and that a related issue
> has been solved already for Tegra in commit 9d0394c6bed5
> ("drm/nouveau/instmem/gk20a: set DMA mask early").
>
> The issue that this series addresses is the fact that the Nouveau driver
> invokes the DMA API before setting the DMA mask. In both cases addressed
> here, these are simply static bidirectional mappings of scratch pages whose
> purpose is not well understood, and in most cases, it does not matter that
> these pages are always allocated below 4 GB even if the hardware can access
> memory much higher up.
>
> However, on platforms without any RAM below 4 GB, the preliminary DMA mask
> of 32 is preventing the nouveau driver from loading on GF100 and NV50
> hardware with an error like the following one:
>
>nouveau :02:00.0: enabling device ( -> 0003)
>nouveau :02:00.0: NVIDIA GT218 (0a8280b1)
>nouveau :02:00.0: bios: version 70.18.a6.00.00
>nouveau :02:00.0: fb ctor failed, -14
>nouveau: probe of :02:00.0 failed with error -14
>
> So fix this by setting a preliminary DMA mask based on the MMU device 
> 'dma_bits'
> property (patch #1), and postpone mapping the scratch pages to the respective
> FB .init() hooks. (#2 and #3)
>
> v5: move setting of preliminary DMA mask to nvkm_device_pci_new() (#1)
> move allocation and DMA mapping of scratch pages to .oneinit hooks (#2, 
> #3)
> v4: split and move dma_set_mask to probe hook (Alexander)
> v3: rework code to get rid of DMA_ERROR_CODE references, which is not
> defined on all architectures
> v2: replace incorrect comparison of dma_addr_t type var against NULL
>
> Ard Biesheuvel (3):
>   drm/nouveau: set streaming DMA mask early
>   drm/nouveau/fb/gf100: defer DMA mapping of scratch page to oneinit()
> hook
>   drm/nouveau/fb/nv50: defer DMA mapping of scratch page to oneinit()
> hook

The series,

Reviewed-by: Alexandre Courbot 

Thanks!
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau


[Nouveau] [PATCH v5 0/3] drm/nouveau: set DMA mask before mapping scratch page

2016-10-06 Thread Ard Biesheuvel
This v4 is now a 3 piece series (since v4), after Alexandre pointed out that
both GF 100 and NV50 are affected by the same issue, and that a related issue
has been solved already for Tegra in commit 9d0394c6bed5
("drm/nouveau/instmem/gk20a: set DMA mask early").

The issue that this series addresses is the fact that the Nouveau driver
invokes the DMA API before setting the DMA mask. In both cases addressed
here, these are simply static bidirectional mappings of scratch pages whose
purpose is not well understood, and in most cases, it does not matter that
these pages are always allocated below 4 GB even if the hardware can access
memory much higher up.

However, on platforms without any RAM below 4 GB, the preliminary DMA mask
of 32 is preventing the nouveau driver from loading on GF100 and NV50
hardware with an error like the following one:

   nouveau :02:00.0: enabling device ( -> 0003)
   nouveau :02:00.0: NVIDIA GT218 (0a8280b1)
   nouveau :02:00.0: bios: version 70.18.a6.00.00
   nouveau :02:00.0: fb ctor failed, -14
   nouveau: probe of :02:00.0 failed with error -14

So fix this by setting a preliminary DMA mask based on the MMU device 'dma_bits'
property (patch #1), and postpone mapping the scratch pages to the respective
FB .init() hooks. (#2 and #3)

v5: move setting of preliminary DMA mask to nvkm_device_pci_new() (#1)
move allocation and DMA mapping of scratch pages to .oneinit hooks (#2, #3)
v4: split and move dma_set_mask to probe hook (Alexander)
v3: rework code to get rid of DMA_ERROR_CODE references, which is not
defined on all architectures
v2: replace incorrect comparison of dma_addr_t type var against NULL

Ard Biesheuvel (3):
  drm/nouveau: set streaming DMA mask early
  drm/nouveau/fb/gf100: defer DMA mapping of scratch page to oneinit()
hook
  drm/nouveau/fb/nv50: defer DMA mapping of scratch page to oneinit()
hook

 drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c | 37 ++--
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf100.c   | 31 +---
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/nv50.c| 33 +++--
 3 files changed, 69 insertions(+), 32 deletions(-)

-- 
2.7.4

___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau