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=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,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 E025BC07E95 for ; Tue, 13 Jul 2021 06:18:38 +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 7D612611AB for ; Tue, 13 Jul 2021 06:18:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D612611AB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de 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 3E56316AA; Tue, 13 Jul 2021 08:17:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3E56316AA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1626157115; bh=hGV4qtTNnjFkhZoApYYk+leWxhr08pq0/GSLrpAjLeg=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=nsaxSoO7tzguV6j7gN/+sebgaQE5XvIFAXpLs7KPnlHV+ArNzxlBc0eONAejKHb4H ZOfH/BmJ6ZjL0vO0MdkWkfl4KAIMHetCLlPANCxMXwPPtU6RdQdYpwEv/iIK7WJzF8 i6BSBMS9L5YXtfTe2ZMKBZubT+q91sm0jUiNFnbU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id BA935F8020C; Tue, 13 Jul 2021 08:17:44 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C865DF80217; Tue, 13 Jul 2021 08:17:42 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5ABC3F800ED for ; Tue, 13 Jul 2021 08:17:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5ABC3F800ED Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Ls5pjoQk"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="tiREBwQd" Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 45BE3221FB; Tue, 13 Jul 2021 06:17:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1626157054; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0KiAVDPUBq8XIeq4pyjlxB4yl1KMI5zbCgUv9UwXw+Q=; b=Ls5pjoQkO8npCHNIB3b4xqTbAPGGJBp6j6tqa0nf/6G/QyWcBPDZLeydqLwgcojCbO+5ja aLIfyaki8EaKBrqOIb7NEyAU+fZVXxdL0pFnBSekBDDptTJkQwDAa8I/4pfdk5xeeKFAYe KHJPcqiMsLxP9qrInNjIjMIhKzwaAQc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1626157054; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0KiAVDPUBq8XIeq4pyjlxB4yl1KMI5zbCgUv9UwXw+Q=; b=tiREBwQdh+LTTOUhgLpn05zgO6nmVhdDhjBRMuVMesUayNOYtkV7aa7aGeLg8w1+ljSqmu uBEleshUhf79ZXAg== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 3413EA3B83; Tue, 13 Jul 2021 06:17:34 +0000 (UTC) Date: Tue, 13 Jul 2021 08:17:34 +0200 Message-ID: From: Takashi Iwai To: Pierre-Louis Bossart Subject: Re: [PATCH 6/8] ALSA: pcm: conditionally avoid mmap of control data In-Reply-To: <15cdd983-e25b-a872-aa25-5086ec71756f@linux.intel.com> References: <20210610205326.1176400-1-pierre-louis.bossart@linux.intel.com> <20210610205326.1176400-7-pierre-louis.bossart@linux.intel.com> <15cdd983-e25b-a872-aa25-5086ec71756f@linux.intel.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 Cc: alsa-devel@alsa-project.org, broonie@kernel.org, Ranjani Sridharan , Kai Vehmanen 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 Mon, 12 Jul 2021 22:56:07 +0200, Pierre-Louis Bossart wrote: > > > > On 6/13/21 2:28 AM, Takashi Iwai wrote: > > On Thu, 10 Jun 2021 22:53:24 +0200, > > Pierre-Louis Bossart wrote: > >> > >> In case of mmap, by default alsa-lib mmaps both control and status data. > >> > >> If driver subscribes for application pointer update, driver needs to get > >> notification whenever appl ptr changes. With the above case driver won't > >> get appl ptr notifications. > >> > >> This patch check on a hw info flag and returns error when user land asks > >> for mmaping control & status data, thus forcing user to issue > >> IOCTL_SYNC_PTR. > >> > >> This patch was originally submitted in 2017, c.f. > >> https://lore.kernel.org/alsa-devel/1494896518-23399-4-git-send-email-subhransu.s.prusty@intel.com/ > >> > >> Suggested-by: Takashi Iwai > >> Signed-off-by: Pierre-Louis Bossart > >> Reviewed-by: Kai Vehmanen > >> Reviewed-by: Ranjani Sridharan > > > > This kind of flag itself was what I also introduced for another > > purpose, too. There is a WIP patch that allows the use of > > non-coherent non-contiguous buffer pages, and this flag would fit for > > that. FWIW, the patch is found at > > https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/log/?h=topic/memalloc > > Sorry Takashi, I missed your feedback on this patch. > > Are you saying I should use the definition in that patch? > > +#define SNDRV_DMA_TYPE_NONCONTIG 8 /* non-coherent SG buffer */ > > I am not quite sure if how this is related to the application using mmap or not? Not about that, but rather meant that some flag for disabling the mmap of PCM control record would be needed for other purposes like the above, too. That is, this patch could be out of series and applied beforehand in my side. thanks, Takashi