Arnd Bergmann
2020-May-08 15:05 UTC
[Nouveau] [PATCH 2/2] nouveau: fix dependencies for DEVICE_PRIVATE
On Fri, May 8, 2020 at 5:00 PM Jason Gunthorpe <jgg at mellanox.com> wrote:> > On Fri, May 08, 2020 at 04:40:09PM +0200, Arnd Bergmann wrote: > > CONFIG_DEVICE_PRIVATE cannot be selected in configurations > > without ZONE_DEVICE: > > It is kind of unfortunate to lift dependencies from DEVICE_PRIVATE > into the users, is this really how kconfig is supposed to work or is > something else wrong here?Usually the problem is trying to use 'select' for something that can be done with 'depends on'. I have actually no idea what CONFIG_DEVICE_PRIVATE does, as it lacks a help text and is a rather generic term. Would it be possible to decouple DEVICE_PRIVATE from ZONE_DEVICE? It sounds like the first is related to the device model, while the second is for memory management, so maybe the dependency is not necessary. Arnd
Jason Gunthorpe
2020-May-08 19:04 UTC
[Nouveau] [PATCH 2/2] nouveau: fix dependencies for DEVICE_PRIVATE
On Fri, May 08, 2020 at 05:05:03PM +0200, Arnd Bergmann wrote:> On Fri, May 8, 2020 at 5:00 PM Jason Gunthorpe <jgg at mellanox.com> wrote: > > > > On Fri, May 08, 2020 at 04:40:09PM +0200, Arnd Bergmann wrote: > > > CONFIG_DEVICE_PRIVATE cannot be selected in configurations > > > without ZONE_DEVICE: > > > > It is kind of unfortunate to lift dependencies from DEVICE_PRIVATE > > into the users, is this really how kconfig is supposed to work or is > > something else wrong here? > > Usually the problem is trying to use 'select' for something that can > be done with 'depends on'. I have actually no idea what > CONFIG_DEVICE_PRIVATE does, as it lacks a help text > and is a rather generic term.It is a sub mode of ZONE_DEVICE, ie DEVICE_PRIVATE turns on a certain kind of ZONE_DEVICE page. Both ZONE_DEVICE and DEVICE_PRIVATE are APIs families drivers use, there is no reason for a user to select either of these directly. Jason
Arnd Bergmann
2020-May-08 20:39 UTC
[Nouveau] [PATCH 2/2] nouveau: fix dependencies for DEVICE_PRIVATE
On Fri, May 8, 2020 at 9:04 PM Jason Gunthorpe <jgg at mellanox.com> wrote:> > On Fri, May 08, 2020 at 05:05:03PM +0200, Arnd Bergmann wrote: > > On Fri, May 8, 2020 at 5:00 PM Jason Gunthorpe <jgg at mellanox.com> wrote: > > > > > > On Fri, May 08, 2020 at 04:40:09PM +0200, Arnd Bergmann wrote: > > > > CONFIG_DEVICE_PRIVATE cannot be selected in configurations > > > > without ZONE_DEVICE: > > > > > > It is kind of unfortunate to lift dependencies from DEVICE_PRIVATE > > > into the users, is this really how kconfig is supposed to work or is > > > something else wrong here? > > > > Usually the problem is trying to use 'select' for something that can > > be done with 'depends on'. I have actually no idea what > > CONFIG_DEVICE_PRIVATE does, as it lacks a help text > > and is a rather generic term. > > It is a sub mode of ZONE_DEVICE, ie DEVICE_PRIVATE turns on a certain > kind of ZONE_DEVICE page. > > Both ZONE_DEVICE and DEVICE_PRIVATE are APIs families drivers use, > there is no reason for a user to select either of these directly.Ok, then how about making ZONE_DEVICE a hidden symbol and adding something like config ZONE_DEVICE_POSSIBLE def_bool y depends on MEMORY_HOTPLUG depends on MEMORY_HOTREMOVE depends on SPARSEMEM_VMEMMAP depends on ARCH_HAS_PTE_DEVMAP then drivers that want it can do config FOO tristate "user visible option" depends on ZONE_DEVICE_POSSIBLE select ZONE_DEVICE Arnd
Maybe Matching Threads
- [PATCH 2/2] nouveau: fix dependencies for DEVICE_PRIVATE
- [PATCH 2/2] nouveau: fix dependencies for DEVICE_PRIVATE
- [PATCH 2/2] nouveau: fix dependencies for DEVICE_PRIVATE
- [PATCH hmm v2 1/5] mm/hmm: make CONFIG_DEVICE_PRIVATE into a select
- [PATCH] drm/nouveau: Fix DEVICE_PRIVATE dependencies