From patchwork Fri Jul 14 17:30:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 9841471 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 96D2D602D8 for ; Fri, 14 Jul 2017 17:30:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78B4C287A1 for ; Fri, 14 Jul 2017 17:30:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D34B287B0; Fri, 14 Jul 2017 17:30:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BE49B287A2 for ; Fri, 14 Jul 2017 17:30:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AF9376E89F; Fri, 14 Jul 2017 17:30:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lb1-smtp-cloud3.xs4all.net (lb1-smtp-cloud3.xs4all.net [194.109.24.22]) by gabe.freedesktop.org (Postfix) with ESMTPS id A973F6E89F for ; Fri, 14 Jul 2017 17:30:24 +0000 (UTC) Received: from [192.168.1.10] ([80.101.105.217]) by smtp-cloud3.xs4all.net with ESMTP id khWL1v00C4hSry801hWMST; Fri, 14 Jul 2017 19:30:21 +0200 To: "dri-devel@lists.freedesktop.org" , Thierry Reding , Mikko Perttunen From: Hans Verkuil Subject: Jetson TK1 & HDMI output in mainline kernel Message-ID: <4736cd4f-adcb-8e7d-f5a1-c71bb7c88ff8@xs4all.nl> Date: Fri, 14 Jul 2017 19:30:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hi Mikko, Thierry, While setting up my Jetson TK1 using the mainline kernel I discovered that the HDMI output didn't work. After some more debugging I discovered that this commit 404bfb78daf3bedafb0bfab24947059575cbea3d (gpu: host1x: Add IOMMU support) was the culprit. As far as I understand it host1x_probe() calls iommu_attach_device(), which in turn tries to find the 'iommus' property in the DT. But the hdmi@54280000 device has no such property and so iommu_attach_device() returns -ENODEV and the host1x_probe fails. After making this extremely ugly patch it all works again: My plan is to use my Jetson TK1 to upstream the Tegra CEC driver that I wrote, but a working HDMI output would help a lot :-) I'm not sure if my analysis of the cause is correct, but if someone can take a look then I would appreciate that! Regards, Hans diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c index 2c58a390123a..683f3a5f382a 100644 --- a/drivers/gpu/host1x/dev.c +++ b/drivers/gpu/host1x/dev.c @@ -186,6 +186,11 @@ static int host1x_probe(struct platform_device *pdev) return -ENOMEM; err = iommu_attach_device(host->domain, &pdev->dev); + if (err == -ENODEV) { + iommu_domain_free(host->domain); + host->domain = NULL; + goto no_mmu; + } if (err) goto fail_free_domain; @@ -197,7 +202,7 @@ static int host1x_probe(struct platform_device *pdev) geometry->aperture_end >> order); host->iova_end = geometry->aperture_end; } - +no_mmu: err = host1x_channel_list_init(&host->channel_list, host->info->nb_channels); if (err) {