lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 11 Jul 2017 11:49:47 +0300
From:   Paul Kocialkowski <contact@...lk.fr>
To:     linux-arm-kernel@...ts.infradead.org, linux-tegra@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc:     Jonathan Hunter <jonathanh@...dia.com>,
        Stephen Warren <swarren@...dotorg.org>,
        Mikko Perttunen <mperttunen@...dia.com>,
        Thierry Reding <thierry.reding@...il.com>
Subject: Re: [PATCH] gpu: host1x: Free the IOMMU domain when there is no
 device to attach

On Mon, 2017-07-10 at 21:33 +0200, Paul Kocialkowski wrote:
> When there is no device to attach to the IOMMU domain, as may be the
> case when the device-tree does not contain the proper iommu node, it
> is
> best to keep going without IOMMU support rather than failing.
> This allows the driver to probe and function instead of taking down
> all of the tegra drm driver, leading to missing display support.

Fixes: 404bfb78daf3 ("gpu: host1x: Add IOMMU support")

> Signed-off-by: Paul Kocialkowski <contact@...lk.fr>
> ---
>  drivers/gpu/host1x/dev.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
> index ac65f52850a6..f296738d0de8 100644
> --- a/drivers/gpu/host1x/dev.c
> +++ b/drivers/gpu/host1x/dev.c
> @@ -186,8 +186,13 @@ static int host1x_probe(struct platform_device
> *pdev)
>  			return -ENOMEM;
>  
>  		err = iommu_attach_device(host->domain, &pdev->dev);
> -		if (err)
> +		if (err == -ENODEV) {
> +			iommu_domain_free(host->domain);
> +			host->domain = NULL;
> +			goto iommu_skip;
> +		} else if (err) {
>  			goto fail_free_domain;
> +		}
>  
>  		geometry = &host->domain->geometry;
>  
> @@ -198,6 +203,7 @@ static int host1x_probe(struct platform_device
> *pdev)
>  		host->iova_end = geometry->aperture_end;
>  	}
>  
> +iommu_skip:
>  	err = host1x_channel_list_init(host);
>  	if (err) {
>  		dev_err(&pdev->dev, "failed to initialize channel
> list\n");
-- 
Paul Kocialkowski,

developer of free digital technology and hardware support

Website: https://www.paulk.fr/
Coding blog: https://code.paulk.fr/
Git repositories: https://git.paulk.fr/ https://git.code.paulk.fr/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ