On Mon, Sep 14, 2009 at 22:12:09, Tivy, Robert wrote: > Since I was the one to ask Sandeep for this API, I will offer up my > reasoning... > > Without this API, in order to call either edma_free_slot() or > edma_free_channel() the LinuxUtils EDMAK device driver will have to carry a > "slot-vs-channel" "flag" or "cookie" around with the EDMA allocation record. > Then we need to consult this flag and call one or the other "free". Other > drivers will be doing this as well. Having this API will simplify code that > allocates both "slots" and "channels". It seems prudent to consolidate the > decision making to one place (edma_free_resource()) instead of having it be > sprinkled throughout the calling code, and also removes the possibility of > the driver calling the wrong one. >
Yes, the drivers need to maintain separate record of slots and channels. In the current EDMA API, both are treated as different entities. So, you need different variables to store information about them. This should also eliminate the need for another flag and the possibility of calling one free API for the other. Thanks, Sekhar > Regards, > > - Rob > > > -----Original Message----- > > From: > > [email protected] > p.com [mailto:davinci-linux-open-source-> > [email protected]] On Behalf Of Nori, Sekhar > > Sent: Saturday, September 12, 2009 9:27 PM > > To: Paulraj, Sandeep > > Cc: [email protected] > > Subject: RE: [PATCH] DaVinci: EDMA: New API edma_free_resource > > > > Hi Sandeep, > > > > On Sat, Sep 12, 2009 at 21:50:44, Paulraj, Sandeep wrote: > > > From: Sandeep Paulraj <[email protected]> > > > > > > This API is very similar to the edma_free_slot and > > edma_free_channel > > > APIs. It is actually a consolidated version of these 2 APIs. > > > A resource can be a channel or a slot. > > > Using this API, the EDMA driver code makes the > > determination to free > > > up a channel or a slot. > > > The user does not have to decide the correct "free" API from among > > > edma_free_channel or edma_free_slot. > > > > > > This API will be used by TI codecs and the DVSDK. > > > > Hmm, wonder how it improves convenience considering that > > channels and slots are allocated separately. > > Presumably, user will need to maintain separate cookies for > > channels and slots. > > > > IMHO, in the absence of an alloc_resource() API, this sounds > > incongruous. > > > > [...] > > > +/** > > > + * edma_free_resource - deallocate DMA parameter RAM > > channel/resource > > > + * @resource: Either a channel or a slot to be freed > > > + * > > > + * This deallocates the DMA channel and associated > > parameter RAM slot > > > + * if the resource happens to be a channel, i.e if the resource > > > +number is > > > + * less than 64 for DaVinci SOCs and less than 32 for Primus. > > > > ^^^^^^^ I think you mean to say DA8XX/OMAP-L1 > > > > Thanks, > > Sekhar > > > > _______________________________________________ > > Davinci-linux-open-source mailing list > > [email protected] > > http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source > > > _______________________________________________ Davinci-linux-open-source mailing list [email protected] http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
