Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp960664pxb; Fri, 13 Aug 2021 10:06:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYf1LPwr6Ka17hkn8qxs051XGIv7CtN17MFN3cT9MZNRDxUxRthTDVOm0CtOWNiEl+khTO X-Received: by 2002:a92:cd8b:: with SMTP id r11mr2568979ilb.136.1628874367861; Fri, 13 Aug 2021 10:06:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628874367; cv=none; d=google.com; s=arc-20160816; b=s0H35/gLk36BeFUOoZZMxdL1OMx3p381fvo5e0+ToxvO07TCZ0kLoCxz49sWkpm8/i zXikNxZvCR/JWPxhOcDmpz2dY+4kRnNsr71ZcJd/6L/rH44yJ5VJnyhNxUsQAcLs45es mn3ITUDJOaWnWonVl53tDZ4oKknndkhpsbSvsfAwkw+ug7uWwmB+uoPnfDld4N9Afw7A 5SL8vgx4SXvOGgqs0JG7IGHbwbFmgDDwA3KWbpgyjOS73ohla5mK3pWHVfHoSnPb4Sss DG5BDE4S50PJcdGtBOXwfrdODL9bBLr561wVh6WyqOse09f5LpfYBYIjjd/al6j+e98D GGvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=seZH6UXRn4T/xqirUnCU1CGuEzP+rGLfzHGpE/1zYaY=; b=G040nCmYU2R/pamQIpn/kTy4irX9gvSXw31SdGo2fIeNuo+vMORPUt/eWMEQ/pJute ur7WcUtMIMaVedyCehiuKBuV8Wt4JwUF728S6lKSNkEB3lqSVtelByxBMpH6YFYOr/qS BeMgWWbxyzcCpy866AHfPdwVbYCVlteCMn2DUmPKF+Bg9zzk1oxwVvrteB0zKkKjCUa+ N6+RZnS2n5yY4ogFyuxj8mr26mzP5cAXEJR4wSlU6sD/hWyH5evpAo3hcQu9aCqVeYw+ /buIqb50c7+WaWKREFuJhDKb/0440vdYuNzPm7LbgV2CWyZlpbxB0UKoZqOLsIvptmNd 3o2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2n2mhL7C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w12si2086703ilo.99.2021.08.13.10.05.56; Fri, 13 Aug 2021 10:06:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2n2mhL7C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242419AbhHMPVK (ORCPT + 99 others); Fri, 13 Aug 2021 11:21:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:60628 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241950AbhHMPQD (ORCPT ); Fri, 13 Aug 2021 11:16:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 855196109D; Fri, 13 Aug 2021 15:14:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628867698; bh=Wnr2UEfhoga8mlUyJF6OVI+WJR8GhYuImneCPcv6KkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2n2mhL7CLWU1JtGFtZOZlciDtm4b+CB2CiMz2Cjjk9/fWi4EI4V0mBvIU+d93B+Kk ekkaA5WD/qzDgdBT2xtRYls0l87xbrVvIbi2QZWmFPWPJapEeQmEKNYmv4zRtSnZJ+ yNih7qoe3YopkX+uNqqnLo3O5DLI/i9dCkbUqZWI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai , Jeff Woods Subject: [PATCH 5.10 14/19] ALSA: pcm: Fix mmap breakage without explicit buffer setup Date: Fri, 13 Aug 2021 17:07:31 +0200 Message-Id: <20210813150523.094017504@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210813150522.623322501@linuxfoundation.org> References: <20210813150522.623322501@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Takashi Iwai commit dc0dc8a73e8e4dc33fba93dfe23356cc5a500c57 upstream. The recent fix c4824ae7db41 ("ALSA: pcm: Fix mmap capability check") restricts the mmap capability only to the drivers that properly set up the buffers, but it caused a regression for a few drivers that manage the buffer on its own way. For those with UNKNOWN buffer type (i.e. the uninitialized / unused substream->dma_buffer), just assume that the driver handles the mmap properly and blindly trust the hardware info bit. Fixes: c4824ae7db41 ("ALSA: pcm: Fix mmap capability check") Reported-and-tested-by: Jeff Woods Cc: Link: https://lore.kernel.org/r/s5him0gpghv.wl-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/core/pcm_native.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -251,7 +251,10 @@ static bool hw_support_mmap(struct snd_p switch (substream->dma_buffer.dev.type) { case SNDRV_DMA_TYPE_UNKNOWN: - return false; + /* we can't know the device, so just assume that the driver does + * everything right + */ + return true; case SNDRV_DMA_TYPE_CONTINUOUS: case SNDRV_DMA_TYPE_VMALLOC: return true;