Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1930308ybl; Tue, 3 Dec 2019 15:11:46 -0800 (PST) X-Google-Smtp-Source: APXvYqzd0WaOki1wRqXRxnuEr0agUdgvCEbOnmLhLWWtuByusG6fVjrnyc8syCZc7aR0RXaL0/V3 X-Received: by 2002:a9d:5552:: with SMTP id h18mr300203oti.122.1575414705927; Tue, 03 Dec 2019 15:11:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575414705; cv=none; d=google.com; s=arc-20160816; b=kQva1Ysx2CrIFYHQ0aagUM4Vgr2JQLW+TxXGSBBhkEs7k/LzEzQPFgh8g321T3omii IcmTJkEmUzyhkEKrtgbunYxblYr8/mKnjq+4EN8zFV2Luos7bsjqx+YOb/++ADeHt99d wWVacp54lNC/3FU47EreP4KbavkuvwQyNX6+iEuK/jOD0MSbbnxkStzGKG0uMywaJwQA 7qTufQ2u/xgJ0QVtXOvNqQenvd4D5vfzv/P4xD8Wuq2DdCXhUEheLPwq72ljbYO+HBCu y1k2W0VpxLv4LPHjYRqs/EvO+tlg+LCCjQt0iNvoNWVyX56Xt7oRyZmdZNPw+uvJokHZ o+Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8DSCt4Qwg0EceFcEYpaF7pQsafcTNvBWcmftYztGaEY=; b=S8u+i/u8m2DVy9Ds50fWFVfZtyecnyk5CY9Fv3941IUu5+GsQD33ekQKaqTQD00rXa B/c13r2Eq8hqitQU2Qokd3Jfqgg0o7SU+CcZk+TYCR3zeTYfW7Ee5PjKoSRxLGdQSlQe GP89l1Q8tbGK/uNoBGuXyGMB7jxheXNZw23ry57gZp59ah7NIqPX+HIk9CsjidbwU63V Onm0bMiPiUODg7WjFChcJZqGjRt61yKo54H1208Pg6JnacDjMmmw7OSDw2Rwj8Q+6xt0 I68IPmUTjeGH4kmdUhab3yqMulQzBcJ3lqoekO0SRmbdz/RbyijF18xHSjXtbJL70eyp Cf6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xMrmD5hQ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y198si2311971oia.163.2019.12.03.15.11.34; Tue, 03 Dec 2019 15:11:45 -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=@kernel.org header.s=default header.b=xMrmD5hQ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727736AbfLCWmL (ORCPT + 99 others); Tue, 3 Dec 2019 17:42:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:56978 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728626AbfLCWmJ (ORCPT ); Tue, 3 Dec 2019 17:42:09 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8B2BC20865; Tue, 3 Dec 2019 22:42:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575412929; bh=clDj2gRBvZtbxRJrZLLG3eR7xseTTPorXU+ZDUkwPKc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xMrmD5hQ3J2mYcqEwiYH/K6eSLEC1SjUI6ebTUHsQe/Ow37ZbMuSerFtka6am1Ps4 bLR7uuaGzsVkQz4/wd67ibLPPGBUchr53mC0rSBqKFWnw4uXtTyaosgxeeYYubTqLT 5Vfd4K5ejY9mzAXFDWCL1ABeBIpVVYz3wQPurrhY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Olivier Moysan , Mark Brown , Sasha Levin Subject: [PATCH 5.3 069/135] ASoC: stm32: sai: add restriction on mmap support Date: Tue, 3 Dec 2019 23:35:09 +0100 Message-Id: <20191203213025.955287513@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191203213005.828543156@linuxfoundation.org> References: <20191203213005.828543156@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Olivier Moysan [ Upstream commit eaf072e512d54c95b0977eda06cbca3151ace1e5 ] Do not support mmap in S/PDIF mode. In S/PDIF mode the buffer has to be copied, to allow the channel status bits insertion. Signed-off-by: Olivier Moysan Link: https://lore.kernel.org/r/20191104133654.28750-1-olivier.moysan@st.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/stm/stm32_sai_sub.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c index d7501f88aaa63..34e73071d4db8 100644 --- a/sound/soc/stm/stm32_sai_sub.c +++ b/sound/soc/stm/stm32_sai_sub.c @@ -1217,6 +1217,16 @@ static int stm32_sai_pcm_process_spdif(struct snd_pcm_substream *substream, return 0; } +/* No support of mmap in S/PDIF mode */ +static const struct snd_pcm_hardware stm32_sai_pcm_hw_spdif = { + .info = SNDRV_PCM_INFO_INTERLEAVED, + .buffer_bytes_max = 8 * PAGE_SIZE, + .period_bytes_min = 1024, + .period_bytes_max = PAGE_SIZE, + .periods_min = 2, + .periods_max = 8, +}; + static const struct snd_pcm_hardware stm32_sai_pcm_hw = { .info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_MMAP, .buffer_bytes_max = 8 * PAGE_SIZE, @@ -1269,7 +1279,7 @@ static const struct snd_dmaengine_pcm_config stm32_sai_pcm_config = { }; static const struct snd_dmaengine_pcm_config stm32_sai_pcm_config_spdif = { - .pcm_hardware = &stm32_sai_pcm_hw, + .pcm_hardware = &stm32_sai_pcm_hw_spdif, .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config, .process = stm32_sai_pcm_process_spdif, }; -- 2.20.1