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 A7CAFCD3432 for ; Tue, 19 Sep 2023 03:23:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231285AbjISDX3 (ORCPT ); Mon, 18 Sep 2023 23:23:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231224AbjISDX2 (ORCPT ); Mon, 18 Sep 2023 23:23:28 -0400 Received: from out30-110.freemail.mail.aliyun.com (out30-110.freemail.mail.aliyun.com [115.124.30.110]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B72B95; Mon, 18 Sep 2023 20:23:18 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R211e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045176;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0VsPmsoK_1695093793; Received: from 30.97.48.69(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0VsPmsoK_1695093793) by smtp.aliyun-inc.com; Tue, 19 Sep 2023 11:23:14 +0800 Message-ID: <793afbca-187d-c54f-c479-52cfd1975799@linux.alibaba.com> Date: Tue, 19 Sep 2023 11:23:19 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [PATCH V2] dmaengine: sprd: 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: <20230919023050.3777-1-kaiwei.liu@unisoc.com> From: Baolin Wang In-Reply-To: <20230919023050.3777-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 9/19/2023 10:30 AM, 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 > --- > Change in V2: > -Change subject line. > -Modify error message to make it more readable. Have you modified the error message against v1? I did not see it. https://lore.kernel.org/all/20230807052014.2781-1-kaiwei.liu@unisoc.com/ > --- > 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"); > + return ret; > + } > + } > + > /* Parse new and deprecated dma-channels properties */ > ret = device_property_read_u32(&pdev->dev, "dma-channels", &chn_count); > if (ret)