lkml.org 
[lkml]   [2018]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 1/5] ALSA: xen-front: Introduce Xen para-virtualized sound frontend driver
From
Date
On 04/16/2018 03:25 PM, Juergen Gross wrote:
> On 16/04/18 08:24, Oleksandr Andrushchenko wrote:
>> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
>>
>> Introduce skeleton of the para-virtualized Xen sound
>> frontend driver.
>>
>> Initial handling for Xen bus states: implement
>> Xen bus state machine for the frontend driver according to
>> the state diagram and recovery flow from sound para-virtualized
>> protocol: xen/interface/io/sndif.h.
>>
>> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> Only one minor nit (see below). With that addressed (or fixed when
> committing):
will fix
> Reviewed-by: Juergen Gross <jgross@suse.com>
Thank you
>
> Juergen
>
>> ---
>> sound/Kconfig | 2 +
>> sound/Makefile | 2 +-
>> sound/xen/Kconfig | 10 +++
>> sound/xen/Makefile | 5 ++
>> sound/xen/xen_snd_front.c | 196 ++++++++++++++++++++++++++++++++++++++++++++++
>> sound/xen/xen_snd_front.h | 18 +++++
>> 6 files changed, 232 insertions(+), 1 deletion(-)
>> create mode 100644 sound/xen/Kconfig
>> create mode 100644 sound/xen/Makefile
>> create mode 100644 sound/xen/xen_snd_front.c
>> create mode 100644 sound/xen/xen_snd_front.h
>>
>> diff --git a/sound/xen/xen_snd_front.c b/sound/xen/xen_snd_front.c
>> new file mode 100644
>> index 000000000000..f406a8f52c51
>> --- /dev/null
>> +++ b/sound/xen/xen_snd_front.c
>> @@ -0,0 +1,196 @@
>> +static void sndback_changed(struct xenbus_device *xb_dev,
>> + enum xenbus_state backend_state)
>> +{
>> + struct xen_snd_front_info *front_info = dev_get_drvdata(&xb_dev->dev);
>> + int ret;
>> +
>> + dev_dbg(&xb_dev->dev, "Backend state is %s, front is %s\n",
>> + xenbus_strstate(backend_state),
>> + xenbus_strstate(xb_dev->state));
>> +
>> + switch (backend_state) {
>> + case XenbusStateReconfiguring:
>> + /* fall through */
>> + case XenbusStateReconfigured:
>> + /* fall through */
>> + case XenbusStateInitialised:
>> + /* fall through */
>> + break;
>> +
>> + case XenbusStateInitialising:
>> + /* recovering after backend unexpected closure */
>> + sndback_disconnect(front_info);
>> + break;
>> +
>> + case XenbusStateInitWait:
>> + /* recovering after backend unexpected closure */
>> + sndback_disconnect(front_info);
>> +
>> + ret = sndback_initwait(front_info);
>> + if (ret < 0)
>> + xenbus_dev_fatal(xb_dev, ret, "initializing frontend");
>> + else
>> + xenbus_switch_state(xb_dev, XenbusStateInitialised);
>> + break;
>> +
>> + case XenbusStateConnected:
>> + if (xb_dev->state != XenbusStateInitialised)
>> + break;
>> +
>> + ret = sndback_connect(front_info);
>> + if (ret < 0)
>> + xenbus_dev_fatal(xb_dev, ret, "initializing frontend");
>> + else
>> + xenbus_switch_state(xb_dev, XenbusStateConnected);
>> + break;
>> +
>> + case XenbusStateClosing:
>> + /*
>> + * in this state backend starts freeing resources,
>> + * so let it go into closed state first, so we can also
>> + * remove ours
>> + */
> Please start the sentence with a capital letter and end it with a
> full stop.
>
>
> Juergen

\
 
 \ /
  Last update: 2018-04-17 10:25    [W:0.034 / U:2.264 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site