Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3341348imw; Mon, 11 Jul 2022 06:55:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tAMfpRPy+EUXpB6SvdF9GB7jqKgwIg6Q74X/Zg547tTY51YRMiT/HlYLRwuy1zjhRPTZgB X-Received: by 2002:a17:907:1b06:b0:6fe:b48d:801f with SMTP id mp6-20020a1709071b0600b006feb48d801fmr18651493ejc.322.1657547741684; Mon, 11 Jul 2022 06:55:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657547741; cv=none; d=google.com; s=arc-20160816; b=h3jjJcLjnBGltE4keRVf9nHpJtuMtfBqXbHedgFV0n1xzYRO1pAQWOrszES/TOy8pF Ac+IN1sfqFtExnEvRMF/MrHP4uGLu6h7WRN+22r7mBJrZNkVMFmbZzojOOW0djYqoN9B Oqj8RCZ+FSoS9qyd7+KVV/VPpGD5xnitcvu5ZgO9u+2n+569/GEYSMM2zdb0sjkQj5+i 86Mg2dQJV46edL8313kzZyms4UmIrBzmz6i88ibyzR7wOcVyKNu/9NM/MkvCDWs/bXSu mSbDZezoluqIoJsDNPP0OEGl4FjCZw84aOeGo7swFCz45kEiRn+FilpT09W3MRojG/Ny N08w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=OYBqC2UD9+CJ4iHScb2NjbDg15WqimNRfTRmgyiSnZI=; b=VqrSjFq+v699Os7CvnQh85dG09CohEWVJeUeayYPQBQDTKzEtq+rJyuf9UKM8Ys8wP y+AMc4i3tT0Aq4xReRSLo2ALmYymfOqnnHB0cojmDjbmfIe6shFHIAeRN4upSJtIBHQi FqdLQDNNfcd1VglfWShxPny6CXQ3GsZWsdbxi13KNf5+DPJ4hrz0LjHe/0tiRHGTiCQC LGqG1I5ZK463agJd9cmxRBND3RTXrA+ityIk9xwXAi+LXcs5QJ4i1mgi8sNv83KU65m5 QxGCq5QfS0a5ysqnlv0R9UIHEz8v4lPU0ZeqjhjO7rOG6wsuI9DD8ND5K4gqxyJm0MD3 DEKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y6-20020a50eb06000000b0043a6e52c416si8618394edp.162.2022.07.11.06.55.16; Mon, 11 Jul 2022 06:55:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230085AbiGKN2e (ORCPT + 99 others); Mon, 11 Jul 2022 09:28:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229760AbiGKN2d (ORCPT ); Mon, 11 Jul 2022 09:28:33 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1EB62A1; Mon, 11 Jul 2022 06:28:30 -0700 (PDT) Received: from mail-yb1-f179.google.com ([209.85.219.179]) by mrelayeu.kundenserver.de (mreue009 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MYvTs-1o6XqW30Ea-00UrBn; Mon, 11 Jul 2022 15:28:28 +0200 Received: by mail-yb1-f179.google.com with SMTP id 136so8702910ybl.5; Mon, 11 Jul 2022 06:28:28 -0700 (PDT) X-Gm-Message-State: AJIora8/07Fi0AK3My1PcDQ+TuBbfoqJk6TSbNswul3PjAZ2+mc4wjqW nXXpMixeBeSiSzMNEu00oTlB7sy6vht+6kfKdUA= X-Received: by 2002:a5b:b47:0:b0:66e:3617:d262 with SMTP id b7-20020a5b0b47000000b0066e3617d262mr16426044ybr.106.1657546107384; Mon, 11 Jul 2022 06:28:27 -0700 (PDT) MIME-Version: 1.0 References: <20220711122459.13773-1-me@linux.beauty> <20220711122459.13773-5-me@linux.beauty> In-Reply-To: <20220711122459.13773-5-me@linux.beauty> From: Arnd Bergmann Date: Mon, 11 Jul 2022 15:28:10 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 4/4] sample/reserved_mem: Introduce a sample of struct page and dio support to no-map rmem To: Li Chen Cc: Catalin Marinas , Will Deacon , Rob Herring , Frank Rowand , Andrew Morton , Li Chen , Linux ARM , Linux Kernel Mailing List , DTML , Linux-MM Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:v2NDaS4hdT01Tjkly3eBikHu19HKS9zqN4ejyDTrA05Z0rRxNN4 iYopIHbVnVMvevWFz3J2WZhu1OoAs2JFS/1evp6XJg6P5jPZtWAorMglwwctaIzG8RbWqEP DnLsPWUizUZdkZXojz9P3e8fHNZ2T8EfR8s3GRcrvAckCyhzibAh9dlJ7f5oNWkxV/H1INv 2ZXwYPfJ6ssgsAEs9iL0w== X-UI-Out-Filterresults: notjunk:1;V03:K0:iDmhkX6mdWU=:Fej3xj/jk+VLvNp/A9rg++ yJ+MK5GGih77Q8agP+IBSuvWykCgsg6JAQwM2WiQHzBh2PI48U/oZBBbP9+V5mDMDvtDMpcIj B3lWb1uKHiRi/snfa+ToE5Ej0t922r6JzkJrPrEYkDQh8zVA2eh1rceX9UAVWV36XbZKo2f3n 6WTVRDexHoOLxqw5/Z73l4UnDn/KvPp/NpuUHwA9TWCUMUNCxxNJYVqYSV/+KOEDvFnnO80U7 4GN1Gg0NfzOvIxE6dIJo8xugfA8j6DYqysjFdaIeXNvDJkpWrweVmdhldH+P4lT6M/3wpXVCW lrFF/cmRzTnSIZOY7Ulu/dQlO0MRWQZzG4XwIMYqN+bVF8/cmkudSxBSSykhSY/EKqYkHpZ/n SzIidj9L8yU9BbaX2NonwLFRer/MUrgdkRPLmQ9+8ITrsgltEKwD0FM2WP2wvRdsIhRPvAPzb tQfBm0gUL0pbFywU7CoXJ866m1GGCnU/pLa4mVOBkmnGueQ56n8bFmD0O4Z6/lBOwzXSNnkue wGW7bx/q9mUXzFJnbFf73ugFF0PrbMQv/ZNtR9oMT7ybwowmDX19s6ITFFoulxta3/QdcRxbG bEt9lb57eQ1jASVhZjAMcXrL1IczTQv9iwIy2e/JJPl0hviu1nEo7mQFmN47MHQDzOn6lnODi ck/aXxJ6GsYgUPm30g5uSYBL/C1/2tMlTYhai+Yz/lZiiURNv2oxNBzpfWTz0ath/0BZ9GXC6 K5cov5ee+sfeGJLe/zptOEPX7tFbX/xGxX1iZQ== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 11, 2022 at 2:24 PM Li Chen wrote: > > From: Li Chen > > This sample driver shows how to build struct pages support to no-map rmem. > > Signed-off-by: Li Chen 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