Fix for drm/sun4i shared with arm-soc

This patch is a preliminary fix that will conflict with subsequent work merged
 through arm-soc.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCX7TgqQAKCRDj7w1vZxhR
 xSyOAQDMT7xST/1bfkftNIoXgyF0El6aFU3IdMs57saTWk5A5AEAtWjAHkjADj1p
 sg7gAHY+hYVullCSr92wsX+67APFFA4=
 =U7c/
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCX7YsHwAKCRDj7w1vZxhR
 xaFCAQCmRKxe0yIFn9VjcCn1hgK6d9tqQXquRTntwswidFnDjQEApLSdKkeTARrU
 +D90lDMJ+UoWoKBGpF9LFxdL+SFvSQ8=
 =Cod1
 -----END PGP SIGNATURE-----

Merge tag 'drm/sun4i-dma-fix-pull-request' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mripard/linux into drm-misc-fixes

Fix for drm/sun4i shared with arm-soc

This patch is a preliminary fix that will conflict with subsequent work merged
through arm-soc.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>

# gpg: Signature made Wed 18 Nov 2020 09:51:53 AM CET
# gpg:                using EDDSA key 5C1337A45ECA9AEB89060E9EE3EF0D6F671851C5
# gpg: Good signature from "Maxime Ripard <maxime.ripard@anandra.org>" [unknown]
# gpg:                 aka "Maxime Ripard <mripard@kernel.org>" [unknown]
# gpg:                 aka "Maxime Ripard (Work Address) <maxime.ripard@bootlin.com>" [unknown]
# gpg:                 aka "Maxime Ripard (Work Address) <maxime@bootlin.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: BE56 75C3 7E81 8C8B 5764  241C 254B CFC5 6BF6 CE8D
#      Subkey fingerprint: 5C13 37A4 5ECA 9AEB 8906  0E9E E3EF 0D6F 6718 51C5
From: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20201118090455.sznrgpduuytlc22k@gilmour.lan
This commit is contained in:
Maxime Ripard 2020-11-19 09:26:06 +01:00
commit cdf117d6d3

View file

@ -814,9 +814,15 @@ static int sun4i_backend_bind(struct device *dev, struct device *master,
*
* XXX(hch): this has no business in a driver and needs to move
* to the device tree.
*
* If we have two subsequent calls to dma_direct_set_offset
* returns -EINVAL. Unfortunately, this happens when we have two
* backends in the system, and will result in the driver
* reporting an error while it has been setup properly before.
* Ignore EINVAL, but it should really be removed eventually.
*/
ret = dma_direct_set_offset(drm->dev, PHYS_OFFSET, 0, SZ_4G);
if (ret)
if (ret && ret != -EINVAL)
return ret;
}