lkml.org 
[lkml]   [2018]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] slimbus: stream: add stream support
On 25-06-18, 11:11, Srinivas Kandagatla wrote:

> > > +struct slim_stream_runtime *slim_stream_allocate(struct slim_device *dev,
> > > + const char *name)
> > > +{
> > > + struct slim_stream_runtime *rt;
> > > + unsigned long flags;
> > > +
> > > + rt = kzalloc(sizeof(*rt), GFP_KERNEL);
> > > + if (!rt)
> > > + return ERR_PTR(-ENOMEM);
> > > +
> > > + rt->name = kasprintf(GFP_KERNEL, "slim-%s", name);
> > > + if (!rt->name) {
> > > + kfree(rt);
> > > + return ERR_PTR(-ENOMEM);
> > > + }
> > > +
> > > + rt->dev = dev;
> > > + rt->state = SLIM_STREAM_STATE_ALLOCATED;
> > > + spin_lock_irqsave(&dev->stream_list_lock, flags);
> > > + list_add_tail(&rt->node, &dev->stream_list);
> > > + spin_unlock_irqrestore(&dev->stream_list_lock, flags);
> >
> > Any reason for _irqsave variant? Do you expect stream APIs to be called
> > from ISR?We can move to non irqsave variant here, as i do not see a case
> > where
> this list would be interrupted from irq context.

That's interesting can you please describe how?
Also, won't it be modified from bottom half...

> > > +/*
> > > + * slim_stream_enable() - Enable a prepared SLIMbus Stream
> >
> > Do you want to check if it is already prepared ..?
> Yep, I think most of the code needs similar state machine check, I will add
> this in next version.

so if you are tying to snd stream states then I don't think you need a
state machine here. ALSA already does that for you so you can skip it :D

--
~Vinod

\
 
 \ /
  Last update: 2018-06-25 18:22    [W:0.051 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site