Skip to content

Commit 957a1ea

Browse files
committed
drm/sun4i: backend: Fix probe failure with multiple backends
Commit e0d0727 ("dma-mapping: introduce DMA range map, supplanting dma_pfn_offset") introduced a regression in our code since the second backed to probe will now get -EINVAL back from dma_direct_set_offset and will prevent the entire DRM device from probing. Ignore -EINVAL as a temporary measure to get it back working, before removing that call entirely. Fixes: e0d0727 ("dma-mapping: introduce DMA range map, supplanting dma_pfn_offset") Signed-off-by: Maxime Ripard <maxime@cerno.tech> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
1 parent 3650b22 commit 957a1ea

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/gpu/drm/sun4i/sun4i_backend.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,9 +814,15 @@ static int sun4i_backend_bind(struct device *dev, struct device *master,
814814
*
815815
* XXX(hch): this has no business in a driver and needs to move
816816
* to the device tree.
817+
*
818+
* If we have two subsequent calls to dma_direct_set_offset
819+
* returns -EINVAL. Unfortunately, this happens when we have two
820+
* backends in the system, and will result in the driver
821+
* reporting an error while it has been setup properly before.
822+
* Ignore EINVAL, but it should really be removed eventually.
817823
*/
818824
ret = dma_direct_set_offset(drm->dev, PHYS_OFFSET, 0, SZ_4G);
819-
if (ret)
825+
if (ret && ret != -EINVAL)
820826
return ret;
821827
}
822828

0 commit comments

Comments
 (0)