18 Nov, 2016

1 commit

  • We're about to add runtime PM of hotplug ports, but we need to restrict it
    to ports that are handled natively by the OS: If they're handled by the
    firmware (which is the case for Thunderbolt on non-Macs), things would
    break if the OS put the ports into D3hot behind the firmware's back.

    To determine if a hotplug port is handled natively, one has to walk up from
    the port to the root bridge and check the cached _OSC Control Field for the
    value of the "PCI Express Native Hot Plug control" bit. There's already a
    function to do that, device_is_managed_by_native_pciehp(), but it's private
    to drivers/pci/hotplug/acpiphp_glue.c and only compiled in if
    CONFIG_HOTPLUG_PCI_ACPI is enabled.

    Make it public and move it to drivers/pci/pci-acpi.c, so that it is
    available in the more general CONFIG_ACPI case.

    The function contains a check if the device in question is a hotplug port
    and returns false if it's not. The caller we're going to add doesn't need
    this as it only calls the function if it actually *is* a hotplug port.
    Move the check out of the function into the single existing caller.

    Rename it to pciehp_is_native() and add some kerneldoc and polish.

    No functional change intended.

    Tested-by: Mika Westerberg
    Signed-off-by: Lukas Wunner
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Rafael J. Wysocki

    Lukas Wunner
     

14 Nov, 2014

1 commit

  • to_hotplug_slot() is unused and wouldn't work anyway, because struct
    hotplug_slot no longer contains a struct kobject (it was removed by
    f46753c5e354 ("PCI: introduce pci_slot")).

    Remove to_hotplug_slot().

    [bhelgaas: changelog]
    Signed-off-by: Gavin Shan
    Signed-off-by: Bjorn Helgaas

    Gavin Shan
     

13 Sep, 2014

1 commit


07 Dec, 2013

1 commit

  • Replace direct inclusions of , and
    , which are incorrect, with
    inclusions and remove some inclusions of those files that aren't
    necessary.

    First of all, , and
    should not be included directly from any files that are built for
    CONFIG_ACPI unset, because that generally leads to build warnings about
    undefined symbols in !CONFIG_ACPI builds. For CONFIG_ACPI set,
    includes those files and for CONFIG_ACPI unset it
    provides stub ACPI symbols to be used in that case.

    Second, there are ordering dependencies between those files that always
    have to be met. Namely, it is required that be included
    prior to so that the acpi_pci_root declarations the
    latter depends on are always there. And which provides
    basic ACPICA type declarations should always be included prior to any other
    ACPI headers in CONFIG_ACPI builds. That also is taken care of including
    as appropriate.

    Signed-off-by: Lv Zheng
    Cc: Greg Kroah-Hartman
    Cc: Matthew Garrett
    Cc: Tony Luck
    Cc: "H. Peter Anvin"
    Acked-by: Bjorn Helgaas (drivers/pci stuff)
    Acked-by: Konrad Rzeszutek Wilk (Xen stuff)
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

15 Nov, 2013

1 commit


06 Sep, 2013

1 commit

  • Pull networking changes from David Miller:
    "Noteworthy changes this time around:

    1) Multicast rejoin support for team driver, from Jiri Pirko.

    2) Centralize and simplify TCP RTT measurement handling in order to
    reduce the impact of bad RTO seeding from SYN/ACKs. Also, when
    both timestamps and local RTT measurements are available prefer
    the later because there are broken middleware devices which
    scramble the timestamp.

    From Yuchung Cheng.

    3) Add TCP_NOTSENT_LOWAT socket option to limit the amount of kernel
    memory consumed to queue up unsend user data. From Eric Dumazet.

    4) Add a "physical port ID" abstraction for network devices, from
    Jiri Pirko.

    5) Add a "suppress" operation to influence fib_rules lookups, from
    Stefan Tomanek.

    6) Add a networking development FAQ, from Paul Gortmaker.

    7) Extend the information provided by tcp_probe and add ipv6 support,
    from Daniel Borkmann.

    8) Use RCU locking more extensively in openvswitch data paths, from
    Pravin B Shelar.

    9) Add SCTP support to openvswitch, from Joe Stringer.

    10) Add EF10 chip support to SFC driver, from Ben Hutchings.

    11) Add new SYNPROXY netfilter target, from Patrick McHardy.

    12) Compute a rate approximation for sending in TCP sockets, and use
    this to more intelligently coalesce TSO frames. Furthermore, add
    a new packet scheduler which takes advantage of this estimate when
    available. From Eric Dumazet.

    13) Allow AF_PACKET fanouts with random selection, from Daniel
    Borkmann.

    14) Add ipv6 support to vxlan driver, from Cong Wang"

    Resolved conflicts as per discussion.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1218 commits)
    openvswitch: Fix alignment of struct sw_flow_key.
    netfilter: Fix build errors with xt_socket.c
    tcp: Add missing braces to do_tcp_setsockopt
    caif: Add missing braces to multiline if in cfctrl_linkup_request
    bnx2x: Add missing braces in bnx2x:bnx2x_link_initialize
    vxlan: Fix kernel panic on device delete.
    net: mvneta: implement ->ndo_do_ioctl() to support PHY ioctls
    net: mvneta: properly disable HW PHY polling and ensure adjust_link() works
    icplus: Use netif_running to determine device state
    ethernet/arc/arc_emac: Fix huge delays in large file copies
    tuntap: orphan frags before trying to set tx timestamp
    tuntap: purge socket error queue on detach
    qlcnic: use standard NAPI weights
    ipv6:introduce function to find route for redirect
    bnx2x: VF RSS support - VF side
    bnx2x: VF RSS support - PF side
    vxlan: Notify drivers for listening UDP port changes
    net: usbnet: update addr_assign_type if appropriate
    driver/net: enic: update enic maintainers and driver
    driver/net: enic: Exposing symbols for Cisco's low latency driver
    ...

    Linus Torvalds
     

15 Aug, 2013

1 commit

  • This optional callback allows hotplug controllers to perform slot
    specific resets. These may be necessary in cases where a normal
    secondary bus reset can interact with controller logic and expose
    spurious hotplugs.

    Signed-off-by: Alex Williamson
    Signed-off-by: Bjorn Helgaas

    Alex Williamson
     

31 Jul, 2013

1 commit

  • pcie_link_width is the enum used to define the link width values for a pcie
    device. This enum should not be contained solely in pci_hotplug.h, and this
    patch moves it next to pci_bus_speed in pci.h

    Signed-off-by: Jacob Keller
    Tested-by: Phil Schmitt
    Acked-by: Bjorn Helgaas
    Signed-off-by: Jeff Kirsher

    Jacob Keller
     

18 Apr, 2013

1 commit


01 Nov, 2011

1 commit

  • The original implementations reference THIS_MODULE in an inline.
    We could include , but it is better to avoid chaining.

    Fortunately someone else already thought of this, and made a similar
    inline into a #define in for device_schedule_callback(),
    [see commit 523ded71de0] so follow that precedent here.

    Also bubble up any __must_check that were used on the prev. wrapper inline
    functions up one to the real __register functions, to preserve any prev.
    sanity checks that were used in those instances.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

23 Feb, 2010

2 commits


15 Sep, 2009

3 commits

  • Use the generic pci_configure_slot() rather than the acpiphp-specific
    decode_hpp() and program_hpp().

    Unlike the previous acpiphp-specific code, pci_configure_slot() programs
    PCIe settings when an _HPX method provides them, so acpiphp-managed PCIe
    devices can now be configured.

    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Kenji Kaneshige
    Acked-by: Kenji Kaneshige
    Signed-off-by: Jesse Barnes

    Bjorn Helgaas
     
  • This patch adds a new pci_configure_slot() function that programs the
    PCI bus characteristics for a newly-added device. This is based on
    code in pciehp_pci.c, but should be generic enough to be used by pciehp,
    shpchp, and acpiphp.

    The hotplug_params struct and the program_hpp_typeX() functions are based
    on the ACPI definitions, but they aren't really ACPI-specific, and there's
    no alternate implementation, so I don't see the need to abstract them yet.

    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Alex Chiang
    Reviewed-by: Kenji Kaneshige
    Acked-by: Kenji Kaneshige
    Signed-off-by: Jesse Barnes

    Bjorn Helgaas
     
  • This patch makes acpi_get_hp_params_from_firmware() take a
    pci_dev rather than a pci_bus and makes it return a standard
    int errno rather than acpi_status.

    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Kenji Kaneshige
    Acked-by: Kenji Kaneshige
    Signed-off-by: Jesse Barnes

    Bjorn Helgaas
     

14 Sep, 2009

1 commit


10 Sep, 2009

1 commit


24 Jun, 2009

1 commit


18 Jun, 2009

1 commit

  • Returns whether an ACPI CA node is a PCI root bridge or not.

    This API is generically useful, and shouldn't just be a hotplug function.

    The implementation becomes much simpler as well.

    Signed-off-by: Alex Chiang
    Acked-by: Bjorn Helgaas
    Signed-off-by: Len Brown

    Alexander Chiang
     

17 Jun, 2009

2 commits

  • Create symbolic link to hotplug driver module in the PCI slot
    directory (/sys/bus/pci/slots/). In the past, we need to load
    hotplug drivers one by one to identify the hotplug driver that handles
    the slot, and it was very inconvenient especially for trouble shooting.
    With this change, we can easily identify the hotplug driver.

    Signed-off-by: Taku Izumi
    Signed-off-by: Kenji Kaneshige
    Reviewed-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    Kenji Kaneshige
     
  • The EMI support in pciehp is obviously broken. It is implemented using
    struct hotplug_slot_attribute, but sysfs_ops for pci_slot_ktype is NOT
    for struct hotplug_slot_attribute, but for struct pci_slot_attribute.
    This bug had been there for a long time, maybe it was introduced when
    PCI slot framework was introduced. The reason why this bug didn't
    cause any problem is maybe the EMI support is not tested at all
    because of lack of test environment.

    As described above, the EMI support in pciehp seems not to be tested
    at all. So this patch removes EMI support from pciehp, instead of
    fixing the bug.

    Signed-off-by: Kenji Kaneshige
    Signed-off-by: Jesse Barnes

    Kenji Kaneshige
     

09 Jan, 2009

1 commit


08 Jan, 2009

1 commit

  • Some ACPI related PCI hotplug code can be shared among PCI hotplug
    drivers. This patch introduces the following functions in
    drivers/pci/hotplug/acpi_pcihp.c to share the code, and changes
    acpiphp and pciehp to use them.

    - int acpi_pci_detect_ejectable(struct pci_bus *pbus)
    This checks if the specified PCI bus has ejectable slots.

    - int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle)
    This checks if the specified handle is ejectable ACPI PCI slot. The
    'pbus' parameter is needed to check if 'handle' is PCI related ACPI
    object.

    This patch also introduces the following inline function in
    include/linux/pci-acpi.h, which is useful to get ACPI handle of the
    PCI bridge from struct pci_bus of the bridge's secondary bus.

    - static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus)
    This returns ACPI handle of the PCI bridge which generates PCI bus
    specified by 'pbus'.

    Signed-off-by: Kenji Kaneshige
    Signed-off-by: Jesse Barnes

    Kenji Kaneshige
     

31 Dec, 2008

1 commit


23 Oct, 2008

3 commits

  • Now that the PCI core manages the 'name' for each individual
    hotplug driver, and all drivers (except rpaphp) have been converted
    to use hotplug_slot_name(), there is no need for the PCI hotplug
    core to drag around its own copy of name either.

    Cc: kristen.c.accardi@intel.com
    Cc: matthew@wil.cx
    Acked-by: Kenji Kaneshige
    Signed-off-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    Alex Chiang
     
  • In preparation for cleaning up the various hotplug drivers
    such that they don't have to manage their own 'name' parameters
    anymore, we provide the following convenience functions:

    pci_slot_name()
    hotplug_slot_name()

    These helpers will be used by individual hotplug drivers.

    Cc: kristen.c.accardi@intel.com
    Cc: matthew@wil.cx
    Acked-by: Kenji Kaneshige
    Signed-off-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    Alex Chiang
     
  • Update pci_hp_register() to take a const char *name parameter.

    The motivation for this is to clean up the individual hotplug
    drivers so that each one does not have to manage its own name.
    The PCI core should be the place where we manage the name.

    We update the interface and all callsites first, in a
    "no functional change" manner, and clean up the drivers later.

    Cc: kristen.c.accardi@intel.com
    Acked-by: Kenji Kaneshige
    Reviewed-by: Matthew Wilcox
    Signed-off-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    Alex Chiang
     

11 Jun, 2008

2 commits

  • Currently, /sys/bus/pci/slots/ only exposes hotplug attributes when a
    hotplug driver is loaded, but PCI slots have attributes such as address,
    speed, width, etc. that are not related to hotplug at all.

    Introduce pci_slot as the primary data structure and kobject model.
    Hotplug attributes described in hotplug_slot become a secondary
    structure associated with the pci_slot.

    This patch only creates the infrastructure that allows the separation of
    PCI slot attributes and hotplug attributes. In this patch, the PCI
    hotplug core remains the only user of this infrastructure, and thus,
    /sys/bus/pci/slots/ will still only become populated when a hotplug
    driver is loaded.

    A later patch in this series will add a second user of this new
    infrastructure and demonstrate splitting the task of exposing pci_slot
    attributes from hotplug_slot attributes.

    - Make pci_slot the primary sysfs entity. hotplug_slot becomes a
    subsidiary structure.
    o pci_create_slot() creates and registers a slot with the PCI core
    o pci_slot_add_hotplug() gives it hotplug capability

    - Change the prototype of pci_hp_register() to take the bus and
    slot number (on parent bus) as parameters.

    - Remove all the ->get_address methods since this functionality is
    now handled by pci_slot directly.

    [achiang@hp.com: rpaphp-correctly-pci_hp_register-for-empty-pci-slots]
    Tested-by: Badari Pulavarty
    Acked-by: Benjamin Herrenschmidt
    [akpm@linux-foundation.org: build fix]
    [akpm@linux-foundation.org: make headers_check happy]
    [akpm@linux-foundation.org: nuther build fix]
    [akpm@linux-foundation.org: fix typo in #include]
    Signed-off-by: Alex Chiang
    Signed-off-by: Matthew Wilcox
    Cc: Greg KH
    Cc: Kristen Carlson Accardi
    Cc: Len Brown
    Acked-by: Kenji Kaneshige
    Signed-off-by: Andrew Morton
    Signed-off-by: Jesse Barnes

    Alex Chiang
     
  • Fix the following problems of shpchp driver about getting hotplug
    control from firmware.

    - The shpchp driver must not control the hotplug controller if it
    fails to get control from the firmware. But current shpchp
    controls the hotplug controller regardless the result, because it
    doesn't check the return value of get_hp_hw_control_from_firmware().

    - Current shpchp driver doesn't support _OSC.

    The pciehp driver already have the code for evaluating _OSC and OSHP
    and shpchp and pciehp can share it. So this patch move that code from
    pciehp to acpi_pcihp.c.

    Signed-off-by: Kenji Kaneshige
    Signed-off-by: Jesse Barnes

    Kenji Kaneshige
     

25 Jan, 2008

1 commit


03 May, 2007

1 commit


19 Oct, 2006

1 commit