Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Hans Zhang <18255117159@163.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	bhelgaas@google.com, helgaas@kernel.org,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 3/4] PCI: pciehp: Add macros for hotplug operation delays
Date: Sun, 2 Nov 2025 00:16:06 +0800	[thread overview]
Message-ID: <eb45e253-0aec-4fca-9bfe-31d23fe8bd1d@163.com> (raw)
In-Reply-To: <c1afb7fa-c45f-44e3-81e1-200da04c29ef@wanadoo.fr>



On 2025/11/2 00:13, Christophe JAILLET wrote:
> Le 01/11/2025 à 17:05, Hans Zhang a écrit :
>> Add WAIT_PDS_TIMEOUT_MS and POLL_CMD_TIMEOUT_MS macros for hotplug
>> operation delays to improve code readability.
>>
>> Signed-off-by: Hans Zhang <18255117159@163.com>
>> ---
>>   drivers/pci/hotplug/pciehp_hpc.c | 7 +++++--
>>   1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/ 
>> pciehp_hpc.c
>> index bcc51b26d03d..15b09c6a8d6b 100644
>> --- a/drivers/pci/hotplug/pciehp_hpc.c
>> +++ b/drivers/pci/hotplug/pciehp_hpc.c
>> @@ -28,6 +28,9 @@
>>   #include "../pci.h"
>>   #include "pciehp.h"
>> +#define WAIT_PDS_TIMEOUT_MS    10
>> +#define POLL_CMD_TIMEOUT_MS    10
>> +
>>   static const struct dmi_system_id 
>> inband_presence_disabled_dmi_table[] = {
>>       /*
>>        * Match all Dell systems, as some Dell systems have inband
>> @@ -103,7 +106,7 @@ static int pcie_poll_cmd(struct controller *ctrl, 
>> int timeout)
>>               smp_mb();
>>               return 1;
>>           }
>> -        msleep(10);
>> +        msleep(POLL_CMD_TIMEOUT_MS);
>>           timeout -= 10;
> 
> Should we have: timeout -= POLL_CMD_TIMEOUT_MS;
> 
> ?

Hi Christophe,

Thank you very much for your reply and reminder.

If Bjorn finds it meaningful, I will fix it in the next version.


> 
>>       } while (timeout >= 0);
>>       return 0;    /* timeout */
>> @@ -283,7 +286,7 @@ static void pcie_wait_for_presence(struct pci_dev 
>> *pdev)
>>           pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status);
>>           if (slot_status & PCI_EXP_SLTSTA_PDS)
>>               return;
>> -        msleep(10);
>> +        msleep(WAIT_PDS_TIMEOUT_MS);
> 
> Same with WAIT_PDS_TIMEOUT_MS.
> 

Will change.

Best regards,
Hans

> CJ
> 
>>           timeout -= 10;
>>       } while (timeout > 0);
>>   }


  reply	other threads:[~2025-11-01 16:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-01 16:05 [PATCH v4 0/4] PCI: Add delay macros for better code readability and maintainability Hans Zhang
2025-11-01 16:05 ` [PATCH v4 1/4] PCI: Add macro for secondary bus reset delay Hans Zhang
2025-11-05 15:56   ` Hans Zhang
2025-11-01 16:05 ` [PATCH v4 2/4] PCI: Add macro for link status check delay Hans Zhang
2025-11-03 15:39   ` Bjorn Helgaas
2025-11-05 15:54     ` Hans Zhang
2025-11-01 16:05 ` [PATCH v4 3/4] PCI: pciehp: Add macros for hotplug operation delays Hans Zhang
2025-11-01 16:13   ` Christophe JAILLET
2025-11-01 16:16     ` Hans Zhang [this message]
2025-11-03 15:37   ` Bjorn Helgaas
2025-11-03 17:24     ` Lukas Wunner
2025-11-05 15:54       ` Hans Zhang
2025-11-01 16:05 ` [PATCH v4 4/4] PCI/DPC: Add macro for RP busy check delay Hans Zhang

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=eb45e253-0aec-4fca-9bfe-31d23fe8bd1d@163.com \
    --to=18255117159@163.com \
    --cc=bhelgaas@google.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=helgaas@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    /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