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=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS 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 0156CC43381 for ; Tue, 26 Mar 2019 08:35:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C422E2084B for ; Tue, 26 Mar 2019 08:35:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731202AbfCZIfi (ORCPT ); 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