Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1162070pxu; Fri, 27 Nov 2020 00:53:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJzD7gEf9IAcnazxwCyFjB6Eg8nWFlwgCM8dT1M1wUpjY7HTFCWXn+0JZ9MV6p3+T+1DF4TR X-Received: by 2002:aa7:c886:: with SMTP id p6mr6497235eds.207.1606467206027; Fri, 27 Nov 2020 00:53:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606467206; cv=none; d=google.com; s=arc-20160816; b=UkgFiSn7Fmx8nv+43fTirTVQjvEjoa8t79nPWfz9Kgi1ckffavk504cKIWr201EPk7 AsU0hwnQllFTaOs4V3DVf07PuAfASBChBAnXjU+ofZMSUgk4IsgSpTHcDU7aYBpT7cvM w8qMxwbeDScJlQTHxm7HwKW2OUaHL9wrH17EFSOL5mJOmeWF8ve29t1p/vU6e50iiECf C+28FVhuTYHtcfD/8/5M59LnCmoUVuCNYxVRs7l1nSFvwRgtU5eZu3niq+E+pXo9xwh5 bYLjoo87giDgLu46b76mhbvCoeoCQRnEZgqhdedJBgVrLga/4F6Z1T0tfv+bbJz4laBj QQIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=OMqcICORIcAhhkjnMDt3nLKuOy2OfxolaCABKDolAkc=; b=bf1qoPx5QSLz70AHKW8FECaS4p+v8vySDo1EBusDBTsTaLRwKZ/8I2y61UFMrbcqFh CkcLj5RpD5xk2Ht805YD/C0vnVybb8rWRghY9BfVee9DrO7R5fyHlIWcyOCngj2PjlNy wSjveI1tkq+/IXiz32LTfxH9OolAmzRpO8d8RtWgpDyVN+5A1Q5J3jIvfaGN/A1N7zyH XuRhb02Jyir73PEqQARYSbl9mnXcUVxvZK1jRnPaya3JQZMUDvA4EtWLUjqxD/5lIMV4 IW5pyN+F6Wwjej+OjVbjr7YLhilG19Yn8OwvEN4jDeRC7CkYy8sQVMqi7mtnTsl+kexv JVHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="Ug/+xYEL"; 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=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jz19si5458884ejb.238.2020.11.27.00.53.03; Fri, 27 Nov 2020 00:53:26 -0800 (PST) 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=@mediatek.com header.s=dk header.b="Ug/+xYEL"; 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=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392558AbgK0GXW (ORCPT + 99 others); Fri, 27 Nov 2020 01:23:22 -0500 Received: from Mailgw01.mediatek.com ([1.203.163.78]:28946 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2389406AbgK0GXW (ORCPT ); Fri, 27 Nov 2020 01:23:22 -0500 X-UUID: 1c604bebc27747fa8bfd2f20124312cf-20201127 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=OMqcICORIcAhhkjnMDt3nLKuOy2OfxolaCABKDolAkc=; b=Ug/+xYELIK6kMlj3IIsEmoYCFqKuOLS6MwmyAURs1j9HDn6ltMCkA2jVyMZgFqEJyoN9g226OXa2a5V+TS02GlUMopl2T4iOOXAeFlEyN5khfsfH91I2DE9ILyUIg9ZpJOEYXhPUWgsF1lrUuJHNfsmbZXQL8pL11yy7fLGvL1s=; X-UUID: 1c604bebc27747fa8bfd2f20124312cf-20201127 Received: from mtkcas36.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1465978574; Fri, 27 Nov 2020 14:23:16 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS31N2.mediatek.inc (172.27.4.87) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 27 Nov 2020 14:23:14 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 27 Nov 2020 14:23:13 +0800 Message-ID: <1606458194.26323.193.camel@mhfsdcap03> Subject: Re: [PATCH v4 12/24] iommu/mediatek: Move hw_init into attach_device From: Yong Wu To: Robin Murphy CC: Joerg Roedel , Matthias Brugger , Rob Herring , Will Deacon , , , Nicolas Boichat , , , , , Evan Green , "Tomasz Figa" , , , Krzysztof Kozlowski , , Greg Kroah-Hartman , Date: Fri, 27 Nov 2020 14:23:14 +0800 In-Reply-To: <55bb14ef-f674-e55c-0803-43d91093eccb@arm.com> References: <20201111123838.15682-1-yong.wu@mediatek.com> <20201111123838.15682-13-yong.wu@mediatek.com> <55bb14ef-f674-e55c-0803-43d91093eccb@arm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-TM-SNTS-SMTP: 8E4E74E78C2C0A3F2DB182D6E5EF394369AE6F486379FA945EA54C8360F9A0862000:8 X-MTK: N Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org T24gVGh1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