Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp315973pxv; Thu, 8 Jul 2021 03:15:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxn+cumeXquygT9lf99iRZjAd+81CW0e7Ir+1xEE7Fa7jEL0AjSsKlZ7l28uR8BG0lLEa48 X-Received: by 2002:a6b:2b44:: with SMTP id r65mr22817966ior.99.1625739314504; Thu, 08 Jul 2021 03:15:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625739314; cv=none; d=google.com; s=arc-20160816; b=h7rbx43KjWbDohM7Ma3YsQmv8hE6nYCe+zjkxNpt2ADjKOoUMrsXheLXGYPw2Dref0 DH+CNLD6zpEHRc1kXVMzb3/ScriFiWrDWs4830xj7cRzce6udF4q9Rs2ale4QTGe73fY B70q78SPHL+MmJ694feg/GCVw1gO8wSsM31kBl1b4vXBVpixyQWXYDe1IsksAZ2IYQv6 F1UlgpFvRZbN2fkiJHjYG0MFp/wtyWeitzY1tKYzzed+BYgngqsDciEnpxvGLkQh7h5A uAn9NosmlWZDazLbRC8vgokSNjRhrq5kpz+1dR/IoVsByiEsajD1UZPwn4e252Ccqv7/ qf/A== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=BdKf2p9ZqSn+V2IGWR+PNooNX2lJcGUJfQegrqEiVdM=; b=AnxcLFGtMNuruX4qFFlBbsriuNrIWl5CQ+/J/B5YCdg7ebkM2pCvUmfmrgBT5TDVme 9fHSi8HjgMUjvucI2bgV/eZBTMyk8EBBDaRkDMJRnFPOjRhqCmrfDPkiHD1G3aN2c/GJ e4geLkjOGDaXx9nhBI65Nt1Gew7/aFEzY6Jz8JJtcdRGC37LSbQXprtdsOf7G/yOT0xU JPZ2AAaqhrESKw/rnA+1rPx4s+uIZ3liK46e3W/Mu1NXLTVzyyPTrjjFfe4t0vgzg+WR aMuM2dOJTO2sACSdf0wwnr85ELMwVvZ+Qt7Qy2uxxIJrkJErWI5hRZ5HcUIfgNY1RAVW ZsxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=b9KBXnQh; 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 n17si1844534jam.90.2021.07.08.03.15.02; Thu, 08 Jul 2021 03:15: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=b9KBXnQh; 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 S231372AbhGHKRN (ORCPT + 99 others); Thu, 8 Jul 2021 06:17:13 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:39538 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S231332AbhGHKRN (ORCPT ); Thu, 8 Jul 2021 06:17:13 -0400 X-UUID: b52e43e1cd4a44ea8bab0ad0d062c7cc-20210708 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:Message-ID:Date:Subject:CC:To:From; bh=BdKf2p9ZqSn+V2IGWR+PNooNX2lJcGUJfQegrqEiVdM=; b=b9KBXnQhFfVkALohUmv/2LnhbOt1iUi904ILwVtQ1tYHLOaWrXl1XYroC752ZyZqDtJex2kTKqACUwgbm3cX8vQjTL97yy4w4zDXL8YDUxLp+ybU6dYhlz1T18HznDFrejFTF7tLeIyBkuB8OEs6eyMkf03jlsC5iSjlHijj/DE=; X-UUID: b52e43e1cd4a44ea8bab0ad0d062c7cc-20210708 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 290473540; Thu, 08 Jul 2021 18:14:25 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by MTKMBS33N2.mediatek.inc (172.27.4.76) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 8 Jul 2021 18:14:23 +0800 Received: from mszswglt01.gcn.mediatek.inc (10.16.20.20) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 8 Jul 2021 18:14:22 +0800 From: To: Sumit Semwal , =?UTF-8?q?Christian=20K=C3=B6nig?= , Matthias Brugger CC: Benjamin Gaignard , Liam Mark , Laura Abbott , Brian Starkey , John Stultz , , , , , , , Guangming Cao Subject: [PATCH] dma-heap: Let dma heap use dma_map_attrs to map & unmap iova Date: Thu, 8 Jul 2021 18:14:21 +0800 Message-ID: <20210708101421.9101-1-guangming.cao@mediatek.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 879CEDBA69CA375324736404F3170BD4C1626A51C81092302B49131EC5ACEC612000:8 X-MTK: N Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org RnJvbTogR3VhbmdtaW5nIENhbyA8R3VhbmdtaW5nLkNhb0BtZWRpYXRlay5jb20+DQoNCkZvciBk bWEtaGVhcCB1c2VycywgdGhleSBjYW4ndCBieXBhc3MgY2FjaGUgc3luYyB3aGVuIG1hcC91bm1h cCBpb3ZhDQp3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