1. 14 Feb, 2012 6 commits
    • Konrad Rzeszutek Wilk's avatar
      PCI: Introduce __pci_reset_function_locked to be used when holding device_lock. · 6fbf9e7a
      Konrad Rzeszutek Wilk authored
      The use case of this is when a driver wants to call FLR when a device
      is attached to it using the SysFS "bind" or "unbind" functionality.
      
      The call chain when a user does "bind" looks as so:
      
       echo "0000:01.07.0" > /sys/bus/pci/drivers/XXXX/bind
      
      and ends up calling:
        driver_bind:
          device_lock(dev);  <=== TAKES LOCK
          XXXX_probe:
               .. pci_enable_device()
               ...__pci_reset_function(), which calls
                       pci_dev_reset(dev, 0):
                              if (!0) {
                                      device_lock(dev) <==== DEADLOCK
      
      The __pci_reset_function_locked function allows the the drivers
      'probe' function to call the "pci_reset_function" while still holding
      the driver mutex lock.
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      6fbf9e7a
    • Julia Lawall's avatar
      PCI: drivers/pci/hotplug/ibmphp_ebda.c: add missing iounmap · 8f0cdddc
      Julia Lawall authored
      Add missing iounmap in error handling code, in a case where the function
      already preforms iounmap on some other execution path.
      
      A simplified version of the semantic match that finds this problem is as
      follows: (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @@
      expression e;
      statement S,S1;
      int ret;
      @@
      e = \(ioremap\|ioremap_nocache\)(...)
      ... when != iounmap(e)
      if (<+...e...+>) S
      ... when any
          when != iounmap(e)
      *if (...)
         { ... when != iounmap(e)
           return ...; }
      ... when any
      iounmap(e);
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      8f0cdddc
    • Amos Kong's avatar
      PCI: Can continually add funcs after adding func0 · f382a086
      Amos Kong authored
      Boot up a KVM guest, and hotplug multifunction
      devices(func1,func2,func0,func3) to guest.
      
      for i in 1 2 0 3;do
      qemu-img create /tmp/resize$i.qcow2 1G -f qcow2
      (qemu) drive_add 0x11.$i id=drv11$i,if=none,file=/tmp/resize$i.qcow2
      (qemu) device_add virtio-blk-pci,id=dev11$i,drive=drv11$i,addr=0x11.$i,multifunction=on
      done
      
      In linux kernel, when func0 of the slot is hot-added, the whole
      slot will be marked as 'enabled', then driver will ignore other new
      hotadded funcs.
      But in Win7 & WinXP, we can continaully add other funcs after adding
      func0, all funcs will be added in guest.
      
      drivers/pci/hotplug/acpiphp_glue.c:
      static int acpiphp_check_bridge(struct acpiphp_bridge *bridge)
      {
      ....
              for (slot = bridge->slots; slot; slot = slot->next) {
                      if (slot->flags & SLOT_ENABLED) {
                              acpiphp_disable_slot()
                      else
                              acpiphp_enable_slot()
      ....                              |
      }                                 v
                                  enable_device()
                                        |
                                        v
              //only don't enable slot if func0 is not added
      	list_for_each_entry(func, &slot->funcs, sibling) {
                     ...
              }
             slot->flags |= SLOT_ENABLED; //mark slot to 'enabled'
      
      This patch just make pci driver can continaully add funcs after adding
      func 0. Only mark slot to 'enabled' when all funcs are added.
      
      For pci multifunction hotplug, we can add functions one by one(func 0 is
      necessary), and all functions will be removed in one time.
      Signed-off-by: default avatarAmos Kong <akong@redhat.com>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      f382a086
    • Myron Stowe's avatar
      x86/PCI: Convert maintaining FW-assigned BIOS BAR values to use a list · 6535943f
      Myron Stowe authored
      This patch converts the underlying maintenance aspects of FW-assigned
      BIOS BAR values from a statically allocated array within struct pci_dev
      to a list of temporary, stand alone, entries.
      Signed-off-by: default avatarMyron Stowe <myron.stowe@redhat.com>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      6535943f
    • Myron Stowe's avatar
      x86/PCI: Infrastructure to maintain a list of FW-assigned BIOS BAR values · 925845bd
      Myron Stowe authored
      Commit 58c84eda introduced functionality to try and reinstate the
      original BIOS BAR addresses of a PCI device when normal resource
      assignment attempts fail.  To keep track of the BIOS BAR addresses,
      struct pci_dev was augmented with an array to hold the BAR addresses
      of the PCI device: 'resource_size_t fw_addr[DEVICE_COUNT_RESOURCE]'.
      
      The reinstatement of BAR addresses is an uncommon event leaving the
      'fw_addr' array unused under normal circumstances.  This functionality
      is also currently architecture specific with an implementation limited
      to x86.  As the use of struct pci_dev is so prevalent, having the
      'fw_addr' array residing within such seems somewhat wasteful.
      
      This patch introduces a stand alone data structure and interfacing
      routines for maintaining a list of FW-assigned BIOS BAR value entries.
      Signed-off-by: default avatarMyron Stowe <myron.stowe@redhat.com>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      925845bd
    • Myron Stowe's avatar
      PCI: Fix starting basis for resource requests · 351fc6d1
      Myron Stowe authored
      pci_revert_fw_address() is used to reinstate a PCI device's original
      FW-assigned BIOS BAR value(s) if normal resource assignment fails.
      
      When attempting to reinstate an address, the point within the resource
      tree from which to attempt the new resource request should be the parent
      resource corresponding to the device, not the base of the resource tree
      (ioport_resource or iomem_resource).  For PCI devices this would
      typically be the resource corresponding to the upstream PCI host bridge
      or P2P bridge aperture.
      
      This patch sets the point within the resource tree to attempt a new
      resource assignment request to the PCI device's parent resource and only
      if that fails does it fall back to the base ioport_resource or
      iomem_resource.
      Signed-off-by: default avatarMyron Stowe <myron.stowe@redhat.com>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      351fc6d1
  2. 10 Feb, 2012 3 commits
    • Yinghai Lu's avatar
      PCI: Fix pci cardbus removal · 3682a394
      Yinghai Lu authored
      During test busn_res allocation with cardbus, found pci card removal is not
      working anymore, and it turns out it is broken by:
      
      |commit 79cc9601
      |Date:   Tue Nov 22 21:06:53 2011 -0800
      |
      |    PCI: Only call pci_stop_bus_device() one time for child devices at remove
      
      The above changed the behavior of pci_remove_behind_bridge that
      yenta_cardbus depended on.  So restore the old behavoir of
      pci_remove_behind_bridge (which requires stopping and removing of all
      devices) by:
      
      1. rename pci_remove_behind_bridge to __pci_remove_behind_bridge, and let
         __pci_remove_bus_device() call it instead.
      2. add pci_stop_behind_bridge that will stop devices behind a bridge
      3. add back pci_remove_behind_bridge that will stop and remove devices
         under bridge.
      
      -v2: update commit description a little bit.
      Tested-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
      Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      3682a394
    • Vaidyanathan Srinivasan's avatar
      PCI: set pci sriov page size before reading SRIOV BAR · 8161fe91
      Vaidyanathan Srinivasan authored
      For an SRIOV device, PCI_SRIOV_SYS_PGSIZE should be set before
      the PCI_SRIOV_BAR are queried.  The sys pagesize defaults to 4k,
      so this change is required on powerpc box with 64k base page size.
          
      This is a regression caused due to moving SRIOV init to sriov_enable().
          
      | commit afd24ece
      | Author: Ram Pai <linuxram@us.ibm.com>
          
      | PCI: delay configuration of SRIOV capability
      | The SRIOV capability, namely page size and total_vfs of a device are
      | configured during enumeration phase of the device.  This can potentially
      | interfere with the PCI operations of the platform, if the IOV capability
      | of the device is not enabled.
      Signed-off-by: default avatarVaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
      Acked-by: default avatarRam Pai <linuxram@us.ibm.com>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      8161fe91
    • Yinghai Lu's avatar
      PCI: workaround hard-wired bus number V2 · 71f6bd4a
      Yinghai Lu authored
      Fixes PCI device detection on IBM xSeries IBM 3850 M2 / x3950 M2
      when using ACPI resources (_CRS).
      This is default, a manual workaround (without this patch)
      would be pci=nocrs boot param.
      
      V2: Add dev_warn if the workaround is hit. This should reveal
      how common such setups are (via google) and point to possible
      problems if things are still not working as expected.
      -> Suggested by Jan Beulich.
      
      Cc: stable@vger.kernel.org
      Tested-by: garyhade@us.ibm.com
      Signed-off-by: default avatarYinghai Lu <yinghai.lu@oracle.com>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      71f6bd4a
  3. 27 Jan, 2012 11 commits
  4. 26 Jan, 2012 14 commits
  5. 25 Jan, 2012 6 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs · aaad641e
      Linus Torvalds authored
      Quoth Ben Myers:
       "Please pull in the following bugfix for xfs.  We forgot to drop a lock on
        error in xfs_readlink.  It hasn't been through -next yet, but there is no
        -next tree tomorrow.  The fix is clear so I'm sending this request today."
      
      * 'for-linus' of git://oss.sgi.com/xfs/xfs:
        xfs: Fix missing xfs_iunlock() on error recovery path in xfs_readlink()
      aaad641e
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · 74a7f6a0
      Linus Torvalds authored
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
        drm/ttm: fix two regressions since move_notify changes
        drm/radeon: avoid deadlock if GPU lockup is detected in ib_pool_get
        drm/radeon: silence out possible lock dependency warning
        drm: Fix authentication kernel crash
        gma500: Fix shmem mapping
        drm/radeon/kms: refine TMDS dual link checks
        drm/radeon/kms: use drm_detect_hdmi_monitor for picking encoder mode
        drm/radeon/kms: rework modeset sequence for DCE41 and DCE5
        drm/radeon/kms: move panel mode setup into encoder mode set
        drm/radeon/kms: move disp eng pll setup to init path
        drm/radeon: finish getting bios earlier
        drm/radeon: fix invalid memory access in radeon_atrm_get_bios()
        drm/radeon/kms: add some missing semaphore init
        drm/radeon/kms: Add an MSI quirk for Dell RS690
        gpu, drm, sis: Don't return uninitialized variable from sis_driver_load()
      74a7f6a0
    • Linus Torvalds's avatar
      Merge branch 'fix/asoc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 486bc794
      Linus Torvalds authored
      * 'fix/asoc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ASoC: wm2000: Fix use-after-free - don't release_firmware() twice on error
        ASoC: wm8958: Use correct format string in dev_err() call
        ASoC: wm8996: Call _POST_PMU callback for CPVDD
        ASoC: mxs: Fix mxs-saif timeout
        ASoC: Disable register synchronisation for low frequency WM8996 SYSCLK
        ASoC: Don't go through cache when applying WM5100 rev A updates
        ASoC: Mark WM5100 register map cache only when going into BIAS_OFF
        ASoC: tlv320aic32x4: always enable analouge block
        ASoC: tlv320aic32x4: always enable dividers
        ASoC: sgtl5000: Fix wrong register name in restore
      486bc794
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap · 7ca4e8c4
      Linus Torvalds authored
      A fairly simple bugfix for a WARN_ON() which was triggered in the cache
      reset support as a result of some subsequent work.  There's only one
      mainline user for the code path that's updated right now (wm8994) so
      should be low risk.
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
        regmap: Reset cache status when reinitialsing the cache
      7ca4e8c4
    • Li Wang's avatar
      eCryptfs: move misleading function comments · 1589cb1a
      Li Wang authored
       The data encryption was moved from ecryptfs_write_end into
      ecryptfs_writepage, this patch moves the corresponding function
      comments to be consistent with the modification.
      Signed-off-by: default avatarLi Wang <liwang@nudt.edu.cn>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1589cb1a
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs · 3074c035
      Linus Torvalds authored
      Says Tyler:
       "Tim's logging message update will be really helpful to users when
        they're trying to locate a problematic file in the lower filesystem
        with filename encryption enabled.
      
        You'll recognize the fix from Li, as you commented on that.
      
        You should also be familiar with my setattr/truncate improvements,
        since you were the one that pointed them out to us (thanks again!).
        Andrew noted the /dev/ecryptfs write count sanitization needed to be
        improved, so I've got a fix in there for that along with some other
        less important cleanups of the /dev/ecryptfs read/write code."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs:
        eCryptfs: Fix oops when printing debug info in extent crypto functions
        eCryptfs: Remove unused ecryptfs_read()
        eCryptfs: Check inode changes in setattr
        eCryptfs: Make truncate path killable
        eCryptfs: Infinite loop due to overflow in ecryptfs_write()
        eCryptfs: Replace miscdev read/write magic numbers
        eCryptfs: Report errors in writes to /dev/ecryptfs
        eCryptfs: Sanitize write counts of /dev/ecryptfs
        ecryptfs: Remove unnecessary variable initialization
        ecryptfs: Improve metadata read failure logging
        MAINTAINERS: Update eCryptfs maintainer address
      3074c035