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,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 44AA5C4338F for ; Sat, 7 Aug 2021 09:27:40 +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 C4FE56113C for ; Sat, 7 Aug 2021 09:27:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C4FE56113C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=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 979D716AC; Sat, 7 Aug 2021 11:26:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 979D716AC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1628328456; bh=ZD5OolJS1SDE0CdYmAzWzlkZQJFEC95DjszGVTgdTZM=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=WumbhyjaCL/nK0VX3wqtzVXGrWhmze/3U2B8EsDbPMowSagOhGpDO/gd5wizXGzI+ dpC3IbxD7P2COC9LsBBWtIwwfbJG3SKv+yUL+/mNZM6zDTdpv4g6t+hSOursTb212j RUtUr0a+aN3AYEPKr13i5WPEpAlXlp5J/ajnNfts= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1A650F8016D; Sat, 7 Aug 2021 11:26:46 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 41507F8027C; Sat, 7 Aug 2021 11:26:43 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (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 AC48AF8014B for ; Sat, 7 Aug 2021 11:26:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AC48AF8014B Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="hQghiuen"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="a6ziqDjP" Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id AE7D21FF39; Sat, 7 Aug 2021 09:26:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1628328392; 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=vlKA8UKfl2p3PP4/aX652JQZs39iI//1koem5Cv6x/8=; b=hQghiuenvSRfzYBBx8E2fRZFZMSfFx8WmkxFpXOfeTOgpO2ayU11Zdk7RdNIfz9KQpy8O1 ZAVuN6PdW6T5lzSciIYK4JP13tKPXIpYVdePK2nWDxfcUmBsAxTwGI2eVs872UgH69XXza 8z3sUjaE2tOXevBWomtHKFviwsckdj4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1628328392; 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=vlKA8UKfl2p3PP4/aX652JQZs39iI//1koem5Cv6x/8=; b=a6ziqDjPnBwIQohEkgvcQfia0ejzefQODSwHUEcyQH6C1k1uRK5v+Ugocm3x94M05slM3v WLAA74bZ4TQI61AQ== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 915DAA3B87; Sat, 7 Aug 2021 09:26:32 +0000 (UTC) Date: Sat, 07 Aug 2021 11:26:32 +0200 Message-ID: From: Takashi Iwai To: Greg KH Subject: Re: Kernel 5.13.6 breaks mmap with snd-hdsp module In-Reply-To: References: <17b1f9647ee.1179b6a05461889.5940365952430364689@fnordco.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, Jeff Woods , regressions , stable 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 Sat, 07 Aug 2021 10:16:47 +0200, Greg KH wrote: > > On Sat, Aug 07, 2021 at 12:49:07AM -0700, Jeff Woods wrote: > > Specifically, commit c4824ae7db418aee6f50f308a20b832e58e997fd triggers the problem. Reverting this change restores functionality. > > > > The device is an RME Multiface II, using the snd-hdsp driver. > > > > Expected behavior: Device plays sound normally > > > > Exhibited behavior: When a program attempts to open the device, the following ALSA lib error happens: > > > > ALSA lib pcm_direct.c:1169:(snd1_pcm_direct_initialize_slave) slave plugin does not support mmap interleaved or mmap noninterleaved access > > > > This change hasn't affected my other computers with less esoteric hardware, so probably the problem lies with the snd-hdsp driver, but the device is unusable without reverting that commit. > > > > I am available to test any patches for this issue. > > Have you notified the developers involved in this change about this > issue? No, it's a new report :) > Adding them now... Could you try the patch below? thanks, Takashi -- 8< -- From: Takashi Iwai Subject: [PATCH] ALSA: pci: rme: Fix mmap breakage The recent change in the PCM core restricts the mmap of unknown buffer type, and this broke the mmap on RME9652 and HDSP drivers that didn't set up properly. Actually those driver do use the buffers allocated in a standard way, and the proper calls should fix the breakage. Fixes: c4824ae7db41 ("ALSA: pcm: Fix mmap capability check") Cc: Signed-off-by: Takashi Iwai --- sound/pci/rme9652/hdsp.c | 6 ++---- sound/pci/rme9652/rme9652.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index 8457a4bbc3df..b32a72e28917 100644 --- a/sound/pci/rme9652/hdsp.c +++ b/sound/pci/rme9652/hdsp.c @@ -4518,8 +4518,7 @@ static int snd_hdsp_playback_open(struct snd_pcm_substream *substream) snd_pcm_set_sync(substream); runtime->hw = snd_hdsp_playback_subinfo; - runtime->dma_area = hdsp->playback_buffer; - runtime->dma_bytes = HDSP_DMA_AREA_BYTES; + snd_pcm_set_runtime_buffer(substream, hdsp->playback_dma_buf); hdsp->playback_pid = current->pid; hdsp->playback_substream = substream; @@ -4595,8 +4594,7 @@ static int snd_hdsp_capture_open(struct snd_pcm_substream *substream) snd_pcm_set_sync(substream); runtime->hw = snd_hdsp_capture_subinfo; - runtime->dma_area = hdsp->capture_buffer; - runtime->dma_bytes = HDSP_DMA_AREA_BYTES; + snd_pcm_set_runtime_buffer(substream, hdsp->capture_dma_buf); hdsp->capture_pid = current->pid; hdsp->capture_substream = substream; diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c index f1aad38760d6..8036ed761d53 100644 --- a/sound/pci/rme9652/rme9652.c +++ b/sound/pci/rme9652/rme9652.c @@ -2279,8 +2279,7 @@ static int snd_rme9652_playback_open(struct snd_pcm_substream *substream) snd_pcm_set_sync(substream); runtime->hw = snd_rme9652_playback_subinfo; - runtime->dma_area = rme9652->playback_buffer; - runtime->dma_bytes = RME9652_DMA_AREA_BYTES; + snd_pcm_set_runtime_buffer(substream, rme9652->playback_dma_buf); if (rme9652->capture_substream == NULL) { rme9652_stop(rme9652); @@ -2339,8 +2338,7 @@ static int snd_rme9652_capture_open(struct snd_pcm_substream *substream) snd_pcm_set_sync(substream); runtime->hw = snd_rme9652_capture_subinfo; - runtime->dma_area = rme9652->capture_buffer; - runtime->dma_bytes = RME9652_DMA_AREA_BYTES; + snd_pcm_set_runtime_buffer(substream, rme9652->capture_dma_buf); if (rme9652->playback_substream == NULL) { rme9652_stop(rme9652); -- 2.26.2 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF75270 for ; Sat, 7 Aug 2021 09:34:18 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id AE7D21FF39; Sat, 7 Aug 2021 09:26:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1628328392; 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=vlKA8UKfl2p3PP4/aX652JQZs39iI//1koem5Cv6x/8=; b=hQghiuenvSRfzYBBx8E2fRZFZMSfFx8WmkxFpXOfeTOgpO2ayU11Zdk7RdNIfz9KQpy8O1 ZAVuN6PdW6T5lzSciIYK4JP13tKPXIpYVdePK2nWDxfcUmBsAxTwGI2eVs872UgH69XXza 8z3sUjaE2tOXevBWomtHKFviwsckdj4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1628328392; 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=vlKA8UKfl2p3PP4/aX652JQZs39iI//1koem5Cv6x/8=; b=a6ziqDjPnBwIQohEkgvcQfia0ejzefQODSwHUEcyQH6C1k1uRK5v+Ugocm3x94M05slM3v WLAA74bZ4TQI61AQ== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 915DAA3B87; Sat, 7 Aug 2021 09:26:32 +0000 (UTC) Date: Sat, 07 Aug 2021 11:26:32 +0200 Message-ID: From: Takashi Iwai To: Greg KH Cc: Jeff Woods , alsa-devel@alsa-project.org, stable , regressions Subject: Re: Kernel 5.13.6 breaks mmap with snd-hdsp module In-Reply-To: References: <17b1f9647ee.1179b6a05461889.5940365952430364689@fnordco.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) Precedence: bulk X-Mailing-List: regressions@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII On Sat, 07 Aug 2021 10:16:47 +0200, Greg KH wrote: > > On Sat, Aug 07, 2021 at 12:49:07AM -0700, Jeff Woods wrote: > > Specifically, commit c4824ae7db418aee6f50f308a20b832e58e997fd triggers the problem. Reverting this change restores functionality. > > > > The device is an RME Multiface II, using the snd-hdsp driver. > > > > Expected behavior: Device plays sound normally > > > > Exhibited behavior: When a program attempts to open the device, the following ALSA lib error happens: > > > > ALSA lib pcm_direct.c:1169:(snd1_pcm_direct_initialize_slave) slave plugin does not support mmap interleaved or mmap noninterleaved access > > > > This change hasn't affected my other computers with less esoteric hardware, so probably the problem lies with the snd-hdsp driver, but the device is unusable without reverting that commit. > > > > I am available to test any patches for this issue. > > Have you notified the developers involved in this change about this > issue? No, it's a new report :) > Adding them now... Could you try the patch below? thanks, Takashi -- 8< -- From: Takashi Iwai Subject: [PATCH] ALSA: pci: rme: Fix mmap breakage The recent change in the PCM core restricts the mmap of unknown buffer type, and this broke the mmap on RME9652 and HDSP drivers that didn't set up properly. Actually those driver do use the buffers allocated in a standard way, and the proper calls should fix the breakage. Fixes: c4824ae7db41 ("ALSA: pcm: Fix mmap capability check") Cc: Signed-off-by: Takashi Iwai --- sound/pci/rme9652/hdsp.c | 6 ++---- sound/pci/rme9652/rme9652.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index 8457a4bbc3df..b32a72e28917 100644 --- a/sound/pci/rme9652/hdsp.c +++ b/sound/pci/rme9652/hdsp.c @@ -4518,8 +4518,7 @@ static int snd_hdsp_playback_open(struct snd_pcm_substream *substream) snd_pcm_set_sync(substream); runtime->hw = snd_hdsp_playback_subinfo; - runtime->dma_area = hdsp->playback_buffer; - runtime->dma_bytes = HDSP_DMA_AREA_BYTES; + snd_pcm_set_runtime_buffer(substream, hdsp->playback_dma_buf); hdsp->playback_pid = current->pid; hdsp->playback_substream = substream; @@ -4595,8 +4594,7 @@ static int snd_hdsp_capture_open(struct snd_pcm_substream *substream) snd_pcm_set_sync(substream); runtime->hw = snd_hdsp_capture_subinfo; - runtime->dma_area = hdsp->capture_buffer; - runtime->dma_bytes = HDSP_DMA_AREA_BYTES; + snd_pcm_set_runtime_buffer(substream, hdsp->capture_dma_buf); hdsp->capture_pid = current->pid; hdsp->capture_substream = substream; diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c index f1aad38760d6..8036ed761d53 100644 --- a/sound/pci/rme9652/rme9652.c +++ b/sound/pci/rme9652/rme9652.c @@ -2279,8 +2279,7 @@ static int snd_rme9652_playback_open(struct snd_pcm_substream *substream) snd_pcm_set_sync(substream); runtime->hw = snd_rme9652_playback_subinfo; - runtime->dma_area = rme9652->playback_buffer; - runtime->dma_bytes = RME9652_DMA_AREA_BYTES; + snd_pcm_set_runtime_buffer(substream, rme9652->playback_dma_buf); if (rme9652->capture_substream == NULL) { rme9652_stop(rme9652); @@ -2339,8 +2338,7 @@ static int snd_rme9652_capture_open(struct snd_pcm_substream *substream) snd_pcm_set_sync(substream); runtime->hw = snd_rme9652_capture_subinfo; - runtime->dma_area = rme9652->capture_buffer; - runtime->dma_bytes = RME9652_DMA_AREA_BYTES; + snd_pcm_set_runtime_buffer(substream, rme9652->capture_dma_buf); if (rme9652->playback_substream == NULL) { rme9652_stop(rme9652); -- 2.26.2