Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4436401rwl; Mon, 3 Apr 2023 05:08:54 -0700 (PDT) X-Google-Smtp-Source: AK7set+pYfX8AXMzSu71fF6pxFb1EjbTlGnlCigCGsSB+Eu1ob8N8VHiiiB6L1xM+RIzOpOjKz0A X-Received: by 2002:a05:6a20:c526:b0:da:bace:b06a with SMTP id gm38-20020a056a20c52600b000dabaceb06amr29340006pzb.50.1680523734339; Mon, 03 Apr 2023 05:08:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680523734; cv=none; d=google.com; s=arc-20160816; b=FCzpDw4sMxVbEwVIa6zui4s1CWasWTyvrIPE8jm8AodYBBatYj3t3vr+QMDjW2Cmw9 lVYUZmXfxT4KwG7qnnu28yJ/YlVa/NAbAL2wFDC2aPaj/yko0XpTtw5dmRU2cUS9Dl8l b/P+aKCM2JDeffDTwLf7F3yDaP5AJB/LZkAjCoC22w8iFVzyARBBi96DxdYmT1plL716 YTPBr5sX00wI99T1PCM8ceVnFl0LwzyFtT0B0NNmPs+m7CMLirWr61yOEkflddyqyGgH ASuzQIcyOjy53U0ndrCGa1374sH0LYBZJNYHFfAvCSHrF1TZkk3FZWZ+4l83VVhqZiff sOlw== 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 :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=twaUGdVwtMluF6fV2IK2tYrfc1E3rft/ihlf7gXCuCY=; b=DxbnELXnJvgHb0krpVyKFWj0L7AxpSz9nT4bbx/Q8JGGb3laq/Ms4lIzVFsf1DURkH BsaFesoohrnDfZFbRi576C+2JVCRxWWoALTRYsfHGceG9+1zI6xYslkTYY+aEsMPQiUq hysdOXJHBzWRwLrU/L3wcXo2uwVparOf0UO9TT5cnSP4e5+Q3rs0WK7RarPnE0Y1LFX7 o4wGwoY9V8R7CbmKjOP8Y2G3+s7H/PTJJ2+R2MQ+ylWxXbw2PqJF4zIaN/LCOi5hO6UH cnOZTK9pgZDGF/TmCB5OHlsEfTvxXaQei0B8NWZkHAS3guEY7a7r/PPs7g6KwdE14RlY XvIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m1-20020a655301000000b0050fb7c5a656si7896782pgq.190.2023.04.03.05.08.43; Mon, 03 Apr 2023 05:08:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232335AbjDCMHg (ORCPT + 99 others); Mon, 3 Apr 2023 08:07:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231897AbjDCMHf (ORCPT ); Mon, 3 Apr 2023 08:07:35 -0400 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FB7FA9; Mon, 3 Apr 2023 05:07:31 -0700 (PDT) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id 1625724E38D; Mon, 3 Apr 2023 20:07:22 +0800 (CST) Received: from EXMBX168.cuchost.com (172.16.6.78) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 3 Apr 2023 20:07:22 +0800 Received: from [192.168.125.145] (183.27.97.179) by EXMBX168.cuchost.com (172.16.6.78) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 3 Apr 2023 20:07:21 +0800 Message-ID: <8128d57b-17cd-8307-ed8c-2611a5658e18@starfivetech.com> Date: Mon, 3 Apr 2023 20:07:20 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH v6 2/4] dmaengine: dw-axi-dmac: Add support for StarFive JH7110 DMA To: Vinod Koul CC: Eugeniy Paltsev , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Palmer Dabbelt , "Emil Renner Berthing" , , , , References: <20230322094820.24738-1-walker.chen@starfivetech.com> <20230322094820.24738-3-walker.chen@starfivetech.com> Content-Language: en-US From: Walker Chen In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [183.27.97.179] X-ClientProxiedBy: EXCAS064.cuchost.com (172.16.6.24) To EXMBX168.cuchost.com (172.16.6.78) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-1.3 required=5.0 tests=NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/3/31 20:04, Vinod Koul wrote: > On 22-03-23, 17:48, Walker Chen wrote: >> Add DMA reset operation in device probe and use different configuration >> on CH_CFG registers according to match data. Update all uses of >> of_device_is_compatible with of_device_get_match_data. >> >> Signed-off-by: Walker Chen >> --- >> .../dma/dw-axi-dmac/dw-axi-dmac-platform.c | 38 ++++++++++++++++--- >> drivers/dma/dw-axi-dmac/dw-axi-dmac.h | 1 + >> 2 files changed, 34 insertions(+), 5 deletions(-) >> >> diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c >> index 4169e1d7d5ca..6cfcb541d8c3 100644 >> --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c >> +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c >> @@ -21,10 +21,12 @@ >> #include >> #include >> #include >> +#include >> #include >> #include >> #include >> #include >> +#include >> #include >> #include >> >> @@ -46,6 +48,10 @@ >> DMA_SLAVE_BUSWIDTH_32_BYTES | \ >> DMA_SLAVE_BUSWIDTH_64_BYTES) >> >> +#define AXI_DMA_FLAG_HAS_APB_REGS BIT(0) >> +#define AXI_DMA_FLAG_HAS_RESETS BIT(1) >> +#define AXI_DMA_FLAG_USE_CFG2 BIT(2) >> + >> static inline void >> axi_dma_iowrite32(struct axi_dma_chip *chip, u32 reg, u32 val) >> { >> @@ -86,7 +92,8 @@ static inline void axi_chan_config_write(struct axi_dma_chan *chan, >> >> cfg_lo = (config->dst_multblk_type << CH_CFG_L_DST_MULTBLK_TYPE_POS | >> config->src_multblk_type << CH_CFG_L_SRC_MULTBLK_TYPE_POS); >> - if (chan->chip->dw->hdata->reg_map_8_channels) { >> + if (chan->chip->dw->hdata->reg_map_8_channels && >> + !chan->chip->dw->hdata->use_cfg2) { > > I think this will break existing users.. > > This is set for reg_map_8_channels && use_cfg2, latter being set only > for new controller, so what about existing users of these bits? Firstly thank you for your comments! There is a statement 'use_cfg2 = !!(flags & AXI_DMA_FLAG_USE_CFG2);' to be added in dw_probe function. Assuming older/existing platform run this code block, e.g. when compatible is "snps,axi-dma-1.01a", the value of variable 'use_cfg2' is still false, the original logic will not be broken. So other existing users are not affected by this. Looking forward to your more comments. Thanks! Best regards, Walker