Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2555606ybk; Mon, 18 May 2020 02:01:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNZ37GVll39ofvnaMVHtl7Xdxp9e36+GFYVQc8W8NDMGuGAzOeSow8ivIIM5P46X0FDE6N X-Received: by 2002:aa7:cd01:: with SMTP id b1mr12348516edw.10.1589792473627; Mon, 18 May 2020 02:01:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589792473; cv=none; d=google.com; s=arc-20160816; b=si/19TppSwjAqYlEesCQvLsNSKzN/8Aq8h9MHlRuSwGWXEOrGvQgDpFZuK8a3JM2wE RtRh0b57gVLT+slnIeZZV3a6nZmQv6xzTJ9aHM1GLlDNSqOg1eYp6PpdAaHA8vehk2Ok y2y9Bm0HFuzIiTgc7fdgUfqSjqWh3SH5P72+M0stXSSrzRcsPo+F4Ag/YnEd3C7vwcne 2rchCvC6n/v9Hk1FXyZt0IfhdoAZiAL2yzy9r/nSTB0d+rAsX653oSZdixLDPtp0oniS OlW567+DcCG0voXk0Y7jjNaufuq76TdS05hEKVCSx3wIBZd6lyK5aNM+xkS6IcdMRal0 m5GQ== 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:date:cc:to:from:subject:message-id :dkim-signature; bh=BE27p8cgAXdiOJaTc4rLjiLgh00VCcwZpGfoS4OOzsM=; b=H8CrWSEzW3eAxZm1UJ7XjLEWpCYH/dMm+cFpM/yCkq339Ne2yM1rQ3vt+C7/Wu7l73 72kL52StFa8/tZpFUveuhX+btHVC7RZ7x3JB6u7D9tU1z/cdipNq7kayGDjqRFqTqBKF qGUCC1GJ9EMlJm9fRRl8tC5k1fymt7z86RIRbcAnIp29st8lIgcrYCUIHTNsXB4LrsvD +7wj3VTb94AlGNAP+lHSYms9hDNAM8Zd689rNfKDhxmzYoTfWPVwbvIpV/E9gBq80MmU E3mSNT2GSYyvvBcHhanZfbONMFAEsJIg7N0euwUYh0sGrxSLqoCoQwDaV7hBwLedqAid uJZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=ptpOJFQJ; 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 m20si5376446ejc.411.2020.05.18.02.00.48; Mon, 18 May 2020 02:01:13 -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=ptpOJFQJ; 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 S1726682AbgERGxC (ORCPT + 99 others); Mon, 18 May 2020 02:53:02 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:20606 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726040AbgERGxB (ORCPT ); Mon, 18 May 2020 02:53:01 -0400 X-UUID: 50de2994ee194d24be05a64da9dcc874-20200518 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=BE27p8cgAXdiOJaTc4rLjiLgh00VCcwZpGfoS4OOzsM=; b=ptpOJFQJPFBPL0cXkOqi5XQq0/yJTcAYzd6Xd1kQWwUg4VdHh2mnbGPt0mbD9ULSgjuY9RuCQsxe6WDM+RcppeVDqP5klDWQdDGAiu8iiqef6Im9IPnivLimwGbVBzh1ZnPdTsfZL3fSYtLAJ1PlFQquB/C2sLu1OEw+FwOZ+Sc=; X-UUID: 50de2994ee194d24be05a64da9dcc874-20200518 Received: from mtkcas36.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1666374242; Mon, 18 May 2020 14:52:50 +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; Mon, 18 May 2020 14:52:46 +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; Mon, 18 May 2020 14:52:46 +0800 Message-ID: <1589784680.15083.19.camel@mhfsdcap03> Subject: Re: [PATCH v2 23/33] iommu/mediatek-v1 Convert to probe/release_device() call-backs From: Yong Wu To: Joerg Roedel CC: Joerg Roedel , Will Deacon , , , , Matthias Brugger , Robin Murphy , "Marek Szyprowski" Date: Mon, 18 May 2020 14:51:20 +0800 In-Reply-To: <20200515100718.GS18353@8bytes.org> References: <20200414131542.25608-1-joro@8bytes.org> <20200414131542.25608-24-joro@8bytes.org> <1589528699.26119.9.camel@mhfsdcap03> <20200515100718.GS18353@8bytes.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-TM-SNTS-SMTP: 645326C83BAFED16ABAF80B4AAC8D7BA842597586DFE9CAF78B92A85A256ADAF2000:8 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 T24gRnJpLCAyMDIwLTA1LTE1IGF0IDEyOjA3ICswMjAwLCBKb2VyZyBSb2VkZWwgd3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