lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <shhqkx5vt5dwbw452yf5cq6gubgcrqpzw6xatyo2m7laogg7gv@xpnspwe5x7ds>
Date: Sat, 19 Apr 2025 15:35:06 +0530
From: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
To: Hans Zhang <18255117159@....com>
Cc: lpieralisi@...nel.org, kw@...ux.com, robh@...nel.org, 
	bhelgaas@...gle.com, s-vadapalli@...com, thomas.richard@...tlin.com, 
	linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org, rockswang7@...il.com
Subject: Re: [RESEND] PCI: cadence: Fix runtime atomic count underflow.

On Sat, Mar 01, 2025 at 08:44:18PM +0800, Hans Zhang wrote:
> From: "Hans Zhang" <18255117159@....com>
> 
> If the pci_host_probe fails to be executed and run one time
> pm_runtime_put_sync. Run pm_runtime_put_sync or pm_runtime_put again in
> cdns_plat_pcie_probe or j721e_pcie_probe. Finally, it will print log
> "runtime PM usage count underflow!".
> 

Please reword the description as:

"If the call to pci_host_probe() in cdns_pcie_host_setup() fails, PM runtime
count is decremented in the error path using pm_runtime_put_sync(). But the
runtime count is not incremented by this driver, but only by the callers
(cdns_plat_pcie_probe/j721e_pcie_probe). And the callers also decrement the
runtime PM count in their error path. So this leads to the below warning from
the PM core:

runtime PM usage count underflow!

So fix it by getting rid of pm_runtime_put_sync() in the error path and directly
return the errno."

> Signed-off-by: Hans Zhang <18255117159@....com>

Fixes tag?

> ---
>  drivers/pci/controller/cadence/pcie-cadence-host.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/controller/cadence/pcie-cadence-host.c b/drivers/pci/controller/cadence/pcie-cadence-host.c
> index 8af95e9da7ce..fe0b8d76005e 100644
> --- a/drivers/pci/controller/cadence/pcie-cadence-host.c
> +++ b/drivers/pci/controller/cadence/pcie-cadence-host.c
> @@ -576,8 +576,6 @@ int cdns_pcie_host_setup(struct cdns_pcie_rc *rc)
>  
>  	return 0;
>  
> - err_init:
> -	pm_runtime_put_sync(dev);
> -
> +err_init:
>  	return ret;

You can now directly do 'return ret' instead of using label.

- Mani

-- 
மணிவண்ணன் சதாசிவம்

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ