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: <c1afb7fa-c45f-44e3-81e1-200da04c29ef@wanadoo.fr>
Date: Sat, 1 Nov 2025 17:13:23 +0100
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Hans Zhang <18255117159@....com>, bhelgaas@...gle.com,
 helgaas@...nel.org, linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 3/4] PCI: pciehp: Add macros for hotplug operation
 delays

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

?

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

CJ

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ