diff options
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r-- | drivers/pci/pci.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 625a4ace10b4..a7ac72639c52 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -1012,11 +1012,7 @@ int pci_save_state(struct pci_dev *dev) | |||
1012 | if (i != 0) | 1012 | if (i != 0) |
1013 | return i; | 1013 | return i; |
1014 | 1014 | ||
1015 | i = pci_save_vc_state(dev); | 1015 | return pci_save_vc_state(dev); |
1016 | if (i != 0) | ||
1017 | return i; | ||
1018 | |||
1019 | return 0; | ||
1020 | } | 1016 | } |
1021 | EXPORT_SYMBOL(pci_save_state); | 1017 | EXPORT_SYMBOL(pci_save_state); |
1022 | 1018 | ||
@@ -3144,12 +3140,10 @@ static int pcie_flr(struct pci_dev *dev, int probe) | |||
3144 | return 0; | 3140 | return 0; |
3145 | 3141 | ||
3146 | if (!pci_wait_for_pending_transaction(dev)) | 3142 | if (!pci_wait_for_pending_transaction(dev)) |
3147 | dev_err(&dev->dev, "transaction is not cleared; proceeding with reset anyway\n"); | 3143 | dev_err(&dev->dev, "timed out waiting for pending transaction; performing function level reset anyway\n"); |
3148 | 3144 | ||
3149 | pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_BCR_FLR); | 3145 | pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_BCR_FLR); |
3150 | |||
3151 | msleep(100); | 3146 | msleep(100); |
3152 | |||
3153 | return 0; | 3147 | return 0; |
3154 | } | 3148 | } |
3155 | 3149 | ||
@@ -3174,16 +3168,12 @@ static int pci_af_flr(struct pci_dev *dev, int probe) | |||
3174 | * is used, so we use the conrol offset rather than status and shift | 3168 | * is used, so we use the conrol offset rather than status and shift |
3175 | * the test bit to match. | 3169 | * the test bit to match. |
3176 | */ | 3170 | */ |
3177 | if (pci_wait_for_pending(dev, pos + PCI_AF_CTRL, | 3171 | if (!pci_wait_for_pending(dev, pos + PCI_AF_CTRL, |
3178 | PCI_AF_STATUS_TP << 8)) | 3172 | PCI_AF_STATUS_TP << 8)) |
3179 | goto clear; | 3173 | dev_err(&dev->dev, "timed out waiting for pending transaction; performing AF function level reset anyway\n"); |
3180 | |||
3181 | dev_err(&dev->dev, "transaction is not cleared; proceeding with reset anyway\n"); | ||
3182 | 3174 | ||
3183 | clear: | ||
3184 | pci_write_config_byte(dev, pos + PCI_AF_CTRL, PCI_AF_CTRL_FLR); | 3175 | pci_write_config_byte(dev, pos + PCI_AF_CTRL, PCI_AF_CTRL_FLR); |
3185 | msleep(100); | 3176 | msleep(100); |
3186 | |||
3187 | return 0; | 3177 | return 0; |
3188 | } | 3178 | } |
3189 | 3179 | ||
@@ -4180,7 +4170,8 @@ int pci_resource_bar(struct pci_dev *dev, int resno, enum pci_bar_type *type) | |||
4180 | return dev->rom_base_reg; | 4170 | return dev->rom_base_reg; |
4181 | } else if (resno < PCI_BRIDGE_RESOURCES) { | 4171 | } else if (resno < PCI_BRIDGE_RESOURCES) { |
4182 | /* device specific resource */ | 4172 | /* device specific resource */ |
4183 | reg = pci_iov_resource_bar(dev, resno, type); | 4173 | *type = pci_bar_unknown; |
4174 | reg = pci_iov_resource_bar(dev, resno); | ||
4184 | if (reg) | 4175 | if (reg) |
4185 | return reg; | 4176 | return reg; |
4186 | } | 4177 | } |