1. 16 10月, 2010 1 次提交
  2. 31 7月, 2010 1 次提交
  3. 19 7月, 2010 1 次提交
    • R
      PM: Make it possible to avoid races between wakeup and system sleep · c125e96f
      Rafael J. Wysocki 提交于
      One of the arguments during the suspend blockers discussion was that
      the mainline kernel didn't contain any mechanisms making it possible
      to avoid races between wakeup and system suspend.
      
      Generally, there are two problems in that area.  First, if a wakeup
      event occurs exactly when /sys/power/state is being written to, it
      may be delivered to user space right before the freezer kicks in, so
      the user space consumer of the event may not be able to process it
      before the system is suspended.  Second, if a wakeup event occurs
      after user space has been frozen, it is not generally guaranteed that
      the ongoing transition of the system into a sleep state will be
      aborted.
      
      To address these issues introduce a new global sysfs attribute,
      /sys/power/wakeup_count, associated with a running counter of wakeup
      events and three helper functions, pm_stay_awake(), pm_relax(), and
      pm_wakeup_event(), that may be used by kernel subsystems to control
      the behavior of this attribute and to request the PM core to abort
      system transitions into a sleep state already in progress.
      
      The /sys/power/wakeup_count file may be read from or written to by
      user space.  Reads will always succeed (unless interrupted by a
      signal) and return the current value of the wakeup events counter.
      Writes, however, will only succeed if the written number is equal to
      the current value of the wakeup events counter.  If a write is
      successful, it will cause the kernel to save the current value of the
      wakeup events counter and to abort the subsequent system transition
      into a sleep state if any wakeup events are reported after the write
      has returned.
      
      [The assumption is that before writing to /sys/power/state user space
      will first read from /sys/power/wakeup_count.  Next, user space
      consumers of wakeup events will have a chance to acknowledge or
      veto the upcoming system transition to a sleep state.  Finally, if
      the transition is allowed to proceed, /sys/power/wakeup_count will
      be written to and if that succeeds, /sys/power/state will be written
      to as well.  Still, if any wakeup events are reported to the PM core
      by kernel subsystems after that point, the transition will be
      aborted.]
      
      Additionally, put a wakeup events counter into struct dev_pm_info and
      make these per-device wakeup event counters available via sysfs,
      so that it's possible to check the activity of various wakeup event
      sources within the kernel.
      
      To illustrate how subsystems can use pm_wakeup_event(), make the
      low-level PCI runtime PM wakeup-handling code use it.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Acked-by: Nmarkgross <markgross@thegnar.org>
      Reviewed-by: NAlan Stern <stern@rowland.harvard.edu>
      c125e96f
  4. 23 6月, 2010 1 次提交
  5. 19 5月, 2010 1 次提交
  6. 12 5月, 2010 1 次提交
  7. 23 4月, 2010 1 次提交
  8. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  9. 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
  10. 16 3月, 2010 1 次提交
  11. 13 3月, 2010 3 次提交
  12. 08 3月, 2010 1 次提交
    • 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
  13. 06 3月, 2010 1 次提交
  14. 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
  15. 24 2月, 2010 1 次提交
  16. 23 2月, 2010 4 次提交
    • 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
    • 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: 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
    • R
      PCI: Clean up build for CONFIG_PCI_QUIRKS unset · 93177a74
      Rafael J. Wysocki 提交于
      Currently, drivers/pci/quirks.c is built unconditionally, but if
      CONFIG_PCI_QUIRKS is unset, the only things actually built in this
      file are definitions of global variables and empty functions (due to
      the #ifdef CONFIG_PCI_QUIRKS embracing all of the code inside the
      file).  This is not particularly nice and if someone overlooks
      the #ifdef CONFIG_PCI_QUIRKS, build errors are introduced.
      
      To clean that up, move the definitions of the global variables in
      quirks.c that are always built to pci.c, move the definitions of
      the empty functions (compiled when CONFIG_PCI_QUIRKS is unset) to
      headers (additionally make these functions static inline) and modify
      drivers/pci/Makefile so that quirks.c is only built if
      CONFIG_PCI_QUIRKS is set.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      93177a74
  17. 20 2月, 2010 1 次提交
  18. 06 2月, 2010 1 次提交
  19. 05 1月, 2010 1 次提交
    • R
      PCI/PM: Use per-device D3 delays · 1ae861e6
      Rafael J. Wysocki 提交于
      It turns out that some PCI devices require extra delays when changing
      power state from D3 to D0 (and the other way around).  Although this
      is against the PCI specification, we can handle it quite easily by
      allowing drivers to define arbitrary D3 delays for devices known to
      require extra time for switching power states.
      
      Introduce additional field d3_delay in struct pci_dev and use it to
      store the value of the device's D0->D3 delay, in miliseconds.  Make
      the PCI PM core code use the per-device d3_delay unless
      pci_pm_d3_delay is greater (in which case the latter is used).
      [This also allows the driver to specify d3_delay shorter than the
       10 ms required by the PCI standard if the device is known to be able
       to handle that.]
      
      Make the sky2 driver set d3_delay to 150 for devices handled by it.
      
      Fixes http://bugzilla.kernel.org/show_bug.cgi?id=14730 which is a
      listed regression from 2.6.30.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      1ae861e6
  20. 01 1月, 2010 1 次提交
  21. 17 12月, 2009 3 次提交
  22. 05 12月, 2009 4 次提交
    • K
      PCI: fix coding style issue in pci_save_state() · 9e0b5b2c
      Kleber Sacilotto de Souza 提交于
      Remove a stray space in pci_save_state().
      Signed-off-by: NKleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      9e0b5b2c
    • C
      PCI: add pci_request_acs · 5d990b62
      Chris Wright 提交于
      Commit ae21ee65 "PCI: acs p2p upsteram
      forwarding enabling" doesn't actually enable ACS.
      
      Add a function to pci core to allow an IOMMU to request that ACS
      be enabled.  The existing mechanism of using iommu_found() in the pci
      core to know when ACS should be enabled doesn't actually work due to
      initialization order;  iommu has only been detected not initialized.
      
      Have Intel and AMD IOMMUs request ACS, and Xen does as well during early
      init of dom0.
      
      Cc: Allen Kay <allen.m.kay@intel.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Cc: Joerg Roedel <joerg.roedel@amd.com>
      Signed-off-by: NChris Wright <chrisw@sous-sol.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      5d990b62
    • S
      PCI: read-modify-write the pcie device control register when initiating pcie flr · 04b55c47
      Shmulik Ravid 提交于
      The pcie_flr routine writes the device control register with the FLR bit
      set clearing all other fields for the FLR duration. Among other fields,
      the Max_Payload_Size is also cleared which can cause errors if there are
      transactions lurking in the HW pipeline. The patch replaces the blank
      write with read-modify-write of the control register keeping the other
      fields intact.
      Signed-off-by: NShmulik Ravid <shmulikr@broadcom.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      04b55c47
    • Y
      PCI: add debug output for DMA mask info · c6a41576
      Yinghai Lu 提交于
      This allows us to find out what DMA mask is used for each PCI device at boot
      time; useful for debugging.
      
      After the patch:
      ehci_hcd 0000:00:02.1: using 31bit consistent DMA mask
      e1000 0000:0b:01.0: using 64bit DMA mask
      e1000 0000:0b:01.0: using 64bit consistent DMA mask
      e1000e 0000:04:00.0: using 64bit DMA mask
      e1000e 0000:04:00.0: using 64bit consistent DMA mask
      ixgb 0000:0c:01.0: using 64bit DMA mask
      ixgb 0000:0c:01.0: using 64bit consistent DMA mask
      aacraid 0000:86:00.0: using 32bit DMA mask
      aacraid 0000:86:00.0: using 32bit consistent DMA mask
      aacraid 0000:86:00.0: using 64bit DMA mask
      aacraid 0000:86:00.0: using 64bit consistent DMA mask
      qla2xxx 0000:0c:02.0: using 64bit consistent DMA mask
      qla2xxx 0000:0c:02.1: using 64bit consistent DMA mask
      lpfc 0000:06:00.0: using 64bit DMA mask
      lpfc 0000:06:00.1: using 64bit DMA mask
      pata_amd 0000:00:06.0: using 32bit DMA mask
      pata_amd 0000:00:06.0: using 32bit consistent DMA mask
      mptsas 0000:0c:04.0: using 64bit DMA mask
      mptsas 0000:0c:04.0: using 64bit consistent DMA mask
      
      forcedeth 0000:00:08.0: using 39bit DMA mask
      forcedeth 0000:00:08.0: using 39bit consistent DMA mask
      niu 0000:02:00.0: using 44bit DMA mask
      niu 0000:02:00.0: using 44bit consistent DMA mask
      sata_nv 0000:00:05.0: using 32bit DMA mask
      sata_nv 0000:00:05.0: using 32bit consistent DMA mask
      ib_mthca 0000:03:00.0: using 64bit DMA mask
      ib_mthca 0000:03:00.0: using 64bit consistent DMA mask
      Reviewed-by: NGrant Grundler <grundler@google.com>
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      c6a41576
  23. 25 11月, 2009 2 次提交
  24. 11 11月, 2009 1 次提交
    • L
      PCI: allow matching of prefetchable resources to non-prefetchable windows · 8c8def26
      Linus Torvalds 提交于
      I'm not entirely sure it needs to go into 32, but it's probably the right
      thing to do. Another way of explaining the patch is:
      
       - we currently pick the _first_ exactly matching bus resource entry, but
         the _last_ inexactly matching one. Normally first/last shouldn't
         matter, but bus resource entries aren't actually all created equal: in
         a transparent bus, the last resources will be the parent resources,
         which we should generally try to avoid unless we have no choice. So
         "first matching" is the thing we should always aim for.
      
       - the patch is a bit bigger than it needs to be, because I simplified the
         logic at the same time. It used to be a fairly incomprehensible
      
      	if ((res->flags & IORESOURCE_PREFETCH) && !(r->flags & IORESOURCE_PREFETCH))
      		best = r;       /* Approximating prefetchable by non-prefetchable */
      
         and technically, all the patch did was to make that complex choice be
         even more complex (it basically added a "&& !best" to say that if we
         already gound a non-prefetchable window for the prefetchable resource,
         then we won't override an earlier one with that later one: remember
         "first matching").
      
       - So instead of that complex one with three separate conditionals in one,
         I split it up a bit, and am taking advantage of the fact that we
         already handled the exact case, so if 'res->flags' has the PREFETCH
         bit, then we already know that 'r->flags' will _not_ have it. So the
         simplified code drops the redundant test, and does the new '!best' test
         separately. It also uses 'continue' as a way to ignore the bus
         resource we know doesn't work (ie a prefetchable bus resource is _not_
         acceptable for anything but an exact match), so it turns into:
      
      	/* We can't insert a non-prefetch resource inside a prefetchable parent .. */
      	if (r->flags & IORESOURCE_PREFETCH)
      		continue;
      	/* .. but we can put a prefetchable resource inside a non-prefetchable one */
      	if (!best)
      		best = r;
      
         instead. With the comments, it's now six lines instead of two, but it's
         conceptually simpler, and I _could_ have written it as two lines:
      
      	if ((res->flags & IORESOURCE_PREFETCH) && !best)
      		best = r;	/* Approximating prefetchable by non-prefetchable */
      
         but I thought that was too damn subtle.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      8c8def26
  25. 07 11月, 2009 1 次提交
  26. 05 11月, 2009 1 次提交