Message ID | 20240222-cdns-qspi-pm-fix-v4-0-6b6af8bcbf59@bootlin.com |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-76299-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:aa16:b0:108:e6aa:91d0 with SMTP id by22csp153504dyb; Thu, 22 Feb 2024 02:13:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUOIyaT37OocG2fTy8AjyVej9ESAgNYGfGjOCW7L8NLDz0GsSDt0m7oO77chwD5h0Fx0DVLGigK03QkIiH774BCd4ufjg== X-Google-Smtp-Source: AGHT+IE8ONLihMRtYHp5lonGagIEePtvqNUGhPjcy6/3KUUEW1wkgf7c1AqnjikVcS4Gr92caH1t X-Received: by 2002:a05:6870:c084:b0:219:432f:be6f with SMTP id c4-20020a056870c08400b00219432fbe6fmr19880934oad.1.1708596818227; Thu, 22 Feb 2024 02:13:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708596818; cv=pass; d=google.com; s=arc-20160816; b=aaQP7vFdM07s2astmGADYOXvG3oRm6MIhOxvEqc/8Wd9259lysxItpfJoS98/gPjz1 UHxZddJVISnVqZSMA2QlzOxPdnSWSq9Pr6D5B1pVswJQok0fhmgNkSmIJCbHC6IVvYz2 WpcWMnR7AJSUNMPVLsJJ/QXUdmE89gt7WInReTRXCv7a/uvqjTgh1TmIikoGKvKDiWLN BDPUz3uXE21E1JYOjzP2wSBPYrYLzr0JTJDsyl27av/5zhRrBObzUzcJCcyMB1egS+Ii bNbwshA5DRWhkS7xwF0md4Ivc3tmL9H2Np+kK7ScTrQFYb/AbAJEJrCJ0O86DQF1c2VU Xrhw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from :dkim-signature; bh=uEtrp1hJ8l8g9RQ2Sx4SLv4ASiAqlpUXE/wBmGapgZU=; fh=Oc81uuoSiCYmWPIZrJKh6tUWDhA09tD21Re6ielkk1Y=; b=UmNNvhNYQKDwVo+jz7imJecyz8NRBNC1Ojok4GtBKO9xAIv0SR3ShC51n1q6L9TsVz 0g0/hCDl31nDbuiQXIj6TU7mgdatp01G5AohVlWW8sphKxspwKxZVV4lUE+Di6dDpJD/ JRN49VHZ1Z2JCgqWuRlMidbe+LxYSKlTytVEIRW7qlFUd8l2imNUjx9+QPLlm3u7o04t iWsF6L7v11ixdBcVSvDt4nUyP6q6ud5Dnv4yh3g2DKPpkeDbq1MwIddLO9rQR1w/khVi jb1OgT1Q2M9+ED5k0MC5pW0XHSGtrGWbwBhTCkL5FLceEVvFuRWCSfsOKnBWlMrx4vEK D8Qw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=JA0FAOaV; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-76299-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76299-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id i131-20020a636d89000000b005dc962cfb64si9911670pgc.89.2024.02.22.02.13.38 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 02:13:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76299-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=JA0FAOaV; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-76299-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76299-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 09804282B6F for <ouuuleilei@gmail.com>; Thu, 22 Feb 2024 10:13:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 74AF93F8F0; Thu, 22 Feb 2024 10:12:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="JA0FAOaV" Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (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 ADAC139867; Thu, 22 Feb 2024 10:12:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708596757; cv=none; b=KNG1YdQRoxXb7tp5rSqhTX8OWmV86im/Pw3ofzMub+5lKSSygebwpBPFAl05k+XhiSNYA75qCibcsrguHCQ74HqNmc2kUyEbli+C1NHvlNzB/ysm02EgS+PlLDphCG4Jou8IZ4+CfLmgKnpsZXyZUdHJFKWzVWQNmmZjnFR51L4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708596757; c=relaxed/simple; bh=roIxjecpP/8DxCcjT0Gc9PACGeN4BQzA4Cmr5z1pWmk=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=TB/weGn7xhUJGqGBHnwcyGbFdxwyBIu6+jgTGBjhbpwx0XjwmqxbGVe52+06TNjVU401kyLwux0gyHlz0Wiub9ytordhgjIKLt1XD1xVWFGDirjMrZnRvU9OHDK2UyJhWdCaSstEPs5IjnxDXYWEzQrIf8BQ+CYvhIIQX2ZsR6Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=JA0FAOaV; arc=none smtp.client-ip=217.70.183.200 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 41F4D20014; Thu, 22 Feb 2024 10:12:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708596750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uEtrp1hJ8l8g9RQ2Sx4SLv4ASiAqlpUXE/wBmGapgZU=; b=JA0FAOaVYo1LbgUm6xqtARBie2nRJv+5vowT6WoZ8BMPtdLALJRWNwoeprLo8+3XRtb0+1 tXOri8yXZuH/g/fWwCrQc8EfwdJ7uNE8R4XrZcREMtw1PqQfTP+/hRrEYJ9nHMZFGlKlHV pqKHpQdJ+J4tRUm8cx8rKOCzZoZcckJKAs40Qx3NWk9qcsPLrAFfsMycgjFJowyJ4ehRBU AYQyF0G5/1rxUpFTAqEwBDocLFemDxw1CrPvuY+1re6B93eK0x/WX0tSO1NJty6PBYHWv+ XYk//oSUxT6N0vRo7mMK7l9k8u/0Rou+xnHtGoFrYVfzjn5Z4CHaIgqqs2Qm8A== From: =?utf-8?q?Th=C3=A9o_Lebrun?= <theo.lebrun@bootlin.com> Subject: [PATCH v4 0/4] spi: cadence-qspi: Fix runtime PM and system-wide suspend Date: Thu, 22 Feb 2024 11:12:28 +0100 Message-Id: <20240222-cdns-qspi-pm-fix-v4-0-6b6af8bcbf59@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-B4-Tracking: v=1; b=H4sIAAwe12UC/33NTQ6CMBAF4KuYrh1ThlLAlfcwLuifNJEWW0I0h LtbWGEkbiZ5L3nfTCTqYHUk58NEgh5ttN6lwI4HItvG3TVYlTJBioymA1K5CM/YW+g7MPYFWHN KpeSqFIakWR90qlfyeku5tXHw4b1+GLOl/YONGWSQy8pogcIoVV2E98PDupP0HVm4EbdEsUMgU EBdCtEoVjeM/xL5lqh3iDwRBaONRESDXHwT8zx/ABu3ecQ4AQAA To: Mark Brown <broonie@kernel.org>, Apurva Nandan <a-nandan@ti.com>, Dhruva Gole <d-gole@ti.com> Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Gregory CLEMENT <gregory.clement@bootlin.com>, Vladimir Kondratiev <vladimir.kondratiev@mobileye.com>, Thomas Petazzoni <thomas.petazzoni@bootlin.com>, Tawfik Bayouk <tawfik.bayouk@mobileye.com>, =?utf-8?q?Th=C3=A9o_Lebrun?= <theo.lebrun@bootlin.com> X-Mailer: b4 0.13.0 X-GND-Sasl: theo.lebrun@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791593617122541555 X-GMAIL-MSGID: 1791593617122541555 |
Series |
spi: cadence-qspi: Fix runtime PM and system-wide suspend
|
|
Message
Théo Lebrun
Feb. 22, 2024, 10:12 a.m. UTC
Hi,
This fixes runtime PM and system-wide suspend for the cadence-qspi
driver. Seeing how runtime PM and autosuspend are enabled by default, I
believe this affects all users of the driver.
This series has been tested on both Mobileye EyeQ5 hardware and the TI
J7200 EVM board, under s2idle.
Thanks all,
Théo
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
---
Changes in v4:
- Take Reviewed-by Dhruva Gole on patch 1/4.
- Fix struct dev_pm_ops declaration to avoid -Wunused-function warning
when CONFIG_PM_SLEEP=n. Replace SET_*_PM_OPS() by *_PM_OPS(). See
kernel test robot warning:
https://lore.kernel.org/oe-kbuild-all/202402221505.712Q7MSU-lkp@intel.com/
- Link to v3: https://lore.kernel.org/r/20240209-cdns-qspi-pm-fix-v3-0-540ac222f26b@bootlin.com
Changes in v3:
- Move both bugfix patches to the start of the series.
- Remove Fixes: trailer from the function renaming patch.
- Link to v2: https://lore.kernel.org/r/20240205-cdns-qspi-pm-fix-v2-0-2e7bbad49a46@bootlin.com
Changes in v2:
- Split the initial change into three separate commits, to make intents
clearer.
- Mark controller as suspended during the system-wide suspend.
- Link to v1: https://lore.kernel.org/r/20240202-cdns-qspi-pm-fix-v1-1-3c8feb2bfdd8@bootlin.com
---
Théo Lebrun (4):
spi: cadence-qspi: fix pointer reference in runtime PM hooks
spi: cadence-qspi: remove system-wide suspend helper calls from runtime PM hooks
spi: cadence-qspi: put runtime in runtime PM hooks names
spi: cadence-qspi: add system-wide suspend and resume callbacks
drivers/spi/spi-cadence-quadspi.c | 33 +++++++++++++++++++++------------
1 file changed, 21 insertions(+), 12 deletions(-)
---
base-commit: 13acce918af915278e49980a3038df31845dbf39
change-id: 20240202-cdns-qspi-pm-fix-29600cc6d7bf
Best regards,
Comments
On Thu, 22 Feb 2024 11:12:28 +0100, Théo Lebrun wrote: > This fixes runtime PM and system-wide suspend for the cadence-qspi > driver. Seeing how runtime PM and autosuspend are enabled by default, I > believe this affects all users of the driver. > > This series has been tested on both Mobileye EyeQ5 hardware and the TI > J7200 EVM board, under s2idle. > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next Thanks! [1/4] spi: cadence-qspi: fix pointer reference in runtime PM hooks commit: 32ce3bb57b6b402de2aec1012511e7ac4e7449dc [2/4] spi: cadence-qspi: remove system-wide suspend helper calls from runtime PM hooks commit: 959043afe53ae80633e810416cee6076da6e91c6 [3/4] spi: cadence-qspi: put runtime in runtime PM hooks names commit: 4efa1250b59ebf47ce64a7b6b7c3e2e0a2a9d35a [4/4] spi: cadence-qspi: add system-wide suspend and resume callbacks commit: 078d62de433b4f4556bb676e5dd670f0d4103376 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark
Hi Mark, Theo, + Nishanth, Vignesh (maintainers of TI K3) On Feb 22, 2024 at 19:13:29 +0000, Mark Brown wrote: > On Thu, 22 Feb 2024 11:12:28 +0100, Théo Lebrun wrote: > > This fixes runtime PM and system-wide suspend for the cadence-qspi > > driver. Seeing how runtime PM and autosuspend are enabled by default, I > > believe this affects all users of the driver. > > > > This series has been tested on both Mobileye EyeQ5 hardware and the TI > > J7200 EVM board, under s2idle. > > > > [...] > > Applied to > > https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next > > Thanks! > > [1/4] spi: cadence-qspi: fix pointer reference in runtime PM hooks > commit: 32ce3bb57b6b402de2aec1012511e7ac4e7449dc > [2/4] spi: cadence-qspi: remove system-wide suspend helper calls from runtime PM hooks > commit: 959043afe53ae80633e810416cee6076da6e91c6 > [3/4] spi: cadence-qspi: put runtime in runtime PM hooks names > commit: 4efa1250b59ebf47ce64a7b6b7c3e2e0a2a9d35a > [4/4] spi: cadence-qspi: add system-wide suspend and resume callbacks > commit: 078d62de433b4f4556bb676e5dd670f0d4103376 It seems like between 6.8.0-rc5-next-20240220 and 6.8.0-rc5-next-20240222 some of TI K3 platform boot have been broken. It particularly seemed related to these patches because we can see cqspi_probe in the call trace and also cqspi_suspend toward the top. See logs for kernel crash in [0] and working in [1] [0] https://gist.github.com/DhruvaG2000/ed997452b41d6e5301598225fc579800 [1] https://gist.github.com/DhruvaG2000/d4e73111aeafaca555ba2d5208deb6dd
On Mon, Feb 26, 2024 at 05:48:03PM +0530, Dhruva Gole wrote: > On Feb 22, 2024 at 19:13:29 +0000, Mark Brown wrote: > > [1/4] spi: cadence-qspi: fix pointer reference in runtime PM hooks > > commit: 32ce3bb57b6b402de2aec1012511e7ac4e7449dc > > [2/4] spi: cadence-qspi: remove system-wide suspend helper calls from runtime PM hooks > > commit: 959043afe53ae80633e810416cee6076da6e91c6 > > [3/4] spi: cadence-qspi: put runtime in runtime PM hooks names > > commit: 4efa1250b59ebf47ce64a7b6b7c3e2e0a2a9d35a > > [4/4] spi: cadence-qspi: add system-wide suspend and resume callbacks > > commit: 078d62de433b4f4556bb676e5dd670f0d4103376 > It seems like between 6.8.0-rc5-next-20240220 and > 6.8.0-rc5-next-20240222 some of TI K3 platform boot have been broken. Is this with some specific kernel configuration? > It particularly seemed related to these patches because we can see > cqspi_probe in the call trace and also cqspi_suspend toward the top. It would be useful to bisect which patch, there's only 4 of them... > See logs for kernel crash in [0] and working in [1] > [0] https://gist.github.com/DhruvaG2000/ed997452b41d6e5301598225fc579800 > [1] https://gist.github.com/DhruvaG2000/d4e73111aeafaca555ba2d5208deb6dd The relevant section from the failing log is: [ 1.516342] printk: legacy bootconsole [ns16550a0] disabled [ 1.533247] Unable to handle kernel paging request at virtual address 12800000340001b4 .. [ 1.709414] Call trace: [ 1.711852] __mutex_lock.constprop.0+0x84/0x540 [ 1.716460] __mutex_lock_slowpath+0x14/0x20 [ 1.720719] mutex_lock+0x48/0x54 [ 1.724026] spi_controller_suspend+0x30/0x7c [ 1.728377] cqspi_suspend+0x1c/0x6c [ 1.731944] pm_generic_runtime_suspend+0x2c/0x44 [ 1.736640] genpd_runtime_suspend+0xa8/0x254 (it's generally helpful to provide the most relevant section directly.) The issue here appears to be that we've registered for runtime suspend prior to registering the controller...
Hello Dhruva, On Mon Feb 26, 2024 at 1:18 PM CET, Dhruva Gole wrote: > Hi Mark, Theo, > > + Nishanth, Vignesh (maintainers of TI K3) > > On Feb 22, 2024 at 19:13:29 +0000, Mark Brown wrote: > > On Thu, 22 Feb 2024 11:12:28 +0100, Théo Lebrun wrote: > > > This fixes runtime PM and system-wide suspend for the cadence-qspi > > > driver. Seeing how runtime PM and autosuspend are enabled by default, I > > > believe this affects all users of the driver. > > > > > > This series has been tested on both Mobileye EyeQ5 hardware and the TI > > > J7200 EVM board, under s2idle. > > > > > > [...] > > > > Applied to > > > > https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next > > > > Thanks! > > > > [1/4] spi: cadence-qspi: fix pointer reference in runtime PM hooks > > commit: 32ce3bb57b6b402de2aec1012511e7ac4e7449dc > > [2/4] spi: cadence-qspi: remove system-wide suspend helper calls from runtime PM hooks > > commit: 959043afe53ae80633e810416cee6076da6e91c6 > > [3/4] spi: cadence-qspi: put runtime in runtime PM hooks names > > commit: 4efa1250b59ebf47ce64a7b6b7c3e2e0a2a9d35a > > [4/4] spi: cadence-qspi: add system-wide suspend and resume callbacks > > commit: 078d62de433b4f4556bb676e5dd670f0d4103376 > > It seems like between 6.8.0-rc5-next-20240220 and > 6.8.0-rc5-next-20240222 some of TI K3 platform boot have been broken. > > It particularly seemed related to these patches because we can see > cqspi_probe in the call trace and also cqspi_suspend toward the top. > > See logs for kernel crash in [0] and working in [1] I'm guessing we are talking about tags next-20240220 and next-20240222 on: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/ Neither of those tags include the patches about fixing PM hooks. ⟩ # next-20240220 ⟩ git log --oneline --author theo.lebrun 2d5c7b7eb345 \ drivers/spi/spi-cadence-quadspi.c ⟩ # next-20240222 ⟩ git log --oneline --author theo.lebrun e31185ce00a9 \ drivers/spi/spi-cadence-quadspi.c 0f3841a5e115 spi: cadence-qspi: report correct number of chip-select 7cc3522aedb5 spi: cadence-qspi: set maximum chip-select to 4 0d62c64a8e48 spi: cadence-qspi: assert each subnode flash CS is valid ⟩ # Those are unrelated patches. Also it shows from the calltrace: this series renames the runtime suspend/resume hooks to cqspi_runtime_* while the callstack you gave talks about cqspi_suspend. It only gets called at system-wide suspend following this series. My guess is that this series will rather fix the issue that you are now facing. :-) Could you try applying them and checking if that fixes your error? Regards, -- Théo Lebrun, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
On Mon, Feb 26, 2024 at 01:27:57PM +0000, Mark Brown wrote: > On Mon, Feb 26, 2024 at 05:48:03PM +0530, Dhruva Gole wrote: > > On Feb 22, 2024 at 19:13:29 +0000, Mark Brown wrote: > [ 1.709414] Call trace: > [ 1.711852] __mutex_lock.constprop.0+0x84/0x540 > [ 1.716460] __mutex_lock_slowpath+0x14/0x20 > [ 1.720719] mutex_lock+0x48/0x54 > [ 1.724026] spi_controller_suspend+0x30/0x7c > [ 1.728377] cqspi_suspend+0x1c/0x6c > [ 1.731944] pm_generic_runtime_suspend+0x2c/0x44 > [ 1.736640] genpd_runtime_suspend+0xa8/0x254 > (it's generally helpful to provide the most relevant section directly.) > The issue here appears to be that we've registered for runtime suspend > prior to registering the controller... Actually, no - after this series cqspi_suspend() is the system not runtime PM operation and should not be called from runtime suspend. How is that happening?
Hello, On Mon Feb 26, 2024 at 2:40 PM CET, Mark Brown wrote: > On Mon, Feb 26, 2024 at 01:27:57PM +0000, Mark Brown wrote: > > On Mon, Feb 26, 2024 at 05:48:03PM +0530, Dhruva Gole wrote: > > > On Feb 22, 2024 at 19:13:29 +0000, Mark Brown wrote: > > > [ 1.709414] Call trace: > > [ 1.711852] __mutex_lock.constprop.0+0x84/0x540 > > [ 1.716460] __mutex_lock_slowpath+0x14/0x20 > > [ 1.720719] mutex_lock+0x48/0x54 > > [ 1.724026] spi_controller_suspend+0x30/0x7c > > [ 1.728377] cqspi_suspend+0x1c/0x6c > > [ 1.731944] pm_generic_runtime_suspend+0x2c/0x44 > > [ 1.736640] genpd_runtime_suspend+0xa8/0x254 > > > (it's generally helpful to provide the most relevant section directly.) > > > The issue here appears to be that we've registered for runtime suspend > > prior to registering the controller... > > Actually, no - after this series cqspi_suspend() is the system not > runtime PM operation and should not be called from runtime suspend. How > is that happening? You might have seen my answer by now. This series is not in the tags quoted. I believe the memory corruption I fixed with this series is being encountered for the first time on TI hardware. They probably did not encounter it previously by luck. Regards, -- Théo Lebrun, Bootlin Embedded Linux and Kernel engineering https://bootlin.com ------------------------------------------------------------------------
Hi, On Feb 26, 2024 at 13:40:00 +0000, Mark Brown wrote: > On Mon, Feb 26, 2024 at 01:27:57PM +0000, Mark Brown wrote: > > On Mon, Feb 26, 2024 at 05:48:03PM +0530, Dhruva Gole wrote: > > > On Feb 22, 2024 at 19:13:29 +0000, Mark Brown wrote: > > > [ 1.709414] Call trace: > > [ 1.711852] __mutex_lock.constprop.0+0x84/0x540 > > [ 1.716460] __mutex_lock_slowpath+0x14/0x20 > > [ 1.720719] mutex_lock+0x48/0x54 > > [ 1.724026] spi_controller_suspend+0x30/0x7c > > [ 1.728377] cqspi_suspend+0x1c/0x6c > > [ 1.731944] pm_generic_runtime_suspend+0x2c/0x44 > > [ 1.736640] genpd_runtime_suspend+0xa8/0x254 > > > (it's generally helpful to provide the most relevant section directly.) > > > The issue here appears to be that we've registered for runtime suspend > > prior to registering the controller... > > Actually, no - after this series cqspi_suspend() is the system not > runtime PM operation and should not be called from runtime suspend. How > is that happening? I tried dropping this entire series, it doesn't really solve the kernel boot issues. Also this particular stack dump isn't easily reproducible either. Perhaps this series may not be the rootcause, I will need some more time to see what's breaking boot for us. But for now this series seems to be in the clear. Will keep you posted if I find anything funny here. FYI- We're just using the arm64 defconfig and respective device DTs
Hi, On Feb 26, 2024 at 14:36:17 +0100, Théo Lebrun wrote: > Hello Dhruva, > > On Mon Feb 26, 2024 at 1:18 PM CET, Dhruva Gole wrote: > > Hi Mark, Theo, > > > > + Nishanth, Vignesh (maintainers of TI K3) > > > > On Feb 22, 2024 at 19:13:29 +0000, Mark Brown wrote: > > > On Thu, 22 Feb 2024 11:12:28 +0100, Théo Lebrun wrote: > > > > This fixes runtime PM and system-wide suspend for the cadence-qspi > > > > driver. Seeing how runtime PM and autosuspend are enabled by default, I > > > > believe this affects all users of the driver. > > > > > > > > This series has been tested on both Mobileye EyeQ5 hardware and the TI > > > > J7200 EVM board, under s2idle. > > > > > > > > [...] > > > > > > Applied to > > > > > > https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next > > > > > > Thanks! > > > > > > [1/4] spi: cadence-qspi: fix pointer reference in runtime PM hooks > > > commit: 32ce3bb57b6b402de2aec1012511e7ac4e7449dc > > > [2/4] spi: cadence-qspi: remove system-wide suspend helper calls from runtime PM hooks > > > commit: 959043afe53ae80633e810416cee6076da6e91c6 > > > [3/4] spi: cadence-qspi: put runtime in runtime PM hooks names > > > commit: 4efa1250b59ebf47ce64a7b6b7c3e2e0a2a9d35a > > > [4/4] spi: cadence-qspi: add system-wide suspend and resume callbacks > > > commit: 078d62de433b4f4556bb676e5dd670f0d4103376 > > > > It seems like between 6.8.0-rc5-next-20240220 and > > 6.8.0-rc5-next-20240222 some of TI K3 platform boot have been broken. > > > > It particularly seemed related to these patches because we can see > > cqspi_probe in the call trace and also cqspi_suspend toward the top. > > > > See logs for kernel crash in [0] and working in [1] > > I'm guessing we are talking about tags next-20240220 and next-20240222 > on: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/ > > Neither of those tags include the patches about fixing PM hooks. > > ⟩ # next-20240220 > ⟩ git log --oneline --author theo.lebrun 2d5c7b7eb345 \ > drivers/spi/spi-cadence-quadspi.c > > ⟩ # next-20240222 > ⟩ git log --oneline --author theo.lebrun e31185ce00a9 \ > drivers/spi/spi-cadence-quadspi.c > 0f3841a5e115 spi: cadence-qspi: report correct number of chip-select > 7cc3522aedb5 spi: cadence-qspi: set maximum chip-select to 4 > 0d62c64a8e48 spi: cadence-qspi: assert each subnode flash CS is valid > ⟩ # Those are unrelated patches. > > Also it shows from the calltrace: this series renames the runtime > suspend/resume hooks to cqspi_runtime_* while the callstack you gave > talks about cqspi_suspend. It only gets called at system-wide suspend > following this series. > > My guess is that this series will rather fix the issue that you are now > facing. :-) Could you try applying them and checking if that fixes your > error? Indeed, it seems like kernelci generated 22Feb and no future builds in our case hence we were not testing the -next with your patches applied. Please pardon the confusion. The boot logs are here with local linux build from 27 Feb -next: https://gist.github.com/DhruvaG2000/78ef6f2953b0940ef8ea38797f2ec6cb It does seem like these patches help us fix the previous regressions. Thanks for the fixes.