mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hans Zhang <18255117159@163.com>
To: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: lpieralisi@kernel.org, kw@linux.com, robh@kernel.org,
	bhelgaas@google.com, s-vadapalli@ti.com,
	thomas.richard@bootlin.com, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org, rockswang7@gmail.com
Subject: Re: [RESEND] PCI: cadence: Fix runtime atomic count underflow.
Date: Sat, 19 Apr 2025 21:14:05 +0800	[thread overview]
Message-ID: <a890091b-b28b-4122-a7ae-bbb8d750cd7d@163.com> (raw)
In-Reply-To: <shhqkx5vt5dwbw452yf5cq6gubgcrqpzw6xatyo2m7laogg7gv@xpnspwe5x7ds>



On 2025/4/19 18:05, Manivannan Sadhasivam wrote:
> On Sat, Mar 01, 2025 at 08:44:18PM +0800, Hans Zhang wrote:
>> From: "Hans Zhang" <18255117159@163.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."
> 

Hi Mani,

Thank you very much for your reply and suggestions.

>> Signed-off-by: Hans Zhang <18255117159@163.com>
> 
> Fixes tag?

Will add.

> 
>> ---
>>   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.

Will change.

Best regards,
Hans


      reply	other threads:[~2025-04-19 13:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-01 12:44 Hans Zhang
2025-04-19 10:05 ` Manivannan Sadhasivam
2025-04-19 13:14   ` Hans Zhang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a890091b-b28b-4122-a7ae-bbb8d750cd7d@163.com \
    --to=18255117159@163.com \
    --cc=bhelgaas@google.com \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=robh@kernel.org \
    --cc=rockswang7@gmail.com \
    --cc=s-vadapalli@ti.com \
    --cc=thomas.richard@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®