Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp377544pxb; Wed, 3 Mar 2021 05:42:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJz73B5xVs4pjEKOIAPe67m8Qc+1tRDj0usrjLjk7iIuExI41SBqWhEFpyj12D8VriVLN3Ve X-Received: by 2002:a17:906:3088:: with SMTP id 8mr25486289ejv.499.1614778944390; Wed, 03 Mar 2021 05:42:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614778944; cv=none; d=google.com; s=arc-20160816; b=ntlJDj0GMbaZDLTMTGw4QH/eLn7VsdnyCxewA/S7mrTguVg/4kKtzzU+Z/WduF5nrn xU8QXzMTd4A8VEVNhijaNGud+kSZg4xogfrqAhMNJAbDUnWPYcCi0jTtLVN56SXBuaie VOQjCOAMCNkqC+z79f3ucdQC5HH2T7D9hn4vo4o1FeJBiZg3+NTHfGkVpbW4x3k3HIsb /uYIsucEdnY5nd7IZHU2lXPHZYXN//9q44YYiXVXU1neUCu/ekDmoYhkRRO0wPNodqzL ZLh+mEboMrix3CXktmvOX2GbobYRf+ZD/BBv2HhdeV6BLf4Bht11y02RD3KvYEI7VuGj aMng== 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=wwC0lgARNYkC5XclDkQk9dPAX4Qe6Br6wCGikuKG4xI=; b=SAcJWXuTKTrxwI9JEVCluxZ46ksmppolD5/aU2dBF8cZfaKSJM0k1b+dE4E+0szhY/ LMdVZe3AoaIZFZHMi7VyudBozcDLcliucZpjxEO6dXU+oW+pnyEaplW3Eaes/9m34ASV gmfBhyzJmuU0OhZdVvDiy6HewZalI9Odgo8RQyQw4Ysy/bsqrJSFy3p64KLjBVCT6HXI 0Cd8TDuGEvp03jUhplVx6AjTM+u6E0fQNLOYP+ui0b7brf4xx917FwM/nxS7EJ4KHmwK g8cTWosCFhi2zVijGHD7z+raax2k9/KyQFyfFVpEQT+0H/T8qWvm3jfXl+sXUguWBEh3 5cKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BuekucYu; 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 dh14si9849317edb.334.2021.03.03.05.41.41; Wed, 03 Mar 2021 05:42:24 -0800 (PST) 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=BuekucYu; 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 S238400AbhCATvh (ORCPT + 99 others); Mon, 1 Mar 2021 14:51:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:55952 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236504AbhCAQ4X (ORCPT ); Mon, 1 Mar 2021 11:56:23 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1ADE864FD9; Mon, 1 Mar 2021 16:36:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614616573; bh=zPU+4l34oRcJR5GEKyG1V6PjrT1k4jy/XGu9bvMubZw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BuekucYuL8r5FvvRBGkNFUoVPSx6Bk+/y6TcSWnqpeiW0eSI7/v0U4RPI0a7yFcqg nvoPs95crTGf9CjC72edriKrVWJnpcKjtHJZZTFNAXemF7mDSZckk/Psu3mqAfL3uy 2EpnpPiRfI3nYa1Yrmbrz0ZbyY0x4oUmgpbYLv3g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai Subject: [PATCH 4.19 021/247] ALSA: usb-audio: Fix PCM buffer allocation in non-vmalloc mode Date: Mon, 1 Mar 2021 17:10:41 +0100 Message-Id: <20210301161032.738743590@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161031.684018251@linuxfoundation.org> References: <20210301161031.684018251@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 fb3c293b82c31a9a68fbcf4e7a45fadd8a47ea2b upstream. The commit f274baa49be6 ("ALSA: usb-audio: Allow non-vmalloc buffer for PCM buffers") introduced the mode to allocate coherent pages for PCM buffers, and it used bus->controller device as its DMA device. It turned out, however, that bus->sysdev is a more appropriate device to be used for DMA mapping in HCD code. This patch corrects the device reference accordingly. Note that, on most platforms, both point to the very same device, hence this patch doesn't change anything practically. But on platforms like xhcd-plat hcd, the change becomes effective. Fixes: f274baa49be6 ("ALSA: usb-audio: Allow non-vmalloc buffer for PCM buffers") Cc: Link: https://lore.kernel.org/r/20210205144559.29555-1-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/usb/pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -1853,7 +1853,7 @@ void snd_usb_preallocate_buffer(struct s { struct snd_pcm *pcm = subs->stream->pcm; struct snd_pcm_substream *s = pcm->streams[subs->direction].substream; - struct device *dev = subs->dev->bus->controller; + struct device *dev = subs->dev->bus->sysdev; if (!snd_usb_use_vmalloc) snd_pcm_lib_preallocate_pages(s, SNDRV_DMA_TYPE_DEV_SG,