From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH] media: staging: tegra-vde: Disable building with COMPILE_TEST Date: Thu, 29 Aug 2019 17:49:02 +0200 Message-ID: <20190829154902.GC19842@ulmo> References: <20190826133140.13456-1-yuehaibing@huawei.com> <7f73bcac-f52d-f1b3-324c-e9b551c5378b@xs4all.nl> <20190829124034.GA19842@ulmo> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="E/DnYTRukya0zdZ1" Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Dmitry Osipenko Cc: Hans Verkuil , YueHaibing , mchehab@kernel.org, gregkh@linuxfoundation.org, jonathanh@nvidia.com, robin.murphy@arm.com, linux-media@vger.kernel.org, linux-tegra@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org List-Id: linux-tegra@vger.kernel.org --E/DnYTRukya0zdZ1 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 29, 2019 at 04:58:22PM +0300, Dmitry Osipenko wrote: > 29.08.2019 15:40, Thierry Reding =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > > On Thu, Aug 29, 2019 at 01:39:32PM +0200, Hans Verkuil wrote: > >> On 8/26/19 3:31 PM, YueHaibing wrote: > >>> If COMPILE_TEST is y and IOMMU_SUPPORT is n, selecting TEGRA_VDE > >>> to m will set IOMMU_IOVA to m, this fails the building of > >>> TEGRA_HOST1X and DRM_TEGRA which is y like this: > >>> > >>> drivers/gpu/host1x/cdma.o: In function `host1x_cdma_init': > >>> cdma.c:(.text+0x66c): undefined reference to `alloc_iova' > >>> cdma.c:(.text+0x698): undefined reference to `__free_iova' > >>> > >>> drivers/gpu/drm/tegra/drm.o: In function `tegra_drm_unload': > >>> drm.c:(.text+0xeb0): undefined reference to `put_iova_domain' > >>> drm.c:(.text+0xeb4): undefined reference to `iova_cache_put' > >>> > >>> Reported-by: Hulk Robot > >>> Fixes: 6b2265975239 ("media: staging: tegra-vde: Fix build error") > >>> Fixes: b301f8de1925 ("media: staging: media: tegra-vde: Add IOMMU sup= port") > >>> Signed-off-by: YueHaibing > >>> --- > >>> drivers/staging/media/tegra-vde/Kconfig | 4 ++-- > >>> 1 file changed, 2 insertions(+), 2 deletions(-) > >>> > >>> diff --git a/drivers/staging/media/tegra-vde/Kconfig b/drivers/stagin= g/media/tegra-vde/Kconfig > >>> index ba49ea5..a41d30c 100644 > >>> --- a/drivers/staging/media/tegra-vde/Kconfig > >>> +++ b/drivers/staging/media/tegra-vde/Kconfig > >>> @@ -1,9 +1,9 @@ > >>> # SPDX-License-Identifier: GPL-2.0 > >>> config TEGRA_VDE > >>> tristate "NVIDIA Tegra Video Decoder Engine driver" > >>> - depends on ARCH_TEGRA || COMPILE_TEST > >>> + depends on ARCH_TEGRA > >> > >> What happens if you drop this change, > >> > >>> select DMA_SHARED_BUFFER > >>> - select IOMMU_IOVA if (IOMMU_SUPPORT || COMPILE_TEST) > >>> + select IOMMU_IOVA if IOMMU_SUPPORT > >> > >> but keep this change? > >> > >> iova.h has stubs that are used if IOMMU_IOVA is not set, so it should > >> work when compile testing this tegra-vde driver. > >> > >> Haven't tried it, but making sure that compile testing keep working is > >> really important. >=20 > The driver's code compilation works okay, it's the linkage stage which > fails during compile-testing. >=20 > > Yeah, that variant seems to work for me. I think it's also more correct > > because the IOMMU_IOVA if IOMMU_SUPPORT dependency really says that the > > IOVA usage is bound to IOMMU support. If IOMMU support is not enabled, > > then IOVA is not needed either, so the dummies will do just fine. >=20 > Am I understanding correctly that you're suggesting to revert [1][2] and > get back to the other problem? >=20 > [1] > https://lore.kernel.org/linux-media/dd547b44-7abb-371f-aeee-a82b96f824e2@= gmail.com/T/ > [2] https://patchwork.ozlabs.org/patch/1136619/ >=20 > If we want to keep compile testing, I guess the only reasonable variant > right now is to select IOMMU_IOVA unconditionally in all of the drivers > (vde, host1x, drm and etc) and then just ignore that IOVA will be > compiled-and-unused if IOMMU_SUPPORT=3Dn (note that IOMMU_SUPPORT=3Dy in = all > of default kernel configurations). Agreed. I think we should just select IOMMU_IOVA unconditionally. We really do want IOMMU_SUPPORT always as well, but it might be nice to be able to switch it off for testing or so. In the cases that really matter we will be enabling both IOMMU_SUPPORT and IOMMU_IOVA anyway, so might as well select IOMMU_IOVA always. It's not terribly big and I can't imagine anyone wanting to run a kernel without IOMMU_SUPPORT for anything other than testing. Thierry --E/DnYTRukya0zdZ1 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAl1n8+oACgkQ3SOs138+ s6Hbfw//W5zV6nU1EoH+SEkePE93YLIaRnk0SQKzSBCTDuVDIXnRE3iqhCRDH/Fg AInyjQFdbHKGt0AWTlpijP7gaEgZDP66trt1BBrJLwaF9/PCM/cKzyY2XUjuIMxN rCBvh/jzRcJPb4e9mQAmyJGcrw/MnM+xn+Vk2zPpDA/Km5jQ6NoIR99HdcJ7JBxr sncQof6st+gMIarbZ5z9bxG9x6tjUJ6/iJREqKqufxL4TpwCtzuvdzioXSRUF3vz u8zGA7dysvAGjPPY/lNTQvFq+HJz8p5BaLDhYc+YH4u/OuvNU8dlnG6nqPiots9l yC6K9VRJR0J7q5J+sAwwMggW4nKGP3f3lnTZbewJkAilA4el4u/YabU+Wh6x+VPz 2gDIfni/lRgJZ8+fxkAF0NQdeKE/zEyCxPngKbEwaFVkIF9JSwdaiNbKwnal5b1I 24e1TkDHP089dfOS8C1RfUC5+G9JfwkorC1olf2SJ4GtsG12bE94viDLf/VPYPt5 JCsRXvP8cGjwJmu6sTdxtiHYjYc+WD/uFLe6R+mJFHz7SsCbgU5KwqkBVBYEzpu7 KBHq9GciM1tokCVdt5XO0j2Oq8X+MerHkX/jEiyFVcCovt/6aHrNgCkxOzmklo5q 2rISJqrNQO+cw88/i8fW5i3bZpAoJoHemz4SgQdZzdxaFgVNyTg= =Pgi/ -----END PGP SIGNATURE----- --E/DnYTRukya0zdZ1--