1. 25 3月, 2010 9 次提交
  2. 20 3月, 2010 4 次提交
    • D
      PCI: cleanup error return for pcix get and set mmrbc functions · 7c9e2b1c
      Dean Nelson 提交于
      pcix_get_mmrbc() returns the maximum memory read byte count (mmrbc), if
      successful, or an appropriate error value, if not.
      
      Distinguishing errors from correct values and understanding the meaning of an
      error can be somewhat confusing in that:
      
      	correct values: 512, 1024, 2048, 4096
      	errors: -EINVAL  			-22
       		PCIBIOS_FUNC_NOT_SUPPORTED	0x81
      		PCIBIOS_BAD_VENDOR_ID		0x83
      		PCIBIOS_DEVICE_NOT_FOUND	0x86
      		PCIBIOS_BAD_REGISTER_NUMBER	0x87
      		PCIBIOS_SET_FAILED		0x88
      		PCIBIOS_BUFFER_TOO_SMALL	0x89
      
      The PCIBIOS_ errors are returned from the PCI functions generated by the
      PCI_OP_READ() and PCI_OP_WRITE() macros.
      
      In a similar manner, pcix_set_mmrbc() also returns the PCIBIOS_ error values
      returned from pci_read_config_[word|dword]() and pci_write_config_word().
      
      Following pcix_get_max_mmrbc()'s example, the following patch simply returns
      -EINVAL for all PCIBIOS_ errors encountered by pcix_get_mmrbc(), and -EINVAL
      or -EIO for those encountered by pcix_set_mmrbc().
      
      This simplification was chosen in light of the fact that none of the current
      callers of these functions are interested in the specific type of error
      encountered. In the future, should this change, one could simply create a
      function that maps each PCIBIOS_ error to a corresponding unique errno value,
      which could be called by pcix_get_max_mmrbc(), pcix_get_mmrbc(), and
      pcix_set_mmrbc().
      
      Additionally, this patch eliminates some unnecessary variables.
      
      Cc: stable@kernel.org
      Signed-off-by: NDean Nelson <dnelson@redhat.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      7c9e2b1c
    • D
      PCI: fix access of PCI_X_CMD by pcix get and set mmrbc functions · bdc2bda7
      Dean Nelson 提交于
      An e1000 driver on a system with a PCI-X bus was always being returned
      a value of 135 from both pcix_get_mmrbc() and pcix_set_mmrbc(). This
      value reflects an error return of PCIBIOS_BAD_REGISTER_NUMBER from
      pci_bus_read_config_dword(,, cap + PCI_X_CMD,).
      
      This is because for a dword, the following portion of the PCI_OP_READ()
      macro:
      
      	if (PCI_##size##_BAD) return PCIBIOS_BAD_REGISTER_NUMBER;
      
      expands to:
      
      	if (pos & 3) return PCIBIOS_BAD_REGISTER_NUMBER;
      
      And is always true for 'cap + PCI_X_CMD', which is 0xe4 + 2 = 0xe6. ('cap' is
      the result of calling pci_find_capability(, PCI_CAP_ID_PCIX).)
      
      The same problem exists for pci_bus_write_config_dword(,, cap + PCI_X_CMD,).
      In both cases, instead of calling _dword(), _word() should be called.
      
      Cc: stable@kernel.org
      Signed-off-by: NDean Nelson <dnelson@redhat.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      bdc2bda7
    • P
      PCI: kill off pci_register_set_vga_state() symbol export. · ded1d8f2
      Paul Mundt 提交于
      When pci_register_set_vga_state() was made __init, the EXPORT_SYMBOL() was
      retained, which now leaves us with a section mismatch.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      Cc: Mike Travis <travis@sgi.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      ded1d8f2
    • D
      PCI: fix return value from pcix_get_max_mmrbc() · 25daeb55
      Dean Nelson 提交于
      For the PCI_X_STATUS register, pcix_get_max_mmrbc() is returning an incorrect
      value, which is based on:
      
      	(stat & PCI_X_STATUS_MAX_READ) >> 12
      
      Valid return values are 512, 1024, 2048, 4096, which correspond to a 'stat'
      (masked and right shifted by 21) of 0, 1, 2, 3, respectively.
      
      A right shift by 11 would generate the correct return value when 'stat' (masked
      and right shifted by 21) has a value of 1 or 2. But for a value of 0 or 3 it's
      not possible to generate the correct return value by only right shifting.
      
      Fix is based on pcix_get_mmrbc()'s similar dealings with the PCI_X_CMD register.
      
      Cc: stable@kernel.org
      Signed-off-by: NDean Nelson <dnelson@redhat.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      25daeb55
  3. 19 3月, 2010 1 次提交
  4. 15 3月, 2010 1 次提交
  5. 13 3月, 2010 3 次提交
  6. 11 3月, 2010 1 次提交
    • M
      microblaze: Enable PCI, missing files · a6475c13
      Michal Simek 提交于
      There are two parts of changes. The first is just enable
      PCI in Makefiles and in Kconfig. The second is the rest of
      missing files. I didn't want to add it with previous patch
      because that patch is too big.
      
      Current Microblaze toolchain has problem with weak symbols
      that's why is necessary to apply this changes to be possible
      to compile pci support.
      Xilinx knows about this problem.
      Signed-off-by: NMichal Simek <monstr@monstr.eu>
      a6475c13
  7. 08 3月, 2010 4 次提交
    • G
      Driver core: create lock/unlock functions for struct device · 8e9394ce
      Greg Kroah-Hartman 提交于
      In the future, we are going to be changing the lock type for struct
      device (once we get the lockdep infrastructure properly worked out)  To
      make that changeover easier, and to possibly burry the lock in a
      different part of struct device, let's create some functions to lock and
      unlock a device so that no out-of-core code needs to be changed in the
      future.
      
      This patch creates the device_lock/unlock/trylock() functions, and
      converts all in-tree users to them.
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Jean Delvare <khali@linux-fr.org>
      Cc: Dave Young <hidave.darkstar@gmail.com>
      Cc: Ming Lei <tom.leiming@gmail.com>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Phil Carmody <ext-phil.2.carmody@nokia.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Rafael J. Wysocki <rjw@sisk.pl>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Len Brown <len.brown@intel.com>
      Cc: Magnus Damm <damm@igel.co.jp>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: Vegard Nossum <vegard.nossum@gmail.com>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Alex Chiang <achiang@hp.com>
      Cc: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andrew Patterson <andrew.patterson@hp.com>
      Cc: Yu Zhao <yu.zhao@intel.com>
      Cc: Dominik Brodowski <linux@dominikbrodowski.net>
      Cc: Samuel Ortiz <sameo@linux.intel.com>
      Cc: Wolfram Sang <w.sang@pengutronix.de>
      Cc: CHENG Renquan <rqcheng@smu.edu.sg>
      Cc: Oliver Neukum <oliver@neukum.org>
      Cc: Frans Pop <elendil@planet.nl>
      Cc: David Vrabel <david.vrabel@csr.com>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      8e9394ce
    • S
      sysfs: fix for thinko with sysfs_bin_attr_init() · 62e877b8
      Stephen Rothwell 提交于
      After merging the final tree, today's linux-next build (powerpc
      allyesconfig) failed like this:
      
      drivers/pci/pci-sysfs.c: In function 'pci_create_legacy_files':
      drivers/pci/pci-sysfs.c:645: error: lvalue required as unary '&' operand
      drivers/pci/pci-sysfs.c:658: error: lvalue required as unary '&' operand
      
      Caused by commit "sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on
      dynamic attributes" interacting with commit "sysfs: Use one lockdep
      class per sysfs attribute") both from the driver-core tree.
      Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      62e877b8
    • E
      sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on dynamic attributes · a07e4156
      Eric W. Biederman 提交于
      These are the non-static sysfs attributes that exist on
      my test machine.  Fix them to use sysfs_attr_init or
      sysfs_bin_attr_init as appropriate.   It simply requires
      making a sysfs attribute present to see this.  So this
      is a little bit tedious but otherwise not too bad.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Acked-by: NWANG Cong <xiyou.wangcong@gmail.com>
      Cc: Tejun Heo <tj@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a07e4156
    • E
      Driver core: Constify struct sysfs_ops in struct kobj_type · 52cf25d0
      Emese Revfy 提交于
      Constify struct sysfs_ops.
      
      This is part of the ops structure constification
      effort started by Arjan van de Ven et al.
      
      Benefits of this constification:
      
       * prevents modification of data that is shared
         (referenced) by many other structure instances
         at runtime
      
       * detects/prevents accidental (but not intentional)
         modification attempts on archs that enforce
         read-only kernel data at runtime
      
       * potentially better optimized code as the compiler
         can assume that the const data cannot be changed
      
       * the compiler/linker move const data into .rodata
         and therefore exclude them from false sharing
      Signed-off-by: NEmese Revfy <re.emese@gmail.com>
      Acked-by: NDavid Teigland <teigland@redhat.com>
      Acked-by: NMatt Domsch <Matt_Domsch@dell.com>
      Acked-by: NMaciej Sosnowski <maciej.sosnowski@intel.com>
      Acked-by: NHans J. Koch <hjk@linutronix.de>
      Acked-by: NPekka Enberg <penberg@cs.helsinki.fi>
      Acked-by: NJens Axboe <jens.axboe@oracle.com>
      Acked-by: NStephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      52cf25d0
  8. 07 3月, 2010 1 次提交
  9. 06 3月, 2010 1 次提交
  10. 01 3月, 2010 1 次提交
  11. 28 2月, 2010 2 次提交
  12. 27 2月, 2010 1 次提交
    • R
      PM: Allow PCI devices to suspend/resume asynchronously · a1e4d72c
      Rafael J. Wysocki 提交于
      Set power.async_suspend for all PCI devices and PCIe port services,
      so that they can be suspended and resumed in parallel with other
      devices they don't depend on in a known way (i.e. devices which are
      not their parents or children).
      
      This only affects the "regular" suspend and resume stages, which
      means in particular that the restoration of the PCI devices' standard
      configuration registers during resume will still be carried out
      synchronously (at the "early" resume stage).
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      a1e4d72c
  13. 24 2月, 2010 4 次提交
  14. 23 2月, 2010 7 次提交
    • K
      PCIe PME: use pci_pcie_cap() · b16694f7
      Kenji Kaneshige 提交于
      Use pci_pcie_cap() instead of pci_find_capability() to get PCIe
      capability offset. This reduces redundant search in PCI configuration
      space.
      Signed-off-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      b16694f7
    • R
      PCI PM: Run-time callbacks for PCI bus type · 6cbf8214
      Rafael J. Wysocki 提交于
      Introduce run-time PM callbacks for the PCI bus type.  Make the new
      callbacks work in analogy with the existing system sleep PM
      callbacks, so that the drivers already converted to struct dev_pm_ops
      can use their suspend and resume routines for run-time PM without
      modifications.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      6cbf8214
    • K
      PCIe PME: use pci_is_pcie() · 552be54c
      Kenji Kaneshige 提交于
      Use pci_is_pcie() instead of looking at obsolete is_pcie field in
      struct pci_dev.
      Signed-off-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      552be54c
    • R
      PCI / ACPI / PM: Platform support for PCI PME wake-up · b67ea761
      Rafael J. Wysocki 提交于
      Although the majority of PCI devices can generate PMEs that in
      principle may be used to wake up devices suspended at run time,
      platform support is generally necessary to convert PMEs into wake-up
      events that can be delivered to the kernel.  If ACPI is used for this
      purpose, PME signals generated by a PCI device will trigger the ACPI
      GPE associated with the device to generate an ACPI wake-up event that
      we can set up a handler for, provided that everything is configured
      correctly.
      
      Unfortunately, the subset of PCI devices that have GPEs associated
      with them is quite limited.  The devices without dedicated GPEs have
      to rely on the GPEs associated with other devices (in the majority of
      cases their upstream bridges and, possibly, the root bridge) to
      generate ACPI wake-up events in response to PME signals from them.
      
      Add ACPI platform support for PCI PME wake-up:
      o Add a framework making is possible to use ACPI system notify
        handlers for run-time PM.
      o Add new PCI platform callback ->run_wake() to struct
        pci_platform_pm_ops allowing us to enable/disable the platform to
        generate wake-up events for given device.  Implemet this callback
        for the ACPI platform.
      o Define ACPI wake-up handlers for PCI devices and PCI root buses and
        make the PCI-ACPI binding code register wake-up notifiers for all
        PCI devices present in the ACPI tables.
      o Add function pci_dev_run_wake() which can be used by PCI drivers to
        check if given device is capable of generating wake-up events at
        run time.
      
      Developed in cooperation with Matthew Garrett <mjg@redhat.com>.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      b67ea761
    • R
      PCI PM: Make it possible to force using INTx for PCIe PME signaling · c39fae14
      Rafael J. Wysocki 提交于
      Apparently, some machines may have problems with PCI run-time power
      management if MSIs are used for the native PCIe PME signaling.  In
      particular, on the MSI Wind U-100 PCIe PME interrupts are not
      generated by a PCIe root port after a resume from suspend to RAM, if
      the system wake-up was triggered by a PME from the device attached to
      this port.  [It doesn't help to free the interrupt on suspend and
      request it back on resume, even if that is done along with disabling
      the MSI and re-enabling it, respectively.]  However, if INTx
      interrupts are used for this purpose on the same machine, everything
      works just fine.
      
      For this reason, add a kernel command line switch allowing one to
      request that MSIs be not used for the native PCIe PME signaling,
      introduce a DMI table allowing us to blacklist machines that need
      this switch to be set by default and put the MSI Wind U-100 into this
      table.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      c39fae14
    • R
      PCI PM: PCIe PME root port service driver · c7f48656
      Rafael J. Wysocki 提交于
      PCIe native PME detection mechanism is based on interrupts generated
      by root ports or event collectors every time a PCIe device sends a
      PME message upstream.
      
      Once a PME message has been sent by an endpoint device and received
      by its root port (or event collector in the case of root complex
      integrated endpoints), the Requester ID from the message header is
      registered in the root port's Root Status register.  At the same
      time, the PME Status bit of the Root Status register is set to
      indicate that there's a PME to handle.  If PCIe PME interrupt is
      enabled for the root port, it generates an interrupt once the PME
      Status has been set.  After receiving the interrupt, the kernel can
      identify the PCIe device that generated the PME using the Requester
      ID from the root port's Root Status register. [For details, see PCI
      Express Base Specification, Rev. 2.0.]
      
      Implement a driver for the PCIe PME root port service working in
      accordance with the above description.
      
      Based on a patch from Shaohua Li <shaohua.li@intel.com>.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      c7f48656
    • R
      PCI PM: Add function for checking PME status of devices · 58ff4633
      Rafael J. Wysocki 提交于
      Add function pci_check_pme_status() that will check the PME status
      bit of given device and clear it along with the PME enable bit.  It
      will be necessary for PCI run-time power management.
      
      Based on a patch from Shaohua Li <shaohua.li@intel.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      58ff4633