Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2733751ybk; Mon, 18 May 2020 06:44:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+Bxb71iblDGiSrUsbCVf0ZukB4FdGvba7paTl3LkYkQ7zXKV9wPY80BfU8j53G1meCt+t X-Received: by 2002:a50:ae02:: with SMTP id c2mr13031189edd.373.1589809480581; Mon, 18 May 2020 06:44:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589809480; cv=none; d=google.com; s=arc-20160816; b=WiMuCIcXPe645e9kA3WmG1Yw+p546ylXMwGcPU35zNkSU/mEKbOkUebLJb9aj3FacM kQPxRcl8qj4rGdoqX/hD1LMJTPBl55/zMERTJOOQ3qAFbuU/dHTrX+7844P7T14HyBou hkSgW52ajrkoGnDiX2CVcSHq31D8JM26Lj7IANr5WX7330zZqBaD5Sj85r4nOu9VBlSR yj+QCFxZPN3rQs5UGH+JDOtT9dXORcM7Xmri3jdKXVr7hug64HBPlq6ln1KfAoHgTtOX htTM5s9MM9z6olzy8qijUWdPgRP7u805eznA6AFma5bsW8NVR5SyZPP7Y4Jeyi7Bzkkf Bvrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=XdyEtz32YQbE3DNdhj1G+LsG3FzrGfFfuKS26wDfzaM=; b=fRYtcV/+U0aKSKSLUF8SNQtsDu+5z7kg9fQZw5aCOcCoBOWbQ7qXOT8dJ7vU4LjJel qM0Y7cCicSOo1k0U6yEH7/n5U/z5bMGinZbA7SuSRb9JD8IRE/rT/fWpaKui4Y0KiAWE q3FuARCbUIYv3ydhtJ0uEowVw7meWPP3pgHGuOSQyS4vlXhvzrD8VuztYRwVqoofdhJz B/aVrEj6HgCkeV9lvDFTDpvTUrFVOCuHqiYIcpS8c1aCQmDiFr8Fhf6oCQMFejzsBOaD eqm8w4WE7MbRNPzhXcF2ECGjoEh9hnCzqAz7B+VKFbZPmRpEEPnBlron8I64qYgrzkzI e6Fw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l10si5599908edv.152.2020.05.18.06.44.15; Mon, 18 May 2020 06:44:40 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727050AbgERNme (ORCPT + 99 others); Mon, 18 May 2020 09:42:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727034AbgERNme (ORCPT ); Mon, 18 May 2020 09:42:34 -0400 Received: from theia.8bytes.org (8bytes.org [IPv6:2a01:238:4383:600:38bc:a715:4b6d:a889]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2335C061A0C for ; Mon, 18 May 2020 06:42:33 -0700 (PDT) Received: by theia.8bytes.org (Postfix, from userid 1000) id 336D3386; Mon, 18 May 2020 15:42:31 +0200 (CEST) Date: Mon, 18 May 2020 15:42:29 +0200 From: Joerg Roedel To: Yong Wu Cc: Matthias Brugger , Will Deacon , Robin Murphy , linux-mediatek@lists.infradead.org, srv_heupstream@mediatek.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, youlin.pei@mediatek.com, anan.sun@mediatek.com Subject: Re: [PATCH] iommu/mediatek-v1: Add def_domain_type Message-ID: <20200518134229.GD18353@8bytes.org> References: <1589530123-30240-1-git-send-email-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1589530123-30240-1-git-send-email-yong.wu@mediatek.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 15, 2020 at 04:08:43PM +0800, Yong Wu wrote: > The MediaTek V1 IOMMU is arm32 whose default domain type is > IOMMU_DOMAIN_UNMANAGED. Add this to satisfy the bus_iommu_probe to > enter "probe_finalize". > > The iommu framework will create a iommu domain for each a device. > But all the devices share a iommu domain here, thus we skip all the > other domains in the "attach_device" except the domain we create > internally with arm_iommu_create_mapping. > > Also a minor change: in the attach_device, "data" always is not null. > Remove "if (!data) return". > > Signed-off-by: Yong Wu > --- > a. rebase on linux-next. > b. After this patch and fixed the mutex issue(locally I only move > mutex_unlock(&group->mutex) before __iommu_group_dma_attach(group)), > the mtk_iommu_v1.c could work normally. > --- > drivers/iommu/mtk_iommu_v1.c | 16 +++++++++++----- > 1 file changed, 11 insertions(+), 5 deletions(-) Applied, thanks.