Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp231433pxb; Wed, 18 Nov 2020 22:42:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJwVWaxqZGjFBwjxA4lxCqVn2mqvduH7mEy8EX0TnW58WWLYTdxMWyC7tR1GEGIv4jY0aB5l X-Received: by 2002:a05:6402:30b5:: with SMTP id df21mr28752311edb.146.1605768142636; Wed, 18 Nov 2020 22:42:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605768142; cv=none; d=google.com; s=arc-20160816; b=go2P1SNH7EJ9ZOByz9HMVU85s2RvzbnuKpLxBzLNt5Vt4HnIcNfMkgClWQbEppcIB7 /lO5mc1gopLtaFHSJ5hHDlrbDDfAbHXBUSCpManie7VfAt4PkxYadTpoWyxOkhJd02t3 FEzayDLD8ke2BMvdCaMFKQKkkI1OA1/9dn9yGJ3he9f7jj5JGqDKr1Sftb2YNbR4bDkn 2ap2bKXViOVLzCF0cVtAen4RYOmXFXvXzL7lukRngrzGS1/BfSQW+jh+05ZSfUH0kN7q cjqr7V3mgoRMg6emO84V80naO3b9DE+FMdyEncx3pTarVvFUeYQXR/5lGi+Ua5X1n2L6 HSBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type:user-agent :in-reply-to:mime-version:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=peqjgdbAmYW7gvTBHcbI8ngIK/dlK4cduPSuWeO1E8I=; b=0RjgJo0JFEZFzj/0vk/pmhicPkxynb31bbOhtvK9CxpPa0l3TMQn6bZeYXrQ65ZTde T3+XkHkhZ+BN68+fuP71yAx6igQBa9d9odWO3pYrLvqmesg+GYpf0k5ctD4ifWjPFTYK 6Li0TLVuEyW7SDnvmBy0Kq5xVVz1phbiJJLkfmQpEX4p9ymyhUvPela6J1wARRO3nf6U eE4d8o2Qge4O6yPLvbCs5QPjzrqnBGZ8hlYmSkLyLWATeuJ/Phi1kNWYWE25fXho3JNc uNffrMcqCq+MtF4aQp1W2iIOcrh8VpDI6WZpmqw4oZqV0h13s/HpeCYfDF2jkRyJ7Fwo PiHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=hheCiG0W; 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=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a5si18183188edq.470.2020.11.18.22.41.58; Wed, 18 Nov 2020 22:42:22 -0800 (PST) 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=@samsung.com header.s=mail20170921 header.b=hheCiG0W; 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=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725887AbgKSGiP (ORCPT + 99 others); Thu, 19 Nov 2020 01:38:15 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:13756 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726192AbgKSGiO (ORCPT ); Thu, 19 Nov 2020 01:38:14 -0500 Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20201119063810epoutp039c554b746f84ab85c6a9858ed3b60342~I1WNsCIdk1716517165epoutp03N for ; Thu, 19 Nov 2020 06:38:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20201119063810epoutp039c554b746f84ab85c6a9858ed3b60342~I1WNsCIdk1716517165epoutp03N DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1605767890; bh=peqjgdbAmYW7gvTBHcbI8ngIK/dlK4cduPSuWeO1E8I=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=hheCiG0W4lfPJerOLSsq6C0Mt9RF7k7zWlhBCPaM30/TQsNzIu9S/VtD4UpoHaK85 iNUtJuWiNxt7UAgXvHIocCUYm9I/Rt+jdc9rWvIBFxdp2Oe02GYSVreQ/eSrqM7ssW kH6W0i7d84OllJvv72SHvebQ68MfWysG0dQ0eXBw= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20201119063809epcas2p251ba7ac82ec0bf918e3e674a94941bc3~I1WM7zndc2277022770epcas2p2e; Thu, 19 Nov 2020 06:38:09 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.40.191]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4Cc93f62ZWzMqYkn; Thu, 19 Nov 2020 06:38:06 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 66.FD.10621.DC216BF5; Thu, 19 Nov 2020 15:38:05 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20201119063804epcas2p332bfc6812c9ebd23f8a32cffbd27e5b0~I1WI4583j1139811398epcas2p3T; Thu, 19 Nov 2020 06:38:04 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201119063804epsmtrp1fc6f137774ee739ff958d7ed0cf68a98~I1WI346Wz1167611676epsmtrp1l; Thu, 19 Nov 2020 06:38:04 +0000 (GMT) X-AuditID: b6c32a45-8dc16a800001297d-82-5fb612cd67b1 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 98.92.08745.CC216BF5; Thu, 19 Nov 2020 15:38:04 +0900 (KST) Received: from KEI (unknown [12.36.155.227]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201119063804epsmtip122631202bd7d2f49ea967b57d3a790ea~I1WImDP2S1939319393epsmtip1G; Thu, 19 Nov 2020 06:38:04 +0000 (GMT) Date: Thu, 19 Nov 2020 15:30:30 +0900 From: Hyesoo Yu To: John Stultz Cc: Minchan Kim , Andrew Morton , LKML , linux-mm , Matthew Wilcox , david@redhat.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, Suren Baghdasaryan , KyongHo Cho , John Dias , Hridya Valsaraju , Sumit Semwal , Brian Starkey , linux-media , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Rob Herring , Christian Koenig , "moderated list:DMA BUFFER SHARING FRAMEWORK" Subject: Re: [PATCH 4/4] dma-heap: Devicetree binding for chunk heap Message-ID: <20201119063030.GC136599@KEI> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Brightmail-Tracker: H4sIAAAAAAAAA02Te1BUVRzHOXt37+4yrlxWjBMEbquMwvDYpRaPBk4joNehGbCy0KbWlb2x xL7aR0pNkxryfhlguSJuDYNCMNQKDM+UR4IEVCBRPERWA6UhkI2CeNjuXpvhv8/v8f09zm8O B+OfZXtxktQGSqeWKYW4K7O+wx8F9fHrpaL+QV9UUlOFI2vPTwDNTjSz0GLNvxi60tnPQvNn rjFQRfanOPrHbMVQ70oQ+uvOJAMNNpXgKOebOha6W/WEhcoX59hoPbcNoCctDWzUM25jo8IB M44unckDaGWpBH/Zgzw3sIaTVaVVgDRbjOT1awGkpTITJy0Ln7HJrNk7DHLslxac7P5ihUmO rt/HyLnvhnAyr7YSkL3mTjZps/jGbT6mDFdQMjmlE1DqBI08SZ0YIYx5TRoplYSJxEHiPWi3 UKCWqagIYdQrcUEHkpT2jYWCD2RKo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8a32cffbd27e5b0 X-Msg-Generator: CA Content-Type: multipart/mixed; boundary="----zeZHP-Gc2C_QEpEYXTEDGPRNV_-gQnEmBA0pzIEDiErY02VX=_162cf7_" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20201118030110epcas2p1105a09711ea2c123f19f413b32372764 References: <20201117181935.3613581-1-minchan@kernel.org> <20201117181935.3613581-5-minchan@kernel.org> <20201119011431.GA136599@KEI> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ------zeZHP-Gc2C_QEpEYXTEDGPRNV_-gQnEmBA0pzIEDiErY02VX=_162cf7_ Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline On Wed, Nov 18, 2020 at 07:19:07PM -0800, John Stultz wrote: > On Wed, Nov 18, 2020 at 5:22 PM Hyesoo Yu wrote: > > > > On Tue, Nov 17, 2020 at 07:00:54PM -0800, John Stultz wrote: > > > So I suspect Rob will push back on this as he has for other dt > > > bindings related to ion/dmabuf heaps (I tried to push a similar > > > solution to exporting multiple CMA areas via dmabuf heaps). > > > > > > The proposal he seemed to like best was having an in-kernel function > > > that a driver would call to initialize the heap (associated with the > > > CMA region the driver is interested in). Similar to Kunihiko Hayashi's > > > patch here: > > > - https://lore.kernel.org/lkml/1594948208-4739-1-git-send-email-hayashi.kunihiko@socionext.com/ > > > > > > The one sticking point for that patch (which I think is a good one), > > > is that we don't have any in-tree users, so it couldn't be merged yet. > > > > > > A similar approach might be good here, but again we probably need to > > > have at least one in-tree user which could call such a registration > > > function. > > > > Thanks for your review. > > > > The chunk heap is not considered for device-specific reserved memory and specific driver. > > It is similar to system heap, but it only collects high-order pages by using specific cma-area for performance. > > So, yes I agree, the chunk heap isn't device specific. It's just that > the CMA regions usually are tied to devices. > > The main objection to this style of solution has been due to the fact > that the DTS is supposed to describe the physical hardware (in an OS > agnostic way), rather than define configuration info for Linux > software drivers. > > Obviously this can be quibbled about, as the normal way of tying > devices to CMA has some assumptions of what the driver will use that > region for, rather than somehow representing a physical tie between a > memory reservation and a device. Nonetheless, Rob has been hesitant to > take any sort of ION/DmaBuf Heap DT devices, and has been more > interested in some device having the memory reservation reference and > the driver for that doing the registration. > > > It is strange that there is in-tree user who registers chunk heap. > > (Wouldn't it be strange for some users to register the system heap?) > > Well, as there's no reservation/configuration needed, the system heap > can register itself. > > The CMA heap currently only registers the default CMA heap, as we > didn't want to expose all CMA regions and there's otherwise no way to > pick and choose. > > > Is there a reason to use dma-heap framework to add cma-area for specific device ? > > > > Even if some in-tree users register dma-heap with cma-area, the buffers could be allocated in user-land and these could be shared among other devices. > > For exclusive access, I guess, the device don't need to register dma-heap for cma area. > > > > It's not really about exclusive access. More just that if you want to > bind a memory reservation/region (cma or otherwise), at least for DTS, > it needs to bind with some device in DT. > > Then the device driver can register that region with a heap driver. > This avoids adding new Linux-specific software bindings to DT. It > becomes a driver implementation detail instead. The primary user of > the heap type would probably be a practical pick (ie the display or > isp driver). > > The other potential solution Rob has suggested is that we create some > tag for the memory reservation (ie: like we do with cma: "reusable"), > which can be used to register the region to a heap. But this has the > problem that each tag has to be well defined and map to a known heap. > > thanks > -john > Thanks for the detailed reply. I understood what you mean exactly. I agree with your opinion that avoids software bindings to DT. The way to register the heap by specific device driver, makes dependency between heap and some device drivers that we pick practically. If that device driver changed or removed whenever H/W changed, the chunk heap is affected regardless of our intentions. As you said, the other solution that add tags need to be well defined. I guess, that will be a long-term solution. First of all, we just want to register chunk heap to allocate high-order pages. I'm going to change to a simple solution that uses default cma like cma heap, not using DT. Thanks. Regards. ------zeZHP-Gc2C_QEpEYXTEDGPRNV_-gQnEmBA0pzIEDiErY02VX=_162cf7_ Content-Type: text/plain; charset="utf-8" ------zeZHP-Gc2C_QEpEYXTEDGPRNV_-gQnEmBA0pzIEDiErY02VX=_162cf7_--