Received: by 2002:a4f:b056:0:0:0:0:0 with SMTP id m22csp1421947ivi; Fri, 2 Oct 2020 09:41:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5gG5nT4PICD0NLVMciYMzXCVgr6+g5fqogUnBvh8xjXTvaQZ6j2oUh2AIhCwx4YY/GzF4 X-Received: by 2002:a17:906:8510:: with SMTP id i16mr3172027ejx.234.1601656878895; Fri, 02 Oct 2020 09:41:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601656878; cv=none; d=google.com; s=arc-20160816; b=b36kV5Syn2+rhrnpS0BkBQCFisMuz0SZwljGXgGpnXw1OXSPmbenE13qmJ/lYyCtES hoX34tQv2xKmmSRezZxkooI3JK4JPYB3oaNvpk3JphZ8apNkoN9pMLer/squ2pzlEYFv eKb+27oz1Uj99XHmJXwjmSpQXYA+dtdcUgX4++8ncKEMu37DTQ60+7V7R2NEfSLglvxU kXCIK07U3ciW9BNGJoBYEJ43zwewadn/FTe8mdE2njymwoTPsWbiGI1RpTx++kSmx04A da5hyJJ3a98LZwwjsWdqV2VDtlgSubzOfFM6JLecn1e8aSEBCEzenOkpQQPx+cUk4yq4 EeYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:from:subject:dkim-signature; bh=3s1ndk5JJzpTHJbjvHEODJg7aasvsgC96M1MqYVGaPM=; b=eF8j2EnhvO/uwH7XZMaoS+IqgUxiPaLeTE2dxdqvie6wBaJ2LjLfy0XeGUP87EMrBk DlFAJz8WaIdAXqmApqq78zPwEb55OSJyZAkv2UnTHhbfBRlKhD7XL//LA9/KqW8khVo7 Kk3ayQVuemszNAoyVBLwFMGl79e3ilnq5l0qTxRlHfzvneMeGozuqNFigPeXzIMGpmy/ ggvDgNCfL7ePmMfMmohAtyIu9vZuprUgF1lMp5S9M6BfSfZSerSRPziCAaf0AEUFKiop jfbWlOKbztnMZBSxDw80etr56mvS3fANOgcsuheX47Cwyb6mbCv90bpwJwsfdAfT/oqG TwEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MoUkOv1b; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p10si1331334edh.108.2020.10.02.09.40.56; Fri, 02 Oct 2020 09:41:18 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MoUkOv1b; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387908AbgJBQhS (ORCPT + 99 others); Fri, 2 Oct 2020 12:37:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726017AbgJBQhS (ORCPT ); Fri, 2 Oct 2020 12:37:18 -0400 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F8B4C0613D0; Fri, 2 Oct 2020 09:37:16 -0700 (PDT) Received: by mail-lf1-x143.google.com with SMTP id y17so2607691lfa.8; Fri, 02 Oct 2020 09:37:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=3s1ndk5JJzpTHJbjvHEODJg7aasvsgC96M1MqYVGaPM=; b=MoUkOv1bLFhwxqvQ7eJEzuUDqCvfwIHhzGJ+sSsfpRCg3Uj1Sos89Zsz4k0HwLFKNd 3tCzaQAjhTOVo8S339v+my5Lg7RGL4x8y7w6eD7Tr7PmQqPGn3S+H0lrZivY7JmXgfdL fFWqSt9VnLNGzqbZy4vqu8qxTLIWeyr0+RrrbOUwuPiLEoHeOf90eklJU7vmSvYcVxnb s+hrQgzG3nCq0iG4YAGJR4mpA75mHDFprpbaMEiv4018f1w4SUkLO2jtJoTHtOd1nE4S ldDiuedoWHw3Os8wYxuYgW+o7SHfB/V/aYQ1IZbQBg8iuT2LKSlBppPnzJbn3xz1WtXa +7ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=3s1ndk5JJzpTHJbjvHEODJg7aasvsgC96M1MqYVGaPM=; b=uGvJ5wiz5yOknrqwQHl3W5d8FcvCCa8XI3Y0cZTtzOvCfO4djqOXfRTniQjE/Lmkq7 oV4Hnn9RpMiOMCcScP/sPzYybfQ9HsX/JnMQQNLD1PLZIJRpoGprkml4S46fsNuNBcsG lDBUCNTusEpwv7xfv3TRYP7wRCBvO7sccQqVoGPf2CGmzq3ljbEB3vP/ciQ6Q13OzxJJ 0n5SGnvakN15MF9voBRWmYZJzVFP2v81oyyr4FF81bzf1UEzP4i5TLxP0e3j3vdkXxYE GQFDZDKaFi7R3Ie/8yhjP7O/JeuxOu/GL6EdhYFq39ZTmmLqz+eEvMUqSoQMcjuLxXNY SD/Q== X-Gm-Message-State: AOAM533IjEWeJj8q0FLAZzqFz+zJ0xuYXfJidyzIFvz3nPkGdWQHYUEl fugdveNYdQLL3LCxsWWEeILMHulnko0= X-Received: by 2002:ac2:538c:: with SMTP id g12mr1092249lfh.326.1601656633904; Fri, 02 Oct 2020 09:37:13 -0700 (PDT) Received: from [192.168.2.145] (109-252-91-252.nat.spd-mgts.ru. [109.252.91.252]) by smtp.googlemail.com with ESMTPSA id t14sm383650lfp.77.2020.10.02.09.37.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 Oct 2020 09:37:12 -0700 (PDT) Subject: Re: [PATCH v4 2/3] iommu/tegra-smmu: Rework tegra_smmu_probe_device() From: Dmitry Osipenko To: Nicolin Chen , thierry.reding@gmail.com, joro@8bytes.org, Maxime Ripard Cc: vdumpa@nvidia.com, jonathanh@nvidia.com, linux-tegra@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org References: <20201002060807.32138-1-nicoleotsuka@gmail.com> <20201002060807.32138-3-nicoleotsuka@gmail.com> <99d322d0-efb5-8a34-ee83-b907b785ced3@gmail.com> <3ecfe9ae-fa32-8384-c912-4e17ff5fede7@gmail.com> Message-ID: <6018e1c5-9ddd-3e37-1d6b-3feb969a7474@gmail.com> Date: Fri, 2 Oct 2020 19:37:11 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <3ecfe9ae-fa32-8384-c912-4e17ff5fede7@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 02.10.2020 19:00, Dmitry Osipenko пишет: > 02.10.2020 18:23, Dmitry Osipenko пишет: >> 02.10.2020 09:08, Nicolin Chen пишет: >>> Then when a client gets probed, of_iommu_configure() in >>> iommu core will search DTB for swgroup ID and call ->of_xlate() >>> to prepare an fwspec, similar to tegra_smmu_probe_device() and >>> tegra_smmu_configure(). Then it'll call tegra_smmu_probe_device() >>> again, and this time we shall return smmu->iommu pointer properly. >> >> I don't quite see where IOMMU core calls of_xlate(). >> >> Have tried to at least boot-test this patch? >> > > I don't see how it ever could work because of_xlate() is only invoked from: > > fsl_mc_dma_configure()->of_dma_configure_id()->of_iommu_configure() > > Looks like the tegra_smmu_configure() is still needed. > > I don't know how sun50i driver could work to be honest. Seems IOMMU is > broken on sun50i, but maybe I'm missing something. > > I added Maxime Ripard to this thread, who is the author of the > sun50i-iommu driver. > Actually, I now see that the other IOMMU drivers (qcom, exynos, etc) do the same. So obviously I'm missing something and it should work..