Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4303416pxu; Tue, 1 Dec 2020 01:21:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJHJyfsccB1ImQ1jQiz8Eyxm+ETQCcwRCNZ6kQVoFo069Ye3yPIBhY0vbBYXwUjSs/VLQd X-Received: by 2002:aa7:cc14:: with SMTP id q20mr2095241edt.140.1606814465915; Tue, 01 Dec 2020 01:21:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606814465; cv=none; d=google.com; s=arc-20160816; b=WOlNmDD6koMkHtWDmDbLWcIp/4iJoNMxrYw6q614s1dAAWo+yImuFxNrNOZ0QZHQ8n YrBpPUuWl0miKgQ/xmiohTzpmaFcJPdSXHpUTZhMrhBTF5pRRa3g2CLKQyJ4fAlgggj/ 85t9wm7KrgghuDyZvCah0c28rYnXDuNjCg+6i9WUK+KH1OoxWWVFjhaoPNTllcJtXmNa pBw6vS24ysrgeSv3rd1/0MTJ0Yfo6wrMEsWCR2gjb9XstYmpNTnZEihd5QlxM3vd8Ypw i6JOEzA+fF0ZdGe2DWyhLatHGVQ+subx2xScMt1W5XQdUkZGIS3QKjzL7/mQxUXz/4HT aUdw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rFw/c9/iGBeFOPwDiVs2cpZBredznY1i2Gl2TcukfhE=; b=Xfg5GrE6NkUn/4RQP6BgfugT2ZZntFsIbSdmJC+T4FymDWxdQ8pkxYnF3DfqVRnMcS p+NF02gDJNLWFGOCOHAikdgz5c9M6BAS3jCxcU6jbxtomWjVU+suP0L4ESh8Vnq5QrM/ XDCbLJkZ5aNFOlPFaeLDpQO9xRmqd0sAOtuYAzh4m3o1XUdZv/Ueq0PQ2M8ulq/C2my2 oam7aA1lFyy6o2miKRrOcAIBetu7rlO73UOAYJ1pCJFbR4tb8uca8oObLouWR9VDowrC jlSTh7Nd49Ty1qIPt5VPUVQx166CGZ9P/WqkHAaYi3BYUyWbQ+X2vu2y+EVbQpENV0R2 tXpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RZY8PfEB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si845339edr.228.2020.12.01.01.20.42; Tue, 01 Dec 2020 01:21:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RZY8PfEB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389012AbgLAJMe (ORCPT + 99 others); Tue, 1 Dec 2020 04:12:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:50142 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388872AbgLAJMc (ORCPT ); Tue, 1 Dec 2020 04:12:32 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 EDB9E21D46; Tue, 1 Dec 2020 09:12:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606813931; bh=RWpL22H5WCyXuPHlHQxEotOnaHqYtQ8SB457ykaaaM4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RZY8PfEBguItKWmW3WdeeFniPRZqr3NRaebMJPc29d4kAawF/7iIJs6ko2iHkz7FP LAnkHgQzdc8kZhBa2GxOfugAb/PxkaQFysurdPSLvdGaAf0NXT2By+m76xdu2RTDQc EXb5tTCN6pcXNxOpIoSxV6U47TuiufLXjYs1KM4E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Clark Wang , Mark Brown , Sasha Levin Subject: [PATCH 5.9 107/152] spi: imx: fix the unbalanced spi runtime pm management Date: Tue, 1 Dec 2020 09:53:42 +0100 Message-Id: <20201201084725.854163718@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084711.707195422@linuxfoundation.org> References: <20201201084711.707195422@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Clark Wang [ Upstream commit 7cd71202961090d8f2d2b863ec66b25ae43e1d39 ] If set active without increase the usage count of pm, the dont use autosuspend function will call the suspend callback to close the two clocks of spi because the usage count is reduced to -1. This will cause the warning dump below when the defer-probe occurs. [ 129.379701] ecspi2_root_clk already disabled [ 129.384005] WARNING: CPU: 1 PID: 33 at drivers/clk/clk.c:952 clk_core_disable+0xa4/0xb0 So add the get noresume function before set active. Fixes: 43b6bf406cd0 spi: imx: fix runtime pm support for !CONFIG_PM Signed-off-by: Clark Wang Link: https://lore.kernel.org/r/20201124085247.18025-1-xiaoning.wang@nxp.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-imx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index 9aac515b718c8..91578103a3ca9 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -1684,6 +1684,7 @@ static int spi_imx_probe(struct platform_device *pdev) pm_runtime_set_autosuspend_delay(spi_imx->dev, MXC_RPM_TIMEOUT); pm_runtime_use_autosuspend(spi_imx->dev); + pm_runtime_get_noresume(spi_imx->dev); pm_runtime_set_active(spi_imx->dev); pm_runtime_enable(spi_imx->dev); -- 2.27.0