From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D00AC001DE for ; Mon, 7 Aug 2023 07:50:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230071AbjHGHud (ORCPT ); Mon, 7 Aug 2023 03:50:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229733AbjHGHu3 (ORCPT ); Mon, 7 Aug 2023 03:50:29 -0400 Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA4461700; Mon, 7 Aug 2023 00:50:26 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0VpBLPig_1691394619; Received: from 30.97.48.53(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0VpBLPig_1691394619) by smtp.aliyun-inc.com; Mon, 07 Aug 2023 15:50:19 +0800 Message-ID: <19716311-c1c5-2638-05ef-a7c3f74de8fe@linux.alibaba.com> Date: Mon, 7 Aug 2023 15:50:20 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH 2/5] dma: add dma mask interface in probe To: Kaiwei Liu , Vinod Koul , Orson Zhai , Chunyan Zhang Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, kaiwei liu , Wenming Wu References: <20230807052014.2781-1-kaiwei.liu@unisoc.com> From: Baolin Wang In-Reply-To: <20230807052014.2781-1-kaiwei.liu@unisoc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/7/2023 1:20 PM, Kaiwei Liu wrote: > In the probe of DMA, the default addressing range is 32 bits, > while the actual DMA hardware addressing range used is 36 bits. > So add dma_set_mask_and_coherent function to match DMA > addressing range. > > Signed-off-by: Kaiwei Liu > --- > drivers/dma/sprd-dma.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c > index 20c3cb1ef2f5..0e146550dfbb 100644 > --- a/drivers/dma/sprd-dma.c > +++ b/drivers/dma/sprd-dma.c > @@ -1115,6 +1115,15 @@ static int sprd_dma_probe(struct platform_device *pdev) > u32 chn_count; > int ret, i; > > + ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(36)); > + if (ret) { > + ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); > + if (ret) { > + dev_err(&pdev->dev, "dma_set_mask_and_coherent failed\n"); The error message is not readable, may be something like below? "unable to set coherent mask to 32\n" The changes look good to me. Chunyan and Orson, please double check the DMA mask? > + return ret; > + } > + } > + > /* Parse new and deprecated dma-channels properties */ > ret = device_property_read_u32(&pdev->dev, "dma-channels", &chn_count); > if (ret)