Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1168615rdb; Wed, 20 Sep 2023 01:17:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG8LbvKZM6cDrOedf79xSzsPtBsKmTryib6On6OnZKmPwXrz293XwHpj//qkIohqsfwgICo X-Received: by 2002:a17:903:228e:b0:1bc:8fca:9d59 with SMTP id b14-20020a170903228e00b001bc8fca9d59mr1443153plh.29.1695197825581; Wed, 20 Sep 2023 01:17:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695197825; cv=none; d=google.com; s=arc-20160816; b=HIfVwzcygxNU3JUJ+QxKxxUzRMzigijfANBoBQwYyuUHkSXOQ37zahCNNcKao+vS61 VBsL2yu/wzV3bJClDEtZXBsURTQofamcI688/BJcZYG2YZdmfSXpTqMpt2I1AcVafU+P ZO05AfZI+5u6AKt/Gn+b+i6fSvB6EBAw9nZXIqDKAHMlsIlxVhzXETU9GccEdoXiVJh/ Mbuy3mre4M8+8vbr4FxUGmr+mHzRlH9Y2c9QOmcbIMyFrS7E1KAwYMv6ZS1yMQuIHOs8 bBfmFPBJNaWKZUMqk8YbDmEDZH3vHwqCf4j7GtQAMSYjFyeoe1GcUZQfdyqkNIEEmmKP 3HxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=bsMA/xfEggo5/nfeQTxuTBNrTRKPnzJvDZ/0U/XSzlA=; fh=eKMOATPrHVOiaI3qKIsEcsobfU5S2XM+/PkUx5ct8Mo=; b=0eNxb8ACEAPjsoSqgmJmpzm1UnjVMSSlXz7TjOY5b960n+gxm+wGNpIiY5cbuv1eZB whR2hE5haVT04prmqWMcZpbp+IJH7iRAXQ5cRW/YPWDSQ5bjiv1mIRa/IIn4SlDEgps8 FqpKpmFDQjdFPPrn92Lp/WYaRhJyrLPOoyoIKR+4xnGXQ8pxhFZh8evRLV6I7Vb+Zx/m CHtNNecCmIlFqGeEx8eV7M3X5HRW5Vw7WXxUu+xfWpSMqoR76Oq9ypQHSvPCpvM78dix IWLJt2M/jGJ5kLvRCkxoebSGGXJFUDEBNHgqfCspQENstnHUCegnuuwwg2SbAtd/H4sQ fkPg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id h4-20020a170902f54400b001bbdd44bbd4si12022696plf.74.2023.09.20.01.17.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 01:17:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id EC91C80BD38E; Wed, 20 Sep 2023 01:12:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233419AbjITIMb (ORCPT + 99 others); Wed, 20 Sep 2023 04:12:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233468AbjITIM3 (ORCPT ); Wed, 20 Sep 2023 04:12:29 -0400 Received: from out30-97.freemail.mail.aliyun.com (out30-97.freemail.mail.aliyun.com [115.124.30.97]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83E42AC; Wed, 20 Sep 2023 01:12:18 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R241e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0VsUUPym_1695197534; Received: from 30.97.48.72(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0VsUUPym_1695197534) by smtp.aliyun-inc.com; Wed, 20 Sep 2023 16:12:15 +0800 Message-ID: <6ac60523-6623-3d0e-d56c-b13a0a8922c9@linux.alibaba.com> Date: Wed, 20 Sep 2023 16:12:20 +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 V3] 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: <20230919073801.25054-1-kaiwei.liu@unisoc.com> From: Baolin Wang In-Reply-To: <20230919073801.25054-1-kaiwei.liu@unisoc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 20 Sep 2023 01:12:35 -0700 (PDT) On 9/19/2023 3:38 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 LGTM. Reviewed-by: Baolin Wang > --- > Change in V2: > -Change subject line. > Change in V3: > -Modify error message to make it more readable. > --- > 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..c371ce405f1d 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, "unable to set coherent mask to 32\n"); > + return ret; > + } > + } > + > /* Parse new and deprecated dma-channels properties */ > ret = device_property_read_u32(&pdev->dev, "dma-channels", &chn_count); > if (ret)