From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A9CDC433E5 for ; Thu, 20 Aug 2020 23:01:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1DDF5207DF for ; Thu, 20 Aug 2020 23:01:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728600AbgHTXBq (ORCPT ); Thu, 20 Aug 2020 19:01:46 -0400 Received: from foss.arm.com ([217.140.110.172]:46972 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728368AbgHTXBq (ORCPT ); Thu, 20 Aug 2020 19:01:46 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C6C6331B; Thu, 20 Aug 2020 16:01:44 -0700 (PDT) Received: from [10.57.40.122] (unknown [10.57.40.122]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 98AAB3F71F; Thu, 20 Aug 2020 16:01:39 -0700 (PDT) Subject: Re: [PATCH 17/18] media/omap3isp: Clean up IOMMU workaround To: Sakari Ailus Cc: hch@lst.de, joro@8bytes.org, linux@armlinux.org.uk, will@kernel.org, inki.dae@samsung.com, sw0312.kim@samsung.com, kyungmin.park@samsung.com, m.szyprowski@samsung.com, agross@kernel.org, bjorn.andersson@linaro.org, thierry.reding@gmail.com, jonathanh@nvidia.com, vdumpa@nvidia.com, digetx@gmail.com, matthias.bgg@gmail.com, yong.wu@mediatek.com, geert+renesas@glider.be, magnus.damm@gmail.com, t-kristo@ti.com, s-anna@ti.com, laurent.pinchart@ideasonboard.com, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org References: <11d8419744e4e744a9448180801b0c4683328afd.1597931876.git.robin.murphy@arm.com> <20200820165339.GK7145@valkosipuli.retiisi.org.uk> <20200820195536.GL7145@valkosipuli.retiisi.org.uk> From: Robin Murphy Message-ID: <5190a40e-ad24-d98e-3588-b95592ea2db3@arm.com> Date: Fri, 21 Aug 2020 00:01:38 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200820195536.GL7145@valkosipuli.retiisi.org.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org On 2020-08-20 20:55, Sakari Ailus wrote: > On Thu, Aug 20, 2020 at 06:25:19PM +0100, Robin Murphy wrote: >> On 2020-08-20 17:53, Sakari Ailus wrote: >>> Hi Robin, >>> >>> On Thu, Aug 20, 2020 at 04:08:36PM +0100, Robin Murphy wrote: >>>> Now that arch/arm is wired up for default domains and iommu-dma, devices >>>> behind IOMMUs will get mappings set up automatically as appropriate, so >>>> there is no need for drivers to do so manually. >>>> >>>> Signed-off-by: Robin Murphy >>> >>> Thanks for the patch. >> >> Many thanks for testing so quickly! >> >>> I haven't looked at the details but it seems that this causes the buffer >>> memory allocation to be physically contiguous, which causes a failure to >>> allocate video buffers of entirely normal size. I guess that was not >>> intentional? >> >> Hmm, it looks like the device ends up with the wrong DMA ops, which implies >> something didn't go as expected with the earlier IOMMU setup and default >> domain creation. Chances are that either I missed some subtlety in the >> omap_iommu change, or I've fundamentally misjudged how the ISP probing works >> and it never actually goes down the of_iommu_configure() path in the first >> place. Do you get any messages from the IOMMU layer earlier on during boot? > > I do get these: > > [ 2.934936] iommu: Default domain type: Translated > [ 2.940917] omap-iommu 480bd400.mmu: 480bd400.mmu registered > [ 2.946899] platform 480bc000.isp: Adding to iommu group 0 > So that much looks OK, if there are no obvious errors. Unfortunately there's no easy way to tell exactly what of_iommu_configure() is doing (beyond enabling a couple of vague debug messages). The first thing I'll do tomorrow is double-check whether it's really working on my boards here, or whether I was just getting lucky with CMA... (I assume you don't have CMA enabled if you're ending up in remap_allocator_alloc()) Robin. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3815FC433E3 for ; Thu, 20 Aug 2020 23:01:49 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E2A8C2087D for ; Thu, 20 Aug 2020 23:01:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E2A8C2087D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id A765D885BA; Thu, 20 Aug 2020 23:01:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gfcvsCHLWo2l; Thu, 20 Aug 2020 23:01:47 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id C2147885BD; Thu, 20 Aug 2020 23:01:47 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id A4907C0894; Thu, 20 Aug 2020 23:01:47 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id BD753C0051 for ; Thu, 20 Aug 2020 23:01:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A98DC884BF for ; Thu, 20 Aug 2020 23:01:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id twkwaHCbUaB6 for ; Thu, 20 Aug 2020 23:01:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by whitealder.osuosl.org (Postfix) with ESMTP id B6DF0884BE for ; Thu, 20 Aug 2020 23:01:45 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C6C6331B; Thu, 20 Aug 2020 16:01:44 -0700 (PDT) Received: from [10.57.40.122] (unknown [10.57.40.122]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 98AAB3F71F; Thu, 20 Aug 2020 16:01:39 -0700 (PDT) Subject: Re: [PATCH 17/18] media/omap3isp: Clean up IOMMU workaround To: Sakari Ailus References: <11d8419744e4e744a9448180801b0c4683328afd.1597931876.git.robin.murphy@arm.com> <20200820165339.GK7145@valkosipuli.retiisi.org.uk> <20200820195536.GL7145@valkosipuli.retiisi.org.uk> From: Robin Murphy Message-ID: <5190a40e-ad24-d98e-3588-b95592ea2db3@arm.com> Date: Fri, 21 Aug 2020 00:01:38 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200820195536.GL7145@valkosipuli.retiisi.org.uk> Content-Language: en-GB Cc: geert+renesas@glider.be, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, thierry.reding@gmail.com, laurent.pinchart@ideasonboard.com, digetx@gmail.com, will@kernel.org, hch@lst.de, linux-samsung-soc@vger.kernel.org, magnus.damm@gmail.com, linux@armlinux.org.uk, jonathanh@nvidia.com, agross@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, inki.dae@samsung.com, linux-mediatek@lists.infradead.org, matthias.bgg@gmail.com, linux-arm-kernel@lists.infradead.org, sw0312.kim@samsung.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, t-kristo@ti.com, kyungmin.park@samsung.com X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On 2020-08-20 20:55, Sakari Ailus wrote: > On Thu, Aug 20, 2020 at 06:25:19PM +0100, Robin Murphy wrote: >> On 2020-08-20 17:53, Sakari Ailus wrote: >>> Hi Robin, >>> >>> On Thu, Aug 20, 2020 at 04:08:36PM +0100, Robin Murphy wrote: >>>> Now that arch/arm is wired up for default domains and iommu-dma, devices >>>> behind IOMMUs will get mappings set up automatically as appropriate, so >>>> there is no need for drivers to do so manually. >>>> >>>> Signed-off-by: Robin Murphy >>> >>> Thanks for the patch. >> >> Many thanks for testing so quickly! >> >>> I haven't looked at the details but it seems that this causes the buffer >>> memory allocation to be physically contiguous, which causes a failure to >>> allocate video buffers of entirely normal size. I guess that was not >>> intentional? >> >> Hmm, it looks like the device ends up with the wrong DMA ops, which implies >> something didn't go as expected with the earlier IOMMU setup and default >> domain creation. Chances are that either I missed some subtlety in the >> omap_iommu change, or I've fundamentally misjudged how the ISP probing works >> and it never actually goes down the of_iommu_configure() path in the first >> place. Do you get any messages from the IOMMU layer earlier on during boot? > > I do get these: > > [ 2.934936] iommu: Default domain type: Translated > [ 2.940917] omap-iommu 480bd400.mmu: 480bd400.mmu registered > [ 2.946899] platform 480bc000.isp: Adding to iommu group 0 > So that much looks OK, if there are no obvious errors. Unfortunately there's no easy way to tell exactly what of_iommu_configure() is doing (beyond enabling a couple of vague debug messages). The first thing I'll do tomorrow is double-check whether it's really working on my boards here, or whether I was just getting lucky with CMA... (I assume you don't have CMA enabled if you're ending up in remap_allocator_alloc()) Robin. _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D406CC433DF for ; Thu, 20 Aug 2020 23:02:07 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A35C22075E for ; Thu, 20 Aug 2020 23:02:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YCwM6Xui" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A35C22075E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=p2KftGjfEA0R2rcQxp6DNe8v/pP4iDnPVvBr/AbZscU=; b=YCwM6XuifkLNtUqAi0BkCxhSC CZp5hG2gREkRliOnHLuWJDEnBYeVEuOV/kooN2oMpF+8GWrTAPcE552Fpm4dDs0soLRCT2wBJOrl7 PpMjvYRRgnv+bphZZcbhe/6Dk2OGop94YwsMm5WWpzVs4JXakjoPj/vNHpLp5IJDJUjmlsTmfYUFt yzRnOmr80H2ZGkqTmYuOdsOqi0y01cg8fkJbBfBzads9hBAc45Ix34Y4CGDHxaDZVt5tp1+FTf9Tp WGtBZxSylWF7o19FLoocNFbIfE6IxNRsLF4VjX/jTS03zvRcaYkLasbZIq35XzvUfc2oyiQ6SiK+l zwyt1Qkww==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8tZE-0007Q9-FP; Thu, 20 Aug 2020 23:01:56 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8tZ9-0007O4-5g; Thu, 20 Aug 2020 23:01:52 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C6C6331B; Thu, 20 Aug 2020 16:01:44 -0700 (PDT) Received: from [10.57.40.122] (unknown [10.57.40.122]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 98AAB3F71F; Thu, 20 Aug 2020 16:01:39 -0700 (PDT) Subject: Re: [PATCH 17/18] media/omap3isp: Clean up IOMMU workaround To: Sakari Ailus References: <11d8419744e4e744a9448180801b0c4683328afd.1597931876.git.robin.murphy@arm.com> <20200820165339.GK7145@valkosipuli.retiisi.org.uk> <20200820195536.GL7145@valkosipuli.retiisi.org.uk> From: Robin Murphy Message-ID: <5190a40e-ad24-d98e-3588-b95592ea2db3@arm.com> Date: Fri, 21 Aug 2020 00:01:38 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200820195536.GL7145@valkosipuli.retiisi.org.uk> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200820_190151_391153_FCBAD133 X-CRM114-Status: GOOD ( 19.41 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: geert+renesas@glider.be, dri-devel@lists.freedesktop.org, bjorn.andersson@linaro.org, linux-tegra@vger.kernel.org, thierry.reding@gmail.com, laurent.pinchart@ideasonboard.com, digetx@gmail.com, s-anna@ti.com, will@kernel.org, hch@lst.de, m.szyprowski@samsung.com, linux-samsung-soc@vger.kernel.org, joro@8bytes.org, magnus.damm@gmail.com, linux@armlinux.org.uk, jonathanh@nvidia.com, agross@kernel.org, yong.wu@mediatek.com, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, inki.dae@samsung.com, vdumpa@nvidia.com, linux-mediatek@lists.infradead.org, matthias.bgg@gmail.com, linux-arm-kernel@lists.infradead.org, sw0312.kim@samsung.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, t-kristo@ti.com, kyungmin.park@samsung.com Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On 2020-08-20 20:55, Sakari Ailus wrote: > On Thu, Aug 20, 2020 at 06:25:19PM +0100, Robin Murphy wrote: >> On 2020-08-20 17:53, Sakari Ailus wrote: >>> Hi Robin, >>> >>> On Thu, Aug 20, 2020 at 04:08:36PM +0100, Robin Murphy wrote: >>>> Now that arch/arm is wired up for default domains and iommu-dma, devices >>>> behind IOMMUs will get mappings set up automatically as appropriate, so >>>> there is no need for drivers to do so manually. >>>> >>>> Signed-off-by: Robin Murphy >>> >>> Thanks for the patch. >> >> Many thanks for testing so quickly! >> >>> I haven't looked at the details but it seems that this causes the buffer >>> memory allocation to be physically contiguous, which causes a failure to >>> allocate video buffers of entirely normal size. I guess that was not >>> intentional? >> >> Hmm, it looks like the device ends up with the wrong DMA ops, which implies >> something didn't go as expected with the earlier IOMMU setup and default >> domain creation. Chances are that either I missed some subtlety in the >> omap_iommu change, or I've fundamentally misjudged how the ISP probing works >> and it never actually goes down the of_iommu_configure() path in the first >> place. Do you get any messages from the IOMMU layer earlier on during boot? > > I do get these: > > [ 2.934936] iommu: Default domain type: Translated > [ 2.940917] omap-iommu 480bd400.mmu: 480bd400.mmu registered > [ 2.946899] platform 480bc000.isp: Adding to iommu group 0 > So that much looks OK, if there are no obvious errors. Unfortunately there's no easy way to tell exactly what of_iommu_configure() is doing (beyond enabling a couple of vague debug messages). The first thing I'll do tomorrow is double-check whether it's really working on my boards here, or whether I was just getting lucky with CMA... (I assume you don't have CMA enabled if you're ending up in remap_allocator_alloc()) Robin. _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E325CC433E1 for ; Thu, 20 Aug 2020 23:03:15 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ABD182075E for ; Thu, 20 Aug 2020 23:03:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ag9mBF14" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ABD182075E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uadhI4K5Qd+mt68O/NDRzwLkCZJ9Z9fHvZR9IZhOu8M=; b=Ag9mBF14PDqqfi4E4Jtr+8qaV VkI6KO7iCu3sotLYHJSReiCFjwomdzex/6ffcwRqZeoK7hP5qBeID4p2LmBO02lq4i3703jc8s6uU Civ6uma/2q5jvxiP0b9iNs0p+h59vApNCLHQjecXC+l/K2UbQWeSksL2HDV10VE7gjijdz/1Gz5lo DtQv+L8/RRvVfievTjaFOgKAtv/x1RiX/xpjjVgGyH1Ya7OsYG65S67Z96KDk5ol0/7PkdB5XROzx hBqPlCthp1HZ/fGfOfnkmZD0TTz3oovBl7PWI5t8g50dfex/INUAwAeNpOZZSXn42/2djbsGtzvL2 3Rp3cytjg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8tZC-0007Pp-W3; Thu, 20 Aug 2020 23:01:55 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8tZ9-0007O4-5g; Thu, 20 Aug 2020 23:01:52 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C6C6331B; Thu, 20 Aug 2020 16:01:44 -0700 (PDT) Received: from [10.57.40.122] (unknown [10.57.40.122]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 98AAB3F71F; Thu, 20 Aug 2020 16:01:39 -0700 (PDT) Subject: Re: [PATCH 17/18] media/omap3isp: Clean up IOMMU workaround To: Sakari Ailus References: <11d8419744e4e744a9448180801b0c4683328afd.1597931876.git.robin.murphy@arm.com> <20200820165339.GK7145@valkosipuli.retiisi.org.uk> <20200820195536.GL7145@valkosipuli.retiisi.org.uk> From: Robin Murphy Message-ID: <5190a40e-ad24-d98e-3588-b95592ea2db3@arm.com> Date: Fri, 21 Aug 2020 00:01:38 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200820195536.GL7145@valkosipuli.retiisi.org.uk> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200820_190151_391153_FCBAD133 X-CRM114-Status: GOOD ( 19.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: geert+renesas@glider.be, dri-devel@lists.freedesktop.org, bjorn.andersson@linaro.org, linux-tegra@vger.kernel.org, thierry.reding@gmail.com, laurent.pinchart@ideasonboard.com, digetx@gmail.com, will@kernel.org, hch@lst.de, m.szyprowski@samsung.com, linux-samsung-soc@vger.kernel.org, joro@8bytes.org, magnus.damm@gmail.com, linux@armlinux.org.uk, jonathanh@nvidia.com, agross@kernel.org, yong.wu@mediatek.com, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, inki.dae@samsung.com, linux-mediatek@lists.infradead.org, matthias.bgg@gmail.com, linux-arm-kernel@lists.infradead.org, sw0312.kim@samsung.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, t-kristo@ti.com, kyungmin.park@samsung.com Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2020-08-20 20:55, Sakari Ailus wrote: > On Thu, Aug 20, 2020 at 06:25:19PM +0100, Robin Murphy wrote: >> On 2020-08-20 17:53, Sakari Ailus wrote: >>> Hi Robin, >>> >>> On Thu, Aug 20, 2020 at 04:08:36PM +0100, Robin Murphy wrote: >>>> Now that arch/arm is wired up for default domains and iommu-dma, devices >>>> behind IOMMUs will get mappings set up automatically as appropriate, so >>>> there is no need for drivers to do so manually. >>>> >>>> Signed-off-by: Robin Murphy >>> >>> Thanks for the patch. >> >> Many thanks for testing so quickly! >> >>> I haven't looked at the details but it seems that this causes the buffer >>> memory allocation to be physically contiguous, which causes a failure to >>> allocate video buffers of entirely normal size. I guess that was not >>> intentional? >> >> Hmm, it looks like the device ends up with the wrong DMA ops, which implies >> something didn't go as expected with the earlier IOMMU setup and default >> domain creation. Chances are that either I missed some subtlety in the >> omap_iommu change, or I've fundamentally misjudged how the ISP probing works >> and it never actually goes down the of_iommu_configure() path in the first >> place. Do you get any messages from the IOMMU layer earlier on during boot? > > I do get these: > > [ 2.934936] iommu: Default domain type: Translated > [ 2.940917] omap-iommu 480bd400.mmu: 480bd400.mmu registered > [ 2.946899] platform 480bc000.isp: Adding to iommu group 0 > So that much looks OK, if there are no obvious errors. Unfortunately there's no easy way to tell exactly what of_iommu_configure() is doing (beyond enabling a couple of vague debug messages). The first thing I'll do tomorrow is double-check whether it's really working on my boards here, or whether I was just getting lucky with CMA... (I assume you don't have CMA enabled if you're ending up in remap_allocator_alloc()) Robin. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52150C433E1 for ; Thu, 20 Aug 2020 23:01:48 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 11CA82075E for ; Thu, 20 Aug 2020 23:01:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 11CA82075E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 72BC36E040; Thu, 20 Aug 2020 23:01:47 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by gabe.freedesktop.org (Postfix) with ESMTP id 0B87F6E040 for ; Thu, 20 Aug 2020 23:01:45 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C6C6331B; Thu, 20 Aug 2020 16:01:44 -0700 (PDT) Received: from [10.57.40.122] (unknown [10.57.40.122]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 98AAB3F71F; Thu, 20 Aug 2020 16:01:39 -0700 (PDT) Subject: Re: [PATCH 17/18] media/omap3isp: Clean up IOMMU workaround To: Sakari Ailus References: <11d8419744e4e744a9448180801b0c4683328afd.1597931876.git.robin.murphy@arm.com> <20200820165339.GK7145@valkosipuli.retiisi.org.uk> <20200820195536.GL7145@valkosipuli.retiisi.org.uk> From: Robin Murphy Message-ID: <5190a40e-ad24-d98e-3588-b95592ea2db3@arm.com> Date: Fri, 21 Aug 2020 00:01:38 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200820195536.GL7145@valkosipuli.retiisi.org.uk> Content-Language: en-GB X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: geert+renesas@glider.be, dri-devel@lists.freedesktop.org, bjorn.andersson@linaro.org, linux-tegra@vger.kernel.org, thierry.reding@gmail.com, laurent.pinchart@ideasonboard.com, digetx@gmail.com, s-anna@ti.com, will@kernel.org, hch@lst.de, m.szyprowski@samsung.com, linux-samsung-soc@vger.kernel.org, joro@8bytes.org, magnus.damm@gmail.com, linux@armlinux.org.uk, jonathanh@nvidia.com, agross@kernel.org, yong.wu@mediatek.com, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, vdumpa@nvidia.com, linux-mediatek@lists.infradead.org, matthias.bgg@gmail.com, linux-arm-kernel@lists.infradead.org, sw0312.kim@samsung.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, t-kristo@ti.com, kyungmin.park@samsung.com Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 2020-08-20 20:55, Sakari Ailus wrote: > On Thu, Aug 20, 2020 at 06:25:19PM +0100, Robin Murphy wrote: >> On 2020-08-20 17:53, Sakari Ailus wrote: >>> Hi Robin, >>> >>> On Thu, Aug 20, 2020 at 04:08:36PM +0100, Robin Murphy wrote: >>>> Now that arch/arm is wired up for default domains and iommu-dma, devices >>>> behind IOMMUs will get mappings set up automatically as appropriate, so >>>> there is no need for drivers to do so manually. >>>> >>>> Signed-off-by: Robin Murphy >>> >>> Thanks for the patch. >> >> Many thanks for testing so quickly! >> >>> I haven't looked at the details but it seems that this causes the buffer >>> memory allocation to be physically contiguous, which causes a failure to >>> allocate video buffers of entirely normal size. I guess that was not >>> intentional? >> >> Hmm, it looks like the device ends up with the wrong DMA ops, which implies >> something didn't go as expected with the earlier IOMMU setup and default >> domain creation. Chances are that either I missed some subtlety in the >> omap_iommu change, or I've fundamentally misjudged how the ISP probing works >> and it never actually goes down the of_iommu_configure() path in the first >> place. Do you get any messages from the IOMMU layer earlier on during boot? > > I do get these: > > [ 2.934936] iommu: Default domain type: Translated > [ 2.940917] omap-iommu 480bd400.mmu: 480bd400.mmu registered > [ 2.946899] platform 480bc000.isp: Adding to iommu group 0 > So that much looks OK, if there are no obvious errors. Unfortunately there's no easy way to tell exactly what of_iommu_configure() is doing (beyond enabling a couple of vague debug messages). The first thing I'll do tomorrow is double-check whether it's really working on my boards here, or whether I was just getting lucky with CMA... (I assume you don't have CMA enabled if you're ending up in remap_allocator_alloc()) Robin. _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel