[PATCH v2] firmware: arm_scmi: Queue in scmi layer for mailbox implementation
Sudeep Holla
sudeep.holla at arm.com
Mon Oct 14 02:55:14 PDT 2024
On Sun, Oct 13, 2024 at 10:26:49AM +0100, Cristian Marussi wrote:
> On Fri, Oct 11, 2024 at 12:15:07PM -0700, Justin Chen wrote:
> >
> > Yes, I see the implementation. Looks like it returns the position in the
> > ring buffer. I also confirmed with CONFIG_DEBUG_MUTEXES which triggers a
> > warning.
> >
> > What about this?
> > if (ret >= 0)
> > ret = 0
> > else
> > mutex_unlock(&smbox->chan_lock);
> >
> > A bit easier to read IMO.
>
> Oh yes much better definitely...or, maybe, even more simply to read:
>
> ...
>
> mutex_lock(&smbox->chan_lock);
> ret = mbox_send_message(smbox->chan, xfer);
> if (ret < 0) {
> mutex_unlock(&smbox->chan_lock);
> return ret;
> }
>
> return 0;
> }
>
> .... up to You...not sure what Sudeep prefers...
>
I like this better. Also I was hoping Justin would send v3 soonish, I want
to send PR for fixes soon. So I have gone ahead and fixed all your comments
myself. I had seen the doxygen one from builder already and had fixed it up
last week when I added this to -next.
--
Regards,
Sudeep
More information about the linux-arm-kernel
mailing list