[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a2Mr0ZMXGDx6htYEbBBtm4mubk-meSASJjPRK1j1O-hEA@mail.gmail.com>
Date: Mon, 11 Jul 2022 15:28:10 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Li Chen <me@...ux.beauty>
Cc: Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Frank Rowand <frowand.list@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Li Chen <lchen@...arella.com>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
DTML <devicetree@...r.kernel.org>, Linux-MM <linux-mm@...ck.org>
Subject: Re: [PATCH 4/4] sample/reserved_mem: Introduce a sample of struct
page and dio support to no-map rmem
On Mon, Jul 11, 2022 at 2:24 PM Li Chen <me@...ux.beauty> wrote:
>
> From: Li Chen <lchen@...arella.com>
>
> This sample driver shows how to build struct pages support to no-map rmem.
>
> Signed-off-by: Li Chen <lchen@...arella.com>
Not sure what a sample driver helps here if there are no actual users in-tree.
It would make more sense to merge the driver that wants to actually use this
first, and then add the additional feature.
> Change-Id: Ie78494fa86fda40ceb73eab3b8ba505d0ad851a1
Please drop these lines, the Change-Id fields are useless in a public
repository.
> +/*
> + * dts example
> + * rmem: rmem@1 {
> + * compatible = "shared-dma-pool";
> + * no-map;
> + * size = <0x0 0x20000000>;
> + * };
> + * perf {
> + * compatible = "example,rmem";
> + * memory-region = <&rmem>;
> + * };
The problem here is that the DT is meant to describe the platform in an OS
independent way, so having a binding that just corresponds to a user space
interface is not a good abstraction.
> + vaddr = reserved_mem_memremap_pages(dev, rmem);
> + if (IS_ERR_OR_NULL(vaddr))
> + return PTR_ERR(vaddr);
Using IS_ERR_OR_NULL() is usually an indication of a bad interface.
For the reserved_mem_memremap_pages(), you should decide whether to return
NULL on error or an error pointer, but not both.
Arnd
Powered by blists - more mailing lists