Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp221637pxv; Thu, 15 Jul 2021 02:51:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7likBxgqNpIIh7B5GSpEj6pfWPGpYPBB/rFDWlZDBIJeQkzl8NWovRZ1nD0xe4ZF6zJ/H X-Received: by 2002:a05:6402:111a:: with SMTP id u26mr5591868edv.260.1626342675201; Thu, 15 Jul 2021 02:51:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626342675; cv=none; d=google.com; s=arc-20160816; b=u6Y1DVr5RKyn9D7wyfK131KDBltvXFowi4xMHrBzLorcY/P+LOjttdw4MqhhRGA1VK 7inZtBP7biEQ84Kcs53uHDviwn3TTwzmCZ1pxmnvwH37fIIi+pTuJUJSewf4uqhUojE7 5PcMiKjtKjhDL6MIfMt/O7mAII0llSDtW0XWi4Ycy2fDehNfJ06zJ6inFbQUxW+KUzER 32vornFitHdavF7I5nlsXP8FvBbIkSPMclXYNl1JsDZ+L3z+4/vjQAkhvy1YMJf+bV+x cq8yCjMV9siObGbA3Bq24pNEUZqIU1Y3htyhnvwGngh10qEniP+XCmSC5K4sTUKGzOGD uQ/g== 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=FdJEfNIhRevGn/F/LNRstNPMVmwpSKWT+XSRG+RptUo=; b=CF0QuNz5udKr3KtAKZecO5AQACEFgr4JwQxaCytHOSpWDUuI56bCqeQR3C5gicOPyz Zs+2lZq+zf1OGML1QMaQEvmgvdOaAZ0Ymqcs5/HjEbc9UYlzzyh8ySRa47w/KJUM+kww JHKrfRwtLEcLDpTRMF3S7w72thLRkvF3Cg3PLuV/lDdgePKQLg5NSs45B9wscxlIb0MX 9Mr5a5uD5BteScwQ9P/1i/rqC7urRXH8+BhXhoLgl5oBeUV7LJxnAL9syE2xcS2qu4+c 4N9Dn+MZhwTHSQYqN9+H4gJmdDjr3vQP3pk4AGgFhyPGSV5eeOeSMRsgjNASHB+4YBev 8Ubg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=XwcGYvS5; 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 z69si7153908ede.301.2021.07.15.02.50.46; Thu, 15 Jul 2021 02:51:14 -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=XwcGYvS5; 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 S234430AbhGOG1I (ORCPT + 99 others); Thu, 15 Jul 2021 02:27:08 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:16163 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S231149AbhGOG1H (ORCPT ); Thu, 15 Jul 2021 02:27:07 -0400 X-UUID: 0a5205d548114b71bf449392ac64c6d6-20210715 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=FdJEfNIhRevGn/F/LNRstNPMVmwpSKWT+XSRG+RptUo=; b=XwcGYvS5eBEW2tM7yKQuXk4RNV6DmpPFDWGENSlPuFnEwQSJXNoRyAOCwMMeYXtRYceq1lpEl36aLbSJSBpnvnuru//JIBbV0w3pt04fCU3tTl5FdEgEkWfDHVNhEtI7E0bEIe2vTgoOK97xYsA1o1YhDZiXATIDr8zLsEFJvy8=; X-UUID: 0a5205d548114b71bf449392ac64c6d6-20210715 Received: from mtkcas36.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 149916070; Thu, 15 Jul 2021 14:24:11 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by MTKMBS33N2.mediatek.inc (172.27.4.76) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 15 Jul 2021 14:24:08 +0800 Received: from mszswglt01.gcn.mediatek.inc (10.16.20.20) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 15 Jul 2021 14:24:07 +0800 From: To: CC: , , , , , , , , , , , , , , Guangming Cao Subject: [PATCH] dma-heap: Let dma heap use dma_map_attrs to map & unmap iova Date: Thu, 15 Jul 2021 14:24:05 +0800 Message-ID: <20210715062405.98932-1-guangming.cao@mediatek.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210708101421.9101-1-guangming.cao@mediatek.com> References: <20210708101421.9101-1-guangming.cao@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: D20BB1BADB131EDFEA63427CEE31F7C3446A8B841868204EDF379FDAF8A9A92E2000:8 X-MTK: N Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org RnJvbTogR3VhbmdtaW5nIENhbyA8R3VhbmdtaW5nLkNhb0BtZWRpYXRlay5jb20+DQoNCk9uIFRo dSwgMjAyMS0wNy0wOCBhdCAxODoxNCArMDgwMCwgZ3VhbmdtaW5nLmNhb0BtZWRpYXRlay5jb20g d3JvdGU6DQoN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