[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210727222255.GA751984@bjorn-Precision-5520>
Date: Tue, 27 Jul 2021 17:22:55 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: Amey Narkhede <ameynarkhede03@...il.com>
Cc: Bjorn Helgaas <bhelgaas@...gle.com>, alex.williamson@...hat.com,
Raphael Norwitz <raphael.norwitz@...anix.com>,
linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
kw@...ux.com, Shanker Donthineni <sdonthineni@...dia.com>,
Sinan Kaya <okaya@...nel.org>, Len Brown <lenb@...nel.org>,
"Rafael J . Wysocki" <rjw@...ysocki.net>
Subject: Re: [PATCH v10 8/8] PCI: Change the type of probe argument in reset
functions
On Fri, Jul 09, 2021 at 06:08:13PM +0530, Amey Narkhede wrote:
> Introduce a new enum pci_reset_mode_t to make the context of probe argument
> in reset functions clear and the code easier to read. Change the type of
> probe argument in functions which implement reset methods from int to
> pci_reset_mode_t to make the intent clear.
Not sure adding an enum and a PCI_RESET_MODE_MAX seems worth it to me.
It's really a boolean parameter, and I'd be happy to change it to a
bool. But I don't think it's worth checking against
PCI_RESET_MODE_MAX unless we need more than two options.
> Add a new line in return statement of pci_reset_bus_function().
Drop this line, since I don't think it's correct and there's no need
to describe whitespace changes anyway.
> Suggested-by: Alex Williamson <alex.williamson@...hat.com>
> Suggested-by: Krzysztof WilczyĆski <kw@...ux.com>
> Signed-off-by: Amey Narkhede <ameynarkhede03@...il.com>
> @@ -306,7 +306,7 @@ static int nitrox_device_flr(struct pci_dev *pdev)
> return -ENOMEM;
> }
>
> - pcie_reset_flr(pdev, 0);
> + pcie_reset_flr(pdev, PCI_RESET_DO_RESET);
>
> pci_restore_state(pdev);
>
> @@ -526,7 +526,7 @@ static void octeon_destroy_resources(struct octeon_device *oct)
> oct->irq_name_storage = NULL;
> }
> /* Soft reset the octeon device before exiting */
> - if (!pcie_reset_flr(oct->pci_dev, 1))
> + if (!pcie_reset_flr(oct->pci_dev, PCI_RESET_PROBE))
> octeon_pci_flr(oct);
> else
> cn23xx_vf_ask_pf_to_do_flr(oct);
> +typedef enum pci_reset_mode {
> + PCI_RESET_DO_RESET,
> + PCI_RESET_PROBE,
> + PCI_RESET_MODE_MAX,
> +} pci_reset_mode_t;
Powered by blists - more mailing lists