Re: [Nouveau] [PATCH 11/25] memremap: lift the devmap_enable manipulation into devm_memremap_pages

2019-06-27 Thread Christoph Hellwig
On Wed, Jun 26, 2019 at 12:04:46PM -0700, Ira Weiny wrote: > > +static int devmap_managed_enable_get(struct device *dev, struct > > dev_pagemap *pgmap) > > +{ > > + if (!pgmap->ops->page_free) { > > NIT: later on you add the check for pgmap->ops... it should probably be here. > > But not

Re: [Nouveau] [PATCH 11/25] memremap: lift the devmap_enable manipulation into devm_memremap_pages

2019-06-26 Thread Ira Weiny
On Wed, Jun 26, 2019 at 02:27:10PM +0200, Christoph Hellwig wrote: > Just check if there is a ->page_free operation set and take care of the > static key enable, as well as the put using device managed resources. > Also check that a ->page_free is provided for the pgmaps types that > require it,

[Nouveau] [PATCH 11/25] memremap: lift the devmap_enable manipulation into devm_memremap_pages

2019-06-26 Thread Christoph Hellwig
Just check if there is a ->page_free operation set and take care of the static key enable, as well as the put using device managed resources. Also check that a ->page_free is provided for the pgmaps types that require it, and check for a valid type as well while we are at it. Note that this also