Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1084462ybf; Fri, 28 Feb 2020 13:47:15 -0800 (PST) X-Google-Smtp-Source: APXvYqz8YoLFRrleCJ+xgHu7ps4g0Ff4JbAxQnpjw6hDKhTSwg0d80seRfzjJtXpXVQM47MqEQAs X-Received: by 2002:a54:4e96:: with SMTP id c22mr4840801oiy.110.1582926435477; Fri, 28 Feb 2020 13:47:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582926435; cv=none; d=google.com; s=arc-20160816; b=YumeHrnKnlpA8hs3tupytZEoK2c8yoLefjqzxDEuDBt3OF4FekXMJF2gKWZUKYJwRW 4zxkdr8LwkHBYlZH32PhNU17rIyFpXOJT/rmEmN6UKjkJV7V4rLipqsr7MEC9AdmDngV +3g5qGKn58KxCrzYLJIu9Mc0GiaZ3uQtWoPafG7erWDVDGx4AF25eqvM1HZRNvtIGGsa /2tyWIAZfhChyvo5zA82i21x9xYHamD92vtiWMVhkjuxgLJBjUpuCwFY3uthdFDF1fDy A93GEc4C5MAYLqpGox2GN8trLj6AKwZVd5/nu3rHqDxVV2uT9ath9tVFIuhvjB0e6R4Y 1MXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=KknqskIbWlTdwSpIkYP/SMhr2Fknsu+AlTBQWMMj00s=; b=RQVekdjrnYr6Yry2hFspgQqGVkvgqe5FAObK+8N3ClD77ueMr8cNVbIRt2zXNqgPnT H5cimaOOesCIYzkT4JLS1ujpfhGCpUonUnXfnBvoQmeEm8WPmuCmuWm4z16VbZc1q8mx D3QcSaA7L8gA3yeemfBm8kUXUq97HLsSIKNoqLDucdwA4HJyH70rB7tBWnqV5K1CQgT1 HLoAMX8Z75YtK0xtOcbZ2123JaPIAATLvGX/nb6OIXiFtTQKn1FJEIQIP8IO8px1A84b I3q8BFK505HRnu8xtBA2Wy5NCVebhqKDjBicGdq7bVcpjiHMV6bu/63DxDfqboUFyANm 2w7g== ARC-Authentication-Results: i=1; mx.google.com; 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 d28si2156961otc.123.2020.02.28.13.47.03; Fri, 28 Feb 2020 13:47:15 -0800 (PST) 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; 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 S1726751AbgB1VqS (ORCPT + 99 others); Fri, 28 Feb 2020 16:46:18 -0500 Received: from smtp09.smtpout.orange.fr ([80.12.242.131]:25458 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726720AbgB1VqS (ORCPT ); Fri, 28 Feb 2020 16:46:18 -0500 Received: from localhost.localdomain ([92.140.213.100]) by mwinf5d18 with ME id 8Mee220022AY1JL03MefEb; Fri, 28 Feb 2020 22:38:44 +0100 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 28 Feb 2020 22:38:44 +0100 X-ME-IP: 92.140.213.100 From: Christophe JAILLET To: broonie@kernel.org, f.fainelli@gmail.com, bcm-kernel-feedback-list@broadcom.com, jonas.gorski@gmail.com Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] spi: bcm63xx-hsspi: Really keep pll clk enabled Date: Fri, 28 Feb 2020 22:38:38 +0100 Message-Id: <20200228213838.7124-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The purpose of commit 0fd85869c2a9 ("spi/bcm63xx-hsspi: keep pll clk enabled") was to keep the pll clk enabled through the lifetime of the device. In order to do that, some 'clk_prepare_enable()'/'clk_disable_unprepare()' calls have been added in the error handling path of the probe function, in the remove function and in the suspend and resume functions. However, a 'clk_disable_unprepare()' call has been unfortunately left in the probe function. So the commit seems to be more or less a no-op. Axe it now, so that the pll clk is left enabled through the lifetime of the device, as described in the commit. Fixes: 0fd85869c2a9 ("spi/bcm63xx-hsspi: keep pll clk enabled") Signed-off-by: Christophe JAILLET --- To be honest, I don't see why we need to keep pll clk, or hsspi clk enabled during the lifetime of the driver. My understanding of the code is that it is only used to get the 'speed_hz' value in the probe function. This value is never refreshed afterwards. I don't see the point in enabling/disabling the clks. I think that they both could be disabled in the probe function, without the need to keep track in the bcm63xx_hsspi structure, neither during pm cycles or the remove fucntion. However, my knowledge on drivers is limited and I may be completly wrong :) --- drivers/spi/spi-bcm63xx-hsspi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/spi/spi-bcm63xx-hsspi.c b/drivers/spi/spi-bcm63xx-hsspi.c index 7327309ea3d5..6c235306c0e4 100644 --- a/drivers/spi/spi-bcm63xx-hsspi.c +++ b/drivers/spi/spi-bcm63xx-hsspi.c @@ -366,7 +366,6 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev) goto out_disable_clk; rate = clk_get_rate(pll_clk); - clk_disable_unprepare(pll_clk); if (!rate) { ret = -EINVAL; goto out_disable_pll_clk; -- 2.20.1