Received: by 10.192.165.156 with SMTP id m28csp590432imm; Mon, 16 Apr 2018 05:43:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx48Qapiio4sOdKwpWAUmtIcPYXiNCCy3WAY2hIv3T8vyQgVRRvDLqQKGZyDKfm9jduaR9dYq X-Received: by 2002:a17:902:145:: with SMTP id 63-v6mr6278421plb.332.1523882612953; Mon, 16 Apr 2018 05:43:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523882612; cv=none; d=google.com; s=arc-20160816; b=UqHojS1Nkr6VcPnwJIC8mWkYUOQVe9PV22swD8V7fnNE1FiDgFX9uHKAobgloE5Oks Op/EcGuAOboeQbmYuGyQRMI93+kC1P/7P7CaVaL/diYVPTDXE1gnDL1mRsOPIC6bmtvW fP7cMAm8q4QA9mch3ae2gVV7b+9GV5ZgJ3yZTq7sUpYX3LiZ8eG/LUztIt/DNun/VFLC BzLnm5ldROS+okPODKjtMzgk+L0OrFFX+2HNajc+Y5nH5ATuH+VNEuL/CJH5cpECBAsy OGgEn22vy3mWXjkwcXJn25VO9InAjCWOKj4B2m/OrvI4HNST/07WNs3imGT6D2DL4FcV aHfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=Z2mnEK8WtlJGidu3Ny8Q/v9n9dxSmdJwJx27o786NV0=; b=GmZeCWfZMEARRmngBM0vC2Tfvn4hmDTtXQ+//m8JEDbBHFjLlp8xJQBa7oufeeW4ij Dkb26lijtunosTL7ptO8rzXkdFI6hBHWe72+jeXrKOMXBGMD1O7vYNRuSuAiRzOg7ehn fLN1MpR5orGvrDkGY5xj6CIHz6u3TTX/FfWexUAL8jJgwFBUYOnmap+MtYcvANMv/DU2 /eakOdTLsxDTKX4TmEojn6hJrgfiyrwD6+TezwJPEV+qalgDsJZevtTpaKMrf7HryWjN 1s4+JKpZMQbj6UjDC8xWlG5r7alhOzn1/NAuVBpRU1n7fnTX9L5R+KnJWyuS2uRwaQqi 4dQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g4-v6si12205795plb.522.2018.04.16.05.43.18; Mon, 16 Apr 2018 05:43:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754073AbeDPMZU (ORCPT + 99 others); Mon, 16 Apr 2018 08:25:20 -0400 Received: from mx2.suse.de ([195.135.220.15]:41163 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752648AbeDPMZS (ORCPT ); Mon, 16 Apr 2018 08:25:18 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 6DE44AB3D; Mon, 16 Apr 2018 12:25:17 +0000 (UTC) Subject: Re: [PATCH v2 1/5] ALSA: xen-front: Introduce Xen para-virtualized sound frontend driver To: Oleksandr Andrushchenko , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, perex@perex.cz, tiwai@suse.com Cc: Oleksandr Andrushchenko References: <20180416062453.24743-1-andr2000@gmail.com> <20180416062453.24743-2-andr2000@gmail.com> From: Juergen Gross Message-ID: Date: Mon, 16 Apr 2018 14:25:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180416062453.24743-2-andr2000@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/04/18 08:24, Oleksandr Andrushchenko wrote: > From: Oleksandr Andrushchenko > > 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 Only one minor nit (see below). With that addressed (or fixed when committing): Reviewed-by: Juergen Gross 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