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
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.

Therefore, if a platform wanted to do proper resource management covering
all kinds of resources, it would have to treat memory and io resources
specially, relying on the driver to do the actual allocation and implement
resource management only for the remaining resource types, which is
certainly ugly.

Thanks for your comments!

Thomas
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to