Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3102055imu; Sun, 27 Jan 2019 21:49:17 -0800 (PST) X-Google-Smtp-Source: ALg8bN5ENeuji6IYzXIekNrPcu922ZMMKgfMCtBuGfSTc54pPt1NQNeLyy9zZVpaNmGK5kLksNYe X-Received: by 2002:a17:902:74cc:: with SMTP id f12mr20668914plt.134.1548654557474; Sun, 27 Jan 2019 21:49:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548654557; cv=none; d=google.com; s=arc-20160816; b=hXzXYitOA4u/70eL7oM9PDCmAWHNZWBhSVhLiILJX7DwssU7IA26sUruAVLcyQxWr6 DDUpI6bvC3+x1gS0LMe6CGGAgDyo/O1nT/HEU5Tq/l0dlwWgz1Lct8xY17zOhIMjwjWB mYCIXHKowxZgkEGXq/lv5m6rwncaEltvAr43LM7tK+f028AuVHqEjzCuTbgOmAIf0yzk FKmwOC5SQCIas7bIwwgWhtJquA9+AZK4nQlnkOR+Z47gZbvkoC2k8VhFoFQ6NYcvBmvx urRP/BF07sgySpaU1JfE0ypIr7E2pw4+e/EJmWLRRI3zxGi/lxwuo3t6nNo0cC96a2Fs SkHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=PNa/AKfePOVHK9K7W4j/u7n0HfgDZMiX/6VClOrFgmg=; b=Kob441ly7Nu1Oh/dvArNpkGs/dByBN6S32PQHn/gHeoYxdPUuBa182P8ysPZi/yC5P +mnmiJ1B2wAupyySdEmVWHlwC4f1yfvGPz8I4m2jM25deTPN5D71nud1PRGwaPfo+F0t Hd24sG8DaOyQjFHHstsJm5eok8mSJyBpMr6pyhS4Ase9HG09hR7eBYYZoTEgpv2B53Ge o8frnyrLZoAf43j32XEzLGVJA9K+jBO3Jw7Nh6xXq8RXaWRKWg1ZiepI7aq64OktQj+P EExYyMN64umC9nsc6romb2aycAT+aUAb/0f3TWbIJipb+sEfl3RfmLf2GuK/TFxg4Ndm 58LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MIbJ5ch7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e11si31010985pfh.147.2019.01.27.21.49.01; Sun, 27 Jan 2019 21:49:17 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=MIbJ5ch7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726783AbfA1Fsh (ORCPT + 99 others); Mon, 28 Jan 2019 00:48:37 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:45846 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726627AbfA1Fsg (ORCPT ); Mon, 28 Jan 2019 00:48:36 -0500 Received: by mail-lf1-f66.google.com with SMTP id b20so10887140lfa.12 for ; Sun, 27 Jan 2019 21:48:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PNa/AKfePOVHK9K7W4j/u7n0HfgDZMiX/6VClOrFgmg=; b=MIbJ5ch7Tkn32fh4s3dVhXJP47vG0N3140zk5hgRAOsWD+yOAR5xrgM0QPfUeAydQg Bphr+l4YgsSgArm3pC8zN2t0YLrJZGfVO7WgKRU60B0g6Ki23LJ5NvI3O6lKMjbQ9EEp JCA7w68Sh8tyGrVxBTKLsUpcF68+6shRX0G4E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PNa/AKfePOVHK9K7W4j/u7n0HfgDZMiX/6VClOrFgmg=; b=iHTc7LxURSKJXVvi4k9nNzPcPJHfywacqvDazmBl8Z8U3ovFfakIpfzp/ho7SYBNW7 XTKnlK/9+JdwkrM5tGj21qL4268VKgQMBu/JNMm7+64JghfnD/IbrvJumprYRzmiPt+1 E5uVkd2O8777FcoENw4TkA3MKqOhwbI/BZgyxq7hCYZEtRhs1203LxGQz9vgd06kTLkK J88Rg8WSqfPDCXJLbG/ipzDsu/W/e78yeQK5wL/L72RNyXvSGp8kOSWYy+ajEqVCqheN VjFYyMhb5+Z3V29lqSBF/BLAkJr9TPjxTLfkDjXwinTli0PDDwUz/0oIlTgU61QqIXYg 8UCg== X-Gm-Message-State: AJcUukecd/YSeDGPj4IHq3y+F7jOXJ/S+QCnyzMReTWeFifWBHxfJorw kwzwD0oSAnXsUG7hCdfFE1O/KAOgXX8eGbyjJf9lVw== X-Received: by 2002:a19:40cc:: with SMTP id n195mr15046378lfa.40.1548654514545; Sun, 27 Jan 2019 21:48:34 -0800 (PST) MIME-Version: 1.0 References: <290f6d3a5fe288b87480cc5fa12c5139728daeca.1547787189.git.baolin.wang@linaro.org> <81e894ba-acad-2fd4-996d-8d35edd8825a@perex.cz> <20190118190805.GF6260@sirena.org.uk> <20190121124053.GA12679@sirena.org.uk> <20190122202535.GK7579@sirena.org.uk> <20190123124658.GE15906@leoy-ThinkPad-X240s> <3962daba-f6ed-d706-c618-b791a1ba6b59@perex.cz> In-Reply-To: From: Baolin Wang Date: Mon, 28 Jan 2019 13:48:22 +0800 Message-ID: Subject: Re: [RFC PATCH] ALSA: core: Add DMA share buffer support To: Takashi Iwai Cc: Jaroslav Kysela , Leo Yan , Mark Brown , alsa-devel@alsa-project.org, Arnd Bergmann , Kees Cook , bgoswami@codeaurora.org, sr@denx.de, gustavo@embeddedor.com, Phil Burk , Matthew Wilcox , mchehab+samsung@kernel.org, sboyd@kernel.org, Vinod Koul , Daniel Thompson , Mathieu Poirier , Srinivas Kandagatla , anna-maria@linutronix.de, Jon Corbet , Jeffery Miller , Charles Keepax , joe@perches.com, Takashi Sakamoto , colyli@suse.de, LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 25 Jan 2019 at 21:04, Takashi Iwai wrote: > > > > > > Erm, obviously it's not enough. Each attach / detach needs to manage > > > the refcount, too, for covering the cases above. It can re-use the > > > PCM mmap_refount, though. > > > > But we've used the DMA buffer file's refcounting to manage the DMA > > buffer. So is this not enough? > > Unless you manage the PCM substream refcount (or block the state > change), the PCM stream itself can be released (or re-setup) freely. > OK. Thanks for your comments. -- Baolin Wang Best Regards