All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Keith Busch <kbusch@meta.com>
Cc: bhelgaas@google.com, linux-pci@vger.kernel.org,
	 Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCH] pci: allow user specifiy a reset wait timeout
Date: Thu, 13 Feb 2025 15:37:34 +0200 (EET)	[thread overview]
Message-ID: <693ad66c-877b-6ef8-50ef-50ca797787bd@linux.intel.com> (raw)
In-Reply-To: <20250207204310.2546091-1-kbusch@meta.com>

On Fri, 7 Feb 2025, Keith Busch wrote:

> From: Keith Busch <kbusch@kernel.org>
> 
> The spec does not provide any upper limit to how long a device may
> return Request Retry Status. It just says "Some devices require a
> lengthy self-initialization sequence to complete". The kernel
> arbitrarily chose 60 seconds since that really ought to be enough. But
> there are devices where this turns out not to be enough.
> 
> Since any timeout choice would be arbitrary, and 60 seconds is generally
> more than enough for the majority of hardware, let's make this a
> parameter so an admin can adjust it specifically to their needs if the
> default timeout isn't appropriate.
> 
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
>  Documentation/admin-guide/kernel-parameters.txt | 3 +++
>  drivers/pci/pci.c                               | 6 +++++-
>  2 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index fb8752b42ec85..1aed555ef8b40 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -4843,6 +4843,9 @@
>  
>  				Note: this may remove isolation between devices
>  				and may put more devices in an IOMMU group.
> +		reset_wait=nn	The number of milliseconds to wait after a
> +				reset while seeing Request Retry Status.
> +				Default is 60000 (1 minute).
>  		force_floating	[S390] Force usage of floating interrupts.
>  		nomio		[S390] Do not use MIO instructions.
>  		norid		[S390] ignore the RID field and force use of
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 869d204a70a37..20817dd5ebba7 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -75,7 +75,8 @@ struct pci_pme_device {
>   * limit, but 60 sec ought to be enough for any device to become
>   * responsive.
>   */
> -#define PCIE_RESET_READY_POLL_MS 60000 /* msec */
> +#define PCIE_RESET_READY_POLL_MS pci_reset_ready_wait
> +unsigned long pci_reset_ready_wait = 60000; /* msec */

I don't think masking variables with defines like that is a good idea.

I also suggest you put the unit as a postfix to the variable name.

>  static void pci_dev_d3_sleep(struct pci_dev *dev)
>  {
> @@ -6841,6 +6842,9 @@ static int __init pci_setup(char *str)
>  				disable_acs_redir_param = str + 18;
>  			} else if (!strncmp(str, "config_acs=", 11)) {
>  				config_acs_param = str + 11;
> +			} else if (!strncmp(str, "reset_wait=", 11)) {
> +				pci_reset_ready_wait =
> +					simple_strtoul(str + 11, &str, 0);
>  			} else {
>  				pr_err("PCI: Unknown option `%s'\n", str);
>  			}
> 

-- 
 i.


      parent reply	other threads:[~2025-02-13 13:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-07 20:43 [PATCH] pci: allow user specifiy a reset wait timeout Keith Busch
2025-02-08  4:50 ` Lukas Wunner
2025-02-10 14:59   ` Keith Busch
2025-02-10 15:15     ` Lukas Wunner
2025-02-10 15:32       ` Keith Busch
2025-02-13 13:37 ` Ilpo Järvinen [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=693ad66c-877b-6ef8-50ef-50ca797787bd@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=kbusch@kernel.org \
    --cc=kbusch@meta.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.