Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4353829pxk; Wed, 30 Sep 2020 00:13:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybKRIA7ZZz1JInQ+4oNfLjYxxNfPxtxR9R4HqCf6IWw2tXY68WRwKEBVHMI3uQ/6TJ5BGk X-Received: by 2002:a17:907:20d9:: with SMTP id qq25mr1356656ejb.382.1601450004452; Wed, 30 Sep 2020 00:13:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601450004; cv=none; d=google.com; s=arc-20160816; b=vhf6FPMXGZJdV/rRR2wkuMG1WdzOi2zRVWwTPuII3iztgrZyGJxX+8E/ivZN//+KUr fVHy94M3SwNSuONGHQ8La1z/lDwc7jZGMaoJd1paNRizMHrPkSW1+Vu4oxcWknyJmM4v jfnxLkbZ1Fvb4+hPYs0LxCaSCf54JdFaM1zMy4QYXG6/EwkURYXlaJQKpAaxrxSXRxRt I4ExYUPXsGGossj+2wVgwfsJMSDt7SrFN9tr7b5yC0GzieOXmKmaRldzcpe5GtNusf9s jJ0FwJX1Jw6BMjR7RR6SGGcbzooUdTYebBCD2aJxzql+nd8uZd9fDmrw4p7gTS0xxn4T 4dWw== 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:message-id:date:subject:cc:to:from :dkim-signature; bh=myVFj1U3iRi7Gh4AobiqyuhDtViW2dsfHPIq8FoB+qY=; b=CB4CuD2zvUpTKeBw0Oyn+QV5j0x0H0ccUESgJkokNJaM2anAOuROn90Hm3BpGk71iv CiWzvakjYxlPja4DF5ylKNuU3RgX0GjBZYxxavJh+fnqhwfW2pAuy5n+wW+HqhavQ5+3 RyUTMEmsh4O7CoiKYv9HTAd4hf/G1MZLoADM0X3472L2I8OqwHYGvoYnuAWpG1lDDJ4t X4eu0RqTZdLcPjCWaw0gExkJbXUxU1JbH/BrNrr+zII5WamNayl/Z6JzTLLrYs5Y2ucr Pt8Mqmns4WW0xGBYvAwSqyEDAeKlIjuyLXRD2Z9BN4kDDMt84n2NlTAnuhavuWkk1lsz CvaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=s1ND6fHP; 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 zh8si703881ejb.92.2020.09.30.00.13.01; Wed, 30 Sep 2020 00:13:24 -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=s1ND6fHP; 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 S1728683AbgI3HJd (ORCPT + 99 others); Wed, 30 Sep 2020 03:09:33 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:50449 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725440AbgI3HJb (ORCPT ); Wed, 30 Sep 2020 03:09:31 -0400 X-UUID: 34d97fd2802e471f822ea5a8b28916c9-20200930 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=s1ND6fHPuUAHBNJ7TWWWTgcC/uNG4z++f9eEclCuW3AnN17OZ4OdiNZW2hgrZlPwToCfsvqvc61kS9R5kkDuBwJcst9vqtXEoZLHiDxj85vKLjNnIYW/ImKADsKWS/qrMuGknqoflWzIXuFBbxVjcx4MUOGZYzlq8Hd16UrGWMI=; X-UUID: 34d97fd2802e471f822ea5a8b28916c9-20200930 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.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 988168212; Wed, 30 Sep 2020 15:09:29 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 30 Sep 2020 15:09:26 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 30 Sep 2020 15:09:27 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Rob Herring , Robin Murphy , Krzysztof Kozlowski , Will Deacon CC: Evan Green , Tomasz Figa , , , , , , , , , Nicolas Boichat , , , , Greg Kroah-Hartman , Subject: [PATCH v3 12/24] iommu/mediatek: Move hw_init into attach_device Date: Wed, 30 Sep 2020 15:06:35 +0800 Message-ID: <20200930070647.10188-13-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200930070647.10188-1-yong.wu@mediatek.com> References: <20200930070647.10188-1-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 657CBC01952634197C224649266BAA9905E3116E1A847803D6F3E2687991134B2000:8 X-MTK: N Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SW4gYXR0YWNoIGRldmljZSwgaXQgd2lsbCB1cGRhdGUgdGhlIHBhZ2V0YWJsZSBiYXNlI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