[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3e000468679b4371a7942a3e07d99894@manjaro.org>
Date: Thu, 17 Apr 2025 18:20:54 +0200
From: Dragan Simic <dsimic@...jaro.org>
To: Diederik de Haas <didi.debian@...ow.org>
Cc: Lorenzo Pieralisi <lpieralisi@...nel.org>, Krzysztof WilczyĆski <kw@...ux.com>, Bjorn Helgaas <bhelgaas@...gle.com>,
Heiko Stuebner <heiko@...ech.de>, Manivannan Sadhasivam
<manivannan.sadhasivam@...aro.org>, Rob Herring <robh@...nel.org>, Shawn Lin
<shawn.lin@...k-chips.com>, Niklas Cassel <cassel@...nel.org>,
linux-pci@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH] PCI: dw-rockchip: Fix function call sequence in
rockchip_pcie_phy_deinit
Hello Diederik,
On 2025-04-17 16:21, Diederik de Haas wrote:
> The documentation for the phy_power_off() function explicitly says
>
> Must be called before phy_exit().
>
> So let's follow that instruction.
>
> Fixes: 0e898eb8df4e ("PCI: rockchip-dwc: Add Rockchip RK356X host
> controller driver")
> Cc: stable@...r.kernel.org # v5.15+
> Signed-off-by: Diederik de Haas <didi.debian@...ow.org>
> ---
> drivers/pci/controller/dwc/pcie-dw-rockchip.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pci/controller/dwc/pcie-dw-rockchip.c
> b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
> index c624b7ebd118..4f92639650e3 100644
> --- a/drivers/pci/controller/dwc/pcie-dw-rockchip.c
> +++ b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
> @@ -410,8 +410,8 @@ static int rockchip_pcie_phy_init(struct
> rockchip_pcie *rockchip)
>
> static void rockchip_pcie_phy_deinit(struct rockchip_pcie *rockchip)
> {
> - phy_exit(rockchip->phy);
> phy_power_off(rockchip->phy);
> + phy_exit(rockchip->phy);
> }
>
> static const struct dw_pcie_ops dw_pcie_ops = {
Thanks for the patch, it's looking good to me. The current state
of the rockchip_pcie_phy_deinit() function might actually not cause
issues because the rockchip_pcie_phy_deinit() function is used only
in the error-handling path in the rockchip_pcie_probe() function,
so having no runtime errors leads to no possible issues.
However, it doesn't mean it shouldn't be fixed, and it would actually
be good to dissolve the rockchip_pcie_phy_deinit() function into the
above-mentioned error-handling path. It's a short, two-line function
local to the compile unit, used in a single place only, so dissolving
it is safe and would actually improve the readability of the code.
Thus, please feel free to include
Reviewed-by: Dragan Simic <dsimic@...jaro.org>
and please consider dissolving the rockchip_pcie_phy_deinit() function
in the possible v2 of this patch, as suggested above.
Powered by blists - more mailing lists