Thanks for considering this API.  It's the "embedded programmer" in me that's 
always trying to consolidate code at as low a level as possible.  Perhaps a 
better name would be "edma_free_channel_or_slot()", so it matches up with the 
allocation API naming, but it would just be a helper function that existed 
along with edma_free_channel() and edma_free_slot().

My request was certainly a selfish one, but since it would improve my EDMA 
driver code I thought it could do the same for others.  I suppose the 
LinuxUtils EDMA driver is a unique client of the EDMA APIs, in that it is a 
resource manager and doesn't actually call any of the functional EDMA APIs (the 
ones that drive the EDMA HW), and from that perspective "slots" and "channels" 
are just different parts of the same resource space, so I'm not really 
representative of the typical EDMA API client.

Regards,

- Rob 

> -----Original Message-----
> From: Kevin Hilman [mailto:khil...@deeprootsystems.com] 
> Sent: Wednesday, September 16, 2009 8:43 AM
> To: Tivy, Robert
> Cc: Nori, Sekhar; Paulraj, Sandeep; 
> davinci-linux-open-source@linux.davincidsp.com
> Subject: Re: [PATCH] DaVinci: EDMA: New API edma_free_resource
> 
> "Tivy, Robert" <rt...@ti.com> writes:
> 
> > 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.
> 
> This sounds pretty normal to me, and expected.
> 
> > 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.
> 
> I agree with Sekhar that a free_resource() without a corresponding
> alloc_resource() doesn't make sense and is more confusing.
> 
> Kevin
> 
> 
> >
> > Regards,
> >
> > - Rob
> >
> >> -----Original Message-----
> >> From: 
> >> davinci-linux-open-source-bounces+rtivy=ti....@linux.davincids
> > p.com [mailto:davinci-linux-open-source-> 
> > bounces+rtivy=ti....@linux.davincidsp.com] On Behalf Of Nori, Sekhar
> >> Sent: Saturday, September 12, 2009 9:27 PM
> >> To: Paulraj, Sandeep
> >> Cc: davinci-linux-open-source@linux.davincidsp.com
> >> 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 <s-paul...@ti.com>
> >> >
> >> > 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 
> >> Davinci-linux-open-source@linux.davincidsp.com
> >> 
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-sourc
> >> e _______________________________________________
> > Davinci-linux-open-source mailing list 
> > Davinci-linux-open-source@linux.davincidsp.com
> > 
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
> 
> _______________________________________________
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to