lkml.org 
[lkml]   [2020]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] soc: qcom: rpmh-rsc: Sleep waiting for tcs slots to be free
Hi,

On Fri, Jul 24, 2020 at 12:44 PM Stephen Boyd <swboyd@chromium.org> wrote:
>
> > > - if (ret)
> > > - goto unlock;
> > >
> > > - ret = find_free_tcs(tcs);
> > > - if (ret < 0)
> > > - goto unlock;
> > > - tcs_id = ret;
> > > + wait_event_lock_irq(drv->tcs_wait,
> > > + (tcs_id = claim_tcs_for_req(drv, tcs, msg)) >= 0,
> >
> > Even though claim_tcs_for_req() only returns 0 or -EBUSY today (IOW it
> > never returns error codes other than -EBUSY), should we handle it? If
> > we don't, claim_tcs_for_req() should be very clear that it shouldn't
> > return any errors other than -EBUSY.
>
> Do you mean you want to change it to be
>
> (tcs_id = claim_tcs_for_req(drv, tcs, msg)) != -EBUSY
>
> instead of >= 0? It should return the tcs_id that was claimed, not just
> 0 or -EBUSY.

Ah, right. Yes, you got it right. Of course then we have to add a
"if (tcd_id < 0) goto unlock", too. If you think it's not worth
adding this then we just need to make sure it's super obvious in
claim_tcs_for_req() that it's not allowed to return other errors.

-Doug

\
 
 \ /
  Last update: 2020-07-24 21:50    [W:1.274 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site