Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933144AbdGKOhn (ORCPT ); Tue, 11 Jul 2017 10:37:43 -0400 Received: from mail-db5eur01on0099.outbound.protection.outlook.com ([104.47.2.99]:50475 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932678AbdGKOhk (ORCPT ); Tue, 11 Jul 2017 10:37:40 -0400 From: Marcel Ziswiler To: "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "contact@paulk.fr" , "linux-tegra@vger.kernel.org" CC: "jonathanh@nvidia.com" , "mperttunen@nvidia.com" , "treding@nvidia.com" , "swarren@nvidia.com" Subject: Re: [PATCH] gpu: host1x: Free the IOMMU domain when there is no device to attach Thread-Topic: [PATCH] gpu: host1x: Free the IOMMU domain when there is no device to attach Thread-Index: AQHS+lM8a3V+P1X7XkqejZ2gl9OH/g== Date: Tue, 11 Jul 2017 14:37:35 +0000 Message-ID: <1499783851.1520.16.camel@toradex.com> References: <20170710193305.5987-1-contact@paulk.fr> <1499762987.1340.10.camel@paulk.fr> In-Reply-To: <1499762987.1340.10.camel@paulk.fr> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: lists.infradead.org; dkim=none (message not signed) header.d=none;lists.infradead.org; dmarc=none action=none header.from=toradex.com; x-originating-ip: [46.140.72.82] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;HE1PR05MB1881;7:0iT16k6Clz6Ay6dkpQ8FWVo1/+Yl//KmqUXgp4Rgz+JIUDSyERejWfWazJal/MzZpn6hL7UXIhn06MadLO4u8WXDcymvaUCvrFaDLqiWW8QXNBgBfLA79QqrJAy+O83b1pWJhJvCCmPNmfVrR1Ws7XIxN69iOzC3/h0YFTmx9JBdcgVyxsUYAqwLOyo/gafPBYMAi8u2lcM2z7pW2Omdn0ARPT7buuqFdX20UqAsB9aera0p9Rw/4fIKBNwv8j6o5e/9TBr62fYQmOdM0ZAALD3Ql/QbcBOhJLm5ndVAF+thUUOLSec2hT1GY8xXLOOoI/eqwiBSxpwi7UqnA7dHhW2/iKLyOfLImyTwpnilISQB6PLLfYdfIyj/Noej7O7qAXi5qmWd1OJj9bwAUijEc0mDlzlemgvnRDnoHgbWx8cPo/yEkPPbAWhzwEQXL9hvEUR3HaO2twQCGB89vR0lkIUMdYr2ikNBZczrr30edQi8WX1rX1xtyOvV3mTcO5nMYkJfYxbKLbmlWOYWBQI9CNgbXMQAkWAmyLDi/W4pP40m4u0YrgPXs8E+NXd3e44uke0b57JMFzQWLy2ethMUORsQ9NjFISovj9J21/q19q4uEQc/WU0g7CJGudiL9NHWfvIhF/Hc9c9KtjPtdmxjCrwYa6s8Yr8IhPKfQ86Gd3YQMkhqVCmhB+OCrY0+kjINX5O9crmq/RJ4tflxH93O37xHCBr4duQ/MGznQDDyUOvbAD7UTenEoVC7KRwUIblZmjGS0uyRB9OsUPiuR/vCmCA++nkvmQX+PF5CpVJDMv0= x-ms-office365-filtering-correlation-id: 312c95b7-d6fd-4370-9be9-08d4c86a5f00 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:HE1PR05MB1881; x-ms-traffictypediagnostic: HE1PR05MB1881: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(133145235818549)(236129657087228); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(2017060910075)(5005006)(8121501046)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123562025)(20161123558100)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:HE1PR05MB1881;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:HE1PR05MB1881; x-forefront-prvs: 0365C0E14B x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39410400002)(39830400002)(39450400003)(39400400002)(377424004)(24454002)(6436002)(305945005)(99286003)(6512007)(53936002)(8936002)(54906002)(25786009)(2900100001)(7736002)(38730400002)(6246003)(575784001)(36756003)(103116003)(3280700002)(2950100002)(3660700001)(5660300001)(86362001)(14454004)(2201001)(229853002)(6506006)(4326008)(6486002)(3846002)(81166006)(33646002)(8676002)(50986999)(102836003)(54356999)(5250100002)(478600001)(2906002)(189998001)(5890100001)(6116002)(66066001)(2501003)(76176999)(32563001);DIR:OUT;SFP:1102;SCL:1;SRVR:HE1PR05MB1881;H:HE1PR05MB1882.eurprd05.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: <5442AF5CE277F048843A80B61A345BB7@eurprd05.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: toradex.com X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jul 2017 14:37:35.0171 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d9995866-0d9b-4251-8315-093f062abab4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB1881 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id v6BEbo3c013552 Content-Length: 2027 Lines: 59 On Tue, 2017-07-11 at 11:49 +0300, Paul Kocialkowski wrote: > 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 > org> > > --- > >  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"); Please note that this does no longer cleanly apply after Mikko's 'gpu: host1x: Refactor channel allocation code' commit from June 15 already applied to current -next. Other than that Tested-by: Marcel Ziswiler Tested-on: Apalis TK1, Apalis T30, Beaver, Colibri T30, Jetson-TK1 Finally graphics working again, thanks guys!