mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-25 19:42:19 +00:00
Merge branch 'pci/misc'
- Convert PCIe capability PCIBIOS errors to errno (Bolarinwa Olayemi Saheed) - Align PCIe capability and PCI accessor return values (Bolarinwa Olayemi Saheed) - Replace http:// links with https:// (Alexander A. Klimov) - Replace lkml.org, spinics, gmane with lore.kernel.org (Bjorn Helgaas) - Update panic message to mention kzalloc(), not kmalloc() (Liao Pingfang) - Move PCI_VENDOR_ID_REDHAT definition to pci_ids.h (Huacai Chen) - Remove unused pci_lost_interrupt() (Heiner Kallweit) * pci/misc: PCI: Remove unused pci_lost_interrupt() PCI: Move PCI_VENDOR_ID_REDHAT definition to pci_ids.h PCI: Fix error in panic message PCI: Replace lkml.org, spinics, gmane with lore.kernel.org PCI: Replace http:// links with https:// PCI: Align PCIe capability and PCI accessor return values PCI: Convert PCIe capability PCIBIOS errors to errno
This commit is contained in:
@@ -405,7 +405,7 @@ int pcie_capability_read_word(struct pci_dev *dev, int pos, u16 *val)
|
||||
|
||||
*val = 0;
|
||||
if (pos & 1)
|
||||
return -EINVAL;
|
||||
return PCIBIOS_BAD_REGISTER_NUMBER;
|
||||
|
||||
if (pcie_capability_reg_implemented(dev, pos)) {
|
||||
ret = pci_read_config_word(dev, pci_pcie_cap(dev) + pos, val);
|
||||
@@ -440,7 +440,7 @@ int pcie_capability_read_dword(struct pci_dev *dev, int pos, u32 *val)
|
||||
|
||||
*val = 0;
|
||||
if (pos & 3)
|
||||
return -EINVAL;
|
||||
return PCIBIOS_BAD_REGISTER_NUMBER;
|
||||
|
||||
if (pcie_capability_reg_implemented(dev, pos)) {
|
||||
ret = pci_read_config_dword(dev, pci_pcie_cap(dev) + pos, val);
|
||||
@@ -465,7 +465,7 @@ EXPORT_SYMBOL(pcie_capability_read_dword);
|
||||
int pcie_capability_write_word(struct pci_dev *dev, int pos, u16 val)
|
||||
{
|
||||
if (pos & 1)
|
||||
return -EINVAL;
|
||||
return PCIBIOS_BAD_REGISTER_NUMBER;
|
||||
|
||||
if (!pcie_capability_reg_implemented(dev, pos))
|
||||
return 0;
|
||||
@@ -477,7 +477,7 @@ EXPORT_SYMBOL(pcie_capability_write_word);
|
||||
int pcie_capability_write_dword(struct pci_dev *dev, int pos, u32 val)
|
||||
{
|
||||
if (pos & 3)
|
||||
return -EINVAL;
|
||||
return PCIBIOS_BAD_REGISTER_NUMBER;
|
||||
|
||||
if (!pcie_capability_reg_implemented(dev, pos))
|
||||
return 0;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
* pcie-dra7xx - PCIe controller driver for TI DRA7xx SoCs
|
||||
*
|
||||
* Copyright (C) 2013-2014 Texas Instruments Incorporated - http://www.ti.com
|
||||
* Copyright (C) 2013-2014 Texas Instruments Incorporated - https://www.ti.com
|
||||
*
|
||||
* Authors: Kishon Vijay Abraham I <kishon@ti.com>
|
||||
*/
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* PCIe host controller driver for Samsung Exynos SoCs
|
||||
*
|
||||
* Copyright (C) 2013 Samsung Electronics Co., Ltd.
|
||||
* http://www.samsung.com
|
||||
* https://www.samsung.com
|
||||
*
|
||||
* Author: Jingoo Han <jg1.han@samsung.com>
|
||||
*/
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* PCIe host controller driver for Freescale i.MX6 SoCs
|
||||
*
|
||||
* Copyright (C) 2013 Kosagi
|
||||
* http://www.kosagi.com
|
||||
* https://www.kosagi.com
|
||||
*
|
||||
* Author: Sean Cross <xobs@kosagi.com>
|
||||
*/
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* PCIe host controller driver for Texas Instruments Keystone SoCs
|
||||
*
|
||||
* Copyright (C) 2013-2014 Texas Instruments., Ltd.
|
||||
* http://www.ti.com
|
||||
* https://www.ti.com
|
||||
*
|
||||
* Author: Murali Karicheri <m-karicheri2@ti.com>
|
||||
* Implementation based on pci-exynos.c and pcie-designware.c
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Synopsys DesignWare PCIe host controller driver
|
||||
*
|
||||
* Copyright (C) 2013 Samsung Electronics Co., Ltd.
|
||||
* http://www.samsung.com
|
||||
* https://www.samsung.com
|
||||
*
|
||||
* Author: Jingoo Han <jg1.han@samsung.com>
|
||||
*/
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Synopsys DesignWare PCIe host controller driver
|
||||
*
|
||||
* Copyright (C) 2013 Samsung Electronics Co., Ltd.
|
||||
* http://www.samsung.com
|
||||
* https://www.samsung.com
|
||||
*
|
||||
* Author: Jingoo Han <jg1.han@samsung.com>
|
||||
*/
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Synopsys DesignWare PCIe host controller driver
|
||||
*
|
||||
* Copyright (C) 2013 Samsung Electronics Co., Ltd.
|
||||
* http://www.samsung.com
|
||||
* https://www.samsung.com
|
||||
*
|
||||
* Author: Jingoo Han <jg1.han@samsung.com>
|
||||
*/
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* PCIe host controller driver for Kirin Phone SoCs
|
||||
*
|
||||
* Copyright (C) 2017 HiSilicon Electronics Co., Ltd.
|
||||
* http://www.huawei.com
|
||||
* https://www.huawei.com
|
||||
*
|
||||
* Author: Xiaowei Song <songxiaowei@huawei.com>
|
||||
*/
|
||||
|
||||
@@ -6,61 +6,11 @@
|
||||
* Copyright (C) 2017 Christoph Hellwig.
|
||||
*/
|
||||
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/pci.h>
|
||||
|
||||
static void pci_note_irq_problem(struct pci_dev *pdev, const char *reason)
|
||||
{
|
||||
struct pci_dev *parent = to_pci_dev(pdev->dev.parent);
|
||||
|
||||
pci_err(pdev, "Potentially misrouted IRQ (Bridge %s %04x:%04x)\n",
|
||||
dev_name(&parent->dev), parent->vendor, parent->device);
|
||||
pci_err(pdev, "%s\n", reason);
|
||||
pci_err(pdev, "Please report to linux-kernel@vger.kernel.org\n");
|
||||
WARN_ON(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* pci_lost_interrupt - reports a lost PCI interrupt
|
||||
* @pdev: device whose interrupt is lost
|
||||
*
|
||||
* The primary function of this routine is to report a lost interrupt
|
||||
* in a standard way which users can recognise (instead of blaming the
|
||||
* driver).
|
||||
*
|
||||
* Returns:
|
||||
* a suggestion for fixing it (although the driver is not required to
|
||||
* act on this).
|
||||
*/
|
||||
enum pci_lost_interrupt_reason pci_lost_interrupt(struct pci_dev *pdev)
|
||||
{
|
||||
if (pdev->msi_enabled || pdev->msix_enabled) {
|
||||
enum pci_lost_interrupt_reason ret;
|
||||
|
||||
if (pdev->msix_enabled) {
|
||||
pci_note_irq_problem(pdev, "MSIX routing failure");
|
||||
ret = PCI_LOST_IRQ_DISABLE_MSIX;
|
||||
} else {
|
||||
pci_note_irq_problem(pdev, "MSI routing failure");
|
||||
ret = PCI_LOST_IRQ_DISABLE_MSI;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
#ifdef CONFIG_ACPI
|
||||
if (!(acpi_disabled || acpi_noirq)) {
|
||||
pci_note_irq_problem(pdev, "Potential ACPI misrouting please reboot with acpi=noirq");
|
||||
/* currently no way to fix acpi on the fly */
|
||||
return PCI_LOST_IRQ_DISABLE_ACPI;
|
||||
}
|
||||
#endif
|
||||
pci_note_irq_problem(pdev, "unknown cause (not MSI or ACPI)");
|
||||
return PCI_LOST_IRQ_NO_INFORMATION;
|
||||
}
|
||||
EXPORT_SYMBOL(pci_lost_interrupt);
|
||||
|
||||
/**
|
||||
* pci_request_irq - allocate an interrupt line for a PCI device
|
||||
* @dev: PCI device to operate on
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* the instance number and string from the type 41 record and exports
|
||||
* it to sysfs.
|
||||
*
|
||||
* Please see http://linux.dell.com/files/biosdevname/ for more
|
||||
* Please see https://linux.dell.com/files/biosdevname/ for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
|
||||
@@ -5708,6 +5708,7 @@ EXPORT_SYMBOL(pcie_get_readrq);
|
||||
int pcie_set_readrq(struct pci_dev *dev, int rq)
|
||||
{
|
||||
u16 v;
|
||||
int ret;
|
||||
|
||||
if (rq < 128 || rq > 4096 || !is_power_of_2(rq))
|
||||
return -EINVAL;
|
||||
@@ -5726,8 +5727,10 @@ int pcie_set_readrq(struct pci_dev *dev, int rq)
|
||||
|
||||
v = (ffs(rq) - 8) << 12;
|
||||
|
||||
return pcie_capability_clear_and_set_word(dev, PCI_EXP_DEVCTL,
|
||||
ret = pcie_capability_clear_and_set_word(dev, PCI_EXP_DEVCTL,
|
||||
PCI_EXP_DEVCTL_READRQ, v);
|
||||
|
||||
return pcibios_err_to_errno(ret);
|
||||
}
|
||||
EXPORT_SYMBOL(pcie_set_readrq);
|
||||
|
||||
@@ -5758,6 +5761,7 @@ EXPORT_SYMBOL(pcie_get_mps);
|
||||
int pcie_set_mps(struct pci_dev *dev, int mps)
|
||||
{
|
||||
u16 v;
|
||||
int ret;
|
||||
|
||||
if (mps < 128 || mps > 4096 || !is_power_of_2(mps))
|
||||
return -EINVAL;
|
||||
@@ -5767,8 +5771,10 @@ int pcie_set_mps(struct pci_dev *dev, int mps)
|
||||
return -EINVAL;
|
||||
v <<= 5;
|
||||
|
||||
return pcie_capability_clear_and_set_word(dev, PCI_EXP_DEVCTL,
|
||||
ret = pcie_capability_clear_and_set_word(dev, PCI_EXP_DEVCTL,
|
||||
PCI_EXP_DEVCTL_PAYLOAD, v);
|
||||
|
||||
return pcibios_err_to_errno(ret);
|
||||
}
|
||||
EXPORT_SYMBOL(pcie_set_mps);
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ config PCIEAER_INJECT
|
||||
error injection can fake almost all kinds of errors with the
|
||||
help of a user space helper tool aer-inject, which can be
|
||||
gotten from:
|
||||
http://www.kernel.org/pub/linux/utils/pci/aer-inject/
|
||||
https://www.kernel.org/pub/linux/utils/pci/aer-inject/
|
||||
|
||||
#
|
||||
# PCI Express ECRC
|
||||
|
||||
@@ -224,20 +224,25 @@ int pcie_aer_is_native(struct pci_dev *dev)
|
||||
|
||||
int pci_enable_pcie_error_reporting(struct pci_dev *dev)
|
||||
{
|
||||
int rc;
|
||||
|
||||
if (!pcie_aer_is_native(dev))
|
||||
return -EIO;
|
||||
|
||||
return pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_AER_FLAGS);
|
||||
rc = pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_AER_FLAGS);
|
||||
return pcibios_err_to_errno(rc);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pci_enable_pcie_error_reporting);
|
||||
|
||||
int pci_disable_pcie_error_reporting(struct pci_dev *dev)
|
||||
{
|
||||
int rc;
|
||||
|
||||
if (!pcie_aer_is_native(dev))
|
||||
return -EIO;
|
||||
|
||||
return pcie_capability_clear_word(dev, PCI_EXP_DEVCTL,
|
||||
PCI_EXP_AER_FLAGS);
|
||||
rc = pcie_capability_clear_word(dev, PCI_EXP_DEVCTL, PCI_EXP_AER_FLAGS);
|
||||
return pcibios_err_to_errno(rc);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pci_disable_pcie_error_reporting);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* trigger various real hardware errors. Software based error
|
||||
* injection can fake almost all kinds of errors with the help of a
|
||||
* user space helper tool aer-inject, which can be gotten from:
|
||||
* http://www.kernel.org/pub/linux/utils/pci/aer-inject/
|
||||
* https://www.kernel.org/pub/linux/utils/pci/aer-inject/
|
||||
*
|
||||
* Copyright 2009 Intel Corporation.
|
||||
* Huang Ying <ying.huang@intel.com>
|
||||
|
||||
@@ -3549,7 +3549,7 @@ static void quirk_no_bus_reset(struct pci_dev *dev)
|
||||
* The device will throw a Link Down error on AER-capable systems and
|
||||
* regardless of AER, config space of the device is never accessible again
|
||||
* and typically causes the system to hang or reset when access is attempted.
|
||||
* http://www.spinics.net/lists/linux-pci/msg34797.html
|
||||
* https://lore.kernel.org/r/20140923210318.498dacbd@dualc.maya.org/
|
||||
*/
|
||||
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATHEROS, 0x0030, quirk_no_bus_reset);
|
||||
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATHEROS, 0x0032, quirk_no_bus_reset);
|
||||
@@ -4378,9 +4378,9 @@ static int pci_acs_ctrl_enabled(u16 acs_ctrl_req, u16 acs_ctrl_ena)
|
||||
* redirect (CR) since all transactions are redirected to the upstream
|
||||
* root complex.
|
||||
*
|
||||
* http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/94086
|
||||
* http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/94102
|
||||
* http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/99402
|
||||
* https://lore.kernel.org/r/201207111426.q6BEQTbh002928@mail.maya.org/
|
||||
* https://lore.kernel.org/r/20120711165854.GM25282@amd.com/
|
||||
* https://lore.kernel.org/r/20121005130857.GX4009@amd.com/
|
||||
*
|
||||
* 1002:4385 SBx00 SMBus Controller
|
||||
* 1002:439c SB7x0/SB8x0/SB9x0 IDE Controller
|
||||
@@ -4620,11 +4620,11 @@ static int pci_quirk_al_acs(struct pci_dev *dev, u16 acs_flags)
|
||||
*
|
||||
* 0x9d10-0x9d1b PCI Express Root port #{1-12}
|
||||
*
|
||||
* [1] http://www.intel.com/content/www/us/en/chipsets/100-series-chipset-datasheet-vol-2.html
|
||||
* [2] http://www.intel.com/content/www/us/en/chipsets/100-series-chipset-datasheet-vol-1.html
|
||||
* [3] http://www.intel.com/content/www/us/en/chipsets/100-series-chipset-spec-update.html
|
||||
* [4] http://www.intel.com/content/www/us/en/chipsets/200-series-chipset-pch-spec-update.html
|
||||
* [5] http://www.intel.com/content/www/us/en/chipsets/200-series-chipset-pch-datasheet-vol-1.html
|
||||
* [1] https://www.intel.com/content/www/us/en/chipsets/100-series-chipset-datasheet-vol-2.html
|
||||
* [2] https://www.intel.com/content/www/us/en/chipsets/100-series-chipset-datasheet-vol-1.html
|
||||
* [3] https://www.intel.com/content/www/us/en/chipsets/100-series-chipset-spec-update.html
|
||||
* [4] https://www.intel.com/content/www/us/en/chipsets/200-series-chipset-pch-spec-update.html
|
||||
* [5] https://www.intel.com/content/www/us/en/chipsets/200-series-chipset-pch-datasheet-vol-1.html
|
||||
* [6] https://www.intel.com/content/www/us/en/processors/core/7th-gen-core-family-mobile-u-y-processor-lines-i-o-spec-update.html
|
||||
* [7] https://www.intel.com/content/www/us/en/processors/core/7th-gen-core-family-mobile-u-y-processor-lines-i-o-datasheet-vol-1.html
|
||||
*/
|
||||
|
||||
@@ -152,7 +152,7 @@ static void pdev_sort_resources(struct pci_dev *dev, struct list_head *head)
|
||||
|
||||
tmp = kzalloc(sizeof(*tmp), GFP_KERNEL);
|
||||
if (!tmp)
|
||||
panic("pdev_sort_resources(): kmalloc() failed!\n");
|
||||
panic("%s: kzalloc() failed!\n", __func__);
|
||||
tmp->res = r;
|
||||
tmp->dev = dev;
|
||||
|
||||
|
||||
@@ -73,7 +73,8 @@ static void pci_std_update_resource(struct pci_dev *dev, int resno)
|
||||
/*
|
||||
* Apparently some Matrox devices have ROM BARs that read
|
||||
* as zero when disabled, so don't update ROM BARs unless
|
||||
* they're enabled. See https://lkml.org/lkml/2005/8/30/138.
|
||||
* they're enabled. See
|
||||
* https://lore.kernel.org/r/43147B3D.1030309@vc.cvut.cz/
|
||||
*/
|
||||
if (!(res->flags & IORESOURCE_ROM_ENABLE))
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user