Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp4907500pxb; Mon, 28 Mar 2022 05:26:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwx0N8YFry68HtgeBinHXliHqagmeDXuNm3JbhLT1vaqzQgOdc+y/Yy94pVjPHUOpHAnR5N X-Received: by 2002:a17:907:c16:b0:6db:1dfc:ca73 with SMTP id ga22-20020a1709070c1600b006db1dfcca73mr27450432ejc.192.1648470368772; Mon, 28 Mar 2022 05:26:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648470368; cv=none; d=google.com; s=arc-20160816; b=UOxe0gtl8aqthBAvKTgH/4rqsxGhwI38P0rqDMLM1GzeQy+apXkKFmxueacadFPMwK iVxMdhtRh3pUmbHY0g1pKKfmOta5aiy4srBJGQzq/nY+zXFOIj64XpZjMxK/yzJ/usnK 0VTOnxH/cJsmbVh0YqVsbN2Nfa/ytDIC5l31GiGuJSnYBx+WhO7TJBgI09h1VKSfyGO3 tNSlDRthNCQc6mEvqsaVIQzh7CUR9ItLkTJqKF7UIzQi8F6YtiPInb1nN2dt7lgYbgUx K2LjrYJ+A26/9/elE4/0BEvme4RUwjN3EJ5oadj+lIgJGRdphDi5qZWShUkBLYFseTa+ 4B4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=sGo4IXWrYvYFKPb6MuOn5Y1sxNV0CkrGIqSlou+M1J4=; b=WHOfkIywFk4iMl0nJfAXHmRMe42VVae7DWk2JW+JPDpRqaoZJpPQ5tQpyYOrjSfBp9 vV6yhx434HT9IIIh0ZHtyUGqyY7oy/Kkpvoa/GGCpYziHMx2+cTDorG/HUF7x26XHG+w w0mIORcPw0PfLAgleAYwWz7hSJUFmqbSgwjmPhUVTu8HL9nbn/AuIy7rDZJ4MOzez2v+ 4F/UFal02YGygOP2/E683+XcppuNXxd4BW6WZmzIQANvj88yfkY8372RgHT8U54w3P5J Gun1yHr4uIBZz6eUU2MG0gxAUe36FzhzvEejpHeOy0bMVQQmVTzROWqJZwUTaJqI2dzP agsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=OZBLlbla; 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 r1-20020a17090638c100b006df76385e60si13861069ejd.768.2022.03.28.05.25.42; Mon, 28 Mar 2022 05:26:08 -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; dkim=pass header.i=@sifive.com header.s=google header.b=OZBLlbla; 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 S240017AbiC1JyP (ORCPT + 99 others); Mon, 28 Mar 2022 05:54:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240013AbiC1JyO (ORCPT ); Mon, 28 Mar 2022 05:54:14 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95643546A9 for ; Mon, 28 Mar 2022 02:52:33 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id c11so11823175pgu.11 for ; Mon, 28 Mar 2022 02:52:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=sGo4IXWrYvYFKPb6MuOn5Y1sxNV0CkrGIqSlou+M1J4=; b=OZBLlblazJg+EmvIrbImIhFMYRc17sRbB35Fpi9pwGw3zCANNiPPqEXPD9uVvr/YKJ CDNYqmhV02YMDkcjTqm5oo3fbexRXcHsrZyvLWFNmYwKrA+FWP67bM9qhOQjSTx0YvFf F0StCKSgSek98iYfrywdlDTmKSDQOt75rkK0cGzUAq+8LI65wQ+t10SW9Lpty0hOU6WW 0DKPzpm+cEphwYjWDfxYKCPcl17jtcAT6clLXTgD4RyDdfs7N249dCkRpgrvbXtK0+mN qcN5+sTK2Q6x7ikn79RlM1X7pw6+Gz7w1KiRglEYr2QgpWWpqrdyP524z1fMTHjwozsS L0xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=sGo4IXWrYvYFKPb6MuOn5Y1sxNV0CkrGIqSlou+M1J4=; b=J7i4x+D8khmDiTIWRlO0OUXzvKSGdpv1WCXssOJW3QS6wb/myeIX4a7mR08wQe8sO1 zQeJ0ypjiGKp69JSYrVnwgAsp5tGLxQJ6qFyXGuQG13JUKJjBWGrHp56ePT3rOXefmcE nLAsKbMW7s+EyDfq98mKJJP1xwQXWavlu3d2zUHX/oz+0COH/cJb33fl+bHIPfYaTOsG MyAcCrHQIspWgIPgd/abY94s977F+6vmXwzb3FUAS+rrmn7J9WLsGrn8uCJ54nOFpHMg qKd8WaCI8baef25laqYoYEaB9RtBjdDHaJuK5CkiqQw1UwqZKkHb7N8LlVnniDoLBbi0 6MCQ== X-Gm-Message-State: AOAM531QEJ8yFvaMiSR+AyQD6xuJxh57zVhh2eHd+4AYejig/5wBu4cK 4rgArCkGVI1ZEjxMl2SBlC/ZdQ== X-Received: by 2002:a63:5ce:0:b0:382:1f05:c8b1 with SMTP id 197-20020a6305ce000000b003821f05c8b1mr9604717pgf.19.1648461152933; Mon, 28 Mar 2022 02:52:32 -0700 (PDT) Received: from hsinchu16.internal.sifive.com (59-124-168-89.hinet-ip.hinet.net. [59.124.168.89]) by smtp.gmail.com with ESMTPSA id g4-20020a633744000000b00381efba48b0sm12255117pgn.44.2022.03.28.02.52.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 02:52:32 -0700 (PDT) From: Zong Li To: robh+dt@kernel.org, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, krzysztof.kozlowski@canonical.com, conor.dooley@microchip.com, geert@linux-m68k.org, bin.meng@windriver.com, green.wan@sifive.com, vkoul@kernel.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Cc: Zong Li Subject: [PATCH v8 0/4] Determine the number of DMA channels by 'dma-channels' property Date: Mon, 28 Mar 2022 17:52:21 +0800 Message-Id: X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 The PDMA driver currently assumes there are four channels by default, it might cause the error if there is actually less than four channels. Change that by getting number of channel dynamically from device tree. For backwards-compatible, it uses the default value (i.e. 4) when there is no 'dma-channels' information in dts. This patch set contains the dts and dt-bindings change. Changed in v8: - Rebase on master - Remove modification of microchip-mpfs.dtsi - Rename DMA node name of fu540-c000.dtsi Changed in v7: - Rebase on tag v5.17-rc7 - Modify the subject of patch Changed in v6: - Rebase on tag v5.17-rc6 - Change sf_pdma.chans[] to a flexible array member. Changed in v5: - Rebase on tag v5.17-rc3 - Fix typo in dt-bindings and commit message - Add PDMA versioning scheme for compatible Changed in v4: - Remove cflags of debug use reported-by: kernel test robot Changed in v3: - Fix allocating wrong size - Return error if 'dma-channels' is larger than maximum Changed in v2: - Rebase on tag v5.16 - Use 4 as default value of dma-channels Zong Li (4): dt-bindings: dma-engine: sifive,fu540: Add dma-channels property and modify compatible riscv: dts: Add dma-channels property and modify compatible riscv: dts: rename the node name of dma dmaengine: sf-pdma: Get number of channel by device tree .../bindings/dma/sifive,fu540-c000-pdma.yaml | 19 +++++++++++++-- arch/riscv/boot/dts/sifive/fu540-c000.dtsi | 5 ++-- drivers/dma/sf-pdma/sf-pdma.c | 24 ++++++++++++------- drivers/dma/sf-pdma/sf-pdma.h | 8 ++----- 4 files changed, 38 insertions(+), 18 deletions(-) -- 2.35.1