Re: [PATCH v6 2/2] PCI/ERR: Split the fatal and non-fatal error recovery handling
From: Christoph Hellwig
Date: Thu Oct 15 2020 - 02:52:29 EST
> /* PCI error reporting and recovery */
> -pci_ers_result_t pcie_do_recovery(struct pci_dev *dev,
> - pci_channel_state_t state,
> +pci_ers_result_t pcie_do_nonfatal_recovery(struct pci_dev *dev);
> +
> +pci_ers_result_t pcie_do_fatal_recovery(struct pci_dev *dev,
> pci_ers_result_t (*reset_link)(struct pci_dev *pdev));
Now that both functions have descriptive names (thanks for that!),
the "_do" component of the names can be dropped.
> +pci_ers_result_t pcie_do_fatal_recovery(struct pci_dev *dev,
> pci_ers_result_t (*reset_link)(struct pci_dev *pdev))
> +{
> + struct pci_dev *udev;
> + struct pci_bus *parent;
> + struct pci_dev *pdev, *temp;
> + pci_ers_result_t result;
> +
> + if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE)
> + udev = dev;
> + else
> + udev = dev->bus->self;
> +
> + parent = udev->subordinate;
> + pci_walk_bus(parent, pci_dev_set_disconnected, NULL);
> +
> + pci_lock_rescan_remove();
> + pci_dev_get(dev);
> + list_for_each_entry_safe_reverse(pdev, temp, &parent->devices,
> + bus_list) {
> + pci_stop_and_remove_bus_device(pdev);
> + }
> +
> + result = reset_link(udev);
Some of the indentation seems strange here, please use tab based
indents everywhere.