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 4A119C4321E for ; Mon, 7 Feb 2022 06:36:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233267AbiBGGez (ORCPT ); Mon, 7 Feb 2022 01:34:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239484AbiBGGat (ORCPT ); Mon, 7 Feb 2022 01:30:49 -0500 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0B25C043185 for ; Sun, 6 Feb 2022 22:30:47 -0800 (PST) Received: by mail-pf1-x435.google.com with SMTP id v74so11321417pfc.1 for ; Sun, 06 Feb 2022 22:30:47 -0800 (PST) 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=kLX5yScMxlQJ0sOssQwN5Kzrzlw7vwEez/KPc90XX1c=; b=mZGtqaYZUVCLH900LgcbwP8iVBRBagHqD2CsiTQ3hHkie78V59FfMQGeXnUnGetJvI DcB9FvVD9uzjdIYzDItXH+R1ixXa96wYWEIko9b1jHCIPaHmmQ2Z7B44q59+ZLK8TRwx 10/0F8jPtCKl3fxbuBofFcQnArPFnhU8VEEvvf86n5NJEVzo/4UCcxvTgCm+/3G3b6P5 KdmRpg8tq3/+ftH0CmD6hkZXgXbzcAkgdP7+jwie3u7YoIh00JFiEle504RX1Sj6Fmbu TcpOU10k5dUOIkDEJGkUyP0gHZNxn09YtyT5ZJgq/+pBL9MRTz48Q+vKM83t0KkxLxZD G/0w== 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=kLX5yScMxlQJ0sOssQwN5Kzrzlw7vwEez/KPc90XX1c=; b=mErJM5qjyoucMhuU7wVA3I+onRZoKNwBlGEB1t0pbPEm9pASYSdzrGV0pD8Nhyqq/H LpDnDNzSiZ29N4LWTIZpRcKy550znxBCeR53AJVRSRMHd0fdepHJrg4ZIzI+Va5unTx1 yn31otw2QOIlawCb9FU3zEiFGB9EkyDmZF+MALYcTLAAqZPb9l63U5dLf5Yda0ukqO4o tTUHrMCriKJOjopjBIfP9tVOBbOTo/7ldpJMm0XH3ZGZU76tUJwyvFOKajrSS+xmPIbK 1uGQ1UDI+wo4gbujIl0KRcO64iJxWrWOsrPPSbUdAEDN0NL3U5gbJIxc4ELeAzcGPh6j a4pw== X-Gm-Message-State: AOAM530iMXmyZdCwwMVCjOxUIE5gJddenJsWXQInZV/lBxKkFSXVZnTh lawCyZtr0u6WE+LQMy3V/4DkI6NE7EagoGCF X-Google-Smtp-Source: ABdhPJzLXi5WEZyX6LDirKnfSvr2IIhEFCVIHrTUFoTtuYM6ocZtuM8KhHrWJ6491MLFe71KsCULsw== X-Received: by 2002:a05:6a00:1789:: with SMTP id s9mr14302978pfg.71.1644215447332; Sun, 06 Feb 2022 22:30:47 -0800 (PST) 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 i10sm5266634pjd.2.2022.02.06.22.30.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Feb 2022 22:30:46 -0800 (PST) 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 v5 0/3] Determine the number of DMA channels by 'dma-channels' property Date: Mon, 7 Feb 2022 14:30:37 +0800 Message-Id: X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: devicetree@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 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 (3): dt-bindings: Add dma-channels property and modify compatible riscv: dts: Add dma-channels property and modify compatible dmaengine: sf-pdma: Get number of channel by device tree .../bindings/dma/sifive,fu540-c000-pdma.yaml | 19 +++++++++++++++-- .../boot/dts/microchip/microchip-mpfs.dtsi | 3 ++- arch/riscv/boot/dts/sifive/fu540-c000.dtsi | 3 ++- drivers/dma/sf-pdma/sf-pdma.c | 21 ++++++++++++------- drivers/dma/sf-pdma/sf-pdma.h | 8 ++----- 5 files changed, 37 insertions(+), 17 deletions(-) -- 2.31.1