Skip to content
Snippets Groups Projects
  1. Aug 09, 2010
  2. Aug 06, 2010
    • Linus Torvalds's avatar
      pci: fix type warnings in intr_remapping.c · c513b67e
      Linus Torvalds authored
      
      Commit 69309a05 ("x86, asm: Clean up and simplify set_64bit()")
      sanitized the x86-64 types to set_64bit(), and incidentally resulted in
      warnings like
      
       drivers/pci/intr_remapping.c: In function 'modify_irte':
       drivers/pci/intr_remapping.c:314: warning: passing argument 1 of 'set_64bit' from incompatible pointer type
       arch/x86/include/asm/cmpxchg_64.h:6: note:expected 'volatile u64 *' but argument is of type 'long unsigned int *'
      
      It turns out that the change to set_64bit() really does clean up things,
      and the PCI intr_remapping.c file did a rather ugly cast in order to
      avoid warnings with the previous set_64bit() type model.
      
      Removing the ugly cast fixes the warning, and makes everybody happy and
      expects a set_64bit() to take the logical "u64 *" argument.
      
      Pointed-out-by: default avatarPeter Anvin <hpa@zytor.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c513b67e
  3. Aug 04, 2010
  4. Aug 02, 2010
    • Narendra K's avatar
      PCI: Fix warnings when CONFIG_DMI unset · b879743f
      Narendra K authored
      
      This patch fixes the below warnings introduced by the commit
      911e1c9b ("PCI:
      export SMBIOS provided firmware instance and label to sysfs").
      
      drivers/pci/pci.h: In function ‘pci_create_firmware_label_files’:
      drivers/pci/pci.h:16: warning: ‘return’ with a value, in function returning void
      drivers/pci/pci.h: In function ‘pci_remove_firmware_label_files’:
      drivers/pci/pci.h:18: warning: ‘return’ with a value, in function returning void
      
      The warnings are seen because of the below code, doing a retun 0
      from the functions 'pci_create_firmware_label_files' and
      'pci_remove_firmware_label_files' defined as void.
      
      +#ifndef CONFIG_DMI
      +static inline void pci_create_firmware_label_files(struct pci_dev *pdev)
      +{ return 0; }
      +static inline void pci_remove_firmware_label_files(struct pci_dev *pdev)
      +{ return 0; }
      
      Signed-off-by: default avatarNarendra K <narendra_k@dell.com>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      b879743f
  5. Aug 01, 2010
  6. Jul 30, 2010
  7. Jul 19, 2010
  8. Jul 18, 2010
    • Rafael J. Wysocki's avatar
      PM: Make it possible to avoid races between wakeup and system sleep · c125e96f
      Rafael J. Wysocki authored
      
      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: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Acked-by: default avatarmarkgross <markgross@thegnar.org>
      Reviewed-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      c125e96f
  9. Jul 16, 2010
    • Bjorn Helgaas's avatar
      PCI: fall back to original BIOS BAR addresses · 58c84eda
      Bjorn Helgaas authored
      If we fail to assign resources to a PCI BAR, this patch makes us try the
      original address from BIOS rather than leaving it disabled.
      
      Linux tries to make sure all PCI device BARs are inside the upstream
      PCI host bridge or P2P bridge apertures, reassigning BARs if necessary.
      Windows does similar reassignment.
      
      Before this patch, if we could not move a BAR into an aperture, we left
      the resource unassigned, i.e., at address zero.  Windows leaves such BARs
      at the original BIOS addresses, and this patch makes Linux do the same.
      
      This is a bit ugly because we disable the resource long before we try to
      reassign it, so we have to keep track of the BIOS BAR address somewhere.
      For lack of a better place, I put it in the struct pci_dev.
      
      I think it would be cleaner to attempt the assignment immediately when the
      claim fails, so we could easily remember the original address.  But we
      currently claim motherboard resources in the middle, after attempting to
      claim PCI resources and before assigning new PCI resources, and changing
      that is a fairly big job.
      
      Addresses https://bugzilla.kernel.org/show_bug.cgi?id=16263
      
      
      
      Reported-by: default avatarAndrew <nitr0@seti.kr.ua>
      Tested-by: default avatarAndrew <nitr0@seti.kr.ua>
      Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      58c84eda
  10. Jul 06, 2010
  11. Jun 23, 2010
  12. Jun 18, 2010
  13. Jun 15, 2010
  14. Jun 11, 2010
    • Jiri Slaby's avatar
      PCI: hotplug/cpqphp, fix NULL dereference · a7ef7d1f
      Jiri Slaby authored
      
      There are devices out there which are PCI Hot-plug controllers with
      compaq PCI IDs, but are not bridges, hence have pdev->subordinate
      NULL. But cpqphp expects the pointer to be non-NULL.
      
      Add a check to the probe function to avoid oopses like:
      BUG: unable to handle kernel NULL pointer dereference at 00000050
      IP: [<f82e3c41>] cpqhpc_probe+0x951/0x1120 [cpqphp]
      *pdpt = 0000000033779001 *pde = 0000000000000000
      ...
      
      The device here was:
      00:0b.0 PCI Hot-plug controller [0804]: Compaq Computer Corporation PCI Hotplug Controller [0e11:a0f7] (rev 11)
      	Subsystem: Compaq Computer Corporation Device [0e11:a2f8]
      
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      a7ef7d1f
Loading