Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4041305img; Tue, 26 Mar 2019 01:36:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqwHNwVNamP0UvKqknW7s191IIVUkig/0Js2MRTkWEQ3qYttiXVEpYBkTMqZ57BpV5XAXEQT X-Received: by 2002:a63:5349:: with SMTP id t9mr27970516pgl.262.1553589401870; Tue, 26 Mar 2019 01:36:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553589401; cv=none; d=google.com; s=arc-20160816; b=wYJJCTuV9O1SXB3ehaY3HAwqreUrpFIQfHzClZDj1lXMYGfMrN59bSoA4t4N0OmtuI ETOZRJTo0dXZ+MOMpeh4WNdl2avm0vmKbPPxnmvkfvnYEeyLthAwUVreqFoUfCtU0Lx7 qJdDsiufci3PlcLBjDXsLK4GF25GhtinE8LWLZ6tUo+WIs118HF5i1g4i8x8ADpx/B6L byAGsDt4J1f70PW6ZX98YPq1ugm65Y9dfYirM+qELxiMRY3oqbOZr1V8cqUR3/1iCiRi y+hG08eSg10m+zPXbCZlt2mb87QO3z6mS/bo1aGBKcx2bJl6lDzcGWNhCwaPqeJkq6JI Vh2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date; bh=7T/149K4u212GIyW/lrd42O9S/w9d+4ttDN52i2JRJs=; b=NZbu6r/M11qs2lm8XbFIrMweEx38bKAv1mDe/45zWFCCzPRup4TF7nKcUekRrNNtla i6G/xD/51JPe/oR16MbvV1UZKGjPokCw8HhLE3vQEWy4rYGZxiz71ZkuxfTCA1fIGcf0 zZfTu7Nnjbls1tnGGwTTtZnfgiU683tQDqGd5vlOYeD+8ToP7Kl6PDKZWajI3gk3QBYU YlCwHNE2VkAonGlSTEqT8W71xWjn3pXPHcq5Ebb+mCnUzDVPCiM/DUyI+Q/n6Uoz8pHW fPGTe+7dY8LUQqLCIEu1xvc7Y4kPYq2MY2rQUb4XV8vbcdtxH3ythi6b28fgvz+FMRf/ edkA== 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 z72si5943201pgd.401.2019.03.26.01.36.26; Tue, 26 Mar 2019 01:36:41 -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 S1731176AbfCZIfi (ORCPT + 99 others); Tue, 26 Mar 2019 04:35:38 -0400 Received: from mx2.suse.de ([195.135.220.15]:58444 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730591AbfCZIfi (ORCPT ); Tue, 26 Mar 2019 04:35:38 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 328D0ACD0; Tue, 26 Mar 2019 08:35:37 +0000 (UTC) Date: Tue, 26 Mar 2019 09:35:36 +0100 Message-ID: From: Takashi Iwai To: Cc: , , , , Subject: Re: [PATCH 09/10] ALSA: pcm: Add snd_pcm_ops for snd_pcm_link() In-Reply-To: <1553586574-18608-5-git-send-email-twischer@de.adit-jv.com> References: <1553529644-5654-1-git-send-email-twischer@de.adit-jv.com> <1553586574-18608-1-git-send-email-twischer@de.adit-jv.com> <1553586574-18608-5-git-send-email-twischer@de.adit-jv.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 26 Mar 2019 08:49:33 +0100, wrote: > > From: Timo Wischer > > snd_pcm_link() can be called by the user as long as the device is not > yet started. Therefore currently a driver which wants to iterate over > the linked substreams has to do this at the start trigger. But the start > trigger should not block for a long time. Therefore there is no callback > which can be used to iterate over the linked substreams without delaying > the start trigger. > This patch introduces a new callback function which will be called after > the linked substream list was updated by snd_pcm_link(). This callback > function is allowed to block for a longer time without interfering the > synchronized start up of linked substreams. > > Signed-off-by: Timo Wischer Well, the idea appears interesting, but I'm afraid that the implementation is still racy. The place you're calling the new callback isn't protected, hence the stream can be triggered while calling it. That is, even during operating your loopback link_changed callback, another thread is able to start the stream. thanks, Takashi