All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/3] drm/nouveau: set DMA mask before mapping scratch page
@ 2016-09-26 12:32 ` Ard Biesheuvel
  0 siblings, 0 replies; 16+ messages in thread
From: Ard Biesheuvel @ 2016-09-26 12:32 UTC (permalink / raw)
  To: linux-kernel, bskeggs, airlied, dri-devel, nouveau; +Cc: Ard Biesheuvel

This v4 is now a 3 piece series, 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 0000:02:00.0: enabling device (0000 -> 0003)
   nouveau 0000:02:00.0: NVIDIA GT218 (0a8280b1)
   nouveau 0000:02:00.0: bios: version 70.18.a6.00.00
   nouveau 0000:02:00.0: fb ctor failed, -14
   nouveau: probe of 0000: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)

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 init() hook
  drm/nouveau/fb/nv50: defer DMA mapping of scratch page to init() hook

 drivers/gpu/drm/nouveau/nouveau_drm.c          | 11 +++++++
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf100.c | 26 +++++++++++------
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/nv50.c  | 30 +++++++++++++-------
 3 files changed, 48 insertions(+), 19 deletions(-)

-- 
2.7.4

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

end of thread, other threads:[~2016-10-06 12:57 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-26 12:32 [PATCH v4 0/3] drm/nouveau: set DMA mask before mapping scratch page Ard Biesheuvel
2016-09-26 12:32 ` Ard Biesheuvel
2016-09-26 12:32 ` [PATCH v4 1/3] drm/nouveau: set streaming DMA mask early Ard Biesheuvel
2016-09-26 12:32   ` Ard Biesheuvel
2016-10-03  5:39   ` [Nouveau] " Alexandre Courbot
2016-10-03  5:39     ` Alexandre Courbot
2016-10-06 12:57     ` [Nouveau] " Ard Biesheuvel
2016-10-06 12:57       ` Ard Biesheuvel
2016-09-26 12:32 ` [PATCH v4 2/3] drm/nouveau/fb/gf100: defer DMA mapping of scratch page to init() hook Ard Biesheuvel
2016-09-26 12:32   ` Ard Biesheuvel
2016-10-03  5:44   ` [Nouveau] " Alexandre Courbot
2016-10-03  5:44     ` Alexandre Courbot
2016-09-26 12:32 ` [PATCH v4 3/3] drm/nouveau/fb/nv50: " Ard Biesheuvel
2016-09-26 12:32   ` Ard Biesheuvel
2016-10-03  5:45   ` [Nouveau] " Alexandre Courbot
2016-10-03  5:45     ` Alexandre Courbot

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.