Received: by 10.223.176.46 with SMTP id f43csp1013921wra; Wed, 24 Jan 2018 09:15:54 -0800 (PST) X-Google-Smtp-Source: AH8x227QVfWZLJAl7GQHb73EeuSGHIdWFkfBz0E7C4j9DtcNb5QnxxMaRvBCvW3x1V04xnNhZvyi X-Received: by 10.98.60.132 with SMTP id b4mr13683787pfk.120.1516814154141; Wed, 24 Jan 2018 09:15:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516814154; cv=none; d=google.com; s=arc-20160816; b=Srshgfp8FKf5SYPn+3eqb50ONfLCC5UWqFvHDmInyuR38yJsIeSQPY7BMVEEQ8cGHB 0A07oCjoaPDm4GHu6vc9verbGuUj/5GtNkil/dlNNNimVyxNXyjmKla8H7/P+R27TjSX ir7XkWU6eKIVRDo2lFGKkLV+V97XVH4iDCH8ig3EsZ3I9H9/ynUTjGMMv0n48BxpjQRJ NCTLxO6NOJftdaajygyNCfZFdiumdmpkWrTrlC26+MQdM1+nvTeo/QJlYP6zFw7gIL/B 2EMmdy4E5MQs36Z7mIJPbAofGnfHUgIvU5PrEpJ3mcl5wqmt8/LYkS7fYxPccFE7jLpV EwiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=cLC4GZjHZXR9bWHonh4XnqtJilkgk7CyJr/pVoUMUg8=; b=PRcd8O/Nm/Qoc8+t0EF54pKJJpe4wple8EElZJ3im+I88kzyl11ocQRT9AvKgjeULr +093YrfbhMFHthYFV6NsY9msbCEF8nRRDjalkRxUm4wv6wEMgjgfj2PvujKj/VCWQYT3 qLHxUssStZRp4l/M5/NvDWdLYdWY8PI9dNWTbrN+jvAI1hcYph4EJZRVlDEOR2jpE+QF bXSkUg3YCd+ub7Wj4A/9FBbZULo73s0SvjKg4o4eTe2nX10drBCQCsTQd0vWNEJ/2/5a 38tZg97b9XK3HwE+EURg2fcbpeORkpeeIOCVGRDNIuhXRjWUtxFBC8rUE7LWiTniIYM/ ootg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k29si3156560pfj.228.2018.01.24.09.15.39; Wed, 24 Jan 2018 09:15:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964915AbeAXRPG (ORCPT + 99 others); Wed, 24 Jan 2018 12:15:06 -0500 Received: from eddie.linux-mips.org ([148.251.95.138]:47470 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964850AbeAXRPE (ORCPT ); Wed, 24 Jan 2018 12:15:04 -0500 Received: (from localhost user: 'ladis' uid#1021 fake: STDIN (ladis@eddie.linux-mips.org)) by eddie.linux-mips.org id S23990395AbeAXRPCQwgMD (ORCPT ); Wed, 24 Jan 2018 18:15:02 +0100 Date: Wed, 24 Jan 2018 18:15:01 +0100 From: Ladislav Michl To: Andy Shevchenko Cc: Linux Kernel Mailing List , "open list:MEMORY TECHNOLOGY..." , Thomas Gleixner , Tom Lendacky , Borislav Petkov , Ingo Molnar , Lorenzo Pieralisi , Philippe Ombredanne , Kate Stewart , Greg Kroah-Hartman , Boris Brezillon , Dmitry Torokhov , Bjorn Helgaas , Wei Yongjun Subject: Re: [PATCH v2 2/3] devres: Add devm_ioremap_shared_resource() Message-ID: <20180124171501.GA1043@lenoch> References: <20180124100604.GA19593@lenoch> <20180124100754.GC19593@lenoch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 24, 2018 at 06:21:38PM +0200, Andy Shevchenko wrote: > On Wed, Jan 24, 2018 at 12:07 PM, Ladislav Michl wrote: > > Implement managed ioremap function for shared resources. > > > +#define devm_ioremap_resource(dev, res) \ > > + __devm_ioremap_resource(dev, res, false) > > +#define devm_ioremap_shared_resource(dev, res) \ > > + __devm_ioremap_resource(dev, res, true) > > +void __iomem *__devm_ioremap_resource(struct device *dev, struct resource *res, > > + bool shared); > > I would rather do the following: > > _resource() -> _resource_exclusive() > > #define _resource() _resource_exclusive() > > Add _resource_shared() > > And use long names below in this file whenever refer to exclusive or > shared variant. Two separate functions were also considered, but I was unable to find small common implementation. If code size does not matter or you can provide a hint to make this solution small and nice, I'll go for it. > > void devm_iounmap(struct device *dev, void __iomem *addr); > > int check_signature(const volatile void __iomem *io_addr, > > const unsigned char *signature, int length); > > + > > void devm_ioremap_release(struct device *dev, void *res); > > This part doesn't belong to the change. > > > + * When possible, use devm_ioremap_resource() or > > + * devm_ioremap_shared_resource() instead. > > - * Checks that a resource is a valid memory region, requests the memory > > - * region and ioremaps it. All operations are managed and will be undone > > - * on driver detach. > > + * Checks that a resource is a valid memory region, eventually requests the > > + * memory region and ioremaps it. All operations are managed and will be > > + * undone on driver detach. > > Wording is changed and no clue in commit message why. Above will be moved to separate patch. ladis