On Wed, Mar 17, 2010 at 20:21:21, Kevin Hilman wrote:
> Sekhar Nori <[email protected]> writes:
>
> > From: Sudhakar Rajashekhara <[email protected]>
> >
> > The drivers on da8xx/omapl EVMs do not utilize all the channels
> > and slots provided by EDMA. Some of these are better utilitzed by
> > the DSP on the SoC for speeding up codec operations.
> >
> > Reserve these channels/slots for the DSP.
> >
> > Signed-off-by: Sudhakar Rajashekhara <[email protected]>
> > Signed-off-by: Sekhar Nori <[email protected]>
> > ---
> >  arch/arm/mach-davinci/board-da830-evm.c    |   32 ++++++++++++++++++-
> >  arch/arm/mach-davinci/board-da850-evm.c    |   48 
> > +++++++++++++++++++++++++++-
> >  arch/arm/mach-davinci/devices-da8xx.c      |   21 +++++++-----
> >  arch/arm/mach-davinci/include/mach/da8xx.h |    3 +-
> >  4 files changed, 92 insertions(+), 12 deletions(-)
> >
>
> Thanks, I like this one better.  Still a small problem though..
>
> > +int __init da850_register_edma(struct edma_rsv_info *rsv)
> > +{
> > +   if (rsv) {
> > +           da850_edma_info[0].rsv = &rsv[0];
> > +           da850_edma_info[1].rsv = &rsv[1];
> > +   }
> > +
> > +   return platform_device_register(&da850_edma_device);
>
> What if the caller only has reserved chans/slots for controller 0?
> &rsv[1] will be an undefined pointer.
>
> I think you need some sort of terminator on the list passed in.
> so only edma_rsv_info pointers that are valid are passed along.
>

Kevin,

I am assuming since all the other platform data is defined for both
controllers, all the platform data should be consistent and provide
information on both controllers.

In case the caller does not need reservation for second controller he
can use NULL initialization:

+static struct edma_rsv_info da850_edma_rsv[] = {
+       {
+               .rsv_chans      = da850_dma0_rsv_chans,
+               .rsv_slots      = da850_dma0_rsv_slots,
+       },
+       {
+       },
+};

Even currently, if devices-da8xx.c had defined two EDMA instances in resource
structure (da850_edma_resources), but populated da850_edma_info[] for only one
controller, the edma probe would go ahead and access info for second instance.

Is it necessary to check for platform data consistency in such a rigorous manner
(since it is not really a 'user' input)?

Thanks,
Sekhar

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

Reply via email to