Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2327914imm; Mon, 28 May 2018 06:08:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpRxOKjBsS+ucdSyxxnfuyKw2blOGthVtNn3+3OvIWV8E0CAtnSVowYrjiyJqXxLFnk2dMQ X-Received: by 2002:a62:860b:: with SMTP id x11-v6mr13443551pfd.92.1527512936241; Mon, 28 May 2018 06:08:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527512936; cv=none; d=google.com; s=arc-20160816; b=dWlBfmeeb1YMMin0qqWgrWdRwH9dZOYAHBNYAzb5qI0gNBSXzloZzvT0RhlgRcr4x7 aZ6Xb2rcmFC9HuqWOFSZt++ijiN+kx0f03M8V3dBm0pezzYxadCHfQwYrpJoFYQRBcDz 0sS6zvjGmhBjG51tfbVfLpTmVhz3GVKI4jPMGY8XLM4w4T5ko00s+PscSg/M7e9oSp6g QvJne4XGJ2qjhwCmkZM8yLtM2rK0SGsz9fyBUao/qOYdvw8y4Fg70ahjcD8ONun98KtP GkfNOLX8GDcqFGSQpYrhqo/luYm3HWETtTxiEOIXE4tWnenTUnKeCMPECOJBsa9aueS5 YygA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=L4hj2YvokkB0xMeelvzCcxTNMlk/FpIWmkMEFXj99NQ=; b=hq90SJv0rb3mtLaYXGod5HsRBrJB5cwK2C4JY6kAYMpxcSejMn0xPT14uvvr1Ln8pF nISmltubKNfL+0ofIP2e+M68TYpzFpyndvpfhVIA6VyWCNb7+0wOAjAO/tjiLodwzuMm s3ZBGNUj9R0r1nK6sb2gsi6ZEXwaIaVTRxIExtGy6WwgZRikGWEXAaoNKBEgSdZ1IFVt uSHAAZndAg84LQbMXRqbWOPSpcbipaXmfNjIcMy7Mdixva2U4WTAmejlnCHy6iOK3pnt mTswpFwURXa+mpDronUdWrI94dvvHSl+eIbjQMEQDDr79ae7zzStQKbZfFdOWGYQ55AZ 6OKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lnO3vb5Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1-v6si12992583pgo.166.2018.05.28.06.08.17; Mon, 28 May 2018 06:08:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lnO3vb5Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1164199AbeE1NHe (ORCPT + 99 others); Mon, 28 May 2018 09:07:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:41486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163923AbeE1KwI (ORCPT ); Mon, 28 May 2018 06:52:08 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EE512204EE; Mon, 28 May 2018 10:52:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527504727; bh=3JwNr/eVHTIZERN5FXvhTbUcUYUt9Hpv6M/5VeFVjZc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lnO3vb5QzmguLhRztnmFc2HaoTXYvfNsdriZ5P+43uKN0bgHjEa1rk2Ik18skFItK ot83JWEboJlAFO0C3BFVCQicWvbvsAm1hOs9kTbTvMNEEwy+0uHsd3aLflwah81/Ld K1kLPtvKXQPavPF0FEdPbsppTTCxpy6f6tlZRJQc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rob Herring , Vinod Koul , Sasha Levin Subject: [PATCH 4.14 241/496] dmaengine: mv_xor_v2: Fix clock resource by adding a register clock Date: Mon, 28 May 2018 12:00:26 +0200 Message-Id: <20180528100330.058046222@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100319.498712256@linuxfoundation.org> References: <20180528100319.498712256@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gregory CLEMENT [ Upstream commit 3cd2c313f1d618f92d1294addc6c685c17065761 ] On the CP110 components which are present on the Armada 7K/8K SoC we need to explicitly enable the clock for the registers. However it is not needed for the AP8xx component, that's why this clock is optional. With this patch both clock have now a name, but in order to be backward compatible, the name of the first clock is not used. It allows to still use this clock with a device tree using the old binding. Reviewed-by: Rob Herring Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- Documentation/devicetree/bindings/dma/mv-xor-v2.txt | 6 ++++ drivers/dma/mv_xor_v2.c | 25 ++++++++++++++++---- 2 files changed, 25 insertions(+), 6 deletions(-) --- a/Documentation/devicetree/bindings/dma/mv-xor-v2.txt +++ b/Documentation/devicetree/bindings/dma/mv-xor-v2.txt @@ -11,7 +11,11 @@ Required properties: interrupts. Optional properties: -- clocks: Optional reference to the clock used by the XOR engine. +- clocks: Optional reference to the clocks used by the XOR engine. +- clock-names: mandatory if there is a second clock, in this case the + name must be "core" for the first clock and "reg" for the second + one + Example: --- a/drivers/dma/mv_xor_v2.c +++ b/drivers/dma/mv_xor_v2.c @@ -163,6 +163,7 @@ struct mv_xor_v2_device { void __iomem *dma_base; void __iomem *glob_base; struct clk *clk; + struct clk *reg_clk; struct tasklet_struct irq_tasklet; struct list_head free_sw_desc; struct dma_device dmadev; @@ -749,13 +750,26 @@ static int mv_xor_v2_probe(struct platfo if (ret) return ret; + xor_dev->reg_clk = devm_clk_get(&pdev->dev, "reg"); + if (PTR_ERR(xor_dev->reg_clk) != -ENOENT) { + if (!IS_ERR(xor_dev->reg_clk)) { + ret = clk_prepare_enable(xor_dev->reg_clk); + if (ret) + return ret; + } else { + return PTR_ERR(xor_dev->reg_clk); + } + } + xor_dev->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(xor_dev->clk) && PTR_ERR(xor_dev->clk) == -EPROBE_DEFER) - return -EPROBE_DEFER; + if (IS_ERR(xor_dev->clk) && PTR_ERR(xor_dev->clk) == -EPROBE_DEFER) { + ret = EPROBE_DEFER; + goto disable_reg_clk; + } if (!IS_ERR(xor_dev->clk)) { ret = clk_prepare_enable(xor_dev->clk); if (ret) - return ret; + goto disable_reg_clk; } ret = platform_msi_domain_alloc_irqs(&pdev->dev, 1, @@ -866,8 +880,9 @@ free_hw_desq: free_msi_irqs: platform_msi_domain_free_irqs(&pdev->dev); disable_clk: - if (!IS_ERR(xor_dev->clk)) - clk_disable_unprepare(xor_dev->clk); + clk_disable_unprepare(xor_dev->clk); +disable_reg_clk: + clk_disable_unprepare(xor_dev->reg_clk); return ret; }