1. 08 8月, 2008 1 次提交
  2. 07 8月, 2008 1 次提交
    • A
      PCI: make pci_register_driver() a macro · bba81165
      Andrew Morton 提交于
      alpha:
      
      CC [M]  drivers/usb/gadget/u_ether.o
      In file included from include/asm/dma-mapping.h:7,
                       from include/linux/dma-mapping.h:52,
                       from include/linux/dmaengine.h:29,
                       from include/linux/skbuff.h:29,
                       from include/linux/if_ether.h:114,
                       from include/linux/etherdevice.h:27,
                       from drivers/usb/gadget/u_ether.c:29:
      include/linux/pci.h: In function 'pci_register_driver':
      include/linux/pci.h:673: error: 'KBUILD_MODNAME' undeclared (first use in this function)
      include/linux/pci.h:673: error: (Each undeclared identifier is reported only once
      include/linux/pci.h:673: error: for each function it appears in.)
      
      Sam says:
      
      The problem is that u_ether.o is used by two modules so when we build it
      KBUILD_MODNAME is not defined because kbuild does not know what value to
      use.
      
      And in pci.h we have the following inline:
      
      static inline int __must_check pci_register_driver(struct pci_driver *driver)
      {
              return __pci_register_driver(driver, THIS_MODULE, KBUILD_MODNAME);
      }
      
      And alpha uses dma-mapping.h to nullify a number of functions that seem to
      require something from pci.h.
      
      Making it a macro fixes this particular problem.  However, the underlying issue
      of a file using KBUILD_MODNAME and being shared between multiple modules is
      *not* addressed.  I guess the answer there is "don't do that".
      
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      bba81165
  3. 29 7月, 2008 1 次提交
  4. 23 7月, 2008 1 次提交
  5. 08 7月, 2008 3 次提交
  6. 01 7月, 2008 1 次提交
  7. 28 6月, 2008 1 次提交
  8. 12 6月, 2008 1 次提交
  9. 11 6月, 2008 4 次提交
    • 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
    • R
      PCI: implement new suspend/resume callbacks · bbb44d9f
      Rafael J. Wysocki 提交于
      Implement new suspend and hibernation callbacks for the PCI bus type.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      bbb44d9f
    • R
      Suspend/Resume bug in PCI layer wrt quirks · e1a2a51e
      Rafael J. Wysocki 提交于
      Some quirks should be called with interrupt disabled, we can't directly
      call them in .resume_early. Also the patch introduces
      pci_fixup_resume_early and pci_fixup_suspend, which matches current
      device core callbacks (.suspend/.resume_early).
      
      TBD: Somebody knows why we need quirk resume should double check if a
      quirk should be called in resume or resume_early. I changed some per my
      understanding, but can't make sure I fixed all.
      Signed-off-by: NShaohua Li <shaohua.li@intel.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      e1a2a51e
    • A
      PCI: drivers/pci/pci.c: add prototypes · 19792a08
      Adrian Bunk 提交于
      This patch adds prototypes for pcibios_disable_device() and
      pcibios_set_pcie_reset_state() in include/linux/pci.h
      
      While I was at it, I also removed the unneeded "extern" from the
      prototype of pcibios_add_platform_entries().
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      19792a08
  10. 13 5月, 2008 1 次提交
  11. 30 4月, 2008 3 次提交
    • Y
      x86/pci: remove flag in pci_cfg_space_size_ext · 70b9f7dc
      Yinghai Lu 提交于
      so let pci_cfg_space_size call it directly without flag.
      Signed-off-by: NYinghai Lu <yhlu.kernel@gmail.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      70b9f7dc
    • S
      x86: fix section mismatch in pci_scan_bus · 98db6f19
      Sam Ravnborg 提交于
      Fix following section mismatch warning:
      WARNING: vmlinux.o(.text+0x275616): Section mismatch in reference from the function pci_scan_bus() to the function .devinit.text:pci_scan_bus_parented()
      
      The warning was seen with a CONFIG_DEBUG_SECTION_MISMATCH=y build.
      The inline function pci_scan_bus refer to functions annotated
      __devinit - so annotate it __devinit too.
      This revealed a few x86 specific functions that were only
      used from __init or __devinit context.
      So annotate these __devinit and the warning was killed.
      
      The added include in pci.h was not strictly required but
      added to avoid being dependent on indirect includes.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: NJesse Barnes <jbarnes@hobbes.lan>
      98db6f19
    • Y
      pci/irq: let pci_device_shutdown to call pci_msi_shutdown v2 · d52877c7
      Yinghai Lu 提交于
      [PATCH 2/2] pci/irq: let pci_device_shutdown to call pci_msi_shutdown v2
      
      this change
      
      | commit 23a274c8
      | Author: Prakash, Sathya <sathya.prakash@lsi.com>
      | Date:   Fri Mar 7 15:53:21 2008 +0530
      |
      |     [SCSI] mpt fusion: Enable MSI by default for SAS controllers
      |
      |     This patch modifies the driver to enable MSI by default for all SAS chips.
      |
      |     Signed-off-by: Sathya Prakash <sathya.prakash@lsi.com>
      |     Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
      |
      Causes the kexec of a RHEL 5.1 kernel to fail.
      
      root casue: the rhel 5.1 kernel still uses INTx emulation.  and
      mptscsih_shutdown doesn't call pci_disable_msi to reenable INTx on kexec path
      
      So call pci_msi_shutdown in the shutdown path to do the same thing to msix
      Signed-off-by: NYinghai Lu <yhlu.kernel@gmail.com>
      Signed-off-by: NJesse Barnes <jbarnes@hobbes.lan>
      d52877c7
  12. 29 4月, 2008 1 次提交
  13. 27 4月, 2008 4 次提交
  14. 21 4月, 2008 9 次提交
    • 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
    • B
      PCI: add generic pci_enable_resources() · 842de40d
      Bjorn Helgaas 提交于
      Each architecture has its own pcibios_enable_resources() implementation.
      These differ in many minor ways that have nothing to do with actual
      architectural differences.  Follow-on patches will make most arches
      use this generic version instead.
      
      This version is based on powerpc, which seemed most up-to-date.  The only
      functional difference from the x86 version is that this uses "!r->parent"
      to check for resource collisions instead of "!r->start && r->end".
      Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      842de40d
    • 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: 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: clean up search.c a lot · 95247b57
      Greg Kroah-Hartman 提交于
      This cleans up the search.c file, now using the pci list of devices that
      are created for the driver core, instead of relying on our separate list
      of devices.  It's better to use the functions already created for this
      kind of thing, instead of rolling our own all the time.
      
      This work is done in anticipation of getting rid of that second list of
      pci devices all together.
      
      And it ends up saving code, always a nice benefit.
      
      This also removes one compiler warning for when CONFIG_PCI_LEGACY is
      enabled as we no longer internally use the deprecated functions anymore.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      95247b57
    • G
      PCI: remove pci_get_device_reverse · 34220909
      Greg Kroah-Hartman 提交于
      This removes the pci_get_device_reverse function as there should not be
      any need to walk pci devices backwards anymore.  All users of this call
      are now gone from the tree, so it is safe to remove it.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      34220909
    • G
      PCI: remove pci_find_present · 448432c4
      Greg Kroah-Hartman 提交于
      No one is using this function anymore for quite some time, so remove it.
      Everyone calls pci_dev_present() instead anyway...
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      448432c4
    • A
      PCI: #if 0 pci_assign_resource_fixed() · 2baad5f9
      Adrian Bunk 提交于
      An unused function that bloated the kernel only when CONFIG_EMBEDDED was
      enabled...
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      2baad5f9
  15. 25 3月, 2008 1 次提交
  16. 17 3月, 2008 1 次提交
  17. 14 3月, 2008 1 次提交
    • G
      PCI: fix issue with busses registering multiple times in sysfs · cc74d96f
      Greg Kroah-Hartman 提交于
      PCI busses can be registered multiple times, so we need to detect if we
      have registered our bus structure in sysfs already.  If so, don't do it
      again.
      
      Thanks to Guennadi Liakhovetski <g.liakhovetski@gmx.de> for reporting
      the problem, and to Linus for poking me to get me to believe that it was
      a real problem.
      
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      cc74d96f
  18. 11 3月, 2008 2 次提交
  19. 05 3月, 2008 1 次提交
    • J
      PCI: Add DECLARE_PCI_DEVICE_TABLE macro · 90a1ba0c
      Jonas Bonn 提交于
      The definitions of struct pci_device_id arrays should generally follow
      the same pattern across the entire kernel.  This macro defines this
      array as const and puts it into the __devinitconst section.
      
      There are currently many definitions scattered about the kernel that
      omit the __devinitdata modifier despite the documentation stating that
      it should always be there.  These definitions really also should have
      been const, which wasn't possible before but has become so with the
      addition of the __devinitconst attribute.
      
      Furthermore, there are definitions that use "const" and __devinitdata,
      which is explicitly wrong but the compiler doesn't catch section
      mismatches if there's only one such one case in the module (which is
      often the case).
      
      Adding the __devinitconst modifier where there was nothing before buys
      us memory.  Adding the const modifier gives the compiler a chance to do
      its thing.  Changing __devinitdata to __devinitconst where it was wrong
      actually fixes some compiler errors in older (mid-release) kernels that
      were patched over by "removing" the section attribute altogether (which
      wastes memory).
      
      This macro makes it pretty difficult to get this definition wrong in
      the future...
      Signed-off-by: NJonas Bonn <jonas@southpole.se>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      90a1ba0c
  20. 11 2月, 2008 1 次提交
  21. 06 2月, 2008 1 次提交