From patchwork Thu Oct 24 20:18:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13849639 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8394022B650; Thu, 24 Oct 2024 20:19:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729801148; cv=none; b=bSJHej7MnP39QTfh1IgSk4+fx8o/sTrMcY4GMOVXbDM8rf2NjnA994Lej9snTpgjNuKjOudZgy1hOwielEmkt+bV7di9hq3iPE8AOwMDkNkES6zPCQ4kVo3Y3tZbf1lzZZ7Ni1Lib4j4hyyI7ifYYef1EjkjPqRyDm+Sz5DA2i0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729801148; c=relaxed/simple; bh=M2oHeB+WOJwn9JLMEYWUmv8S51I4OUTUIuKP3pPKzws=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OIhwUAO2x/512pGAqUyJbUodihYM7GEGrBr0/qC3O5eCz7rSAvfSZ6LN3kXKygF4eaYNw3TDTnas3KP150lQQJEw0xLbeTtJQ3HpjCvO6fdzLyAs1IO+7NKRtCf+vDMJO0KTJjoaN8cXie+kr+IpiYnPdfuLLhvejO6TCoDlZ3g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b=UgcDTyOU; arc=none smtp.client-ip=212.227.15.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="UgcDTyOU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1729801125; x=1730405925; i=wahrenst@gmx.net; bh=v+14rsoDnpAU5TPVahAWZNaZb+eP4NYQnwXlsAb9tek=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=UgcDTyOU5bSh/Of79AnlYW2C8G6v/KE/0uWp3LwaS+2sqDjpsumWPc1ecW20OIax hHzduJZHohBslNz6BdvpvcK4W7qpIptZIMKMxo4sq1mpFodYQnzt8f/Ibe3D5owFl OwYmfZGZEOVtfXT/lFQxy/+CkCg8jm0zPlV0waE5jHxjFLfycWr2Bga76xhFpkcWy 9w3bUncR87f7knGrWygBhXOoKY639eSmDMjX2poe0/crWdFdmBeN3u6EVKFT5ILZ0 sAQrsVY8T8lkxHM0eYqnQefxySVZ9F8dr4cio4TqeUvO4ntN9U6rvsUyJnQt46i0l amzgo/brHTx8pWC2Bg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N63Vi-1twyC43LRo-010j8C; Thu, 24 Oct 2024 22:18:44 +0200 From: Stefan Wahren To: Russell King , Florian Fainelli , Ray Jui , Scott Branden , Vinod Koul , Ulf Hansson , Minas Harutyunyan , Greg Kroah-Hartman Cc: Lukas Wunner , Peter Robinson , linux-arm-kernel@lists.infradead.org, kernel-list@raspberrypi.com, bcm-kernel-feedback-list@broadcom.com, dmaengine@vger.kernel.org, linux-mmc@vger.kernel.org, linux-usb@vger.kernel.org, Stefan Wahren Subject: [PATCH 1/9] Revert "usb: dwc2: Skip clock gating on Broadcom SoCs" Date: Thu, 24 Oct 2024 22:18:29 +0200 Message-Id: <20241024201837.79927-2-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241024201837.79927-1-wahrenst@gmx.net> References: <20241024201837.79927-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:PoFhx6WkBPUO7pLARqsqywTbLY7iieU0MH5b7d0DdfFeMyOazVo Mu56Lc1LhP+2/40RmxDhm0iBfV4aj2TJaNQdfgZCBspp9FgEHwaA7cUDn2tWA4ak5i9qNuA Rn1Fzj45z2VgnIuahh4hiksqiW9DaE/bxVdC6RB4z89CtXfzfZ9pu/wZX/yxxB03AQL21AF jk25RXvuolTepHkR+oNiA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:I8zVc3auTtg=;cId+YZnZj+DctB2DlOUivtlkeoa ducXA7FUpTt0qSb2hc9U6KaZToeZhHSNStRCCMf1Cye1+c08UFvOpPa4wPj8aExUhmSzA4R44 0vRxuTayMSDIy+BMxp+LO8xCYemeOK1LTOq24TELfudNbwMV2NJRoK+O4/JTAJ5RJ9msAt9r/ 80/Qn/H74CcArXtceabruOXR/mBIldWMm5VdcQ9yIacwatdoqkmVLn8XDXc1gQrOA294BXeOw y9arKXpEgB3Q4MTxqg5R0FfQetMjR6OhfI/69JYz0xOSy/sAJcFyHrW50kZt2KvG0EmQWCjKr roknfVV4Tz02lH1pFj4s2mvp8Z4l73eDWL56LF2RWRk2knT33iNcIYWFzwKbCRYRkRJ1DUiUY LLWpIA3hLYFvfsj2f1oSrh2+BwgGShutOafeGXHy8/+wuMe/a6jtnjMwoTzLmULWPF6Sv90Dx 127L1SNJq02h0dOeb0uno78azOCDngx/Wp3ZnvnlqdB0FvNTbsWaC/OXE15FV4/Vvd8VtMUsM kNJQOvmn1YqPa2mkWVV7nhaMRC7g/AssBXjYX7ob+qM4T7WWjARm4WTptbp+d/BUo62RS40dN i0YiU1dyIbxIV5vb3NwAUjx/Q/tLLFKliS+jCPNaew9dv3TvtgGgKYJT6eP8rE3Xc1bybD5z1 304Dcr13+RulTZ05w3YkilQ3ZIeUpWFrMU1aQJo3Mq4gaPa6lYu9fEbM/g4ky2nGGoBfJ2FBx 63mjKnGCcnCQxX/zrxTNsg7eXkdLUD/TDdzOnIlXmR35OKaGE0bsBSF8Q6mO9MZxGNkJQw7hq BxPPXRpw/eCjR8O0nt8IVPYA== The commit d483f034f032 ("usb: dwc2: Skip clock gating on Broadcom SoCs") introduced a regression on Raspberry Pi 3 B Plus, which prevents enumeration of the onboard Microchip LAN7800 in case no external USB device is connected during boot. Fixes: d483f034f032 ("usb: dwc2: Skip clock gating on Broadcom SoCs") Signed-off-by: Stefan Wahren --- drivers/usb/dwc2/params.c | 1 - 1 file changed, 1 deletion(-) -- 2.34.1 diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c index 68226defdc60..4d73fae80b12 100644 --- a/drivers/usb/dwc2/params.c +++ b/drivers/usb/dwc2/params.c @@ -23,7 +23,6 @@ static void dwc2_set_bcm_params(struct dwc2_hsotg *hsotg) p->max_transfer_size = 65535; p->max_packet_count = 511; p->ahbcfg = 0x10; - p->no_clock_gating = true; } static void dwc2_set_his_params(struct dwc2_hsotg *hsotg) From patchwork Thu Oct 24 20:18:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13849635 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94233185920; Thu, 24 Oct 2024 20:19:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729801146; cv=none; b=C0nkYmiwR+qwCCGHY4B50IlH0Ji7usFuKfhdC/4z1fzb5eXCGYyuVk/H8xslHPz5T3nRmd6Qo2YKBTSmnyr17i5Lh5gvJGJh5C6nMpmC110SrlSLl85qI48CeF89Tuv2gHGtb0wzSj9ShpC5xaiKJe7tVG5fmmtKpyfDX76wx/0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729801146; c=relaxed/simple; bh=V9/4Nd+sWme/u2mCmc2sE127qiJQZgk7dOc5mUf2E6c=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=To0rLQGV46J+DzNdBvDDyeIiLa7XNT2fdtoq0AU/Z/NIAR3iodev/tH0vq/pduZ51E6LnFkXh541lrJDYTADzzDgHwhSw7O6cotnuPgt7sAXmRTPwwtF2wm5EgNWtSMP+vMn0t9wlJ1okhQPbCAQdSDFrTQMHWnXaUksXQhlKD8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b=FWZYMB4i; arc=none smtp.client-ip=212.227.15.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="FWZYMB4i" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1729801125; x=1730405925; i=wahrenst@gmx.net; bh=KTdkJ5P6J2KL4Qt0vXA0RPNETkbTyLxenzCZPLKwNyw=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=FWZYMB4i6pII+5Cu3Z5TKjNhZw3OeczRSY9NS1oKV+6nCpO5qBxWkFSMzQy3ryjy sTBPl6mymi8N8pfcjQTGHeixmz1FlytcthQTMKfUKj6lj84V+VBjLmBq3UgalJkva JEaQFMRjgNbNbdMEaPmK+wAshzpYPXvTCn17cGjSsKzmWYik3rbrkKHlLo1ybXYgw nmpXqDpNELx0KrelSEq2Bs+U+6YillRq8IJ0viD5X7COpWmtluzO7vibsakKMu5Bg Ozx3pTFWgU0KSPGK/Rcz7+ZbUURtla0EhwLwSQm4nJlNpYgFvArJgR7y1qypvMbPj CC9yErUmZ94S0rAR6w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MacSe-1taMqF1UCo-00fMm2; Thu, 24 Oct 2024 22:18:45 +0200 From: Stefan Wahren To: Russell King , Florian Fainelli , Ray Jui , Scott Branden , Vinod Koul , Ulf Hansson , Minas Harutyunyan , Greg Kroah-Hartman Cc: Lukas Wunner , Peter Robinson , linux-arm-kernel@lists.infradead.org, kernel-list@raspberrypi.com, bcm-kernel-feedback-list@broadcom.com, dmaengine@vger.kernel.org, linux-mmc@vger.kernel.org, linux-usb@vger.kernel.org, Stefan Wahren Subject: [PATCH 2/9] dmaengine: bcm2835-dma: add suspend/resume pm support Date: Thu, 24 Oct 2024 22:18:30 +0200 Message-Id: <20241024201837.79927-3-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241024201837.79927-1-wahrenst@gmx.net> References: <20241024201837.79927-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:uurm7aNTi5uMv/4ThSbmO9f2OZgP0MZnWhjwfJlbBd5reY0RN+4 IAVrERajL/SXD91WlaaM5YamNsh/dSKucmU55D5SaAEEQkoqZBY/JHgqNxRpe0I5XTRShXL 3u/VkDO3dMzYYk6cWKJTvkzd/3tQ0Ng04QCY6SWoGEJClobXZpUdzZj1vDLuxu1P9YxyRx2 DKKtsV1iGb8R5B/hQ1oVQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:+I6/p0Kc/ug=;MnMyC57laSsmSHRtvqZJ29mp/Nb ePBEqIpKuQ7RKFK7KACh+NKHeayIpTFmIwoSOdWHe1XRErBmYkSoLGDQhOKUpPUTsWVcFue/i rUMTicPtvX9cqyD1KQ4eJvQvH+nWcurtOmNmBXo+bi0dofmvddlAj5McAgWtBvMG6GYIFIrN9 oE16Y/uJh2Hd/R/euG0xJDULNTZbEw6tgfXATdhS3kFFfnSNUfV4EWSyfW73EmSIF6hrN2Hk5 B6gS5N/IdG7wtL26mujzFnpR0JNUP+xJ/bCsn3e7pHmNOgrGvsZ5FHx/uxVu6hoJ8/LLOsp5j X+dXXB6VOjJHgV8mQD2mmBETQaZkP/A3mECb8xigYDHAL85umvvilsWxnTpQs2NnS/8PKYT73 0S8ZqdPMEymxnWMvafKsHgo4IIj9k9pCTXc7kg0U8jtrowurSIYRfvqmvwEKjXAVFqD04rQbr gfwFAg3nzhPJqQEmiypB8qeicZn4Fn1nGB6b3OByUjjwQJahLl+n4qPrB+H0dTnj1lw5pvP0f g+HpQXexssH1UuWRKnCBu2LY8DUUjarhkvk34n9DmeqFB3hLOm0VwBw6b0rSLCnkgcbEgh3my l8rtV8v9UH6OZMRY3/p2p/6fD4jBiWfNovx09+EJx5dbyFPaDmTlL0e2VnLWbWhJVmLq4yGwo abyowlcPDncsKoUBF/ywor+7bT9STzwNIpIAC8BLXDpYwUCNWiSG5k6O1K5XdwOpwMRWObVyi j3obmgQUA3H0m1j5dleEczNfwxENYHJo8t1h3CMl/C6Zq2F8/ZEAicuhUFBP8n3BEBQWB/B8P qcoHpZmtzh6PglEjii4PGTrQ== bcm2835-dma provides the service to others, so it should suspend late and resume early. Signed-off-by: Stefan Wahren --- drivers/dma/bcm2835-dma.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) -- 2.34.1 diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c index e1b92b4d7b05..647dda9f3376 100644 --- a/drivers/dma/bcm2835-dma.c +++ b/drivers/dma/bcm2835-dma.c @@ -875,6 +875,35 @@ static struct dma_chan *bcm2835_dma_xlate(struct of_phandle_args *spec, return chan; } +static int bcm2835_dma_suspend_late(struct device *dev) +{ + struct bcm2835_dmadev *od = dev_get_drvdata(dev); + struct bcm2835_chan *c, *next; + + list_for_each_entry_safe(c, next, &od->ddev.channels, + vc.chan.device_node) { + void __iomem *chan_base = c->chan_base; + + if (readl(chan_base + BCM2835_DMA_ADDR)) { + dev_warn(dev, "Suspend is prevented by chan %d\n", + c->ch); + return -EBUSY; + } + } + + return 0; +} + +static int bcm2835_dma_resume_early(struct device *dev) +{ + return 0; +} + +static const struct dev_pm_ops bcm2835_dma_pm_ops = { + SET_LATE_SYSTEM_SLEEP_PM_OPS(bcm2835_dma_suspend_late, + bcm2835_dma_resume_early) +}; + static int bcm2835_dma_probe(struct platform_device *pdev) { struct bcm2835_dmadev *od; @@ -1033,6 +1062,7 @@ static struct platform_driver bcm2835_dma_driver = { .driver = { .name = "bcm2835-dma", .of_match_table = of_match_ptr(bcm2835_dma_of_match), + .pm = pm_ptr(&bcm2835_dma_pm_ops), }, }; From patchwork Thu Oct 24 20:18:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13849637 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E6EB189916; Thu, 24 Oct 2024 20:19:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729801147; cv=none; b=NydYeJTVfvAMgy2aEV6ZmHMeH788erUZGJpv7lY+3otH8sMkk4+LYftlRtiL/lZFJ7AVmKdw2b20mbw8Mqt7bJEQ9c/UUo2hP4MwL9+uc/8LyeZmxgUqAdXLX9ey+sm4YpPk/WUvNQBxsfx3u4TnGNTohxenlQAjA7QYFzlZZ/U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729801147; c=relaxed/simple; bh=YB9sep2oCN35bAcGfSErLNH5swAiXAI0QKrxaK1mf2A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=p3ghdo/4uPH9pYKHsOFCZ0uootY8uo9SBxjNdYN5jgz4acV9VmN+0gzU26ENEJlllXKvAlSjghsgMlwPjDXVvCSA1mP3GVcBDBw0nvmIlgD6LhhvOuZi60qpFE6ERPdBTYBEMO+yJ5kEN4U38LLTgIEdFD/SSH5kUv9zGpudCY0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b=iizMTzz8; arc=none smtp.client-ip=212.227.15.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="iizMTzz8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1729801126; x=1730405926; i=wahrenst@gmx.net; bh=kE9FPbtpN1gptfSk3BViKriGQyJtWlX0djOx3GlUBlw=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=iizMTzz892WPd7YaLtaujj/lOy0cUqiiXP+tEw336uO6CZMXHbV4g32/L2EZo13g ycMm1aSQa+ShVeLq6o7h2EUmtU6cdSpJES7tCSp/MU3m80X7/mOXOWbqhPLD/6hBH sQBFLkkPQN3j8o68Spb0aTw0UBDZtqTr46ygYljc3uTWQucd2OeKkU6RA5mefcqAu GrWPJchlOzqtzUWSXzioXOFN4REO0T8cLZvnYGU9ieU7CxaTLgCV2TRMAZ9znwzCF FHhxBVEbH+XfEmWunQyHtji80hIEpSws+1yultzgOrOzgpG79Oh5TlfX86PmXluRR jxntSTo4JfdGgdvy8Q== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MkYc0-1tkEjD3kbO-00n1jq; Thu, 24 Oct 2024 22:18:46 +0200 From: Stefan Wahren To: Russell King , Florian Fainelli , Ray Jui , Scott Branden , Vinod Koul , Ulf Hansson , Minas Harutyunyan , Greg Kroah-Hartman Cc: Lukas Wunner , Peter Robinson , linux-arm-kernel@lists.infradead.org, kernel-list@raspberrypi.com, bcm-kernel-feedback-list@broadcom.com, dmaengine@vger.kernel.org, linux-mmc@vger.kernel.org, linux-usb@vger.kernel.org, Stefan Wahren Subject: [PATCH 3/9] mmc: bcm2835: Fix type of current clock speed Date: Thu, 24 Oct 2024 22:18:31 +0200 Message-Id: <20241024201837.79927-4-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241024201837.79927-1-wahrenst@gmx.net> References: <20241024201837.79927-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:ZHnUj5N1ri1FpgNmvmUfKpJ9EiJQpv1kd+uvgbTIUstY1PSxrly 8HeS+/FhbVxKaaRb8yQqTsJcZoJHeNKOf3U3evEWVJjhnGE8PNjuuYVdbuL70ociJQOLGm9 caxShFkJTRZeEVpz1IlOnpJcVzDc7UBxGPcke2XHsrX4Zdh1pn1m2utJkd1Ne6JIcwFcexU YsE74od3LaP9yL3cMaOOg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:7dNHSwoAxOw=;Ok3TtRcyjeVnY1CYGL21gL5LX4u pVP7Lzl6Oe4+cPYtXju8zUfZdE0pTqF58Q685nJlqCu2JWSvaCN2S19czG+V8Ms3fRgjZbcOn qdVL2O9+14D+IIsHjmOb9WYMXzNEUhwoos/V8PpFqqLsxHqaWGAp+OLM5Df5CHvpr2rAyOUYg 1XWUWUXJFjoIRoW1XQL+GXtwBwsHypTRqwSGu1d+RJb+kTcuAwfil8fzR0XoPNVi9YsfT3fBa 7ZC9/TqV5IF43qX8FersJSEpFduFvJSi3p0VKxENo4yFQLIRZ8ryIm40/1dNKovLgL06hFHA2 Pn5lmCi5Z41ci+vIzH2Dl9hhE2gu6bWRPkhbRHzMmMeXczmo2G6Fk+OkoiZeh6Tu9fnw9AtHu Ud4tNzCj2ArdUpUNCO00kjqqxEgrZNYiEBThjMxKyQcphEz0rt1+75VMekALKYocyeS1HTk7O vI257JLeoXtln/Rz+cU2iBuVsPJrTNOFcQRODa6Na0CuqpGawb9JKtr8Uc1IaAAOXt+OShsGr yj4hJ5R0wK/zr47cu9rsIeSSc+5PDmeaTTbyNM/OMG9TQrnKH7BkP2VE8H2dgvJmQRzb2UVY5 +rdxeoBr7SGI9n2JJgnrae4I1P5RY1JXI5f1u4nfz2CUQFtKTI5KA+xaPgacxWTAaI0Eghqn4 8gDVPcCaPdnxVgTThrgHzgLOlcpvQn2zPaCTVSfrABivY6Wx/xDn0csGPZZAnYmYA3Cd4uYrE UAmAdIf/jAMFDB23WW3lmmLNvCUItAcGgPjV57+lO88mEeA55czVEHvpX4xPi0Bg3F1fa0mGn +rT5/+W06U9lT9ldU7qlla5w== The type of mmc_ios.clock is unsigned int, so the cached value should be of the same type. Fixes: 660fc733bd74 ("mmc: bcm2835: Add new driver for the sdhost controller.") Signed-off-by: Stefan Wahren --- drivers/mmc/host/bcm2835.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.34.1 diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c index 35d8fdea668b..3d3eda5a337c 100644 --- a/drivers/mmc/host/bcm2835.c +++ b/drivers/mmc/host/bcm2835.c @@ -150,7 +150,7 @@ struct bcm2835_host { struct platform_device *pdev; - int clock; /* Current clock speed */ + unsigned int clock; /* Current clock speed */ unsigned int max_clk; /* Max possible freq */ struct work_struct dma_work; struct delayed_work timeout_work; /* Timer for timeouts */ From patchwork Thu Oct 24 20:18:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13849636 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8FDF5184101; Thu, 24 Oct 2024 20:19:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729801146; cv=none; b=h7pQ3gBVUzp0XeXXuwJo3RVYBcqzNv5figtr2OmT7LZ3ZGwU2d6R1I/F0WU7rjIWAFkFCLBrqVYCBxYl+gBWRfbOwcyshxieTH6xSakVqzrX42kNA6wmA8gWUc0K4YSaqKUwv5uIOQpPMr2/rygOlp1vlGrrzdFgYz4a1Xe7Uww= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729801146; c=relaxed/simple; bh=W/Eol3PGqBkVJnzoyfSd/OIVp/8l/BiqcbjtDTzoD5A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Zzp8m4FIGpTF/ARCPK4VOZ5VbTBumCd7al1OuqR3e4xt2OvemVrzSopa312X7H3XRVeA9rjqOekVCyjfrUI4A6+N7Q895Vq6RLIRKg+qEqE+RWactQagfQLn+O9PmiKbCjXi0xht6fNV/JaVLLDrXH0hA0S0MMyZeq+LUo19MCM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b=fkSSPrHf; arc=none smtp.client-ip=212.227.15.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="fkSSPrHf" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1729801126; x=1730405926; i=wahrenst@gmx.net; bh=TppAUiDXkUFwSrv2A2knMxXHQkH96XkM3sjE1E2labc=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=fkSSPrHfP8zuCDU0FQvXVesIFe0r59OPVPafqp13z6faJWuN+qe9m8e4Wvn/zVXo kTXnXzVpL406wexjvAHBkZlM8oDg22VDJYQaHIUgCBeOaNFzPkOG4cbtEETBYVOEo kPLkb46PkQL2fA5BoO8y0+FH1fxAAjwOOnJ3smndqfO8Yh6i/ICbpf/WmEcSEBoJL h/73jMD2QqGUZT35cLHcmrJ8W2zWgktTBiiQze2yMoFhFH6gnxfz0EXSxW1A+nyXN F6g87zasR9YzlQb9YfmImwH9soaYjAHlT3vHL0gmUWrO9g/sPCQ4r74ZbLzF+9yyM nC0HwqL5dtKEx+o5Eg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MZTqW-1tQfdw22Z4-00TIze; Thu, 24 Oct 2024 22:18:46 +0200 From: Stefan Wahren To: Russell King , Florian Fainelli , Ray Jui , Scott Branden , Vinod Koul , Ulf Hansson , Minas Harutyunyan , Greg Kroah-Hartman Cc: Lukas Wunner , Peter Robinson , linux-arm-kernel@lists.infradead.org, kernel-list@raspberrypi.com, bcm-kernel-feedback-list@broadcom.com, dmaengine@vger.kernel.org, linux-mmc@vger.kernel.org, linux-usb@vger.kernel.org, Stefan Wahren Subject: [PATCH 4/9] mmc: bcm2835: Introduce proper clock handling Date: Thu, 24 Oct 2024 22:18:32 +0200 Message-Id: <20241024201837.79927-5-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241024201837.79927-1-wahrenst@gmx.net> References: <20241024201837.79927-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:N3tKX4mSMl82K77Rqp30pHjdPKnfkJo5HTAHo86MD9OPHY0F2/v V5Z5RNm/VpCjv/E8YtDmv8A3Cie1520lbzwFOj9pefuP7NUdj1eoNNLqFn5HIUy/u1gjJhw ZiDYAGyHuN3F7GGNcGbHR4Oc0cXc3dhBvYTx2o3EnK8a2iV04dlFpjky5ngicZreQTthbBV EOT3LnUTA5oinVOI59jZQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:BM4IuQddS9U=;c2AS344vTTYGtGZcIMh+jqcDywx sJEWBxyaT0tqBhihI5NGhQxC8EcLjeYqW6ZwLRZ1580Xo+S6cTVgWtyR+IjXC5HqTUwhCfgjR +tNlG6U2nbHFAvIeMHN5Cz8xQIOfapRRqpAECdQ/NvfcXWOTszC9SKUCpzSYsY8qZcgi3P53c t1u5K/b+pRnuAtWASpwERgu9qplnGc178WJE92gFFoYvvsID7DLa/OGZECg+QdVXVYWC+ImOA Wqv5YHIWrr1fTtugZKw8QNkiYheSXlCSCNv1DKOkCOoGBgBkKtRI2C58K4trSfS8HAD9fnc/I I+JHcX1BGp4UVy4HARdhRBmZlzPNiMjfvSvWj+tDw6SqAEBvIryvcc6Y0bjrRj045SQjPIOUw Jrjuto4RfZ1uCsYCe7v0oU5oulw7/IVxA11DvLaFUn2PyBTOeGnZOU3Ry+L4MO7WWNL6t5t1/ GEFeoi91Vx/cK04O5cjhvp63xDRUe54FXR1oe+zUgHfk3SsATOit5GXfiWZe4at8k+0PVrvKl n1cU6pAP4ge4IIbdbR9Uxi2SpwwNGaEJfD3DLbwikI870UaNSDbGj7sHywAVnkfOUfv0EECRC LBSPTOfBNCr7/v9Zk3V+yr7r/21m+nFcWfm6dEHai+Kjsi0tTxQXAGI7vJFTR1eklcfaeil3d 7iay6oaBxsHGbWz2xfpOq2LwKUECb0hzkBy0UuSnhOE5EBmQFi3Ae74Yv0h0GqGEAY9H93TTW C9ad9W8MV4BupQNF7d+F5o97DMwwKCHd8JXqf4nHPevojPpqvDDVzb0hSdNOGXLwtFEwMTiPc s0XDmfh7vMc1ap35fZMpzwMw== The custom sdhost controller on BCM2835 is feed by the critical VPU clock. In preparation for PM suspend/resume support, add a proper clock handling to the driver like in the other clock consumers (e.g. I2C). Move the clock handling behind mmc_of_parse(), because it could return with -EPROBE_DEFER and we want to minimize potential clock operation during boot phase. Signed-off-by: Stefan Wahren --- drivers/mmc/host/bcm2835.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) -- 2.34.1 diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c index 3d3eda5a337c..107666b7c1c8 100644 --- a/drivers/mmc/host/bcm2835.c +++ b/drivers/mmc/host/bcm2835.c @@ -148,6 +148,7 @@ struct bcm2835_host { void __iomem *ioaddr; u32 phys_addr; + struct clk *clk; struct platform_device *pdev; unsigned int clock; /* Current clock speed */ @@ -1345,7 +1346,6 @@ static int bcm2835_add_host(struct bcm2835_host *host) static int bcm2835_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct clk *clk; struct bcm2835_host *host; struct mmc_host *mmc; const __be32 *regaddr_p; @@ -1393,15 +1393,6 @@ static int bcm2835_probe(struct platform_device *pdev) /* Ignore errors to fall back to PIO mode */ } - - clk = devm_clk_get(dev, NULL); - if (IS_ERR(clk)) { - ret = dev_err_probe(dev, PTR_ERR(clk), "could not get clk\n"); - goto err; - } - - host->max_clk = clk_get_rate(clk); - host->irq = platform_get_irq(pdev, 0); if (host->irq < 0) { ret = host->irq; @@ -1412,16 +1403,30 @@ static int bcm2835_probe(struct platform_device *pdev) if (ret) goto err; - ret = bcm2835_add_host(host); + host->clk = devm_clk_get(dev, NULL); + if (IS_ERR(host->clk)) { + ret = dev_err_probe(dev, PTR_ERR(host->clk), "could not get clk\n"); + goto err; + } + + ret = clk_prepare_enable(host->clk); if (ret) goto err; + host->max_clk = clk_get_rate(host->clk); + + ret = bcm2835_add_host(host); + if (ret) + goto err_clk; + platform_set_drvdata(pdev, host); dev_dbg(dev, "%s -> OK\n", __func__); return 0; +err_clk: + clk_disable_unprepare(host->clk); err: dev_dbg(dev, "%s -> err %d\n", __func__, ret); if (host->dma_chan_rxtx) @@ -1445,6 +1450,8 @@ static void bcm2835_remove(struct platform_device *pdev) cancel_work_sync(&host->dma_work); cancel_delayed_work_sync(&host->timeout_work); + clk_disable_unprepare(host->clk); + if (host->dma_chan_rxtx) dma_release_channel(host->dma_chan_rxtx); From patchwork Thu Oct 24 20:18:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13849638 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88460189F5E; Thu, 24 Oct 2024 20:19:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729801147; cv=none; b=C+rHZKqWybBfd0rWic0AlaN6bEmK4dZcaC0rOGhQZYorJQ+sr4IRQarxn67aCSpPoWdZLXjZStBgEqJ6tV09yTDCL6Pj/c8IauhS4QIf82U/SmVI/0kQn6mdeuyjc4l52rZ9FSdSCOKpdJhVwZz306mR/MS4SZJtvZyMf98OG7o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729801147; c=relaxed/simple; bh=nDW0JkC5oOVw3y6HyHxt9mKYcZxpXMokS2HNemOLjZ4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=oeIf5HhsnqOGMZu4HcqcL/Tm/jGIXvPbc9wmhX0dqSAfjSOAD8MyndoIlV6wjghOZFzkpJRROu0lrKzetYwYRbabzbUns9zAWEJvuPSaUoinKLVFH2srNz0uPNVOKPH5Zr32HNSEHndSPxHI9ZGybluILfzHtpnqIerr25JdzRo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b=KZLSTsDx; arc=none smtp.client-ip=212.227.15.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="KZLSTsDx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1729801127; x=1730405927; i=wahrenst@gmx.net; bh=7SJXJq2uX1cxKxMjslAAHJO+ZqjPnNq4UxpqnQBoZXU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=KZLSTsDxZihnlXirdBa0AQQu2DSslmDJlLNVopdqTNhQm9XMLk63uuEmJ43pIIQw wkf0+C/y3POcLDf2xE+Gj6SGf0JmoK8Spt7IJfZKEWkiEZOY3/J3c+zlKWTFXdG36 RxB4CnL2KZV3xvuSqw9PRCkEfetAKS6zoli0N5k/w6G6GoaPPxk41m2ywLTKIWQw3 aRGTkIqDoSZ+h1mtDD4utQAwEtY6YImjihsQyEcciR4vWYrs19aOOpGc+TzqRWBcR pxr4JC7WMp+hsiqaXV5mPT+nq83ExA80OH2+i3ZOsD9KugyiW3Aq4vHghBCTL3H6k PnfjK7K8zt5hv6TEnw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MPXhA-1tGnkz0Eny-00Le1q; Thu, 24 Oct 2024 22:18:47 +0200 From: Stefan Wahren To: Russell King , Florian Fainelli , Ray Jui , Scott Branden , Vinod Koul , Ulf Hansson , Minas Harutyunyan , Greg Kroah-Hartman Cc: Lukas Wunner , Peter Robinson , linux-arm-kernel@lists.infradead.org, kernel-list@raspberrypi.com, bcm-kernel-feedback-list@broadcom.com, dmaengine@vger.kernel.org, linux-mmc@vger.kernel.org, linux-usb@vger.kernel.org, Stefan Wahren Subject: [PATCH 5/9] mmc: bcm2835: add suspend/resume pm support Date: Thu, 24 Oct 2024 22:18:33 +0200 Message-Id: <20241024201837.79927-6-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241024201837.79927-1-wahrenst@gmx.net> References: <20241024201837.79927-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:9TmHXDC8x1toKmQj5TL/zr1r9VxVKXQInUCA3JeqWfeBotHSHp8 wLE1AA0+kLRoWZpFnsyE4ypCh+VDSSwImsj9NpzVERhwNkskidZqyV6e/pwYvPgtjXqqPIN dKF5Cw/6ZqzyERKBCWYhADUJLiDKe+wT6MTyi6A5+uNIl6WlpGZ+RY+ZFRdnWqfhJ1IdpNP J6BA6SqMbLqZ8lwtJFtow== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:bPTh4IaJ1/s=;DvZyp+ul50m2MoJpgBSYoErzoer AbfbZynkrtkr/VN3ylQefl5asCMF01gq+igg96KF6o8g7jl7bfNo8d0xBpVQ05s8QpmOLM2Oy CnmuA+QE+SRGFAhwFRd4+17v5FHfxOcbok9OczzdUDVdosuNY5hsVXa+cQ5o+tqdW1uY69ViY 3/PbVKf8MBtIRQiyJmCOybn87kxd4kgM3Hj4YY4cEcncWh+WpLB3O+xj6kSbzeddMx+Dm2qC4 yW02bi2qa/uOli5uTteIeCdNS5+1ULuFUPZ0bONegz0m/CaE4VRG/pA6N9J1gs0ncIpjE7qLM XQMHBcBkSiD5FNdqO886NQleDowz5/JkDVIKj5732IaAZdjGuPPgXwiUb1NtBLYh5Yiz3Gi3V K+jA+NDX7rAsrq2cVtEZGK8FL8ZEhW3DR4unOGEDHHpJE0FoVT8KUPwrDDGahIbK4r0RZChoq PN5FRDMXc8XjRy3GUEq5HK6oIgJ/tMpoeXoVOv1CKYuii67fvypFxO/7kg/XK94EsoD3wsD9K eCyW7ggaqih3cg5DiQ8CY3ea8zlGVe0FBl+enBhSKObYJF3oqVI/gJtIZZzcBf6HDgl1gr8MK 6vmKR4Qh+bu9Uo0ulgIDyxCic49QrET8p9bPtTTGEkfoFI6pLvwq1mrioVtlp7NjI5RJUl49R KtPDKUgHARqf9J4m89h53uezA1DbUS0qdD1VukTzLZIl4QRch6HLpaDMGud7zwADQMTJ2Saj4 6ZjmHrYPUTgnBSHLAQF+IyNbNX/xzkbdtfrM0yPqG3kGbkTmlQlAIexAgMQYUroEMbJjDCDEd PK8Alhu0VddmoeusWHwUv0mA== Add a minimalistic suspend/resume PM support. Signed-off-by: Stefan Wahren --- drivers/mmc/host/bcm2835.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) -- 2.34.1 diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c index 107666b7c1c8..17c327b7b5cc 100644 --- a/drivers/mmc/host/bcm2835.c +++ b/drivers/mmc/host/bcm2835.c @@ -1343,6 +1343,30 @@ static int bcm2835_add_host(struct bcm2835_host *host) return 0; } +static int bcm2835_suspend(struct device *dev) +{ + struct bcm2835_host *host = dev_get_drvdata(dev); + + if (!host->data_complete) { + dev_warn(dev, "Suspend is prevented\n"); + return -EBUSY; + } + + clk_disable_unprepare(host->clk); + + return 0; +} + +static int bcm2835_resume(struct device *dev) +{ + struct bcm2835_host *host = dev_get_drvdata(dev); + + return clk_prepare_enable(host->clk); +} + +static DEFINE_SIMPLE_DEV_PM_OPS(bcm2835_pm_ops, bcm2835_suspend, + bcm2835_resume); + static int bcm2835_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -1471,6 +1495,7 @@ static struct platform_driver bcm2835_driver = { .name = "sdhost-bcm2835", .probe_type = PROBE_PREFER_ASYNCHRONOUS, .of_match_table = bcm2835_match, + .pm = pm_ptr(&bcm2835_pm_ops), }, }; module_platform_driver(bcm2835_driver); From patchwork Thu Oct 24 20:18:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13849642 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 990F2200BB6; Thu, 24 Oct 2024 20:19:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729801150; cv=none; b=ls0tQyb9UdGwPNBrNCrgCtHNf7o7KS6tTniDik0QY+E0YZt6OYHWbeLSFjVr3yYlR8hiE4Q/mpMahQ+q+Tro5/D85uZpGCX7L1+9dZrMuRgtW6eSrFEhSAkHfutBp2S9O66K/k9MTgiqhs5oKsSPN0zJL5VGSiv0g3hz8L3JQFc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729801150; c=relaxed/simple; bh=NLJhKND256gSjgqz5+jXNVwCkHAy7Lhhbara7R1G0Sk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qNm+mXYuGXFjLwPYC1zaiqCF7P7mh+7aGeFoss67T1wvATM+4jhTC6MJ1rUAEzVl19Io77KrU+wd5fbVOMPiPTRYyC/qLH+fy1+almNyTT32I0bTFytxp18bY65dD1PnF/ezlHVbUx8GJwzCcn6E9DkvxutG0CgjOfAIzkEEINQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b=ph1S/yzx; arc=none smtp.client-ip=212.227.15.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="ph1S/yzx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1729801127; x=1730405927; i=wahrenst@gmx.net; bh=JRrp6JLKk7ZewfhLxhmIMUVWuQ9FaYJ7taL+ewhOlow=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=ph1S/yzxaSFMuUMjJULTbbm+fsL+wECSBxU56vEZvnETgFB+vq+2R0WCmBVU8Yi6 k6zzyp950Q+YXdcOLDZ5VoszNaOFSBPQgkcUaeaKbQiY6XWlG4B94CMNRbCGv1RAi IUBW3HrVGrtPWUb+UYTnTgNaue6GBkjgfoBIQO0hq66zb9t7TDyfFq6yMWarqHEG6 U/gtNnWNQNRIhu/xt0CB03HB1YY4lonltbw2f1lsYTmLjLpL8S08b8FuHo1nRMQg8 KaB6oYgyzphWEplATpMD8LM4cJrNKVlCLD1N2ukly5CA1Og9i2nDOnZWSnFf3VIl1 bKRykL/6LjR6SvE1vQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Ml6qM-1tkmxX2UY8-00mTVU; Thu, 24 Oct 2024 22:18:47 +0200 From: Stefan Wahren To: Russell King , Florian Fainelli , Ray Jui , Scott Branden , Vinod Koul , Ulf Hansson , Minas Harutyunyan , Greg Kroah-Hartman Cc: Lukas Wunner , Peter Robinson , linux-arm-kernel@lists.infradead.org, kernel-list@raspberrypi.com, bcm-kernel-feedback-list@broadcom.com, dmaengine@vger.kernel.org, linux-mmc@vger.kernel.org, linux-usb@vger.kernel.org, Stefan Wahren Subject: [PATCH 6/9] usb: dwc2: gadget: Introduce register restore flags Date: Thu, 24 Oct 2024 22:18:34 +0200 Message-Id: <20241024201837.79927-7-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241024201837.79927-1-wahrenst@gmx.net> References: <20241024201837.79927-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:CqgYeeZNUwYzTJ4GE0juj9SGPyyOYxIPFyKOUz1FCHoELlxSPBO uCLm65+qf767P9c8nkrvo5VhNJ7oPFi4WFKbWl3AseMCGXpBsR/KLyp1MCdLM+nMMpNRV9T /pnK0vR8LoRYHBV2HlLfMXf+44c7VWxKOP19k6KPCJG3KnWLT1eF+bRkJMlQYx3ZO3OC3BV mioA28LqtZbvj1VyXmTZA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:hZar9UeG20M=;j9ZFZy0OgPtqao0NNzl58dNPiZt EpetYR4ISrhIiTBcgszQxelh4/1CiqikfvXspNioGdzClbIku0Ca1slnzFl7p4gMzTnZzyGXD WspSwVPO2xQq13VhQorPUu2G0Ugx3T720iQsHjk96uMR5O1EDfZurG0DpLGPIrSV2A30r8gw5 KnYXZsm/siTlVMeAapnw3wCinkgXGrFs38airnjTltCGbjOvTXdLNla3j5TR+ASk+biUDEfUB y9hsFE/rFoYqVAqZv+dRHaIXzr6wv0nR51lzYvIUkcCl2+zZ7aDSTLHaHKi/hnua5R63omMbR wVZsWXvBxvUAKlgnHufIXU13+aRm9Z+oeB140OsochtcJsuY6NpQOMBnJJV04lT7JhIVXCnUE saiVnVyWl77MWY5cLDLJduPA3uKZ4A4lF3FcInPJV6H2sc4GPk4+DvJ/TFmiAH0KkHPAourcH gl0Sw2LjYjWR2uSuwJeIeIoU2jdNyhiSRa3DtW94Eh4/i0M5gF4RZgCfrOdcyrOtk90rIIrbd 31oWHzbscthVEFo3TT+RhKrXo8P6lT4Kl8Rle7kHIr8k66brM+Y2+fLHji/B6gh9/1379BRhZ CjIkp2jrIIbfBUSmHP7DoMCFWGmrTto/1iUonxGlDoZaqOnh50mVEt079FecoxfDzfxymvJyW HA28UYhsdQb9Y8xkyxblKuwSvMjirFIcPfwrFJ0wW81KGjNiedDQ8D1bguartUg84+eHpIFQQ 6SkHFnL0XQrTcQA9UTnVr/0gYOSrYvQAWzQngQhZ8zsaW7uJsSc5PcGEh3sXakkdNH0G4GDHj g3gsx4tQHeVpU1JuMO6gSz/Q== dwc2_restore_device_registers() use a single boolean to decide about the register restoring behavior. So replace this with a flags parameter, which can be extended later. No functional change intended. Signed-off-by: Stefan Wahren --- drivers/usb/dwc2/core.h | 6 ++++-- drivers/usb/dwc2/gadget.c | 12 +++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) -- 2.34.1 diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h index 2bd74f3033ed..48f4b639ca2f 100644 --- a/drivers/usb/dwc2/core.h +++ b/drivers/usb/dwc2/core.h @@ -1127,6 +1127,8 @@ struct dwc2_hsotg { #define DWC2_FS_IOT_ID 0x55310000 #define DWC2_HS_IOT_ID 0x55320000 +#define DWC2_RESTORE_DCTL BIT(0) + #if IS_ENABLED(CONFIG_USB_DWC2_HOST) || IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE) union dwc2_hcd_internal_flags { u32 d32; @@ -1420,7 +1422,7 @@ int dwc2_hsotg_set_test_mode(struct dwc2_hsotg *hsotg, int testmode); #define dwc2_is_device_connected(hsotg) (hsotg->connected) #define dwc2_is_device_enabled(hsotg) (hsotg->enabled) int dwc2_backup_device_registers(struct dwc2_hsotg *hsotg); -int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg, int remote_wakeup); +int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg, unsigned int flags); int dwc2_gadget_enter_hibernation(struct dwc2_hsotg *hsotg); int dwc2_gadget_exit_hibernation(struct dwc2_hsotg *hsotg, int rem_wakeup, int reset); @@ -1459,7 +1461,7 @@ static inline int dwc2_hsotg_set_test_mode(struct dwc2_hsotg *hsotg, static inline int dwc2_backup_device_registers(struct dwc2_hsotg *hsotg) { return 0; } static inline int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg, - int remote_wakeup) + unsigned int flags) { return 0; } static inline int dwc2_gadget_enter_hibernation(struct dwc2_hsotg *hsotg) { return 0; } diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index e7bf9cc635be..96d703f4c509 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -5203,11 +5203,11 @@ int dwc2_backup_device_registers(struct dwc2_hsotg *hsotg) * if controller power were disabled. * * @hsotg: Programming view of the DWC_otg controller - * @remote_wakeup: Indicates whether resume is initiated by Device or Host. + * @flags: Defines which registers should be restored. * * Return: 0 if successful, negative error code otherwise */ -int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg, int remote_wakeup) +int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg, unsigned int flags) { struct dwc2_dregs_backup *dr; int i; @@ -5223,7 +5223,7 @@ int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg, int remote_wakeup) } dr->valid = false; - if (!remote_wakeup) + if (flags & DWC2_RESTORE_DCTL) dwc2_writel(hsotg, dr->dctl, DCTL); dwc2_writel(hsotg, dr->daintmsk, DAINTMSK); @@ -5414,6 +5414,7 @@ int dwc2_gadget_exit_hibernation(struct dwc2_hsotg *hsotg, u32 gpwrdn; u32 dctl; int ret = 0; + unsigned int flags = 0; struct dwc2_gregs_backup *gr; struct dwc2_dregs_backup *dr; @@ -5476,6 +5477,7 @@ int dwc2_gadget_exit_hibernation(struct dwc2_hsotg *hsotg, dctl = dwc2_readl(hsotg, DCTL); dctl |= DCTL_PWRONPRGDONE; dwc2_writel(hsotg, dctl, DCTL); + flags |= DWC2_RESTORE_DCTL; } /* Wait for interrupts which must be cleared */ mdelay(2); @@ -5491,7 +5493,7 @@ int dwc2_gadget_exit_hibernation(struct dwc2_hsotg *hsotg, } /* Restore device registers */ - ret = dwc2_restore_device_registers(hsotg, rem_wakeup); + ret = dwc2_restore_device_registers(hsotg, flags); if (ret) { dev_err(hsotg->dev, "%s: failed to restore device registers\n", __func__); @@ -5619,7 +5621,7 @@ int dwc2_gadget_exit_partial_power_down(struct dwc2_hsotg *hsotg, /* Restore DCFG */ dwc2_writel(hsotg, dr->dcfg, DCFG); - ret = dwc2_restore_device_registers(hsotg, 0); + ret = dwc2_restore_device_registers(hsotg, DWC2_RESTORE_DCTL); if (ret) { dev_err(hsotg->dev, "%s: failed to restore device registers\n", __func__); From patchwork Thu Oct 24 20:18:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13849644 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 15357184101; Thu, 24 Oct 2024 20:19:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729801151; cv=none; b=WaqCWjfLK3E8mu+pYBmhwTA17OOECVBywPDUJ8vlAWhT85x8DFfOIrmk20XQZiaDUAED4LVtQ3CrgrH9tkiB3lHZscy1a4xyaPmMYVwYkLr304wzQzVAGxIcl5upYIaBzJlaHjN7Z9asJ78p38VMGvUAMwHqGAFEUGWw78gdgOw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729801151; c=relaxed/simple; bh=j30l09n0Udlcdy0qRhe+svmzEsdnvvcaYN/b2OU5rG8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KWSV9SFVJRfmaZLCYlWc9XnC+ZcG5q4gd+6GMEclPCnS2G1EHOS/wIJdQ7Wk+xsdwzf4MA3ObD3JRijIjEp4eKIBkKJqW5QOoFREifJy3YzV+f49npSZUMfXWs8GdT3RpUKpdkOhHGrK0CCarTFUmHnQtEULFOcc1anbWVUuj6E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b=XTf6+f+K; arc=none smtp.client-ip=212.227.15.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="XTf6+f+K" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1729801128; x=1730405928; i=wahrenst@gmx.net; bh=+xEThDmQ7pfAOY3UNaiZU7Wtb02xRWnrFRg9OV2hgNc=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=XTf6+f+KOy4BdeP4kCd5vR2ryMWEUxYHFI1GDqBf7FzwCGSmOSnYQvcWKJj/rXuT a7zRRXu3NsxMgILZ/5rPKPqYZVI8ftdGWQypV4gSiAiAUFzylmMYBmoda/wYa+4WW cOf1TsNv1BBdP4V8yni2ecZhpIxoXuRok3Gqi0w1CJj963pqxSJXgbpnIVM/f3egv onT70ySWr/8YySSbkwGE4jThxp2R6ZZ/8B15DmFwH4ip5NceMrY/jnfkXtas7ADqf KmxI17C0TxtnJ8u5xQNJhAtqxLllIsAsDQuptmAM1rwhAAoslBxCijDK7VvTMZDgI EI7Vz94sIVnol927HA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mlf4S-1tlLBq0Zfe-00qK3m; Thu, 24 Oct 2024 22:18:48 +0200 From: Stefan Wahren To: Russell King , Florian Fainelli , Ray Jui , Scott Branden , Vinod Koul , Ulf Hansson , Minas Harutyunyan , Greg Kroah-Hartman Cc: Lukas Wunner , Peter Robinson , linux-arm-kernel@lists.infradead.org, kernel-list@raspberrypi.com, bcm-kernel-feedback-list@broadcom.com, dmaengine@vger.kernel.org, linux-mmc@vger.kernel.org, linux-usb@vger.kernel.org, Stefan Wahren Subject: [PATCH 7/9] usb: dwc2: Refactor backup/restore of registers Date: Thu, 24 Oct 2024 22:18:35 +0200 Message-Id: <20241024201837.79927-8-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241024201837.79927-1-wahrenst@gmx.net> References: <20241024201837.79927-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:eRif5tIwK3koxZ75G+M0l8840Bnvc3475TVXGPWA5N/tjqiBGB4 7tDs8j7h/LOypzExOB9hOlGUlucZi2oyE7ZbTIInuypdLHwXBJKsqbgDxXdnqatbmz3PU/Z n2nbULH+IWZFQyyusbRmagDZA+Bqrn6ohaePW3trTLiUgcwlXcck+4QJR/0XW5yg8si710u Qyf7Mv950o+/4VhV2vcJQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:E4sKnrR0dlE=;nlS9kirPC1tE1GHjl61oQOZYgIF H7lsXm15P4VyVpYtaqlHZm9x2Nzfc0Clz6wLhQNnNSyw29pRdw919ysDt7I3FTtVstWM45aQG MrnI+IkFEbJPu839p1EFSA62XsTMhoLSiMF6mc+GpwbXLMt0FAB+MxX1k+epY5fpeOqxJoIc9 Dza/dpxw/7BJiWiG7fVxg6+HrKd6Q0Sk4bMYim4Kt4nmKGKFaIqFElVnFsdZL0eGp5DbGUt2l ySr3ZrxTxmJUc7NREq7UYcfF4ZkXhQypMSnpEpDl98eARmLtLdO0RWW+yrVulvkH4ZZj9dLfH anWnPHsazNXl4veUiVx98Ftxg+/7RMVv50C00MB9N8YEOE+rAi1hq1L38OgAoVpZVNk5PAsWZ hwGdIC+UWVBKG8RCrlNL3YxAQFZZuHG1DtuBV8l9gm1kL96b2O1hE+rlCE4MMIFvqYGSjbFl9 rckLOBb41BWCLie4M46tqs3DkOmQrKzMiYgyRuh49NveRgLNYZvxSft2HCU5Uq0OGNlmPFLQQ Hw5cjQORY5MFlJa15nDRB6OO2tuDQ8DhFy4+SDtbhhSYXTxxBQUowjEcJm1Jax1WGDgxJK3wN aGwkc3UIyeIweVMDfDol9lRBxdPrapKIwmsdUSev4bh4JRMgcPqBocObi7vJPPAXtSo2OVWAx mp/tw98VG8i5hIHkkjBFMZDYmKBjXiq03Ae18tdlojnDt5pasq1cbaK/hwPgBQM8g3/kpODES nORllTAya9FAjl+ZOAInZFKOHj9BbWzTn5lTKHKvD/Toas3gJAE+eeiwcUANsfYCZ8kJhX11b tYJ26AI4vG6XbnEOV00tPBQQ== The DWC2 runtime PM code reuses similar patterns to backup and restore the registers. So consolidate them in USB mode specific variants. This also has the advantage it is reusable for further PM improvements. Special care is taken for DCFG register during device mode restore. Signed-off-by: Stefan Wahren --- drivers/usb/dwc2/core.h | 15 ++++++ drivers/usb/dwc2/gadget.c | 108 +++++++++++++++++++------------------- drivers/usb/dwc2/hcd.c | 99 +++++++++++++++++----------------- 3 files changed, 121 insertions(+), 101 deletions(-) -- 2.34.1 diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h index 48f4b639ca2f..265791fbe87f 100644 --- a/drivers/usb/dwc2/core.h +++ b/drivers/usb/dwc2/core.h @@ -1128,6 +1128,7 @@ struct dwc2_hsotg { #define DWC2_HS_IOT_ID 0x55320000 #define DWC2_RESTORE_DCTL BIT(0) +#define DWC2_RESTORE_DCFG BIT(1) #if IS_ENABLED(CONFIG_USB_DWC2_HOST) || IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE) union dwc2_hcd_internal_flags { @@ -1437,6 +1438,9 @@ int dwc2_hsotg_tx_fifo_total_depth(struct dwc2_hsotg *hsotg); int dwc2_hsotg_tx_fifo_average_depth(struct dwc2_hsotg *hsotg); void dwc2_gadget_init_lpm(struct dwc2_hsotg *hsotg); void dwc2_gadget_program_ref_clk(struct dwc2_hsotg *hsotg); +int dwc2_gadget_backup_critical_registers(struct dwc2_hsotg *hsotg); +int dwc2_gadget_restore_critical_registers(struct dwc2_hsotg *hsotg, + unsigned int flags); static inline void dwc2_clear_fifo_map(struct dwc2_hsotg *hsotg) { hsotg->fifo_map = 0; } #else @@ -1484,6 +1488,11 @@ static inline int dwc2_hsotg_tx_fifo_average_depth(struct dwc2_hsotg *hsotg) { return 0; } static inline void dwc2_gadget_init_lpm(struct dwc2_hsotg *hsotg) {} static inline void dwc2_gadget_program_ref_clk(struct dwc2_hsotg *hsotg) {} +static inline int dwc2_gadget_backup_critical_registers(struct dwc2_hsotg *hsotg) +{ return 0; } +static inline int dwc2_gadget_restore_critical_registers(struct dwc2_hsotg *hsotg, + unsigned int flags) +{ return 0; } static inline void dwc2_clear_fifo_map(struct dwc2_hsotg *hsotg) {} #endif @@ -1507,6 +1516,8 @@ int dwc2_host_exit_partial_power_down(struct dwc2_hsotg *hsotg, void dwc2_host_enter_clock_gating(struct dwc2_hsotg *hsotg); void dwc2_host_exit_clock_gating(struct dwc2_hsotg *hsotg, int rem_wakeup); bool dwc2_host_can_poweroff_phy(struct dwc2_hsotg *dwc2); +int dwc2_host_backup_critical_registers(struct dwc2_hsotg *hsotg); +int dwc2_host_restore_critical_registers(struct dwc2_hsotg *hsotg); static inline void dwc2_host_schedule_phy_reset(struct dwc2_hsotg *hsotg) { schedule_work(&hsotg->phy_reset_work); } #else @@ -1546,6 +1557,10 @@ static inline void dwc2_host_exit_clock_gating(struct dwc2_hsotg *hsotg, int rem_wakeup) {} static inline bool dwc2_host_can_poweroff_phy(struct dwc2_hsotg *dwc2) { return false; } +static inline int dwc2_host_backup_critical_registers(struct dwc2_hsotg *hsotg) +{ return 0; } +static inline int dwc2_host_restore_critical_registers(struct dwc2_hsotg *hsotg) +{ return 0; } static inline void dwc2_host_schedule_phy_reset(struct dwc2_hsotg *hsotg) {} #endif diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 96d703f4c509..2e071a0342f8 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -5223,6 +5223,9 @@ int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg, unsigned int flags) } dr->valid = false; + if (flags & DWC2_RESTORE_DCFG) + dwc2_writel(hsotg, dr->dcfg, DCFG); + if (flags & DWC2_RESTORE_DCTL) dwc2_writel(hsotg, dr->dctl, DCTL); @@ -5309,6 +5312,49 @@ void dwc2_gadget_program_ref_clk(struct dwc2_hsotg *hsotg) dev_dbg(hsotg->dev, "GREFCLK=0x%08x\n", dwc2_readl(hsotg, GREFCLK)); } +int dwc2_gadget_backup_critical_registers(struct dwc2_hsotg *hsotg) +{ + int ret; + + /* Backup all registers */ + ret = dwc2_backup_global_registers(hsotg); + if (ret) { + dev_err(hsotg->dev, "%s: failed to backup global registers\n", + __func__); + return ret; + } + + ret = dwc2_backup_device_registers(hsotg); + if (ret) { + dev_err(hsotg->dev, "%s: failed to backup device registers\n", + __func__); + return ret; + } + + return 0; +} + +int dwc2_gadget_restore_critical_registers(struct dwc2_hsotg *hsotg, + unsigned int flags) +{ + int ret; + + ret = dwc2_restore_global_registers(hsotg); + if (ret) { + dev_err(hsotg->dev, "%s: failed to restore registers\n", + __func__); + return ret; + } + ret = dwc2_restore_device_registers(hsotg, flags); + if (ret) { + dev_err(hsotg->dev, "%s: failed to restore device registers\n", + __func__); + return ret; + } + + return 0; +} + /** * dwc2_gadget_enter_hibernation() - Put controller in Hibernation. * @@ -5326,18 +5372,9 @@ int dwc2_gadget_enter_hibernation(struct dwc2_hsotg *hsotg) /* Change to L2(suspend) state */ hsotg->lx_state = DWC2_L2; dev_dbg(hsotg->dev, "Start of hibernation completed\n"); - ret = dwc2_backup_global_registers(hsotg); - if (ret) { - dev_err(hsotg->dev, "%s: failed to backup global registers\n", - __func__); - return ret; - } - ret = dwc2_backup_device_registers(hsotg); - if (ret) { - dev_err(hsotg->dev, "%s: failed to backup device registers\n", - __func__); + ret = dwc2_gadget_backup_critical_registers(hsotg); + if (ret) return ret; - } gpwrdn = GPWRDN_PWRDNRSTN; udelay(10); @@ -5485,20 +5522,9 @@ int dwc2_gadget_exit_hibernation(struct dwc2_hsotg *hsotg, dwc2_writel(hsotg, 0xffffffff, GINTSTS); /* Restore global registers */ - ret = dwc2_restore_global_registers(hsotg); - if (ret) { - dev_err(hsotg->dev, "%s: failed to restore registers\n", - __func__); - return ret; - } - - /* Restore device registers */ - ret = dwc2_restore_device_registers(hsotg, flags); - if (ret) { - dev_err(hsotg->dev, "%s: failed to restore device registers\n", - __func__); + ret = dwc2_gadget_restore_critical_registers(hsotg, flags); + if (ret) return ret; - } if (rem_wakeup) { mdelay(10); @@ -5532,19 +5558,9 @@ int dwc2_gadget_enter_partial_power_down(struct dwc2_hsotg *hsotg) dev_dbg(hsotg->dev, "Entering device partial power down started.\n"); /* Backup all registers */ - ret = dwc2_backup_global_registers(hsotg); - if (ret) { - dev_err(hsotg->dev, "%s: failed to backup global registers\n", - __func__); - return ret; - } - - ret = dwc2_backup_device_registers(hsotg); - if (ret) { - dev_err(hsotg->dev, "%s: failed to backup device registers\n", - __func__); + ret = dwc2_gadget_backup_critical_registers(hsotg); + if (ret) return ret; - } /* * Clear any pending interrupts since dwc2 will not be able to @@ -5591,11 +5607,8 @@ int dwc2_gadget_exit_partial_power_down(struct dwc2_hsotg *hsotg, { u32 pcgcctl; u32 dctl; - struct dwc2_dregs_backup *dr; int ret = 0; - dr = &hsotg->dr_backup; - dev_dbg(hsotg->dev, "Exiting device partial Power Down started.\n"); pcgcctl = dwc2_readl(hsotg, PCGCTL); @@ -5612,21 +5625,10 @@ int dwc2_gadget_exit_partial_power_down(struct dwc2_hsotg *hsotg, udelay(100); if (restore) { - ret = dwc2_restore_global_registers(hsotg); - if (ret) { - dev_err(hsotg->dev, "%s: failed to restore registers\n", - __func__); - return ret; - } - /* Restore DCFG */ - dwc2_writel(hsotg, dr->dcfg, DCFG); - - ret = dwc2_restore_device_registers(hsotg, DWC2_RESTORE_DCTL); - if (ret) { - dev_err(hsotg->dev, "%s: failed to restore device registers\n", - __func__); + ret = dwc2_gadget_restore_critical_registers(hsotg, DWC2_RESTORE_DCTL | + DWC2_RESTORE_DCFG); + if (ret) return ret; - } } /* Set the Power-On Programming done bit */ diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index cb54390e7de4..32fa606e5d59 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -5477,6 +5477,49 @@ int dwc2_restore_host_registers(struct dwc2_hsotg *hsotg) return 0; } +int dwc2_host_backup_critical_registers(struct dwc2_hsotg *hsotg) +{ + int ret; + + /* Backup all registers */ + ret = dwc2_backup_global_registers(hsotg); + if (ret) { + dev_err(hsotg->dev, "%s: failed to backup global registers\n", + __func__); + return ret; + } + + ret = dwc2_backup_host_registers(hsotg); + if (ret) { + dev_err(hsotg->dev, "%s: failed to backup host registers\n", + __func__); + return ret; + } + + return 0; +} + +int dwc2_host_restore_critical_registers(struct dwc2_hsotg *hsotg) +{ + int ret; + + ret = dwc2_restore_global_registers(hsotg); + if (ret) { + dev_err(hsotg->dev, "%s: failed to restore registers\n", + __func__); + return ret; + } + + ret = dwc2_restore_host_registers(hsotg); + if (ret) { + dev_err(hsotg->dev, "%s: failed to restore host registers\n", + __func__); + return ret; + } + + return 0; +} + /** * dwc2_host_enter_hibernation() - Put controller in Hibernation. * @@ -5492,18 +5535,9 @@ int dwc2_host_enter_hibernation(struct dwc2_hsotg *hsotg) u32 gpwrdn; dev_dbg(hsotg->dev, "Preparing host for hibernation\n"); - ret = dwc2_backup_global_registers(hsotg); - if (ret) { - dev_err(hsotg->dev, "%s: failed to backup global registers\n", - __func__); - return ret; - } - ret = dwc2_backup_host_registers(hsotg); - if (ret) { - dev_err(hsotg->dev, "%s: failed to backup host registers\n", - __func__); + ret = dwc2_host_backup_critical_registers(hsotg); + if (ret) return ret; - } /* Enter USB Suspend Mode */ hprt0 = dwc2_readl(hsotg, HPRT0); @@ -5697,20 +5731,9 @@ int dwc2_host_exit_hibernation(struct dwc2_hsotg *hsotg, int rem_wakeup, dwc2_writel(hsotg, 0xffffffff, GINTSTS); /* Restore global registers */ - ret = dwc2_restore_global_registers(hsotg); - if (ret) { - dev_err(hsotg->dev, "%s: failed to restore registers\n", - __func__); + ret = dwc2_host_restore_critical_registers(hsotg); + if (ret) return ret; - } - - /* Restore host registers */ - ret = dwc2_restore_host_registers(hsotg); - if (ret) { - dev_err(hsotg->dev, "%s: failed to restore host registers\n", - __func__); - return ret; - } if (rem_wakeup) { dwc2_hcd_rem_wakeup(hsotg); @@ -5777,19 +5800,9 @@ int dwc2_host_enter_partial_power_down(struct dwc2_hsotg *hsotg) dev_warn(hsotg->dev, "Suspend wasn't generated\n"); /* Backup all registers */ - ret = dwc2_backup_global_registers(hsotg); - if (ret) { - dev_err(hsotg->dev, "%s: failed to backup global registers\n", - __func__); - return ret; - } - - ret = dwc2_backup_host_registers(hsotg); - if (ret) { - dev_err(hsotg->dev, "%s: failed to backup host registers\n", - __func__); + ret = dwc2_host_backup_critical_registers(hsotg); + if (ret) return ret; - } /* * Clear any pending interrupts since dwc2 will not be able to @@ -5858,19 +5871,9 @@ int dwc2_host_exit_partial_power_down(struct dwc2_hsotg *hsotg, udelay(100); if (restore) { - ret = dwc2_restore_global_registers(hsotg); - if (ret) { - dev_err(hsotg->dev, "%s: failed to restore registers\n", - __func__); - return ret; - } - - ret = dwc2_restore_host_registers(hsotg); - if (ret) { - dev_err(hsotg->dev, "%s: failed to restore host registers\n", - __func__); + ret = dwc2_host_restore_critical_registers(hsotg); + if (ret) return ret; - } } /* Drive resume signaling and exit suspend mode on the port. */ From patchwork Thu Oct 24 20:18:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13849641 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C5D41FF7D9; Thu, 24 Oct 2024 20:19:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729801150; cv=none; b=m+ED3b0YRz7UmMcYV5GmE8Ea9LC2JrxTjoCcgmWCa1eX0DP/BbQJaj24zndQgFRLsa9iYSiZ4H8iqw6SnwYYYDJmjVi8Qc7qw5RVR1MTzhTsC9dyhN933+Otu3iHHhknetu6kyQpRdPSi6s0kCQODeY3TOmkVCPL8hlLNwDWWk4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729801150; c=relaxed/simple; bh=Dnh9zA68cmn86JxmjQWm3VeD9mYPGUG2L6WhqKPqrUc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lM/nXwQCgXsnQ3gXEskXD4nl0+dTFUJ+1OlosFsbMBgR/njOtsefcHe34B08zXQ91pFMRRdzMndYNWEW1cXIitR7wOgl2l3aReOuEra4UdBBT03+hloB8RTt1fMo7do+0ueu2aFu0HXUjxwE0gtneeg0YTGLOaSQpJWpaSdX8TU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b=mCOITbe6; arc=none smtp.client-ip=212.227.15.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="mCOITbe6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1729801128; x=1730405928; i=wahrenst@gmx.net; bh=09r8SsGNZ34ZiyCPE+YPDY1tjwAlvhjANIoGjogob0I=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=mCOITbe6kHxdddVppdEAfMpWuaJ7FXS8bFZWtv08QtIXMgFQPg8lO48zlrMFjNBf IjaCVhUBQfVf8Dxzue6u/KszzyySDHkoBTWGyhM27HKPmtqcp1Sqawfvqrf6nxS8m ZpBLZ+tZGo9LNkXeOnqzvuFnni1M1Bdw/kBogY8Kkf1JKv3X1pAKANKMPiHBroGfl n+T8HJF1Yg+KwA/H/+geVhD27n32TGhUwFhm/yvtUka6lLbRGe75cXNqbUy7mVSPp RmWsBz3E2BgB+z32FQXjP70h6L6fY0dJmSg3yRTuNFSoU3Q0fvzKGPbX/GSG9l40m rsT+mjGe6+gqkblBMQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MfpOd-1tWoL3372P-00ahnt; Thu, 24 Oct 2024 22:18:48 +0200 From: Stefan Wahren To: Russell King , Florian Fainelli , Ray Jui , Scott Branden , Vinod Koul , Ulf Hansson , Minas Harutyunyan , Greg Kroah-Hartman Cc: Lukas Wunner , Peter Robinson , linux-arm-kernel@lists.infradead.org, kernel-list@raspberrypi.com, bcm-kernel-feedback-list@broadcom.com, dmaengine@vger.kernel.org, linux-mmc@vger.kernel.org, linux-usb@vger.kernel.org, Stefan Wahren , Douglas Anderson Subject: [PATCH 8/9] usb: dwc2: Implement recovery after PM domain off Date: Thu, 24 Oct 2024 22:18:36 +0200 Message-Id: <20241024201837.79927-9-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241024201837.79927-1-wahrenst@gmx.net> References: <20241024201837.79927-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:zkKVgRdB44ItjXckFDgPAlkuuQ2i0j7P5bnbkUiZdasbdzYhQAt P9aB5ib4nf0N+oSia4NHvIKYts72cBONmlSRqGoCcQ7ibpjNWt5EWDtrm97BJk2PPqYLjba BjWiG7tbr0EWFKAaJFKw4Aakpi4LERXa+wRyYlxTxjRRLYCNrHfZdEkxZHlsRk68fQJPRqJ ST516HzZLglAylSOYKMUw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:H5kEY+3Mlns=;AcHF9pEJKh8r2X5rTvVoct2vQuF hqqbFxf+9UnM0tqC9UkdZWLVXEUytN9iXAZ4o8/2eYOcotjuH0kVNMBW32O5jVmNRW1ez6Cif 8JyXMMV90D5tHOpQrDNx+61GxBjLw24HyYrl91VY+DJOFiyPhreuFtBLtSSw2yxmuFSylAGBK J+Y5eJ/nVeo/ysNnRGqP5PnyfFxkB6FQ56pOmGix2gpUwIAtA96SS3xzBYEiwa8xBLDJbNzPp x9T7/cGKlGJLBwNN/RVbM6rFnQ4qPdZHyD94Yzp47NriAj7m/AkW0TSF/HDHvaZ2iMJ5H9iqT +A5k+GPuHQdCZbZowerj182DNm8FhJ9giHAoqXRCyH65WPW1VXRvGjg97eCWn8q0qVWtAoUdU Ku+ah8YmRJBxuy50l5UvBNwpPF0d0td0eUydQvlBXFkng/eLAdhPMY+yP5/JRyfj7UQQxHFZ9 OhRpIso4TwuSKVbvlszF2dzILMnTI+SEHyGTmwFaPPj/6DImfs+kOZdPosnEjRVSR8TAnEDFR 85LAvebiJ/EhDAOnoJ1vRfzBL6C+e0Sjj8NNf+sW1FUWB/JQxxlMpY+6NXrX4GEFBKYaJd6qb 8SAIXMwjB412l2padBCh9g4B5pBTX5do9jOpdn5b6Y0jDz08EJGE2pX5wo35L6CC/4k0XZbrp v/sjgTn9YYe5AYbGOBdNGqlcucQYm4J9ZTsOOJL4hISMuAJM3hUs+Stj81xrBLcvd1uwcKlmh tvEauX3ey1pKyeKZHEtMB4HoRjZYlL1Ye5wrtKZrd5k7rlrWtdr0kHxMNXmgUWIFGo8g9/pUE syTLd0jFoFyWRmVapgaVKi3Q== According to the dt-bindings there are some platforms, which have a dedicated USB power domain for DWC2 IP core supply. If the power domain is switched off during system suspend then all USB register will lose their settings. Use GUSBCFG_TOUTCAL as a canary to detect that the power domain has been powered off during suspend. Since the GOTGCTL_CURMODE_HOST doesn't match on all platform with the current mode, additionally backup GINTSTS. This works reliable to decide which registers should be restored. Signed-off-by: Stefan Wahren Reviewed-by: Douglas Anderson --- drivers/usb/dwc2/core.c | 1 + drivers/usb/dwc2/core.h | 2 ++ drivers/usb/dwc2/platform.c | 38 +++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+) -- 2.34.1 diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c index 9919ab725d54..c3d24312db0f 100644 --- a/drivers/usb/dwc2/core.c +++ b/drivers/usb/dwc2/core.c @@ -43,6 +43,7 @@ int dwc2_backup_global_registers(struct dwc2_hsotg *hsotg) /* Backup global regs */ gr = &hsotg->gr_backup; + gr->gintsts = dwc2_readl(hsotg, GINTSTS); gr->gotgctl = dwc2_readl(hsotg, GOTGCTL); gr->gintmsk = dwc2_readl(hsotg, GINTMSK); gr->gahbcfg = dwc2_readl(hsotg, GAHBCFG); diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h index 265791fbe87f..34127b890b2a 100644 --- a/drivers/usb/dwc2/core.h +++ b/drivers/usb/dwc2/core.h @@ -667,6 +667,7 @@ struct dwc2_hw_params { /** * struct dwc2_gregs_backup - Holds global registers state before * entering partial power down + * @gintsts: Backup of GINTSTS register * @gotgctl: Backup of GOTGCTL register * @gintmsk: Backup of GINTMSK register * @gahbcfg: Backup of GAHBCFG register @@ -683,6 +684,7 @@ struct dwc2_hw_params { * @valid: True if registers values backuped. */ struct dwc2_gregs_backup { + u32 gintsts; u32 gotgctl; u32 gintmsk; u32 gahbcfg; diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c index c1b7209b9483..4a3c81cd45d6 100644 --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c @@ -685,6 +685,14 @@ static int __maybe_unused dwc2_suspend(struct device *dev) regulator_disable(dwc2->usb33d); } + if (is_device_mode) + ret = dwc2_gadget_backup_critical_registers(dwc2); + else + ret = dwc2_host_backup_critical_registers(dwc2); + + if (ret) + return ret; + if (dwc2->ll_hw_enabled && (is_device_mode || dwc2_host_can_poweroff_phy(dwc2))) { ret = __dwc2_lowlevel_hw_disable(dwc2); @@ -694,6 +702,24 @@ static int __maybe_unused dwc2_suspend(struct device *dev) return ret; } +static int dwc2_restore_critical_registers(struct dwc2_hsotg *hsotg) +{ + struct dwc2_gregs_backup *gr; + + gr = &hsotg->gr_backup; + + if (!gr->valid) { + dev_err(hsotg->dev, "No valid register backup, failed to restore\n"); + return -EINVAL; + } + + if (gr->gintsts & GINTSTS_CURMODE_HOST) + return dwc2_host_restore_critical_registers(hsotg); + + return dwc2_gadget_restore_critical_registers(hsotg, DWC2_RESTORE_DCTL | + DWC2_RESTORE_DCFG); +} + static int __maybe_unused dwc2_resume(struct device *dev) { struct dwc2_hsotg *dwc2 = dev_get_drvdata(dev); @@ -706,6 +732,18 @@ static int __maybe_unused dwc2_resume(struct device *dev) } dwc2->phy_off_for_suspend = false; + /* + * During suspend it's possible that the power domain for the + * DWC2 controller is disabled and all register values get lost. + * In case the GUSBCFG register is not initialized, it's clear the + * registers must be restored. + */ + if (!(dwc2_readl(dwc2, GUSBCFG) & GUSBCFG_TOUTCAL_MASK)) { + ret = dwc2_restore_critical_registers(dwc2); + if (ret) + return ret; + } + if (dwc2->params.activate_stm_id_vb_detection) { unsigned long flags; u32 ggpio, gotgctl; From patchwork Thu Oct 24 20:18:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13849643 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 63E7A2170CD; Thu, 24 Oct 2024 20:19:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729801150; cv=none; b=jjERx89tsiEUFPPGrpYsckUfoKMtRnJZs3wlIQx0DSB2QmOTpWKuYSzI7CiK/P/ROvOh8kmQWMwfCXzVZTVoW1eGJ6EBBrUKEVBlAxGLncu4wkx45zvOgWqkCCyfSxXKF4Ixv9Poyeshqg4znXh60ORBg4Pyl5BvV4j82qcti2o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729801150; c=relaxed/simple; bh=EIb/0BVQLAIWTGsSf2exEUrI6S97uVc10LsFQOB7HdM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=uyqd3qQCioRQAaV5aqHIimBclOHbQwSYaxm2Q4CPXxz7ja1YrOz3mNnkGtpP5GIbzlErZb4P343saDZ6FI62uFuxObKc4UyRzvtbzi2FOc1P18BuspGgpGqvSIVCNOWM/CRMfszBkDeWM3r/CpSiI1G+7UAVa7PCAy9m16AEdyM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b=f+sUdQPI; arc=none smtp.client-ip=212.227.15.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="f+sUdQPI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1729801129; x=1730405929; i=wahrenst@gmx.net; bh=EIb/0BVQLAIWTGsSf2exEUrI6S97uVc10LsFQOB7HdM=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=f+sUdQPIrpLcefcW9v+loVnd4h4gsck8HNCHWcpP3Nfk99KiATs4QJkAvJEe3rDS MhR8qm9+EjTb0Bn25PBmJk+tmJBk3wdvAR4ftaA4J1rfuXWuoAmbBznBtQvnfJxov lvCk2fawLS5Fzjmjoach7C/8405fkKde9SDXNrCQ3xmmiGdd+NpSc+HpMtisWIUAC xIiRpXBU7P6NATk3Ss8GOEE0fN8p5D45EVZG2AGlGP9jDEMt6gftus+iGlXNzeiSR wGoH/n62knbVqXDD1nVVO+XPpNCb/Mrj+zGaRVlRs4CM7ubmZDFWpIa/13FHmjTqz kvE2ApD3fC9hxOd4Wg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MOzT4-1tGFWf15oq-00HnTY; Thu, 24 Oct 2024 22:18:49 +0200 From: Stefan Wahren To: Russell King , Florian Fainelli , Ray Jui , Scott Branden , Vinod Koul , Ulf Hansson , Minas Harutyunyan , Greg Kroah-Hartman Cc: Lukas Wunner , Peter Robinson , linux-arm-kernel@lists.infradead.org, kernel-list@raspberrypi.com, bcm-kernel-feedback-list@broadcom.com, dmaengine@vger.kernel.org, linux-mmc@vger.kernel.org, linux-usb@vger.kernel.org, Stefan Wahren Subject: [PATCH 9/9] ARM: bcm2835_defconfig: Enable SUSPEND Date: Thu, 24 Oct 2024 22:18:37 +0200 Message-Id: <20241024201837.79927-10-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241024201837.79927-1-wahrenst@gmx.net> References: <20241024201837.79927-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:y5qs/K+Ex8uHWt3Wttf4GhkVYRu3Bxw5179FQJlfcGye3NuYOCR rlCUl4rYbHCkDTE0zT9u2NBAmL64Jd3QihDV92VlvKRtbLca9N7WjGdTP+QyH2x7mUabJqE qKI8xvSwgeKpTl+BjWz04YJl/Rion2QY3C3kJFsI7qAIXd8TStmqJgWB9Ej+XwxUbdD61rr bSuWGu1IT+G9XL2uAuhpA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:5Bqh0xCZoz8=;7qu7RK6hWjZs3fljgjsKj1/Vyl/ ykqWpTFJZT6uHKczUlyiqZovVrD2KIPNEp0uF+KUvU3Pcr4p+1qvKIl2WhLYDVoVQANhub/gJ DSWWnDp26eAVcntEruJm9YumheLecR/XB8j2naIuhoqe2bK0xe3cWgPo7ddT1TxOaDzlwU+mH pgvVQuT5+rA/UM5/lVNeBr/jVwvcecwyu2sOANNkqqgsbNXb1u74ib8507/tD0zPFG48Zp3vu OjA2tSiHoS0jfCSeJApf0016KWwsNHZ0vmxY5ZZBnlNjiSNyaLepHBIZ/20My4rKWUgLYB/Au URUeJRmHdl13QDeXARorbtntR9IYMowWYzdra0luik5WeyBe0zcGWvc5B4Cv8WSD6LAWWklIR Jc1KFyEbXpURxZC2r974fDURffxx4SHi3FkfBVmoKwl9qzV7Jf+1iO2eY0BIPP8DR9yRLFmT6 UChhtkQtAePgVLuKYcIMvAmvfaskALwQTB/QbEIaHaCbPN1/1yPWrKTbl7SXv909Ep3OA4J5L SEoQJSvvvtI/dy/NapCw/qu9g9jA1Xpapf6tlm5TW7EvCuNlJ6c30LzxxHqJLpzrNIvDkoKfB MWclfuY9e56KGJGoyCTlLXdQCU3mEl2KUcd0wKK3VLXJjTgtqBFFKaDVQp578XkBHGKrLLGjn FBcQ2J+7ZSvzLGnd0et8UhCimlOghZ6q0/Kb5kEh9j9440wrf/KoVQyXxJi/WYQVq3QciNCD9 M6CWHHltYhrJbFNz5PEC2fxeiUG7xH5w3SvA1ui+Lj2QSYFkJSkXWxHy/LP5Kq/LjzP1QfF2q n+HGCgrJRdE1UOdQsZo5bnEQ== Since the Raspberry Pi supports Suspend-To-Idle now, this option should be enabled. This should make power management testing easier. Signed-off-by: Stefan Wahren Reviewed-by: Florian Fainelli --- arch/arm/configs/bcm2835_defconfig | 2 -- 1 file changed, 2 deletions(-) -- 2.34.1 diff --git a/arch/arm/configs/bcm2835_defconfig b/arch/arm/configs/bcm2835_defconfig index b5f0bd8dd536..97632dee1ab3 100644 --- a/arch/arm/configs/bcm2835_defconfig +++ b/arch/arm/configs/bcm2835_defconfig @@ -38,8 +38,6 @@ CONFIG_CPU_FREQ_GOV_ONDEMAND=y CONFIG_CPUFREQ_DT=y CONFIG_ARM_RASPBERRYPI_CPUFREQ=y CONFIG_VFP=y -# CONFIG_SUSPEND is not set -CONFIG_PM=y CONFIG_JUMP_LABEL=y CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y