1. 13 12月, 2008 1 次提交
    • R
      cpumask: change cpumask_scnprintf, cpumask_parse_user, cpulist_parse, and... · 29c0177e
      Rusty Russell 提交于
      cpumask: change cpumask_scnprintf, cpumask_parse_user, cpulist_parse, and cpulist_scnprintf to take pointers.
      
      Impact: change calling convention of existing cpumask APIs
      
      Most cpumask functions started with cpus_: these have been replaced by
      cpumask_ ones which take struct cpumask pointers as expected.
      
      These four functions don't have good replacement names; fortunately
      they're rarely used, so we just change them over.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NMike Travis <travis@sgi.com>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Cc: paulus@samba.org
      Cc: mingo@redhat.com
      Cc: tony.luck@intel.com
      Cc: ralf@linux-mips.org
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: cl@linux-foundation.org
      Cc: srostedt@redhat.com
      29c0177e
  2. 24 10月, 2008 1 次提交
  3. 23 10月, 2008 1 次提交
    • B
      PCI: Workaround invalid P2P bridge bus numbers · a1c19894
      Benjamin Herrenschmidt 提交于
      Some firmware fail to properly configure P2P bridges, leaving them
      with invalid bus numbers. In some cases, this happens on some embedded
      4xx boards as the result of the kernel allocating different bus space
      than the firmware does to host bridges while not setting
      pcibios_assign_all_busses() for various reasons. In other cases, it can
      just be bogus firmware.
      
      This adds some sanity checking to the PCI probing code. If a bridge is
      found whose primary bus number doesn't match the bus it's sitting on,
      or whose secondary bus number not strictly above it's primary bus
      number, then the bridge bus numbers are deconfigured in the first pass
      of pci_scan_bridge() to be re-assigned in the second pass.
      Tested-by: N"Ayman El-Khashab" <AymanE@tanisys.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      a1c19894
  4. 21 10月, 2008 9 次提交
  5. 17 10月, 2008 1 次提交
  6. 13 9月, 2008 1 次提交
  7. 10 9月, 2008 1 次提交
    • J
      PCI: Fix printk warnings in probe.c · 4ca8a772
      Johann Felix Soden 提交于
      The cleaned up resource code in probe.c introduced some warnings:
      drivers/pci/probe.c: In function 'pci_read_bridge_bases':
      drivers/pci/probe.c:386: warning: format '%llx' expects type 'long long unsigned int', but argument 3 has type 'resource_size_t'
      drivers/pci/probe.c:386: warning: format '%llx' expects type 'long long unsigned int', but argument 4 has type 'resource_size_t'
      drivers/pci/probe.c:398: warning: format '%llx' expects type 'long long unsigned int', but argument 3 has type 'resource_size_t'
      drivers/pci/probe.c:398: warning: format '%llx' expects type 'long long unsigned int', but argument 4 has type 'resource_size_t'
      drivers/pci/probe.c:434: warning: format '%llx' expects type 'long long unsigned int', but argument 4 has type 'resource_size_t'
      drivers/pci/probe.c:434: warning: format '%llx' expects type 'long long unsigned int', but argument 5 has type 'resource_size_t'
      
      So fix them up.
      Signed-off-by: NJohann Felix Soden <johfel@users.sourceforge.net>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      4ca8a772
  8. 08 8月, 2008 1 次提交
  9. 29 7月, 2008 3 次提交
  10. 08 7月, 2008 1 次提交
    • R
      PCI ACPI: Rework PCI handling of wake-up · eb9d0fe4
      Rafael J. Wysocki 提交于
      * Introduce function acpi_pm_device_sleep_wake() for enabling and
        disabling the system wake-up capability of devices that are power
        manageable by ACPI.
      
      * Introduce function acpi_bus_can_wakeup() allowing other (dependent)
        subsystems to check if ACPI is able to enable the system wake-up
        capability of given device.
      
      * Introduce callback .sleep_wake() in struct pci_platform_pm_ops and
        for the ACPI PCI 'driver' make it use acpi_pm_device_sleep_wake().
      
      * Introduce callback .can_wakeup() in struct pci_platform_pm_ops and
        for the ACPI 'driver' make it use acpi_bus_can_wakeup().
      
      * Move the PME# handlig code out of pci_enable_wake() and split it
        into two functions, pci_pme_capable() and pci_pme_active(),
        allowing the caller to check if given device is capable of
        generating PME# from given power state and to enable/disable the
        device's PME# functionality, respectively.
      
      * Modify pci_enable_wake() to use the new ACPI callbacks and the new
        PME#-related functions.
      
      * Drop the generic .platform_enable_wakeup() callback that is not
        used any more.
      
      * Introduce device_set_wakeup_capable() that will set the
        power.can_wakeup flag of given device.
      
      * Rework PCI device PM initialization so that, if given device is
        capable of generating wake-up events, either natively through the
        PME# mechanism, or with the help of the platform, its
        power.can_wakeup flag is set and its power.should_wakeup flag is
        unset as appropriate.
      
      * Make ACPI set the power.can_wakeup flag for devices found to be
        wake-up capable by it.
      
      * Make the ACPI wake-up code enable/disable GPEs for devices that
        have the wakeup.flags.prepared flag set (which means that their
        wake-up power has been enabled).
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      eb9d0fe4
  11. 04 7月, 2008 1 次提交
  12. 28 6月, 2008 1 次提交
  13. 26 6月, 2008 1 次提交
    • B
      PCI: use dev_printk when possible · 80ccba11
      Bjorn Helgaas 提交于
      Convert printks to use dev_printk().
      
      I converted pr_debug() to dev_dbg().  Both use KERN_DEBUG and are enabled
      only when DEBUG is defined.
      
      I converted printk(KERN_DEBUG) to dev_printk(KERN_DEBUG), not to dev_dbg(),
      because dev_dbg() is only enabled when DEBUG is defined.
      
      I converted DBG(KERN_INFO) (only in setup-bus.c) to dev_info().  The DBG()
      name makes it sound like debug, but it's been enabled forever, so dev_info()
      preserves the previous behavior.
      
      I tried to make the resource assignment formats more consistent, e.g.,
        "BAR %d: got res [%#llx-%#llx] bus [%#llx-%#llx] flags %#lx\n"
      instead of sometimes using "start-end" and sometimes using "size@start".
      I'm not attached to one or the other; I'd just like them consistent.
      Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      80ccba11
  14. 24 6月, 2008 1 次提交
  15. 11 6月, 2008 2 次提交
    • A
      PCI: introduce pci_slot · f46753c5
      Alex Chiang 提交于
      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: NBadari Pulavarty <pbadari@us.ibm.com>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      [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: NAlex Chiang <achiang@hp.com>
      Signed-off-by: NMatthew Wilcox <matthew@wil.cx>
      Cc: Greg KH <greg@kroah.com>
      Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
      Cc: Len Brown <lenb@kernel.org>
      Acked-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      f46753c5
    • Z
      PCI: Disable PME during PCI scan · 49db1399
      Zhao Yakui 提交于
      If a device supports #PME and can generate PME events from D0, we may see
      superfluous events before a driver is loaded (drivers should only enable PME as
      needed), preventing suspend from working if the corresponding GPE was enabled.
      
      Likewise, if the ACPI device has the _PRW object, the _PSW/_DSW object will be
      called in order to disable the wakeup functionality. But when it is allowed to
      wake up the sleeping state, OSPM will enable it again.
      
      So we should disable PME in the course of scanning PCI devices and enable it
      again only when PME events are actually required to be generated from the
      requested PCI state (for example, D3_hot or D3_cold).  It is also safe to
      disable PME again when the PME is disabled for the PCI devices.
      Signed-off-by: NZhao Yakui <yakui.zhao@intel.com>
      Signed-off-by: NLi Shaohua <shaohua.li@intel.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      49db1399
  16. 30 4月, 2008 1 次提交
  17. 27 4月, 2008 3 次提交
  18. 21 4月, 2008 9 次提交
    • A
      PCI: pci_scan_device() mustn't be __devinit · 7f7b5de2
      Adrian Bunk 提交于
      WARNING: drivers/pci/built-in.o(.text+0x150f): Section mismatch in reference from the function pci_scan_single_device() to the function .devinit.text:pci_scan_device()
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      7f7b5de2
    • A
      PCI: pci_alloc_child_bus() mustn't be __devinit · cbd4e055
      Adrian Bunk 提交于
      WARNING: drivers/pci/built-in.o(.text+0xc4c): Section mismatch in reference from the function pci_add_new_bus() to the function .devinit.text:pci_alloc_child_bus()
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      cbd4e055
    • I
      PCI: clean up resource alignment management · 88452565
      Ivan Kokshaysky 提交于
      Done per Linus' request and suggestions. Linus has explained that
      better than I'll be able to explain:
      
      On Thu, Mar 27, 2008 at 10:12:10AM -0700, Linus Torvalds wrote:
      > Actually, before we go any further, there might be a less intrusive
      > alternative: add just a couple of flags to the resource flags field (we
      > still have something like 8 unused bits on 32-bit), and use those to
      > implement a generic "resource_alignment()" routine.
      >
      > Two flags would do it:
      >
      >  - IORESOURCE_SIZEALIGN: size indicates alignment (regular PCI device
      >    resources)
      >
      >  - IORESOURCE_STARTALIGN: start field is alignment (PCI bus resources
      >    during probing)
      >
      > and then the case of both flags zero (or both bits set) would actually be
      > "invalid", and we would also clear the IORESOURCE_STARTALIGN flag when we
      > actually allocate the resource (so that we don't use the "start" field as
      > alignment incorrectly when it no longer indicates alignment).
      >
      > That wouldn't be totally generic, but it would have the nice property of
      > automatically at least add sanity checking for that whole "res->start has
      > the odd meaning of 'alignment' during probing" and remove the need for a
      > new field, and it would allow us to have a generic "resource_alignment()"
      > routine that just gets a resource pointer.
      
      Besides, I removed IORESOURCE_BUS_HAS_VGA flag which was unused for ages.
      Signed-off-by: NIvan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Gary Hade <garyhade@us.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      88452565
    • B
      PCI: Expose PCI VPD through sysfs · 94e61088
      Ben Hutchings 提交于
      Vital Product Data (VPD) may be exposed by PCI devices in several
      ways.  It is generally unsafe to read this information through the
      existing interfaces to user-land because of stateful interfaces.
      
      This adds:
      - abstract operations for VPD access (struct pci_vpd_ops)
      - VPD state information in struct pci_dev (struct pci_vpd)
      - an implementation of the VPD access method specified in PCI 2.2
        (in access.c)
      - a 'vpd' binary file in sysfs directories for PCI devices with VPD
        operations defined
      
      It adds a probe for PCI 2.2 VPD in pci_scan_device() and release of
      VPD state in pci_release_dev().
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      94e61088
    • S
      PCI: add PCI Express ASPM support · 7d715a6c
      Shaohua Li 提交于
      PCI Express ASPM defines a protocol for PCI Express components in the D0
      state to reduce Link power by placing their Links into a low power state
      and instructing the other end of the Link to do likewise. This
      capability allows hardware-autonomous, dynamic Link power reduction
      beyond what is achievable by software-only controlled power management.
      However, The device should be configured by software appropriately.
      Enabling ASPM will save power, but will introduce device latency.
      
      This patch adds ASPM support in Linux. It introduces a global policy for
      ASPM, a sysfs file /sys/module/pcie_aspm/parameters/policy can control
      it. The interface can be used as a boot option too. Currently we have
      below setting:
              -default, BIOS default setting
              -powersave, highest power saving mode, enable all available ASPM
      state and clock power management
              -performance, highest performance, disable ASPM and clock power
      management
      By default, the 'default' policy is used currently.
      
      In my test, power difference between powersave mode and performance mode
      is about 1.3w in a system with 3 PCIE links.
      
      Note: some devices might not work well with aspm, either because chipset
      issue or device issue. The patch provide API (pci_disable_link_state),
      driver can disable ASPM for specific device.
      Signed-off-by: NShaohua Li <shaohua.li@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      7d715a6c
    • G
      PCI: Include PCI domain in PCI bus names on x86/x86_64 · cb3576fa
      Gary Hade 提交于
      The PCI bus names included in /proc/iomem and /proc/ioports are
      of the form 'PCI Bus #XX' where XX is the bus number.  This patch
      changes the naming to 'PCI Bus XXXX:YY' where XXXX is the domain
      number and YY is the bus number.  For example, PCI bus 14 in
      domain 0 will show as 'PCI Bus 0000:14' instead of 'PCI Bus #14'.
      This change makes the naming consistent with other architectures
      such as ia64 where multiple PCI domain support has been around
      longer.
      Signed-off-by: NGary Hade <garyhade@us.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      cb3576fa
    • G
      PCI: remove global list of PCI devices · 5ff580c1
      Greg Kroah-Hartman 提交于
      This patch finally removes the global list of PCI devices.  We are
      relying entirely on the list held in the driver core now, and do not
      need a separate "shadow" list as no one uses it.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      5ff580c1
    • G
      PCI: add is_added flag to struct pci_dev · 8a1bc901
      Greg Kroah-Hartman 提交于
      This lets us check if the device is really added to the driver core or
      not, which is what we need when walking some of the bus lists.  The flag
      is there in anticipation of getting rid of the other PCI device list,
      which is what we used to check in this situation.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8a1bc901
    • G
      PCI: make no_pci_devices() use the pci_bus_type list · 70308923
      Greg Kroah-Hartman 提交于
      no_pci_devices() should use the driver core list of PCI devices, not our
      "separate" one.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      70308923
  19. 20 4月, 2008 1 次提交