From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796292621; b=mBH5HQmcD7i2DyIt5wJ5QLab4zAhdKq3yU1S/oc/3E/DnU6cfHZZxByZFKXIK/mREkri 3FbR3hb3h36oR8DM9U+KvTywIkTXD4NnjLEbSGHTA/K+9wjvBN5csWqWfywqiE12fyfGT pnZEI6/G7YHwN/DM7L01WXKtqFLi/IPksVHTmPW9zpJHCKKXn4qm+pZzD7KZHHvrL74E3 BDuggqkOpBTbGYWSkF1KVcn9IypCEg+ATHCu8Y95gN05VBirdAt6yUOu7HOhAgwxCORhE lvxxIEllHsph2pX+fHeYd3NRoUSeM2WvOzQhvS8idKwr/VoND3Cd0ZtXxJAXWebeoYw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796292621; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=8ZL7Qg2BsScgWGlcfYlxoyNHK+zYv6nG6mMi/OR56xc=; b=2ctNuY8yRA9fhK85HVKJwYfK99L5puxoOV41NWGT4o8bc6K6YLHEQSoAFHTLHkRUL6Xl KicTVMvaS7cfwX9VryVGXOM/qeVi2KpyDXqME++ei6K6lxNCKgfc1Kz9T/w94m55igrxh 6wA5z6rBj2snjdIRhMnJEtX2aew7zpQQtnk+bAOLLNgBsBD1lKCeEKTIy7m4pgc/lhM8L dxcajA/ljgxKaguy55v2T7hzZQv/TcqnCX5wTRHpLCLdnePKUTKw8fOFol9T+gzwd2odn UWVNqVcAEpiSWhm/P9naG6LOwTEjEhA0BlwL2Nrd4LXlVymHPZluJ+22m2h88i60jCQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="Vuvi/fNt"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4740D606A322 for ; Thu, 3 Dec 2026 10:10:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Vuvi/fNt Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADC771F00893; Thu, 3 Dec 2026 10:10:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796292620; bh=8ZL7Qg2BsScgWGlcfYlxoyNHK+zYv6nG6mMi/OR56xc=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Vuvi/fNt1V5r555UmlmkQ7neeEFwWxfSd2AjZXObi7PyI12DvFGcl7MDb9HzKYwDG sFI5NvOxFUnoN4tDCjud9iRt2A628j8rOR5Qp9/p3y5l2bYDX4qwjAtztH/vTZ5nW5 BUVLVMYiimRJNarJehF7j0yEgjzW/XuYUcd/jmMqDkjeBKncGaA7SjM7pUFrB9pODc ZAYb3wFzFMSJIxLREChV6WgAbtqN2nBLrOaTgyXFwT7elY5Obac9ZdktZcPMe0nR9w TrqRfS9EOLWrcV6UiocEzJ4AhMqeIJKpShjPkKl/Gtt/ANAS7LDxcfyPbKyLBfsKm5 XoohMWY1Wh9tg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 2/6] PCI: rzg3s-host: Fix runtime PM handling in the NOIRQ suspend/resume phase Reply-To: sashiko-reviews@lists.linux.dev To: "Claudiu Beznea" Cc: linux-pci@vger.kernel.org, wsa+renesas@sang-engineering.com In-Reply-To: <20261203093224.247349-3-claudiu.beznea@kernel.org> References: <20261203093224.247349-1-claudiu.beznea@kernel.org> <20261203093224.247349-3-claudiu.beznea@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 10:10:20 +0000 X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] PCI: rzg3s-host: second suspend after failed resume underflows clk/resets - [Low] PCI: rzg3s-host: inverted genpd stop/start order in changelog and comment -- commit d950b9cde70f06d5719f83c5c0372210d7beeeeb Author: Claudiu Beznea PCI: rzg3s-host: Fix runtime PM handling in the NOIRQ suspend/resume phase This commit removes the pm_runtime_put_sync() and pm_runtime_resume_and_get() calls from rzg3s_pcie_suspend_noirq() and rzg3s_pcie_resume_noirq(), relying on the generic power domain noirq callbacks to power the device off and on. > the generic power domain .suspend_noirq()/.resume_noirq() callbacks > (genpd_suspend_noirq()/genpd_resume_noirq()) invoke the driver's > .suspend_noirq()/.resume_noirq() callbacks and call > genpd_stop_dev()/genpd_start_dev() before and after them, respectively. [Severity: Low] Is the genpd_stop_dev()/genpd_start_dev() order inverted here? In drivers/pmdomain/core.c, genpd_finish_suspend() calls suspend_noirq() first and genpd_stop_dev() after it, while genpd_finish_resume() calls genpd_start_dev() before pm_generic_resume_noirq(). The new comment in rzg3s_pcie_resume_noirq() has the same issue: it says genpd_resume_noirq() "will enable clocks" mid-function, even though genpd_start_dev() has already enabled them before rzg3s_pcie_resume_noirq() is entered. > diff --git a/drivers/pci/controller/pcie-rzg3s-host.c b/drivers/pci/contr= oller/pcie-rzg3s-host.c > index 1dbe2a2a4bf1c..66a5adf9db7ec 100644 > --- a/drivers/pci/controller/pcie-rzg3s-host.c > +++ b/drivers/pci/controller/pcie-rzg3s-host.c > @@ -1957,19 +1957,18 @@ static int rzg3s_pcie_suspend_noirq(struct device= *dev) > if (ret) > goto config_reinit; > =20 > - ret =3D pm_runtime_put_sync(dev); > - if (ret) > - goto power_resets_restore; > + /* > + * Since the power domain's genpd_suspend_noirq() will disable clocks, > + * there is no need to manually invoke runtime PM API here. > + */ > =20 > ret =3D rzg3s_sysc_config_func(sysc, RZG3S_SYSC_FUNC_ID_RST_RSM_B, 0); > if (ret) > - goto rpm_resume; > + goto power_resets_restore; [Severity: Medium] Can a second system suspend after a failed rzg3s_pcie_resume_noirq() now underflow port->refclk and double-assert host->power_resets? When rzg3s_pcie_resume_noirq() fails (for example on a link-up timeout in rzg3s_pcie_host_init()), it re-asserts host->power_resets and leaves port->refclk disabled, while device_resume_noirq() still clears is_noirq_suspended and completes system resume. On the next suspend, rzg3s_pcie_suspend_noirq() runs again on the already-deinitialized controller. It disables port->refclk again, writes host->axi + RZG3S_PCI_RESET in rzg3e_pcie_config_deinit() under reset, and calls reset_control_bulk_assert() a second time on shared power_resets. On single-controller SoCs this hits WARN_ON() in __reset_control_assert() and aborts suspend with -EINVAL; on dual-controller RZ/V2H where pcie0 and pcie1 share aresetn, it drops the sibling's count to zero and resets it. Tracking whether the controller is already suspended and returning early in rzg3s_pcie_suspend_noirq() would avoid tearing it down twice. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203093224.2473= 49-1-claudiu.beznea@kernel.org?part=3D2