From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-Path: Date: Wed, 12 Apr 2017 11:00:28 +0100 From: Lorenzo Pieralisi To: Benjamin Herrenschmidt Subject: Re: [PATCH v3 04/32] asm-generic: add ioremap_nopost() remap interface Message-ID: <20170412100028.GB31143@red-moon> References: <20170411122923.6285-1-lorenzo.pieralisi@arm.com> <20170411122923.6285-5-lorenzo.pieralisi@arm.com> <1491917983.7236.9.camel@kernel.crashing.org> <20170411143138.GC6821@red-moon> <1491952447.7236.24.camel@kernel.crashing.org> MIME-Version: 1.0 In-Reply-To: <1491952447.7236.24.camel@kernel.crashing.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jonas Bonn , Rich Felker , linux-pci@vger.kernel.org, Will Deacon , "James E.J. Bottomley" , David Howells , Max Filippov , Paul Mackerras , Huacai Chen , Guan Xuetao , Thomas Gleixner , Hans-Christian Egtvedt , linux-arch@vger.kernel.org, Jesper Nilsson , Yoshinori Sato , Michael Ellerman , Helge Deller , Russell King , Ingo Molnar , Geert Uytterhoeven , Catalin Marinas , Matt Turner , Haavard Skinnemoen , Fenghua Yu , James Hogan , Chris Metcalf , Arnd Bergmann , Heiko Carstens , Stefan Kristiansson , Mikael Starvik , Ivan Kokshaysky , Bjorn Helgaas , Stafford Horne , linux-arm-kernel@lists.infradead.org, Richard Henderson , Chris Zankel , Michal Simek , Tony Luck , Vineet Gupta , linux-kernel@vger.kernel.org, Ralf Baechle , Richard Kuo , Niklas Cassel , "Luis R . Rodriguez" , Martin Schwidefsky , Ley Foon Tan , "David S. Miller" Content-Type: text/plain; charset="us-ascii" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+bjorn=helgaas.com@lists.infradead.org List-ID: On Wed, Apr 12, 2017 at 09:14:07AM +1000, Benjamin Herrenschmidt wrote: > On Tue, 2017-04-11 at 15:31 +0100, Lorenzo Pieralisi wrote: > > > This is a semantic that simply *cannot* be generically provided accross > > > architectures as a mapping attribute. > > > > I agree that a default implementation does not make much sense. The > > only solution to this, if we want the ioremap_nopost to be made available > > to generic code (and drivers - ie DT PCI host bridge drivers on ARM/ARM64 > > are not arch code), is to make the ioremap_nopost() call return NULL > > unless overriden by arch code that can provide its semantics. > > That would be a better option. I think that's what I will implement which basically means I will replace the default: static inline void __iomem *ioremap_nopost(phys_addr_t offset, size_t size) { return ioremap_nocache(offset, size); } with static inline void __iomem *ioremap_nopost(phys_addr_t offset, size_t size) { return NULL; } If an arch can override ioremap_nopost() with sensible mapping attributes (or whatever make it enforceable) it does, if it can't any ioremap_nopost() usage will result in a mapping failure, if you see any other viable solution please shout. Thanks, Lorenzo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lorenzo Pieralisi Subject: Re: [PATCH v3 04/32] asm-generic: add ioremap_nopost() remap interface Date: Wed, 12 Apr 2017 11:00:28 +0100 Message-ID: <20170412100028.GB31143@red-moon> References: <20170411122923.6285-1-lorenzo.pieralisi@arm.com> <20170411122923.6285-5-lorenzo.pieralisi@arm.com> <1491917983.7236.9.camel@kernel.crashing.org> <20170411143138.GC6821@red-moon> <1491952447.7236.24.camel@kernel.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1491952447.7236.24.camel@kernel.crashing.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Benjamin Herrenschmidt Cc: Jonas Bonn , Rich Felker , linux-pci@vger.kernel.org, Will Deacon , "James E.J. Bottomley" , David Howells , Max Filippov , Paul Mackerras , Huacai Chen , Guan Xuetao , Thomas Gleixner , Hans-Christian Egtvedt , linux-arch@vger.kernel.org, Jesper Nilsson , Yoshinori Sato , Michael Ellerman , Helge Deller , Russell King , Ingo Molnar , Geert Uytterhoeven , Catalin Marinas , Matt Turner , Haavard Skinnemoen , Fenghua Yu List-Id: linux-arch.vger.kernel.org On Wed, Apr 12, 2017 at 09:14:07AM +1000, Benjamin Herrenschmidt wrote: > On Tue, 2017-04-11 at 15:31 +0100, Lorenzo Pieralisi wrote: > > > This is a semantic that simply *cannot* be generically provided accross > > > architectures as a mapping attribute. > > > > I agree that a default implementation does not make much sense. The > > only solution to this, if we want the ioremap_nopost to be made available > > to generic code (and drivers - ie DT PCI host bridge drivers on ARM/ARM64 > > are not arch code), is to make the ioremap_nopost() call return NULL > > unless overriden by arch code that can provide its semantics. > > That would be a better option. I think that's what I will implement which basically means I will replace the default: static inline void __iomem *ioremap_nopost(phys_addr_t offset, size_t size) { return ioremap_nocache(offset, size); } with static inline void __iomem *ioremap_nopost(phys_addr_t offset, size_t size) { return NULL; } If an arch can override ioremap_nopost() with sensible mapping attributes (or whatever make it enforceable) it does, if it can't any ioremap_nopost() usage will result in a mapping failure, if you see any other viable solution please shout. Thanks, Lorenzo From mboxrd@z Thu Jan 1 00:00:00 1970 From: lorenzo.pieralisi@arm.com (Lorenzo Pieralisi) Date: Wed, 12 Apr 2017 11:00:28 +0100 Subject: [PATCH v3 04/32] asm-generic: add ioremap_nopost() remap interface In-Reply-To: <1491952447.7236.24.camel@kernel.crashing.org> References: <20170411122923.6285-1-lorenzo.pieralisi@arm.com> <20170411122923.6285-5-lorenzo.pieralisi@arm.com> <1491917983.7236.9.camel@kernel.crashing.org> <20170411143138.GC6821@red-moon> <1491952447.7236.24.camel@kernel.crashing.org> Message-ID: <20170412100028.GB31143@red-moon> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wed, Apr 12, 2017 at 09:14:07AM +1000, Benjamin Herrenschmidt wrote: > On Tue, 2017-04-11 at 15:31 +0100, Lorenzo Pieralisi wrote: > > > This is a semantic that simply *cannot* be generically provided accross > > > architectures as a mapping attribute. > > > > I agree that a default implementation does not make much sense. The > > only solution to this, if we want the ioremap_nopost to be made available > > to generic code (and drivers - ie DT PCI host bridge drivers on ARM/ARM64 > > are not arch code), is to make the ioremap_nopost() call return NULL > > unless overriden by arch code that can provide its semantics. > > That would be a better option. I think that's what I will implement which basically means I will replace the default: static inline void __iomem *ioremap_nopost(phys_addr_t offset, size_t size) { return ioremap_nocache(offset, size); } with static inline void __iomem *ioremap_nopost(phys_addr_t offset, size_t size) { return NULL; } If an arch can override ioremap_nopost() with sensible mapping attributes (or whatever make it enforceable) it does, if it can't any ioremap_nopost() usage will result in a mapping failure, if you see any other viable solution please shout. Thanks, Lorenzo