Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp471185pxb; Wed, 3 Feb 2021 09:36:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJxPb4xLvkaIxeECvKbaZ2fAnAl1qWeWa1SyxNKoFOchqIXFz26IL4tYHtrOkOa/uNwL3gQN X-Received: by 2002:a17:907:11c7:: with SMTP id va7mr4317804ejb.351.1612373789728; Wed, 03 Feb 2021 09:36:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612373789; cv=none; d=google.com; s=arc-20160816; b=v/JNJWg4rK5Wo6+oEUFSBjoyBbqtzWaKC+cD82QbmEDlVrPRR+/lYRHKgPrNs4Mv70 dFOOXBGfN15hIOCLAFg7NSr5COmtFClFunWMVw1yxc0UDUEdi+v0axPAeODBZyiO4juU kk2S5yiklAi+psoEQZXV4rnGubA+OZkGvK3MTKshYh2T8qZ7pMgZ6aogfRWmkQ2cXhBH ucRnt6t8F+UD9ggoHTjTAWs87WhskJKX+6WcFFwHShYEs6oBhqDB+Ew41TXs6d1yZIV5 MWeATjogYWuD2HhRTmb3+wW529RAV27DlJj6vQUpES63nIJHsS+jIKIiUbO/iInFzmof iErw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:date:message-id:from:references:cc:to :subject:dkim-signature; bh=6JriUFT4K4GwYTQBWmEFwOKzOJIBhwKv+n4I3Bk9mZ4=; b=v4egO0RvgGfFrWtrHf3aYoqz71jqjOG50aRGn3zXsnB0Pweb8v42AVe+OS3mXjSABE ySJtBt4gHLhpEhvhyNZqDkuVpNvpe6KYultOcDgt3YeFQYJJ5nIY+ptMMKIzYcLzE9ud 1MUMZuoBf/I105zv59T4uObE3hg8vfUc8fSlHS4BSs88SWTEQ2KekFSgTlvV35ImMpZG mKJsCiwNC6xf2cIdw44MK14MSJNHg8Ho71iayHuRGwBTXWXx3MpFp1htKKmNfFHJssJe StwroN5OOdLNSnRkNf7K6K4mpQEcpgfidKcsGbfyeHYOZMfIOoueDOwIi7XBRFrRUwvm UMzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@opensynergy.com header.s=srmailgate02 header.b=ZS9V4YZ7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=opensynergy.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b61si1737561edf.278.2021.02.03.09.36.02; Wed, 03 Feb 2021 09:36:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@opensynergy.com header.s=srmailgate02 header.b=ZS9V4YZ7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=opensynergy.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232000AbhBCRfA (ORCPT + 99 others); Wed, 3 Feb 2021 12:35:00 -0500 Received: from mx1.opensynergy.com ([217.66.60.4]:46830 "EHLO mx1.opensynergy.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231801AbhBCRe5 (ORCPT ); Wed, 3 Feb 2021 12:34:57 -0500 Received: from SR-MAILGATE-02.opensynergy.com (localhost.localdomain [127.0.0.1]) by mx1.opensynergy.com (Proxmox) with ESMTP id DEDB2A15A4; Wed, 3 Feb 2021 18:34:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=opensynergy.com; h=cc:cc:content-transfer-encoding:content-type:content-type :date:from:from:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=srmailgate02; bh=6JriUFT4K4Gw YTQBWmEFwOKzOJIBhwKv+n4I3Bk9mZ4=; b=ZS9V4YZ72FWVi7jLDWcSYcAxKf+E q4/rbVgU+kTQKo0+HohUXRP4aRJctXkwRTS7slZVNXGVKEiK9xYezJH9qleb++ty JDcfELO4n6iMqRMMd0uR7JoH2qOXonsSXmUprzdqEdYgcb9UJ5qN8waT3PmM2XPN dlUUlFCn3FynQI2qXzqEURdH7WoJ1zk7yMy89/tIPNhS8TiZERrSlg8ybV0LKvN4 OLsmqvjaD56VsoWRsLLSzTwfxCW8IgfMgG9uVJemr/v2fqHOTROjmkg4MgFGNlYR JULqEYM8W+YWDNKrq+WzFkkvkBm5hy9haTBbLVTHCkGRzuKehKmn9ICG+w== Subject: Re: [virtio-dev] Re: [PATCH v2 2/9] ALSA: virtio: add virtio sound driver To: Takashi Iwai CC: Guennadi Liakhovetski , , , , , Jaroslav Kysela , Takashi Iwai , "Michael S. Tsirkin" References: <20210124165408.1122868-1-anton.yakovlev@opensynergy.com> <20210124165408.1122868-3-anton.yakovlev@opensynergy.com> <8754dae8-114-6383-510-de2ba9dc4fa@intel.com> <52f71ac6-3ec7-2884-7a64-1995f416d20a@opensynergy.com> From: Anton Yakovlev Message-ID: Date: Wed, 3 Feb 2021 18:34:12 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SR-MAIL-01.open-synergy.com (10.26.10.21) To SR-MAIL-01.open-synergy.com (10.26.10.21) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Takashi, On 03.02.2021 17:59, Takashi Iwai wrote: > On Tue, 02 Feb 2021 00:18:09 +0100, > Anton Yakovlev wrote: >>>> +/** >>>> + * virtsnd_reset_fn() - Kernel worker's function to reset the device. >>>> + * @work: Reset device work. >>>> + * >>>> + * Context: Process context. >>>> + */ >>>> +static void virtsnd_reset_fn(struct work_struct *work) >>>> +{ >>>> + struct virtio_snd *snd = >>>> + container_of(work, struct virtio_snd, reset_work); >>>> + struct virtio_device *vdev = snd->vdev; >>>> + struct device *dev = &vdev->dev; >>>> + int rc; >>>> + >>>> + dev_info(dev, "sound device needs reset\n"); >>>> + >>>> + /* >>>> + * It seems that the only way to properly reset the device is to >>>> remove >>>> + * and re-create the ALSA sound card device. >>>> + * >>>> + * Also resetting the device involves a number of steps with >>>> setting the >>>> + * status bits described in the virtio specification. And the >>>> easiest >>>> + * way to get everything right is to use the virtio bus interface. >>>> + */ >>>> + rc = dev->bus->remove(dev); >>>> + if (rc) >>>> + dev_warn(dev, "bus->remove() failed: %d", rc); >>>> + >>>> + rc = dev->bus->probe(dev); >>>> + if (rc) >>>> + dev_err(dev, "bus->probe() failed: %d", rc); >>> >>> This looks very suspicious to me. Wondering what ALSA maintainers >> will say >>> to this. >> >> I'm also wondering what the virtio people have to say. This part is a >> purely virtio specific thing. And since none of the existing virtio >> drivers processes the request to reset the device, it is not clear what >> is the best way to proceed here. For this reason, the most >> straightforward and simple solution was chosen. > > What is this "reset" actually supposed to do? Reconfguring > everything, or changing only certain parameters, devices, whatever? It means bringing this particular device to its initial state. After that, the driver can re-read the configurations from the device and reconfigure everything. > thanks, > > Takashi > -- Anton Yakovlev Senior Software Engineer OpenSynergy GmbH Rotherstr. 20, 10245 Berlin