diff options
Diffstat (limited to 'drivers/pci/hotplug/pciehp_hpc.c')
-rw-r--r-- | drivers/pci/hotplug/pciehp_hpc.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 7bab0606f1a9..18a42f8f5dc5 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * PCI Express PCI Hot Plug Driver | 3 | * PCI Express PCI Hot Plug Driver |
3 | * | 4 | * |
@@ -8,21 +9,6 @@ | |||
8 | * | 9 | * |
9 | * All rights reserved. | 10 | * All rights reserved. |
10 | * | 11 | * |
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License as published by | ||
13 | * the Free Software Foundation; either version 2 of the License, or (at | ||
14 | * your option) any later version. | ||
15 | * | ||
16 | * This program is distributed in the hope that it will be useful, but | ||
17 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | ||
19 | * NON INFRINGEMENT. See the GNU General Public License for more | ||
20 | * details. | ||
21 | * | ||
22 | * You should have received a copy of the GNU General Public License | ||
23 | * along with this program; if not, write to the Free Software | ||
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
25 | * | ||
26 | * Send feedback to <greg@kroah.com>,<kristen.c.accardi@intel.com> | 12 | * Send feedback to <greg@kroah.com>,<kristen.c.accardi@intel.com> |
27 | * | 13 | * |
28 | */ | 14 | */ |
@@ -838,16 +824,22 @@ struct controller *pcie_init(struct pcie_device *dev) | |||
838 | struct pci_dev *pdev = dev->port; | 824 | struct pci_dev *pdev = dev->port; |
839 | 825 | ||
840 | ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); | 826 | ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); |
841 | if (!ctrl) { | 827 | if (!ctrl) |
842 | dev_err(&dev->device, "%s: Out of memory\n", __func__); | ||
843 | goto abort; | 828 | goto abort; |
844 | } | 829 | |
845 | ctrl->pcie = dev; | 830 | ctrl->pcie = dev; |
846 | pcie_capability_read_dword(pdev, PCI_EXP_SLTCAP, &slot_cap); | 831 | pcie_capability_read_dword(pdev, PCI_EXP_SLTCAP, &slot_cap); |
847 | 832 | ||
848 | if (pdev->hotplug_user_indicators) | 833 | if (pdev->hotplug_user_indicators) |
849 | slot_cap &= ~(PCI_EXP_SLTCAP_AIP | PCI_EXP_SLTCAP_PIP); | 834 | slot_cap &= ~(PCI_EXP_SLTCAP_AIP | PCI_EXP_SLTCAP_PIP); |
850 | 835 | ||
836 | /* | ||
837 | * We assume no Thunderbolt controllers support Command Complete events, | ||
838 | * but some controllers falsely claim they do. | ||
839 | */ | ||
840 | if (pdev->is_thunderbolt) | ||
841 | slot_cap |= PCI_EXP_SLTCAP_NCCS; | ||
842 | |||
851 | ctrl->slot_cap = slot_cap; | 843 | ctrl->slot_cap = slot_cap; |
852 | mutex_init(&ctrl->ctrl_lock); | 844 | mutex_init(&ctrl->ctrl_lock); |
853 | init_waitqueue_head(&ctrl->queue); | 845 | init_waitqueue_head(&ctrl->queue); |