Received: by 10.213.65.68 with SMTP id h4csp718552imn; Fri, 6 Apr 2018 07:48:06 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/eahWqG846kqmOxiBqwVpjEoUCYmdti5pwaW8wHfvKtgMzTvgeLwLLW7+tTTSSyNjV2yFm X-Received: by 2002:a17:902:9308:: with SMTP id bc8-v6mr27597081plb.189.1523026086459; Fri, 06 Apr 2018 07:48:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523026086; cv=none; d=google.com; s=arc-20160816; b=mtY7WXfYVBc+RrfuiEA7cUM+iu7mQAG+5BQrYZzp2TrjZqG1rwqMQqe4LQHProxlP0 5YOBz+kfSEsRY7p7g1D83XE/jMyEuAKxkI2ceeAA4GM3oTv0KUGs4sJaMzYvygJkA3Ma jhe8XFObueQxx8Nke2eABwwXtnqQ4q05SMmYjV8zxDeATBJ+Lt1jMQc/OM8QO7IDrPpN LI5aTG5T+EYgWKNxvowg7c25YkzCGv4kpnoAlGD0l1koDVPQn0jLK3wh6npNeCb6w/db R7nfI11WawnxsDCeV6HncM64UmfQJdUIKF8054sovclBvoARr236KomAyWMMeVBvBdTf Nkrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=o0bOkz4Dr0VcKMNR2ysvg0bm/3AxqFXneZhR+QK64Ic=; b=OdrIpnP+u4bKT0Rt6b4GSwT3L4lGdKY2s3llC/XSOgcXllV1tbOoYxydJ15yfbePXe a4rdwCoCHWMpkRvE0J8b9SlZXx/7EfRBg+BL0+7/8qFq7F4oH3R2U4EQvy5lPfQrCMNk gQW1doL5aFZU2XkWreE9TEk96mlcUkuq+uJkFODI9S0T1JOujPuVonX3HvGcG+FkNwfb YDUOuQrT1Zre0djnWRcrpgGQaDX66YVLMSvBopIVAu/TsjPCSGde09EWtElOns0vkbZS avJuUGs3bSNPqUmzHe5xOmgsFC3eNAO4f3Fy82V9qY0ohmwYxGOvAPfF7D3sB92LsELG Euww== ARC-Authentication-Results: i=1; mx.google.com; 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 186si7290267pgi.821.2018.04.06.07.47.52; Fri, 06 Apr 2018 07:48:06 -0700 (PDT) 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; 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 S1755772AbeDFOqh (ORCPT + 99 others); Fri, 6 Apr 2018 10:46:37 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58006 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755674AbeDFNdo (ORCPT ); Fri, 6 Apr 2018 09:33:44 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 09473CC9; Fri, 6 Apr 2018 13:33:43 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Roese , Takashi Iwai Subject: [PATCH 4.9 004/102] ALSA: pcm: Use dma_bytes as size parameter in dma_mmap_coherent() Date: Fri, 6 Apr 2018 15:22:45 +0200 Message-Id: <20180406084332.114569603@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406084331.507038179@linuxfoundation.org> References: <20180406084331.507038179@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 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 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stefan Roese commit 9066ae7ff5d89c0b5daa271e2d573540097a94fa upstream. When trying to use the driver (e.g. aplay *.wav), the 4MiB DMA buffer will get mmapp'ed in 16KiB chunks. But this fails with the 2nd 16KiB area, as the page offset is outside of the VMA range (size), which is currently used as size parameter in snd_pcm_lib_default_mmap(). By using the DMA buffer size (dma_bytes) instead, the complete DMA buffer can be mmapp'ed and the issue is fixed. This issue was detected on an ARM platform (TI AM57xx) using the RME HDSP MADI PCIe soundcard. Fixes: 657b1989dacf ("ALSA: pcm - Use dma_mmap_coherent() if available") Signed-off-by: Stefan Roese Cc: Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/core/pcm_native.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -3410,7 +3410,7 @@ int snd_pcm_lib_default_mmap(struct snd_ area, substream->runtime->dma_area, substream->runtime->dma_addr, - area->vm_end - area->vm_start); + substream->runtime->dma_bytes); #endif /* CONFIG_X86 */ /* mmap with fault handler */ area->vm_ops = &snd_pcm_vm_ops_data_fault;