From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6945C433E6 for ; Mon, 1 Feb 2021 23:21:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8D91D64EBD for ; Mon, 1 Feb 2021 23:21:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231251AbhBAXUy (ORCPT ); Mon, 1 Feb 2021 18:20:54 -0500 Received: from mx1.opensynergy.com ([217.66.60.4]:8219 "EHLO mx1.opensynergy.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231246AbhBAXUq (ORCPT ); Mon, 1 Feb 2021 18:20:46 -0500 Received: from SR-MAILGATE-02.opensynergy.com (localhost.localdomain [127.0.0.1]) by mx1.opensynergy.com (Proxmox) with ESMTP id E0387A1570; Tue, 2 Feb 2021 00:20:00 +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=ssfdkDmw6xak rwOPLgsefLQO8t7T2+/G9UIklxeWIDE=; b=NOAwJnm3djpRw7B3Z2J3EzeTW/U/ SH+1zuzXql+yR7YTrw+/qGWPiQvz0aYOvH4GGuwdmfcrKcyDENOxTfCCqFvwJCEJ v13+6qI/tPZzYS2uRXqKRqJbNJhESGqXaxRq2Esq9R5gTlG89ZDRM1BHMAaGELZ5 bBW1Jxx7lSklVzt3mu070UNG9YY+AoCdAVkN9MBez38CQ/NmLQgb0CuaXhY18uVT Vv2xCUn1U2ZD+L7I23me1NXVFbEIlNK8H+E0DOhMCnnd6EavKHZPGhXzR+/v7uKk iUuflU8H+9MJYMBV9fh8SUXny7ddh/IBd2bpmRnp4shSwpvHE7t5wMs0mw== Subject: Re: [virtio-dev] Re: [PATCH v2 4/9] ALSA: virtio: build PCM devices and substream hardware descriptors To: Guennadi Liakhovetski CC: , , , , Jaroslav Kysela , Takashi Iwai , "Michael S. Tsirkin" References: <20210124165408.1122868-1-anton.yakovlev@opensynergy.com> <20210124165408.1122868-5-anton.yakovlev@opensynergy.com> <6f93189c-7cfc-25c7-6b2c-ad8e21bf42c@intel.com> From: Anton Yakovlev Message-ID: <4eb2f618-1b8d-b339-8f85-ff061a1f563e@opensynergy.com> Date: Tue, 2 Feb 2021 00:19:59 +0100 MIME-Version: 1.0 In-Reply-To: <6f93189c-7cfc-25c7-6b2c-ad8e21bf42c@intel.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SR-MAIL-02.open-synergy.com (10.26.10.22) To SR-MAIL-01.open-synergy.com (10.26.10.21) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25.01.2021 16:44, Guennadi Liakhovetski wrote: > On Sun, 24 Jan 2021, Anton Yakovlev wrote: > ...[snip]... >> >> diff --git a/sound/virtio/virtio_card.c b/sound/virtio/virtio_card.c >> index 955eadc2d858..39fe13b43dd1 100644 >> --- a/sound/virtio/virtio_card.c >> +++ b/sound/virtio/virtio_card.c >> @@ -92,6 +92,17 @@ static void virtsnd_event_notify_cb(struct >> virtqueue *vqueue) >> if (!event) >> break; >> >> + switch (le32_to_cpu(event->hdr.code)) { >> + case VIRTIO_SND_EVT_PCM_PERIOD_ELAPSED: >> + case VIRTIO_SND_EVT_PCM_XRUN: { > > In the previous patch you had a switch-case statement complying to the > common kernel coding style. It isn't specified in coding-style.rst, but > these superfluous braces really don't seem to be good for anything - in > this and multiple other switch-case statements in the series. I will fix this. Thanks! ...[snip]... >> @@ -359,6 +384,8 @@ static int virtsnd_probe(struct virtio_device *vdev) >> static void virtsnd_remove(struct virtio_device *vdev) >> { >> struct virtio_snd *snd = vdev->priv; >> + struct virtio_pcm *pcm; >> + struct virtio_pcm *pcm_next; >> >> if (!snd) >> return; >> @@ -376,6 +403,24 @@ static void virtsnd_remove(struct virtio_device >> *vdev) >> vdev->config->reset(vdev); >> vdev->config->del_vqs(vdev); >> >> + list_for_each_entry_safe(pcm, pcm_next, &snd->pcm_list, list) { >> + unsigned int i; >> + >> + list_del(&pcm->list); >> + >> + for (i = 0; i < ARRAY_SIZE(pcm->streams); ++i) { >> + struct virtio_pcm_stream *stream = >> &pcm->streams[i]; >> + >> + if (stream->substreams) >> + devm_kfree(&vdev->dev, stream->substreams); >> + } >> + >> + devm_kfree(&vdev->dev, pcm); > > Please double-check both devm_kfree() calls above. Probably they aren't > needed in the .remove() method. Then I will redo these parts, and the parts that you noticed in the rest of the comments to this file. ...[snip]... > > Thanks > Guennadi > > --------------------------------------------------------------------- > To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org > For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org > > -- Anton Yakovlev Senior Software Engineer OpenSynergy GmbH Rotherstr. 20, 10245 Berlin www.opensynergy.com From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF3CFC433DB for ; Mon, 1 Feb 2021 23:21:06 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 173EE64EB8 for ; Mon, 1 Feb 2021 23:21:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 173EE64EB8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=opensynergy.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 42C5F1750; Tue, 2 Feb 2021 00:20:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 42C5F1750 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1612221664; bh=Z4d4N8/v3zjJzHkshDQbAJ+ak6QtKWSG5JFKnPnNwfM=; h=Subject:To:References:From:Date:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=IFYqvYAX0bliaCF5qCT9rKudJPAhXxCF/I4hVgLvqbHMETO7fJITtb5FRPjAsMnGd 1nnyCWUNigbhAnLeH5yh7w2gADhzlqZsEAiFyt2WmAj7Ccylfvt+c93pjyJMSyqhfA ii1603NGkcRMvOWiAkfPuh6Ko/jzp4CF4ibW0fko= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C47D8F80152; Tue, 2 Feb 2021 00:20:13 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0B1C9F80154; Tue, 2 Feb 2021 00:20:12 +0100 (CET) Received: from mx1.opensynergy.com (mx1.opensynergy.com [217.66.60.4]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id CEF26F80152 for ; Tue, 2 Feb 2021 00:20:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CEF26F80152 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=opensynergy.com header.i=@opensynergy.com header.b="NOAwJnm3" Received: from SR-MAILGATE-02.opensynergy.com (localhost.localdomain [127.0.0.1]) by mx1.opensynergy.com (Proxmox) with ESMTP id E0387A1570; Tue, 2 Feb 2021 00:20:00 +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=ssfdkDmw6xak rwOPLgsefLQO8t7T2+/G9UIklxeWIDE=; b=NOAwJnm3djpRw7B3Z2J3EzeTW/U/ SH+1zuzXql+yR7YTrw+/qGWPiQvz0aYOvH4GGuwdmfcrKcyDENOxTfCCqFvwJCEJ v13+6qI/tPZzYS2uRXqKRqJbNJhESGqXaxRq2Esq9R5gTlG89ZDRM1BHMAaGELZ5 bBW1Jxx7lSklVzt3mu070UNG9YY+AoCdAVkN9MBez38CQ/NmLQgb0CuaXhY18uVT Vv2xCUn1U2ZD+L7I23me1NXVFbEIlNK8H+E0DOhMCnnd6EavKHZPGhXzR+/v7uKk iUuflU8H+9MJYMBV9fh8SUXny7ddh/IBd2bpmRnp4shSwpvHE7t5wMs0mw== Subject: Re: [virtio-dev] Re: [PATCH v2 4/9] ALSA: virtio: build PCM devices and substream hardware descriptors To: Guennadi Liakhovetski References: <20210124165408.1122868-1-anton.yakovlev@opensynergy.com> <20210124165408.1122868-5-anton.yakovlev@opensynergy.com> <6f93189c-7cfc-25c7-6b2c-ad8e21bf42c@intel.com> From: Anton Yakovlev Message-ID: <4eb2f618-1b8d-b339-8f85-ff061a1f563e@opensynergy.com> Date: Tue, 2 Feb 2021 00:19:59 +0100 MIME-Version: 1.0 In-Reply-To: <6f93189c-7cfc-25c7-6b2c-ad8e21bf42c@intel.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SR-MAIL-02.open-synergy.com (10.26.10.22) To SR-MAIL-01.open-synergy.com (10.26.10.21) Cc: virtio-dev@lists.oasis-open.org, alsa-devel@alsa-project.org, "Michael S. Tsirkin" , linux-kernel@vger.kernel.org, Takashi Iwai , virtualization@lists.linux-foundation.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On 25.01.2021 16:44, Guennadi Liakhovetski wrote: > On Sun, 24 Jan 2021, Anton Yakovlev wrote: > ...[snip]... >> >> diff --git a/sound/virtio/virtio_card.c b/sound/virtio/virtio_card.c >> index 955eadc2d858..39fe13b43dd1 100644 >> --- a/sound/virtio/virtio_card.c >> +++ b/sound/virtio/virtio_card.c >> @@ -92,6 +92,17 @@ static void virtsnd_event_notify_cb(struct >> virtqueue *vqueue) >> if (!event) >> break; >> >> + switch (le32_to_cpu(event->hdr.code)) { >> + case VIRTIO_SND_EVT_PCM_PERIOD_ELAPSED: >> + case VIRTIO_SND_EVT_PCM_XRUN: { > > In the previous patch you had a switch-case statement complying to the > common kernel coding style. It isn't specified in coding-style.rst, but > these superfluous braces really don't seem to be good for anything - in > this and multiple other switch-case statements in the series. I will fix this. Thanks! ...[snip]... >> @@ -359,6 +384,8 @@ static int virtsnd_probe(struct virtio_device *vdev) >> static void virtsnd_remove(struct virtio_device *vdev) >> { >> struct virtio_snd *snd = vdev->priv; >> + struct virtio_pcm *pcm; >> + struct virtio_pcm *pcm_next; >> >> if (!snd) >> return; >> @@ -376,6 +403,24 @@ static void virtsnd_remove(struct virtio_device >> *vdev) >> vdev->config->reset(vdev); >> vdev->config->del_vqs(vdev); >> >> + list_for_each_entry_safe(pcm, pcm_next, &snd->pcm_list, list) { >> + unsigned int i; >> + >> + list_del(&pcm->list); >> + >> + for (i = 0; i < ARRAY_SIZE(pcm->streams); ++i) { >> + struct virtio_pcm_stream *stream = >> &pcm->streams[i]; >> + >> + if (stream->substreams) >> + devm_kfree(&vdev->dev, stream->substreams); >> + } >> + >> + devm_kfree(&vdev->dev, pcm); > > Please double-check both devm_kfree() calls above. Probably they aren't > needed in the .remove() method. Then I will redo these parts, and the parts that you noticed in the rest of the comments to this file. ...[snip]... > > Thanks > Guennadi > > --------------------------------------------------------------------- > To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org > For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org > > -- Anton Yakovlev Senior Software Engineer OpenSynergy GmbH Rotherstr. 20, 10245 Berlin www.opensynergy.com From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1337C433DB for ; Mon, 1 Feb 2021 23:20:06 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8167664EBF for ; Mon, 1 Feb 2021 23:20:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8167664EBF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=opensynergy.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=virtualization-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 305EA21507; Mon, 1 Feb 2021 23:20:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bIz32c9MHCWT; Mon, 1 Feb 2021 23:20:04 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 0E4EA214F6; Mon, 1 Feb 2021 23:20:04 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 00579C0FA7; Mon, 1 Feb 2021 23:20:04 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 00587C013A for ; Mon, 1 Feb 2021 23:20:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E6CE384948 for ; Mon, 1 Feb 2021 23:20:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rVGta7QWcU-M for ; Mon, 1 Feb 2021 23:20:02 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.opensynergy.com (mx1.opensynergy.com [217.66.60.4]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 4CB01847B3 for ; Mon, 1 Feb 2021 23:20:02 +0000 (UTC) Received: from SR-MAILGATE-02.opensynergy.com (localhost.localdomain [127.0.0.1]) by mx1.opensynergy.com (Proxmox) with ESMTP id E0387A1570; Tue, 2 Feb 2021 00:20:00 +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=ssfdkDmw6xak rwOPLgsefLQO8t7T2+/G9UIklxeWIDE=; b=NOAwJnm3djpRw7B3Z2J3EzeTW/U/ SH+1zuzXql+yR7YTrw+/qGWPiQvz0aYOvH4GGuwdmfcrKcyDENOxTfCCqFvwJCEJ v13+6qI/tPZzYS2uRXqKRqJbNJhESGqXaxRq2Esq9R5gTlG89ZDRM1BHMAaGELZ5 bBW1Jxx7lSklVzt3mu070UNG9YY+AoCdAVkN9MBez38CQ/NmLQgb0CuaXhY18uVT Vv2xCUn1U2ZD+L7I23me1NXVFbEIlNK8H+E0DOhMCnnd6EavKHZPGhXzR+/v7uKk iUuflU8H+9MJYMBV9fh8SUXny7ddh/IBd2bpmRnp4shSwpvHE7t5wMs0mw== Subject: Re: [virtio-dev] Re: [PATCH v2 4/9] ALSA: virtio: build PCM devices and substream hardware descriptors To: Guennadi Liakhovetski References: <20210124165408.1122868-1-anton.yakovlev@opensynergy.com> <20210124165408.1122868-5-anton.yakovlev@opensynergy.com> <6f93189c-7cfc-25c7-6b2c-ad8e21bf42c@intel.com> From: Anton Yakovlev Message-ID: <4eb2f618-1b8d-b339-8f85-ff061a1f563e@opensynergy.com> Date: Tue, 2 Feb 2021 00:19:59 +0100 MIME-Version: 1.0 In-Reply-To: <6f93189c-7cfc-25c7-6b2c-ad8e21bf42c@intel.com> Content-Language: en-US X-ClientProxiedBy: SR-MAIL-02.open-synergy.com (10.26.10.22) To SR-MAIL-01.open-synergy.com (10.26.10.21) Cc: virtio-dev@lists.oasis-open.org, alsa-devel@alsa-project.org, "Michael S. Tsirkin" , linux-kernel@vger.kernel.org, Takashi Iwai , Jaroslav Kysela , virtualization@lists.linux-foundation.org X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" On 25.01.2021 16:44, Guennadi Liakhovetski wrote: > On Sun, 24 Jan 2021, Anton Yakovlev wrote: > ...[snip]... >> >> diff --git a/sound/virtio/virtio_card.c b/sound/virtio/virtio_card.c >> index 955eadc2d858..39fe13b43dd1 100644 >> --- a/sound/virtio/virtio_card.c >> +++ b/sound/virtio/virtio_card.c >> @@ -92,6 +92,17 @@ static void virtsnd_event_notify_cb(struct >> virtqueue *vqueue) >> if (!event) >> break; >> >> + switch (le32_to_cpu(event->hdr.code)) { >> + case VIRTIO_SND_EVT_PCM_PERIOD_ELAPSED: >> + case VIRTIO_SND_EVT_PCM_XRUN: { > > In the previous patch you had a switch-case statement complying to the > common kernel coding style. It isn't specified in coding-style.rst, but > these superfluous braces really don't seem to be good for anything - in > this and multiple other switch-case statements in the series. I will fix this. Thanks! ...[snip]... >> @@ -359,6 +384,8 @@ static int virtsnd_probe(struct virtio_device *vdev) >> static void virtsnd_remove(struct virtio_device *vdev) >> { >> struct virtio_snd *snd = vdev->priv; >> + struct virtio_pcm *pcm; >> + struct virtio_pcm *pcm_next; >> >> if (!snd) >> return; >> @@ -376,6 +403,24 @@ static void virtsnd_remove(struct virtio_device >> *vdev) >> vdev->config->reset(vdev); >> vdev->config->del_vqs(vdev); >> >> + list_for_each_entry_safe(pcm, pcm_next, &snd->pcm_list, list) { >> + unsigned int i; >> + >> + list_del(&pcm->list); >> + >> + for (i = 0; i < ARRAY_SIZE(pcm->streams); ++i) { >> + struct virtio_pcm_stream *stream = >> &pcm->streams[i]; >> + >> + if (stream->substreams) >> + devm_kfree(&vdev->dev, stream->substreams); >> + } >> + >> + devm_kfree(&vdev->dev, pcm); > > Please double-check both devm_kfree() calls above. Probably they aren't > needed in the .remove() method. Then I will redo these parts, and the parts that you noticed in the rest of the comments to this file. ...[snip]... > > Thanks > Guennadi > > --------------------------------------------------------------------- > To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org > For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org > > -- Anton Yakovlev Senior Software Engineer OpenSynergy GmbH Rotherstr. 20, 10245 Berlin www.opensynergy.com _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: virtio-dev-return-7969-cohuck=redhat.com@lists.oasis-open.org Sender: List-Post: List-Help: List-Unsubscribe: List-Subscribe: Received: from lists.oasis-open.org (oasis-open.org [10.110.1.242]) by lists.oasis-open.org (Postfix) with ESMTP id 898A09865DE for ; Mon, 1 Feb 2021 23:20:02 +0000 (UTC) References: <20210124165408.1122868-1-anton.yakovlev@opensynergy.com> <20210124165408.1122868-5-anton.yakovlev@opensynergy.com> <6f93189c-7cfc-25c7-6b2c-ad8e21bf42c@intel.com> From: Anton Yakovlev Message-ID: <4eb2f618-1b8d-b339-8f85-ff061a1f563e@opensynergy.com> Date: Tue, 2 Feb 2021 00:19:59 +0100 MIME-Version: 1.0 In-Reply-To: <6f93189c-7cfc-25c7-6b2c-ad8e21bf42c@intel.com> Subject: Re: [virtio-dev] Re: [PATCH v2 4/9] ALSA: virtio: build PCM devices and substream hardware descriptors Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit To: Guennadi Liakhovetski Cc: virtualization@lists.linux-foundation.org, alsa-devel@alsa-project.org, virtio-dev@lists.oasis-open.org, linux-kernel@vger.kernel.org, Jaroslav Kysela , Takashi Iwai , "Michael S. Tsirkin" List-ID: On 25.01.2021 16:44, Guennadi Liakhovetski wrote: > On Sun, 24 Jan 2021, Anton Yakovlev wrote: > ...[snip]... >> >> diff --git a/sound/virtio/virtio_card.c b/sound/virtio/virtio_card.c >> index 955eadc2d858..39fe13b43dd1 100644 >> --- a/sound/virtio/virtio_card.c >> +++ b/sound/virtio/virtio_card.c >> @@ -92,6 +92,17 @@ static void virtsnd_event_notify_cb(struct >> virtqueue *vqueue) >> if (!event) >> break; >> >> + switch (le32_to_cpu(event->hdr.code)) { >> + case VIRTIO_SND_EVT_PCM_PERIOD_ELAPSED: >> + case VIRTIO_SND_EVT_PCM_XRUN: { > > In the previous patch you had a switch-case statement complying to the > common kernel coding style. It isn't specified in coding-style.rst, but > these superfluous braces really don't seem to be good for anything - in > this and multiple other switch-case statements in the series. I will fix this. Thanks! ...[snip]... >> @@ -359,6 +384,8 @@ static int virtsnd_probe(struct virtio_device *vdev) >> static void virtsnd_remove(struct virtio_device *vdev) >> { >> struct virtio_snd *snd = vdev->priv; >> + struct virtio_pcm *pcm; >> + struct virtio_pcm *pcm_next; >> >> if (!snd) >> return; >> @@ -376,6 +403,24 @@ static void virtsnd_remove(struct virtio_device >> *vdev) >> vdev->config->reset(vdev); >> vdev->config->del_vqs(vdev); >> >> + list_for_each_entry_safe(pcm, pcm_next, &snd->pcm_list, list) { >> + unsigned int i; >> + >> + list_del(&pcm->list); >> + >> + for (i = 0; i < ARRAY_SIZE(pcm->streams); ++i) { >> + struct virtio_pcm_stream *stream = >> &pcm->streams[i]; >> + >> + if (stream->substreams) >> + devm_kfree(&vdev->dev, stream->substreams); >> + } >> + >> + devm_kfree(&vdev->dev, pcm); > > Please double-check both devm_kfree() calls above. Probably they aren't > needed in the .remove() method. Then I will redo these parts, and the parts that you noticed in the rest of the comments to this file. ...[snip]... > > Thanks > Guennadi > > --------------------------------------------------------------------- > To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org > For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org > > -- Anton Yakovlev Senior Software Engineer OpenSynergy GmbH Rotherstr. 20, 10245 Berlin www.opensynergy.com --------------------------------------------------------------------- To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org