On Wed, Mar 6, 2024, at 16:04, Christoph Hellwig wrote: > On Wed, Mar 06, 2024 at 03:19:52PM +0100, Andreas Larsson wrote: >> > I think that is the correct thing to do then: the only >> > drivers that I see with this dependency are PCI sound cards >> > that apparently rely on DMA to the 16MB ISA range, which is >> > not provided by sparc. >> >> The ZONE_DMA dependency does not seem related to ISA per se. Commit >> 80ab8eae70e5 ("ALSA: Enable CONFIG_ZONE_DMA for smaller PCI DMA masks") >> that started to introduce it did were about ensuring 32-bit masks. > > Yikes! That commit is just unbelievable buggy. CONFIG_ZONE_DMA > is only for architetures to select, not drivers. A driver randomly > enabling such an arch zone is just crazy. It looks like it did not remain that way for long, as 2db1a57986d3 ("ALSA: pci: depend on ZONE_DMA") removed the broken select again. > I've been wondering for a while if we need some Kconfig magic > so that certain symbols can only be select from arch/* and not > elsewhere to prevent this (we had a few other similar cases like > DMA_MAP_OPS). It's a nice idea, but it would require a lot of reworks to get right, with things like drivers/platform/x86 or drivers/{parisc,s390,sh} that are still somewhat architecture code, and subsystems like drivers/gpu/drm that typically just select whatever they want instead of using dependencies. Arnd