Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1884353pxk; Sat, 5 Sep 2020 01:16:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRdYLdDo2YZOHcoXf3/tuXryc+zt1Uk3kdaq6pzOPAJKErQD0DWGYKHcUN43llTgRA/2/c X-Received: by 2002:a17:906:c0d1:: with SMTP id bn17mr11081874ejb.311.1599293818836; Sat, 05 Sep 2020 01:16:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599293818; cv=none; d=google.com; s=arc-20160816; b=RKvr+JABQgpfGX0Q+rGg48crJ7UBeM1LWCljj31GoKMg2FAw7QxytKeWQDLSAKY8Ef cv/54/BGiym7RUQ7QKkAevNU/sqQ1V8fclst8xP9Sxf887qbHBEDpa9iWgxsAqz7/05K Lrji8hnNXoCzJmSz1fOCqhfnmyW+VqB1wc57B3WIC1tfQqi/H32073u9vK0/gGSHgHQN +7fZpEdPYR5iSPHoLT5RhvFT8KQTPX+HRnKUx0xaPtTUWGPv5g73acDqR6bcrBUU2REc abAIkULR0ygcH//xPq2g5OAD1c7kXJxARBoYrw8F1GtV4VOTSX0+r8QTWxmW3ecj90TE fowQ== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=myVFj1U3iRi7Gh4AobiqyuhDtViW2dsfHPIq8FoB+qY=; b=jJkYkF8gJ4ZmTaDnkF1I5IRPH0xUOVC9nxIgs4Lx80ac+6XYJD5TjfKkJnGZL/M59a BOwqf3TcdH2tUxulnRc9OliyiRJWFiRQpAoszZ1/VjhWUPJcuN5hCXH42ECpWy8bqYAH Z325ItylMK4qVoZIKK8VQ5V0S7pcof7CutPTNXAk4CkZdJI8Ki589XebQAlWHA8jv6H8 lgqgNAEAghYZtiQt+biLdpEmVF5Evw5PGxYmLRp3+YafQU8jeI9qJY6wVFsS8JmQFAfI H6TSIF1WEJcxB1BEIks/rEbLjaRCoxR0cnzMd2FYOpMA3cho1dVBw1uzcMCZiOrm3Hp0 KWcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=edesmhfC; 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 si15si5791703ejb.246.2020.09.05.01.16.35; Sat, 05 Sep 2020 01:16:58 -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=@mediatek.com header.s=dk header.b=edesmhfC; 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 S1728490AbgIEINJ (ORCPT + 99 others); Sat, 5 Sep 2020 04:13:09 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:58408 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728465AbgIEINF (ORCPT ); Sat, 5 Sep 2020 04:13:05 -0400 X-UUID: 7f8506d2f66d43f4a5a9f6d754d03d14-20200905 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=myVFj1U3iRi7Gh4AobiqyuhDtViW2dsfHPIq8FoB+qY=; b=edesmhfC1p2Yep/nIwnAGF9/SVw6wgFjSSiGtrYUdAYPMQYM6ltkkbQG/A2NzYzssfMT+Q7EGJIDe6J7uYdM6bmIKiMS42tG+bJHMms9N+OHre8hndSCLTMDBztO/yMsxSiuwuw7pxrLkBcB8rSL4lIuHMF/JojXYmY2LuPHyf4=; X-UUID: 7f8506d2f66d43f4a5a9f6d754d03d14-20200905 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 2035466605; Sat, 05 Sep 2020 16:13:02 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 5 Sep 2020 16:12:59 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 5 Sep 2020 16:12:59 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Rob Herring , Robin Murphy CC: Will Deacon , Evan Green , Tomasz Figa , , , , , , , , , Nicolas Boichat , , , Subject: [PATCH v2 12/23] iommu/mediatek: Move hw_init into attach_device Date: Sat, 5 Sep 2020 16:09:09 +0800 Message-ID: <20200905080920.13396-13-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200905080920.13396-1-yong.wu@mediatek.com> References: <20200905080920.13396-1-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Content-Transfer-Encoding: base64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SW4gYXR0YWNoIGRldmljZSwgaXQgd2lsbCB1cGRhdGUgdGhlIHBhZ2V0YWJsZSBiYXNlIGFkZHJl c3MgcmVnaXN0ZXIuDQpNb3ZlIHRoZSBod19pbml0IGZ1bmN0aW9uIGFsc28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