Merge branch 'remotes/lorenzo/pci/brcmstb'
authorBjorn Helgaas <bhelgaas@google.com>
Wed, 24 Feb 2021 20:59:20 +0000 (14:59 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 24 Feb 2021 20:59:20 +0000 (14:59 -0600)
- Add support for BCM4908 with external PERST# signal controller (Rafał
  Miłecki)

* remotes/lorenzo/pci/brcmstb:
  PCI: brcmstb: support BCM4908 with external PERST# signal controller
  dt-bindings: PCI: brcmstb: add BCM4908 binding

23 files changed:
MAINTAINERS
arch/s390/include/asm/facility.h
drivers/acpi/pci_root.c
drivers/gpu/drm/qxl/qxl_drv.c
drivers/net/wireless/intel/iwlwifi/fw/file.h
drivers/pci/Makefile
drivers/pci/controller/cadence/pcie-cadence-host.c
drivers/pci/hotplug/acpiphp.h
drivers/pci/pci-bridge-emul.c
drivers/pci/pci.c
drivers/pci/pcie/Kconfig
drivers/pci/pcie/Makefile
drivers/pci/pcie/aer.c
drivers/pci/pcie/bw_notification.c [deleted file]
drivers/pci/pcie/err.c
drivers/pci/pcie/portdrv.h
drivers/pci/pcie/portdrv_pci.c
drivers/pci/search.c
drivers/pci/setup-res.c
drivers/pci/syscall.c
include/linux/acpi.h
include/linux/pci_ids.h
lib/logic_pio.c

index cc1e6a5..52311ef 100644 (file)
@@ -2603,7 +2603,7 @@ L:        linux-kernel@vger.kernel.org
 S:     Maintained
 F:     drivers/clk/keystone/
 
-ARM/TEXAS INSTRUMENT KEYSTONE ClOCKSOURCE
+ARM/TEXAS INSTRUMENT KEYSTONE CLOCKSOURCE
 M:     Santosh Shilimkar <ssantosh@kernel.org>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 L:     linux-kernel@vger.kernel.org
index 68c476b..91b5d71 100644 (file)
@@ -44,7 +44,7 @@ static inline int __test_facility(unsigned long nr, void *facilities)
 }
 
 /*
- * The test_facility function uses the bit odering where the MSB is bit 0.
+ * The test_facility function uses the bit ordering where the MSB is bit 0.
  * That makes it easier to query facility bits with the bit number as
  * documented in the Principles of Operation.
  */
index 0bf072c..dcd5937 100644 (file)
@@ -56,8 +56,6 @@ static struct acpi_scan_handler pci_root_handler = {
        },
 };
 
-static DEFINE_MUTEX(osc_lock);
-
 /**
  * acpi_is_root_bridge - determine whether an ACPI CA node is a PCI root bridge
  * @handle:  the ACPI CA node in question.
@@ -223,12 +221,7 @@ static acpi_status acpi_pci_query_osc(struct acpi_pci_root *root,
 
 static acpi_status acpi_pci_osc_support(struct acpi_pci_root *root, u32 flags)
 {
-       acpi_status status;
-
-       mutex_lock(&osc_lock);
-       status = acpi_pci_query_osc(root, flags, NULL);
-       mutex_unlock(&osc_lock);
-       return status;
+       return acpi_pci_query_osc(root, flags, NULL);
 }
 
 struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle)
@@ -353,10 +346,10 @@ EXPORT_SYMBOL_GPL(acpi_get_pci_dev);
  * _OSC bits the BIOS has granted control of, but its contents are meaningless
  * on failure.
  **/
-acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 *mask, u32 req)
+static acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 *mask, u32 req)
 {
        struct acpi_pci_root *root;
-       acpi_status status = AE_OK;
+       acpi_status status;
        u32 ctrl, capbuf[3];
 
        if (!mask)
@@ -370,18 +363,16 @@ acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 *mask, u32 req)
        if (!root)
                return AE_NOT_EXIST;
 
-       mutex_lock(&osc_lock);
-
        *mask = ctrl | root->osc_control_set;
        /* No need to evaluate _OSC if the control was already granted. */
        if ((root->osc_control_set & ctrl) == ctrl)
-               goto out;
+               return AE_OK;
 
        /* Need to check the available controls bits before requesting them. */
        while (*mask) {
                status = acpi_pci_query_osc(root, root->osc_support_set, mask);
                if (ACPI_FAILURE(status))
-                       goto out;
+                       return status;
                if (ctrl == *mask)
                        break;
                decode_osc_control(root, "platform does not support",
@@ -392,21 +383,19 @@ acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 *mask, u32 req)
        if ((ctrl & req) != req) {
                decode_osc_control(root, "not requesting control; platform does not support",
                                   req & ~(ctrl));
-               status = AE_SUPPORT;
-               goto out;
+               return AE_SUPPORT;
        }
 
        capbuf[OSC_QUERY_DWORD] = 0;
        capbuf[OSC_SUPPORT_DWORD] = root->osc_support_set;
        capbuf[OSC_CONTROL_DWORD] = ctrl;
        status = acpi_pci_run_osc(handle, capbuf, mask);
-       if (ACPI_SUCCESS(status))
-               root->osc_control_set = *mask;
-out:
-       mutex_unlock(&osc_lock);
-       return status;
+       if (ACPI_FAILURE(status))
+               return status;
+
+       root->osc_control_set = *mask;
+       return AE_OK;
 }
-EXPORT_SYMBOL(acpi_pci_osc_control_set);
 
 static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm,
                                 bool is_pcie)
@@ -452,9 +441,8 @@ static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm,
                if ((status == AE_NOT_FOUND) && !is_pcie)
                        return;
 
-               dev_info(&device->dev, "_OSC failed (%s)%s\n",
-                        acpi_format_exception(status),
-                        pcie_aspm_support_enabled() ? "; disabling ASPM" : "");
+               dev_info(&device->dev, "_OSC: platform retains control of PCIe features (%s)\n",
+                        acpi_format_exception(status));
                return;
        }
 
@@ -510,7 +498,7 @@ static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm,
        } else {
                decode_osc_control(root, "OS requested", requested);
                decode_osc_control(root, "platform willing to grant", control);
-               dev_info(&device->dev, "_OSC failed (%s); disabling ASPM\n",
+               dev_info(&device->dev, "_OSC: platform retains control of PCIe features (%s)\n",
                        acpi_format_exception(status));
 
                /*
index 6e7f16f..dab190a 100644 (file)
@@ -141,7 +141,7 @@ static void qxl_drm_release(struct drm_device *dev)
 
        /*
         * TODO: qxl_device_fini() call should be in qxl_pci_remove(),
-        * reodering qxl_modeset_fini() + qxl_device_fini() calls is
+        * reordering qxl_modeset_fini() + qxl_device_fini() calls is
         * non-trivial though.
         */
        qxl_modeset_fini(qdev);
index 597bc88..04fbfe5 100644 (file)
@@ -866,7 +866,7 @@ struct iwl_fw_dbg_trigger_time_event {
  * tx_bar: tid bitmap to configure on what tid the trigger should occur
  *     when a BAR is send (for an Rx BlocAck session).
  * frame_timeout: tid bitmap to configure on what tid the trigger should occur
- *     when a frame times out in the reodering buffer.
+ *     when a frame times out in the reordering buffer.
  */
 struct iwl_fw_dbg_trigger_ba {
        __le16 rx_ba_start;
index 11cc794..d62c4ac 100644 (file)
@@ -36,4 +36,4 @@ obj-$(CONFIG_PCI_ENDPOINT)    += endpoint/
 obj-y                          += controller/
 obj-y                          += switch/
 
-ccflags-$(CONFIG_PCI_DEBUG) := -DDEBUG
+subdir-ccflags-$(CONFIG_PCI_DEBUG) := -DDEBUG
index 811c1cb..1cb7cfc 100644 (file)
@@ -321,9 +321,10 @@ static int cdns_pcie_host_map_dma_ranges(struct cdns_pcie_rc *rc)
 
        resource_list_for_each_entry(entry, &bridge->dma_ranges) {
                err = cdns_pcie_host_bar_config(rc, entry);
-               if (err)
+               if (err) {
                        dev_err(dev, "Fail to configure IB using dma-ranges\n");
-               return err;
+                       return err;
+               }
        }
 
        return 0;
index a2094c0..a74b274 100644 (file)
@@ -176,9 +176,6 @@ int acpiphp_unregister_attention(struct acpiphp_attention_info *info);
 int acpiphp_register_hotplug_slot(struct acpiphp_slot *slot, unsigned int sun);
 void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *slot);
 
-/* acpiphp_glue.c */
-typedef int (*acpiphp_callback)(struct acpiphp_slot *slot, void *data);
-
 int acpiphp_enable_slot(struct acpiphp_slot *slot);
 int acpiphp_disable_slot(struct acpiphp_slot *slot);
 u8 acpiphp_get_power_status(struct acpiphp_slot *slot);
index 139869d..fdaf86a 100644 (file)
@@ -21,8 +21,9 @@
 #include "pci-bridge-emul.h"
 
 #define PCI_BRIDGE_CONF_END    PCI_STD_HEADER_SIZEOF
+#define PCI_CAP_PCIE_SIZEOF    (PCI_EXP_SLTSTA2 + 2)
 #define PCI_CAP_PCIE_START     PCI_BRIDGE_CONF_END
-#define PCI_CAP_PCIE_END       (PCI_CAP_PCIE_START + PCI_EXP_SLTSTA2 + 2)
+#define PCI_CAP_PCIE_END       (PCI_CAP_PCIE_START + PCI_CAP_PCIE_SIZEOF)
 
 /**
  * struct pci_bridge_reg_behavior - register bits behaviors
@@ -46,7 +47,8 @@ struct pci_bridge_reg_behavior {
        u32 w1c;
 };
 
-static const struct pci_bridge_reg_behavior pci_regs_behavior[] = {
+static const
+struct pci_bridge_reg_behavior pci_regs_behavior[PCI_STD_HEADER_SIZEOF / 4] = {
        [PCI_VENDOR_ID / 4] = { .ro = ~0 },
        [PCI_COMMAND / 4] = {
                .rw = (PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
@@ -164,7 +166,8 @@ static const struct pci_bridge_reg_behavior pci_regs_behavior[] = {
        },
 };
 
-static const struct pci_bridge_reg_behavior pcie_cap_regs_behavior[] = {
+static const
+struct pci_bridge_reg_behavior pcie_cap_regs_behavior[PCI_CAP_PCIE_SIZEOF / 4] = {
        [PCI_CAP_LIST_ID / 4] = {
                /*
                 * Capability ID, Next Capability Pointer and
@@ -260,6 +263,8 @@ static const struct pci_bridge_reg_behavior pcie_cap_regs_behavior[] = {
 int pci_bridge_emul_init(struct pci_bridge_emul *bridge,
                         unsigned int flags)
 {
+       BUILD_BUG_ON(sizeof(bridge->conf) != PCI_BRIDGE_CONF_END);
+
        bridge->conf.class_revision |= cpu_to_le32(PCI_CLASS_BRIDGE_PCI << 16);
        bridge->conf.header_type = PCI_HEADER_TYPE_BRIDGE;
        bridge->conf.cache_line_size = 0x10;
index b9fecc2..50b55a1 100644 (file)
@@ -4029,6 +4029,10 @@ int pci_register_io_range(struct fwnode_handle *fwnode, phys_addr_t addr,
        ret = logic_pio_register_range(range);
        if (ret)
                kfree(range);
+
+       /* Ignore duplicates due to deferred probing */
+       if (ret == -EEXIST)
+               ret = 0;
 #endif
 
        return ret;
index 3946555..45a2ef7 100644 (file)
@@ -133,14 +133,6 @@ config PCIE_PTM
          This is only useful if you have devices that support PTM, but it
          is safe to enable even if you don't.
 
-config PCIE_BW
-       bool "PCI Express Bandwidth Change Notification"
-       depends on PCIEPORTBUS
-       help
-         This enables PCI Express Bandwidth Change Notification.  If
-         you know link width or rate changes occur only to correct
-         unreliable links, you may answer Y.
-
 config PCIE_EDR
        bool "PCI Express Error Disconnect Recover support"
        depends on PCIE_DPC && ACPI
index d969789..b2980db 100644 (file)
@@ -12,5 +12,4 @@ obj-$(CONFIG_PCIEAER_INJECT)  += aer_inject.o
 obj-$(CONFIG_PCIE_PME)         += pme.o
 obj-$(CONFIG_PCIE_DPC)         += dpc.o
 obj-$(CONFIG_PCIE_PTM)         += ptm.o
-obj-$(CONFIG_PCIE_BW)          += bw_notification.o
 obj-$(CONFIG_PCIE_EDR)         += edr.o
index 77b0f2c..ba22388 100644 (file)
@@ -1388,7 +1388,7 @@ static pci_ers_result_t aer_root_reset(struct pci_dev *dev)
        if (type == PCI_EXP_TYPE_RC_END)
                root = dev->rcec;
        else
-               root = dev;
+               root = pcie_find_root_port(dev);
 
        /*
         * If the platform retained control of AER, an RCiEP may not have
@@ -1414,7 +1414,8 @@ static pci_ers_result_t aer_root_reset(struct pci_dev *dev)
                }
        } else {
                rc = pci_bus_error_reset(dev);
-               pci_info(dev, "Root Port link has been reset (%d)\n", rc);
+               pci_info(dev, "%s Port link has been reset (%d)\n",
+                       pci_is_root_bus(dev->bus) ? "Root" : "Downstream", rc);
        }
 
        if ((host->native_aer || pcie_ports_native) && aer) {
diff --git a/drivers/pci/pcie/bw_notification.c b/drivers/pci/pcie/bw_notification.c
deleted file mode 100644 (file)
index 565d23c..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * PCI Express Link Bandwidth Notification services driver
- * Author: Alexandru Gagniuc <mr.nuke.me@gmail.com>
- *
- * Copyright (C) 2019, Dell Inc
- *
- * The PCIe Link Bandwidth Notification provides a way to notify the
- * operating system when the link width or data rate changes.  This
- * capability is required for all root ports and downstream ports
- * supporting links wider than x1 and/or multiple link speeds.
- *
- * This service port driver hooks into the bandwidth notification interrupt
- * and warns when links become degraded in operation.
- */
-
-#define dev_fmt(fmt) "bw_notification: " fmt
-
-#include "../pci.h"
-#include "portdrv.h"
-
-static bool pcie_link_bandwidth_notification_supported(struct pci_dev *dev)
-{
-       int ret;
-       u32 lnk_cap;
-
-       ret = pcie_capability_read_dword(dev, PCI_EXP_LNKCAP, &lnk_cap);
-       return (ret == PCIBIOS_SUCCESSFUL) && (lnk_cap & PCI_EXP_LNKCAP_LBNC);
-}
-
-static void pcie_enable_link_bandwidth_notification(struct pci_dev *dev)
-{
-       u16 lnk_ctl;
-
-       pcie_capability_write_word(dev, PCI_EXP_LNKSTA, PCI_EXP_LNKSTA_LBMS);
-
-       pcie_capability_read_word(dev, PCI_EXP_LNKCTL, &lnk_ctl);
-       lnk_ctl |= PCI_EXP_LNKCTL_LBMIE;
-       pcie_capability_write_word(dev, PCI_EXP_LNKCTL, lnk_ctl);
-}
-
-static void pcie_disable_link_bandwidth_notification(struct pci_dev *dev)
-{
-       u16 lnk_ctl;
-
-       pcie_capability_read_word(dev, PCI_EXP_LNKCTL, &lnk_ctl);
-       lnk_ctl &= ~PCI_EXP_LNKCTL_LBMIE;
-       pcie_capability_write_word(dev, PCI_EXP_LNKCTL, lnk_ctl);
-}
-
-static irqreturn_t pcie_bw_notification_irq(int irq, void *context)
-{
-       struct pcie_device *srv = context;
-       struct pci_dev *port = srv->port;
-       u16 link_status, events;
-       int ret;
-
-       ret = pcie_capability_read_word(port, PCI_EXP_LNKSTA, &link_status);
-       events = link_status & PCI_EXP_LNKSTA_LBMS;
-
-       if (ret != PCIBIOS_SUCCESSFUL || !events)
-               return IRQ_NONE;
-
-       pcie_capability_write_word(port, PCI_EXP_LNKSTA, events);
-       pcie_update_link_speed(port->subordinate, link_status);
-       return IRQ_WAKE_THREAD;
-}
-
-static irqreturn_t pcie_bw_notification_handler(int irq, void *context)
-{
-       struct pcie_device *srv = context;
-       struct pci_dev *port = srv->port;
-       struct pci_dev *dev;
-
-       /*
-        * Print status from downstream devices, not this root port or
-        * downstream switch port.
-        */
-       down_read(&pci_bus_sem);
-       list_for_each_entry(dev, &port->subordinate->devices, bus_list)
-               pcie_report_downtraining(dev);
-       up_read(&pci_bus_sem);
-
-       return IRQ_HANDLED;
-}
-
-static int pcie_bandwidth_notification_probe(struct pcie_device *srv)
-{
-       int ret;
-
-       /* Single-width or single-speed ports do not have to support this. */
-       if (!pcie_link_bandwidth_notification_supported(srv->port))
-               return -ENODEV;
-
-       ret = request_threaded_irq(srv->irq, pcie_bw_notification_irq,
-                                  pcie_bw_notification_handler,
-                                  IRQF_SHARED, "PCIe BW notif", srv);
-       if (ret)
-               return ret;
-
-       pcie_enable_link_bandwidth_notification(srv->port);
-       pci_info(srv->port, "enabled with IRQ %d\n", srv->irq);
-
-       return 0;
-}
-
-static void pcie_bandwidth_notification_remove(struct pcie_device *srv)
-{
-       pcie_disable_link_bandwidth_notification(srv->port);
-       free_irq(srv->irq, srv);
-}
-
-static int pcie_bandwidth_notification_suspend(struct pcie_device *srv)
-{
-       pcie_disable_link_bandwidth_notification(srv->port);
-       return 0;
-}
-
-static int pcie_bandwidth_notification_resume(struct pcie_device *srv)
-{
-       pcie_enable_link_bandwidth_notification(srv->port);
-       return 0;
-}
-
-static struct pcie_port_service_driver pcie_bandwidth_notification_driver = {
-       .name           = "pcie_bw_notification",
-       .port_type      = PCIE_ANY_PORT,
-       .service        = PCIE_PORT_SERVICE_BWNOTIF,
-       .probe          = pcie_bandwidth_notification_probe,
-       .suspend        = pcie_bandwidth_notification_suspend,
-       .resume         = pcie_bandwidth_notification_resume,
-       .remove         = pcie_bandwidth_notification_remove,
-};
-
-int __init pcie_bandwidth_notification_init(void)
-{
-       return pcie_port_service_register(&pcie_bandwidth_notification_driver);
-}
index 510f31f..b576aa8 100644 (file)
@@ -198,8 +198,7 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev,
        pci_dbg(bridge, "broadcast error_detected message\n");
        if (state == pci_channel_io_frozen) {
                pci_walk_bridge(bridge, report_frozen_detected, &status);
-               status = reset_subordinates(bridge);
-               if (status != PCI_ERS_RESULT_RECOVERED) {
+               if (reset_subordinates(bridge) != PCI_ERS_RESULT_RECOVERED) {
                        pci_warn(bridge, "subordinate device reset failed\n");
                        goto failed;
                }
@@ -231,15 +230,14 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev,
        pci_walk_bridge(bridge, report_resume, &status);
 
        /*
-        * If we have native control of AER, clear error status in the Root
-        * Port or Downstream Port that signaled the error.  If the
-        * platform retained control of AER, it is responsible for clearing
-        * this status.  In that case, the signaling device may not even be
-        * visible to the OS.
+        * If we have native control of AER, clear error status in the device
+        * that detected the error.  If the platform retained control of AER,
+        * it is responsible for clearing this status.  In that case, the
+        * signaling device may not even be visible to the OS.
         */
        if (host->native_aer || pcie_ports_native) {
-               pcie_clear_device_status(bridge);
-               pci_aer_clear_nonfatal_status(bridge);
+               pcie_clear_device_status(dev);
+               pci_aer_clear_nonfatal_status(dev);
        }
        pci_info(bridge, "device recovery successful\n");
        return status;
index af7cf23..2ff5724 100644 (file)
@@ -53,12 +53,6 @@ int pcie_dpc_init(void);
 static inline int pcie_dpc_init(void) { return 0; }
 #endif
 
-#ifdef CONFIG_PCIE_BW
-int pcie_bandwidth_notification_init(void);
-#else
-static inline int pcie_bandwidth_notification_init(void) { return 0; }
-#endif
-
 /* Port Type */
 #define PCIE_ANY_PORT                  (~0)
 
index 0b250bc..c7ff1ee 100644 (file)
@@ -153,7 +153,8 @@ static void pcie_portdrv_remove(struct pci_dev *dev)
 static pci_ers_result_t pcie_portdrv_error_detected(struct pci_dev *dev,
                                        pci_channel_state_t error)
 {
-       /* Root Port has no impact. Always recovers. */
+       if (error == pci_channel_io_frozen)
+               return PCI_ERS_RESULT_NEED_RESET;
        return PCI_ERS_RESULT_CAN_RECOVER;
 }
 
@@ -255,7 +256,6 @@ static void __init pcie_init_services(void)
        pcie_pme_init();
        pcie_dpc_init();
        pcie_hp_init();
-       pcie_bandwidth_notification_init();
 }
 
 static int __init pcie_portdrv_init(void)
index 2061672..b4c138a 100644 (file)
@@ -168,7 +168,6 @@ struct pci_bus *pci_find_next_bus(const struct pci_bus *from)
        struct list_head *n;
        struct pci_bus *b = NULL;
 
-       WARN_ON(in_interrupt());
        down_read(&pci_bus_sem);
        n = from ? from->node.next : pci_root_buses.next;
        if (n != &pci_root_buses)
@@ -196,7 +195,6 @@ struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn)
 {
        struct pci_dev *dev;
 
-       WARN_ON(in_interrupt());
        down_read(&pci_bus_sem);
 
        list_for_each_entry(dev, &bus->devices, bus_list) {
@@ -274,7 +272,6 @@ static struct pci_dev *pci_get_dev_by_id(const struct pci_device_id *id,
        struct device *dev_start = NULL;
        struct pci_dev *pdev = NULL;
 
-       WARN_ON(in_interrupt());
        if (from)
                dev_start = &from->dev;
        dev = bus_find_device(&pci_bus_type, dev_start, (void *)id,
@@ -381,7 +378,6 @@ int pci_dev_present(const struct pci_device_id *ids)
 {
        struct pci_dev *found = NULL;
 
-       WARN_ON(in_interrupt());
        while (ids->vendor || ids->subvendor || ids->class_mask) {
                found = pci_get_dev_by_id(ids, NULL);
                if (found) {
index 43eda10..7f1acb3 100644 (file)
@@ -410,10 +410,16 @@ EXPORT_SYMBOL(pci_release_resource);
 int pci_resize_resource(struct pci_dev *dev, int resno, int size)
 {
        struct resource *res = dev->resource + resno;
+       struct pci_host_bridge *host;
        int old, ret;
        u32 sizes;
        u16 cmd;
 
+       /* Check if we must preserve the firmware's resource assignment */
+       host = pci_find_host_bridge(dev->bus);
+       if (host->preserve_config)
+               return -ENOTSUPP;
+
        /* Make sure the resource isn't assigned before resizing it. */
        if (!(res->flags & IORESOURCE_UNSET))
                return -EBUSY;
index 31e3955..8b003c8 100644 (file)
@@ -20,7 +20,7 @@ SYSCALL_DEFINE5(pciconfig_read, unsigned long, bus, unsigned long, dfn,
        u16 word;
        u32 dword;
        long err;
-       long cfg_ret;
+       int cfg_ret;
 
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
@@ -46,7 +46,7 @@ SYSCALL_DEFINE5(pciconfig_read, unsigned long, bus, unsigned long, dfn,
        }
 
        err = -EIO;
-       if (cfg_ret != PCIBIOS_SUCCESSFUL)
+       if (cfg_ret)
                goto error;
 
        switch (len) {
@@ -105,7 +105,7 @@ SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn,
                if (err)
                        break;
                err = pci_user_write_config_byte(dev, off, byte);
-               if (err != PCIBIOS_SUCCESSFUL)
+               if (err)
                        err = -EIO;
                break;
 
@@ -114,7 +114,7 @@ SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn,
                if (err)
                        break;
                err = pci_user_write_config_word(dev, off, word);
-               if (err != PCIBIOS_SUCCESSFUL)
+               if (err)
                        err = -EIO;
                break;
 
@@ -123,7 +123,7 @@ SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn,
                if (err)
                        break;
                err = pci_user_write_config_dword(dev, off, dword);
-               if (err != PCIBIOS_SUCCESSFUL)
+               if (err)
                        err = -EIO;
                break;
 
index 053bf05..4703daa 100644 (file)
@@ -581,9 +581,6 @@ extern bool osc_pc_lpi_support_confirmed;
 #define ACPI_GSB_ACCESS_ATTRIB_RAW_BYTES       0x0000000E
 #define ACPI_GSB_ACCESS_ATTRIB_RAW_PROCESS     0x0000000F
 
-extern acpi_status acpi_pci_osc_control_set(acpi_handle handle,
-                                            u32 *mask, u32 req);
-
 /* Enable _OST when all relevant hotplug operations are enabled */
 #if defined(CONFIG_ACPI_HOTPLUG_CPU) &&                        \
        defined(CONFIG_ACPI_HOTPLUG_MEMORY) &&          \
index d8156a5..aae07d5 100644 (file)
 
 #define PCI_VENDOR_ID_REDHAT           0x1b36
 
+#define PCI_VENDOR_ID_SILICOM_DENMARK  0x1c2c
+
 #define PCI_VENDOR_ID_AMAZON_ANNAPURNA_LABS    0x1c36
 
 #define PCI_VENDOR_ID_CIRCUITCO                0x1cc8
index f32fe48..07b4b9a 100644 (file)
@@ -28,6 +28,8 @@ static DEFINE_MUTEX(io_range_mutex);
  * @new_range: pointer to the IO range to be registered.
  *
  * Returns 0 on success, the error code in case of failure.
+ * If the range already exists, -EEXIST will be returned, which should be
+ * considered a success.
  *
  * Register a new IO range node in the IO range list.
  */
@@ -51,6 +53,7 @@ int logic_pio_register_range(struct logic_pio_hwaddr *new_range)
        list_for_each_entry(range, &io_range_list, list) {
                if (range->fwnode == new_range->fwnode) {
                        /* range already there */
+                       ret = -EEXIST;
                        goto end_register;
                }
                if (range->flags == LOGIC_PIO_CPU_MMIO &&