Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1638013pxa; Thu, 20 Aug 2020 17:00:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRJa/454SEJcV+GhU8a18lPXzSBQ59T+me+KDYcgGvMYd5ZB/2HjMZHvfsQgy2or+spOHl X-Received: by 2002:a05:6402:1a26:: with SMTP id be6mr364561edb.162.1597968037930; Thu, 20 Aug 2020 17:00:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597968037; cv=none; d=google.com; s=arc-20160816; b=L31/umpSIv6fQ9tnmDDNnJsj7YGkZA6AtrpLbpje1ck3z4G/AzGKadmrFFCpKTZsfi P9Pc/vyAvPmYgLPMoL2e0/kdjHGYrV8pTIH7JedvhpACbt9F/YtYmFY4p3x97kJkM9eF Knm6Lz9x/hNYUFkKNQRCLPP0zKwD3ni3aO2MW4RIaqe86ZpOaXjzwNX7luP0qxqxJk4U q7rUY71sAD4fioZSbZhZNeY/qRx41/jT6rj00mmrOfUHB39jo2eT1JDZMx7RGmQludcC szhNMg219Vdy728COT6Y5nTuFHdCoPl7X6CAmne+T3yjD3uxHlze42gDU+3Lbh81XcXF RjNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=zl1QxScgA0qrgk7f3TYczASNgpZvOi3nXxuGzDA57Ro=; b=oXkThJ6XFlAtcEY+91zwG49Ol5EBr+6Uz9caAQk7daCNBraLZZ9oWRpv2Wts4DLeC5 uxrjtcgQoAADf2eL+89zRbXfItUzm/IxBVwUv0QMUh4loXXRDRgpNhXJRImH0w8E/ef4 p28rp1KZF3SkQN01PPLejp6nXKt9exwgxMhruhb2eH5EL0KSfAYc3MUSjblLxEN/7+4v aADChXQCRA53lldlLmSun2c2m1rr/vQQdjTC6QbI4vTZOpZawfix6aenjhCQmV+FyMo/ KlehvoWxXXdfb3jdgZlJhxaifjHZjv5PbqN3CVXI0Wq3XuS7aU7vKRJ4wVNQ0BRLW5S+ N/ZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 96si82653edq.405.2020.08.20.17.00.14; Thu, 20 Aug 2020 17:00:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728608AbgHTXBq (ORCPT + 99 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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.