Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753157AbeADNog (ORCPT + 1 other); Thu, 4 Jan 2018 08:44:36 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:44758 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753129AbeADNod (ORCPT ); Thu, 4 Jan 2018 08:44:33 -0500 X-Google-Smtp-Source: ACJfBovCn7y9V4O1lbC2QaO6a7VeLRmgDfhUOU6XXvJifsTMn+/yTdMKHLkklWw+1iyQ/Fgh7bACdA== Subject: Re: [RESEND PATCH v2 14/15] ASoC: qcom: apq8096: Add db820c machine driver To: Mark Brown , Stephen Boyd Cc: Andy Gross , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, David Brown , Rob Herring , Mark Rutland , Liam Girdwood , Patrick Lai , Banajit Goswami , Jaroslav Kysela , Takashi Iwai , linux-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20171214173402.19074-1-srinivas.kandagatla@linaro.org> <20171214173402.19074-15-srinivas.kandagatla@linaro.org> <20180104120244.GE10774@sirena.org.uk> From: Srinivas Kandagatla Message-ID: <418b531d-9d51-80c5-85aa-8ab8ef27bebb@linaro.org> Date: Thu, 4 Jan 2018 13:44:30 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20180104120244.GE10774@sirena.org.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 04/01/18 12:02, Mark Brown wrote: > On Wed, Jan 03, 2018 at 09:20:45AM -0800, Stephen Boyd wrote: >> On 12/14/2017 09:34 AM, srinivas.kandagatla@linaro.org wrote: > >>> uThis patch adds support to DB820c machine driver. > >>> + ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32)); > >> Why do we need to do this? Can you add some sort of comment in the code >> about why? > > And why are we applying DMA restrictions in a machine driver? Initially I had this in pcm driver, but looking at example usage of snd_dma_alloc_pages, most of them use card->dev and some of them use pcm device for allocating dma memory. Also, as I moved most dsp static services and dais out of DT, except codec and sound card, sound card device was the only choice I had for binding with iommu and enforcing iova range restrictions. This call will be replaced by dma-ranges property in DT either way. --srini >