Hi Thomas, On Wed, Apr 21, 2010 at 13:43:55, Koeller, T. wrote: > Hi Kevin, > > > > > Actually, the driver is the place where the resources are used and > > therefore where they should be reserved and released. This patch > > removes this from the drivers and puts it in SoC code which I don't > > like. > > > > There are really two main things going on here that I see: > > > > 1. add parent resources (cfg, irq, dma, etc.) > > 2. move resource reservation from drivers to SoC code > > > > It's primarily 2 that I object to. > > > > While I think (1) may be helpful, if we're going to do it, we should > > do it throughout all of mach-davinci/*. > > Here I do not quite agree with your view. In general, resource managment > is about avoiding conflicts. This means that it must be done in a > place where the resource requirements of all devices are known, and this > is the bus, not the individual drivers. This is more obvious when > dealing with buses that enumerate their devices and collect their > resource requirements in order to make intelligent decisions. The > platform bus has been invented to extend this concept to devices that > are not really on such a bus. > > For platform devices, resources are set up by the platform and passed to > the drivers via platform devices. At this point, the decision about which > resource is going to be used by a particular driver has already been made, > and nothing is gained by defering the actual allocation. Resource
I can think of one (admittedly esoteric) example where this not true. On the DM6446 EVM, the NAND and NOR flash reside on the same chip-select and it is possible to runtime switch between the flashes used by flipping a jumper and insmoding the appropriate driver. Currently, both nand and nor drivers do not make a memory region request, but that should probably be fixed. > allocation in the driver is only possible for resources for which > global root nodes exist (IO and MEMORY addresses). All other kinds of > resources cannot be allocated by drivers because these do not (and should > not) know about the root resource nodes in the platform. Consequently, > you see lots of drivers that do allocate memory resources, but ignore > all the others. IRQ resources are managed by request_irq(). EDMA does its own resource management, but ideally should be using drivers/dma/ resource manager. So, I tend to think of it as driver requesting and releasing all shared resources. Thanks, Sekhar _______________________________________________ Davinci-linux-open-source mailing list [email protected] http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
