1. 17 May, 2011 14 commits
    • Rafael J. Wysocki's avatar
      Revert "PM / Hibernate: Reduce autotuned default image size" · 1c1be3a9
      Rafael J. Wysocki authored
      This reverts commit bea3864f
      (PM / Hibernate: Reduce autotuned default image size), because users
      are now able to resolve the issue this commit was supposed to address
      in a different way (i.e. by using the new /sys/power/reserved_size
      interface).
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      1c1be3a9
    • Rafael J. Wysocki's avatar
      PM / Hibernate: Add sysfs knob to control size of memory for drivers · ddeb6487
      Rafael J. Wysocki authored
      Martin reports that on his system hibernation occasionally fails due
      to the lack of memory, because the radeon driver apparently allocates
      too much of it during the device freeze stage.  It turns out that the
      amount of memory allocated by radeon during hibernation (and
      presumably during system suspend too) depends on the utilization of
      the GPU (e.g. hibernating while there are two KDE 4 sessions with
      compositing enabled causes radeon to allocate more memory than for
      one KDE 4 session).
      
      In principle it should be possible to use image_size to make the
      memory preallocation mechanism free enough memory for the radeon
      driver, but in practice it is not easy to guess the right value
      because of the way the preallocation code uses image_size.  For this
      reason, it seems reasonable to allow users to control the amount of
      memory reserved for driver allocations made after the hibernate
      preallocation, which currently is constant and amounts to 1 MB.
      
      Introduce a new sysfs file, /sys/power/reserved_size, whose value
      will be used as the amount of memory to reserve for the
      post-preallocation reservations made by device drivers, in bytes.
      For backwards compatibility, set its default (and initial) value to
      the currently used number (1 MB).
      
      References: https://bugzilla.kernel.org/show_bug.cgi?id=34102Reported-and-tested-by: default avatarMartin Steigerwald <Martin@Lichtvoll.de>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      ddeb6487
    • Eric Dumazet's avatar
      PM / Wakeup: Remove useless synchronize_rcu() call · 13e38136
      Eric Dumazet authored
      wakeup_source_add() adds an item into wakeup_sources list.
      
      There is no need to call synchronize_rcu() at this point.
      
      Its only needed in wakeup_source_remove()
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      13e38136
    • Kay Sievers's avatar
      kmod: always provide usermodehelper_disable() · 13d53f87
      Kay Sievers authored
      We need to prevent kernel-forked processes during system poweroff.
      Such processes try to access the filesystem whose disks we are
      trying to shutdown at the same time. This causes delays and exceptions
      in the storage drivers.
      
      A follow-up patch will add these calls and need usermodehelper_disable()
      also on systems without suspend support.
      Signed-off-by: default avatarKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      13d53f87
    • Amerigo Wang's avatar
      PM / ACPI: Remove acpi_sleep=s4_nonvs · c3b0795c
      Amerigo Wang authored
      acpi_sleep=s4_nonvs is superseded by acpi_sleep=nonvs, so remove it.
      Signed-off-by: default avatarWANG Cong <amwang@redhat.com>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      Acked-by: default avatarLen Brown <lenb@kernel.org>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      c3b0795c
    • Rafael J. Wysocki's avatar
      PM / Wakeup: Fix build warning related to the "wakeup" sysfs file · e762318b
      Rafael J. Wysocki authored
      The "wakeup" device sysfs file is only created if CONFIG_PM_SLEEP
      is set, so put it under CONFIG_PM_SLEEP and make a build warning
      related to it go away.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      e762318b
    • Rafael J. Wysocki's avatar
      PM: Print a warning if firmware is requested when tasks are frozen · a144c6a6
      Rafael J. Wysocki authored
      Some drivers erroneously use request_firmware() from their ->resume()
      (or ->thaw(), or ->restore()) callbacks, which is not going to work
      unless the firmware has been built in.  This causes system resume to
      stall until the firmware-loading timeout expires, which makes users
      think that the resume has failed and reboot their machines
      unnecessarily.  For this reason, make _request_firmware() print a
      warning and return immediately with error code if it has been called
      when tasks are frozen and it's impossible to start any new usermode
      helpers.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Reviewed-by: default avatarValdis Kletnieks <valdis.kletnieks@vt.edu>
      a144c6a6
    • Rafael J. Wysocki's avatar
      PM / Runtime: Rework runtime PM handling during driver removal · e1866b33
      Rafael J. Wysocki authored
      The driver core tries to prevent race conditions between runtime PM
      and driver removal from happening by incrementing the runtime PM
      usage counter of the device and executing pm_runtime_barrier() before
      running the bus notifier and the ->remove() callbacks provided by the
      device's subsystem or driver.  This guarantees that, if a future
      runtime suspend of the device has been scheduled or a runtime resume
      or idle request has been queued up right before the driver removal,
      it will be canceled or waited for to complete and no other
      asynchronous runtime suspend or idle requests for the device will be
      put into the PM workqueue until the ->remove() callback returns.
      However, it doesn't prevent resume requests from being queued up
      after pm_runtime_barrier() has been called and it doesn't prevent
      pm_runtime_resume() from executing the device subsystem's runtime
      resume callback.  Morever, it prevents the device's subsystem or
      driver from putting the device into the suspended state by calling
      pm_runtime_suspend() from its ->remove() routine.  This turns out to
      be a major inconvenience for some subsystems and drivers that want to
      leave the devices they handle in the suspended state.
      
      To really prevent runtime PM callbacks from racing with the bus
      notifier callback in __device_release_driver(), which is necessary,
      because the notifier is used by some subsystems to carry out
      operations affecting the runtime PM functionality, use
      pm_runtime_get_sync() instead of the combination of
      pm_runtime_get_noresume() and pm_runtime_barrier().  This will resume
      the device if it's in the suspended state and will prevent it from
      being suspended again until pm_runtime_put_*() is called.
      
      To allow subsystems and drivers to put devices into the suspended
      state by calling pm_runtime_suspend() from their ->remove() routines,
      execute pm_runtime_put_sync() after running the bus notifier in
      __device_release_driver().  This will require subsystems and drivers
      to make their ->remove() callbacks avoid races with runtime PM
      directly, but it will allow of more flexibility in the handling of
      devices during the removal of their drivers.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      e1866b33
    • Mike Frysinger's avatar
      Freezer: Use SMP barriers · ee940d8d
      Mike Frysinger authored
      The freezer processes are dealing with multiple threads running
      simultaneously, and on a UP system, the memory reads/writes do
      not need barriers to keep things in sync.  These are only needed
      on SMP systems, so use SMP barriers instead.
      Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      ee940d8d
    • MyungJoo Ham's avatar
      PM / Suspend: Do not ignore error codes returned by suspend_enter() · 3c431936
      MyungJoo Ham authored
      The current implementation of suspend-to-RAM returns 0 if there is an
      error from suspend_enter(), because suspend_devices_and_enter() ignores
      the return value from suspend_enter().  This patch addresses this issue
      and properly keep the error return from suspend_enter() and let
      suspend_devices_and_enter relay the error return.
      Signed-off-by: default avatarMyungJoo Ham <myungjoo.ham@samsung.com>
      Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      3c431936
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 · c1d10d18
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
        net: Change netdev_fix_features messages loglevel
        vmxnet3: Fix inconsistent LRO state after initialization
        sfc: Fix oops in register dump after mapping change
        IPVS: fix netns if reading ip_vs_* procfs entries
        bridge: fix forwarding of IPv6
      c1d10d18
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc · 477de0de
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc:
        Revert "mmc: fix a race between card-detect rescan and clock-gate work instances"
      477de0de
    • Randy Dunlap's avatar
      mm: fix kernel-doc warning in page_alloc.c · b5e6ab58
      Randy Dunlap authored
      Fix new kernel-doc warning in mm/page_alloc.c:
      
        Warning(mm/page_alloc.c:2370): No description found for parameter 'nid'
      Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b5e6ab58
    • Yinghai Lu's avatar
      PCI: Clear bridge resource flags if requested size is 0 · 93d2175d
      Yinghai Lu authored
      During pci remove/rescan testing found:
      
        pci 0000:c0:03.0: PCI bridge to [bus c4-c9]
        pci 0000:c0:03.0:   bridge window [io  0x1000-0x0fff]
        pci 0000:c0:03.0:   bridge window [mem 0xf0000000-0xf00fffff]
        pci 0000:c0:03.0:   bridge window [mem 0xfc180000000-0xfc197ffffff 64bit pref]
        pci 0000:c0:03.0: device not available (can't reserve [io  0x1000-0x0fff])
        pci 0000:c0:03.0: Error enabling bridge (-22), continuing
        pci 0000:c0:03.0: enabling bus mastering
        pci 0000:c0:03.0: setting latency timer to 64
        pcieport 0000:c0:03.0: device not available (can't reserve [io  0x1000-0x0fff])
        pcieport: probe of 0000:c0:03.0 failed with error -22
      
      This bug was caused by commit c8adf9a3 ("PCI: pre-allocate
      additional resources to devices only after successful allocation of
      essential resources.")
      
      After that commit, pci_hotplug_io_size is changed to additional_io_size
      from minium size.  So it will not go through resource_size(res) != 0
      path, and will not be reset.
      
      The root cause is: pci_bridge_check_ranges will set RESOURCE_IO flag for
      pci bridge, and later if children do not need IO resource.  those bridge
      resources will not need to be allocated.  but flags is still there.
      that will confuse the the pci_enable_bridges later.
      
      related code:
      
         static void assign_requested_resources_sorted(struct resource_list *head,
                                          struct resource_list_x *fail_head)
         {
                 struct resource *res;
                 struct resource_list *list;
                 int idx;
      
                 for (list = head->next; list; list = list->next) {
                         res = list->res;
                         idx = res - &list->dev->resource[0];
                         if (resource_size(res) && pci_assign_resource(list->dev, idx)) {
         ...
                                 reset_resource(res);
                         }
                 }
         }
      
      At last, We have to clear the flags in pbus_size_mem/io when requested
      size == 0 and !add_head.  becasue this case it will not go through
      adjust_resources_sorted().
      
      Just make size1 = size0 when !add_head. it will make flags get cleared.
      
      At the same time when requested size == 0, add_size != 0, will still
      have in head and add_list.  because we do not clear the flags for it.
      
      After this, we will get right result:
      
        pci 0000:c0:03.0: PCI bridge to [bus c4-c9]
        pci 0000:c0:03.0:   bridge window [io  disabled]
        pci 0000:c0:03.0:   bridge window [mem 0xf0000000-0xf00fffff]
        pci 0000:c0:03.0:   bridge window [mem 0xfc180000000-0xfc197ffffff 64bit pref]
        pci 0000:c0:03.0: enabling bus mastering
        pci 0000:c0:03.0: setting latency timer to 64
        pcieport 0000:c0:03.0: setting latency timer to 64
        pcieport 0000:c0:03.0: irq 160 for MSI/MSI-X
        pcieport 0000:c0:03.0: Signaling PME through PCIe PME interrupt
        pci 0000:c4:00.0: Signaling PME through PCIe PME interrupt
        pcie_pme 0000:c0:03.0:pcie01: service driver pcie_pme loaded
        aer 0000:c0:03.0:pcie02: service driver aer loaded
        pciehp 0000:c0:03.0:pcie04: Hotplug Controller:
      
      v3: more simple fix. also fix one typo in pbus_size_mem
      Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
      Reviewed-by: default avatarRam Pai <linuxram@us.ibm.com>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      93d2175d
  2. 16 May, 2011 7 commits
  3. 15 May, 2011 6 commits
  4. 14 May, 2011 13 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client · bd1a643e
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
        rbd: fix split bio handling
        rbd: fix leak of ops struct
      bd1a643e
    • Li Zefan's avatar
      Btrfs: fix FS_IOC_SETFLAGS ioctl · ebcb904d
      Li Zefan authored
      Steps to reproduce the bug:
      
        - Call FS_IOC_SETLFAGS ioctl with flags=FS_COMPR_FL
        - Call FS_IOC_SETFLAGS ioctl with flags=0
        - Call FS_IOC_GETFLAGS ioctl, and you'll see FS_COMPR_FL is still set!
      Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      ebcb904d
    • Li Zefan's avatar
      Btrfs: fix FS_IOC_GETFLAGS ioctl · d0092bdd
      Li Zefan authored
      As we've added per file compression/cow support.
      Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      d0092bdd
    • Li Zefan's avatar
      fs: remove FS_COW_FL · e1e8fb6a
      Li Zefan authored
      FS_COW_FL and FS_NOCOW_FL were newly introduced to control per file
      COW in btrfs, but FS_NOCOW_FL is sufficient.
      
      The fact is we don't have corresponding BTRFS_INODE_COW flag.
      
      COW is default, and FS_NOCOW_FL can be used to switch off COW for
      a single file.
      
      If we mount btrfs with nodatacow, a newly created file will be set with
      the FS_NOCOW_FL flag. So to turn on COW for it, we can just clear the
      FS_NOCOW_FL flag.
      Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      e1e8fb6a
    • liubo's avatar
      Btrfs: fix easily get into ENOSPC in mixed case · 1aba86d6
      liubo authored
      When a btrfs disk is created by mixed data & metadata option, it will have no
      pure data or pure metadata space info.
      
      In btrfs's for-linus branch, commit 78b1ea13838039cd88afdd62519b40b344d6c920
      (Btrfs: fix OOPS of empty filesystem after balance) initializes space infos at
      the very beginning.  The problem is this initialization does not take the mixed
      case into account, which will cause btrfs will easily get into ENOSPC in mixed
      case.
      Signed-off-by: default avatarLiu Bo <liubo2009@cn.fujitsu.com>
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      1aba86d6
    • Daniel J Blueman's avatar
      Prevent oopsing in posix_acl_valid() · f5de9391
      Daniel J Blueman authored
      If posix_acl_from_xattr() returns an error code, a negative address is
      dereferenced causing an oops; fix by checking for error code first.
      Signed-off-by: default avatarDaniel J Blueman <daniel.blueman@gmail.com>
      Reviewed-by: default avatarJosef Bacik <josef@redhat.com>
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      f5de9391
    • Linus Torvalds's avatar
    • Hugh Dickins's avatar
      tmpfs: fix race between swapoff and writepage · 05bf86b4
      Hugh Dickins authored
      Shame on me!  Commit b1dea800 "tmpfs: fix race between umount and
      writepage" fixed the advertized race, but introduced another: as even
      its comment makes clear, we cannot safely rely on a peek at list_empty()
      while holding no lock - until info->swapped is set, shmem_unuse_inode()
      may delete any formerly-swapped inode from the shmem_swaplist, which
      in this case would leave a swap area impossible to swapoff.
      
      Although I don't relish taking the mutex every time, I don't care much
      for the alternatives either; and at least the peek at list_empty() in
      shmem_evict_inode() (a hotter path since most inodes would never have
      been swapped) remains safe, because we already truncated the whole file.
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      Cc: stable@kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      05bf86b4
    • Tejun Heo's avatar
      libata: fix oops when LPM is used with PMP · 5f6f12cc
      Tejun Heo authored
      ae01b249 (libata: Implement ATA_FLAG_NO_DIPM and apply it to mcp65)
      added ATA_FLAG_NO_DIPM and made ata_eh_set_lpm() check the flag.
      However, @ap is NULL if @link points to a PMP link and thus the
      unconditional @ap->flags dereference leads to the following oops.
      
        BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
        IP: [<ffffffff813f98e1>] ata_eh_recover+0x9a1/0x1510
        ...
        Pid: 295, comm: scsi_eh_4 Tainted: P            2.6.38.5-core2 #1 System76, Inc. Serval Professional/Serval Professional
        RIP: 0010:[<ffffffff813f98e1>]  [<ffffffff813f98e1>] ata_eh_recover+0x9a1/0x1510
        RSP: 0018:ffff880132defbf0  EFLAGS: 00010246
        RAX: 0000000000000000 RBX: ffff880132f40000 RCX: 0000000000000000
        RDX: ffff88013377c000 RSI: ffff880132f40000 RDI: 0000000000000000
        RBP: ffff880132defce0 R08: ffff88013377dc58 R09: ffff880132defd98
        R10: 0000000000000000 R11: 00000000ffffffff R12: 0000000000000000
        R13: 0000000000000000 R14: ffff88013377c000 R15: 0000000000000000
        FS:  0000000000000000(0000) GS:ffff8800bf700000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
        CR2: 0000000000000018 CR3: 0000000001a03000 CR4: 00000000000406e0
        DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
        DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
        Process scsi_eh_4 (pid: 295, threadinfo ffff880132dee000, task ffff880133b416c0)
        Stack:
         0000000000000000 ffff880132defcc0 0000000000000000 ffff880132f42738
         ffffffff813ee8f0 ffffffff813eefe0 ffff880132defd98 ffff88013377f190
         ffffffffa00b3e30 ffffffff813ef030 0000000032defc60 ffff880100000000
        Call Trace:
         [<ffffffff81400867>] sata_pmp_error_handler+0x607/0xc30
         [<ffffffffa00b273f>] ahci_error_handler+0x1f/0x70 [libahci]
         [<ffffffff813faade>] ata_scsi_error+0x5be/0x900
         [<ffffffff813cf724>] scsi_error_handler+0x124/0x650
         [<ffffffff810834b6>] kthread+0x96/0xa0
         [<ffffffff8100cd64>] kernel_thread_helper+0x4/0x10
        Code: 8b 95 70 ff ff ff b8 00 00 00 00 48 3b 9a 10 2e 00 00 48 0f 44 c2 48 89 85 70 ff ff ff 48 8b 8d 70 ff ff ff f6 83 69 02 00 00 01 <48> 8b 41 18 0f 85 48 01 00 00 48 85 c9 74 12 48 8b 51 08 48 83
        RIP  [<ffffffff813f98e1>] ata_eh_recover+0x9a1/0x1510
         RSP <ffff880132defbf0>
        CR2: 0000000000000018
      
      Fix it by testing @link->ap->flags instead.
      
      stable: ATA_FLAG_NO_DIPM was added during 2.6.39 cycle but was
              backported to 2.6.37 and 38.  This is a fix for that and thus
              also applicable to 2.6.37 and 38.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Reported-by: default avatar"Nathan A. Mourey II" <nmoureyii@ne.rr.com>
      LKML-Reference: <1304555277.2059.2.camel@localhost.localdomain>
      Cc: Connor H <cmdkhh@gmail.com>
      Cc: stable@kernel.org
      Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
      5f6f12cc
    • Linus Torvalds's avatar
      Merge branch 'fbmem' · afa49791
      Linus Torvalds authored
      * fbmem:
        Further fbcon sanity checking
        fbmem: fix remove_conflicting_framebuffers races
      afa49791
    • Tejun Heo's avatar
      Revert "libata: ahci_start_engine compliant to AHCI spec" · 22fe9446
      Tejun Heo authored
      This reverts commit 270dac35.
      
      The commits causes command timeouts on AC plug/unplug.  It isn't yet
      clear why.  As the commit was for a single rather obscure controller,
      revert the change for now.
      
      The problem was reported and bisected by Gu Rui in bug#34692.
      
       https://bugzilla.kernel.org/show_bug.cgi?id=34692
      
      Also, reported by Rafael and Michael in the following thread.
      
       http://thread.gmane.org/gmane.linux.kernel/1138771Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Reported-by: default avatarGu Rui <chaos.proton@gmail.com>
      Reported-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Reported-by: default avatarMichael Leun <lkml20100708@newton.leun.net>
      Cc: Jian Peng <jipeng2005@gmail.com>
      Cc: Jeff Garzik <jgarzik@pobox.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      22fe9446
    • Bruno Prémont's avatar
      Further fbcon sanity checking · c590cece
      Bruno Prémont authored
      This moves the
      
          if (num_registered_fb == FB_MAX)
                  return -ENXIO;
      
      check _AFTER_ the call to do_remove_conflicting_framebuffers() as this
      would (now in a safe way) allow a native driver to replace the
      conflicting one even if all slots in registered_fb[] are taken.
      
      This also prevents unregistering a framebuffer that is no longer
      registered (vga16f will unregister at module unload time even if the
      frame buffer had been unregistered earlier due to being found
      conflicting).
      Signed-off-by: default avatarBruno Prémont <bonbons@linux-vserver.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c590cece
    • Linus Torvalds's avatar
      fbmem: fix remove_conflicting_framebuffers races · 712f3147
      Linus Torvalds authored
      When a register_framebuffer() call results in us removing old
      conflicting framebuffers, the new registration_lock doesn't protect that
      situation.  And we can't just add the same locking to the function,
      because these functions call each other: register_framebuffer() calls
      remove_conflicting_framebuffers, which in turn calls
      unregister_framebuffer for any conflicting entry.
      
      In order to fix it, this just creates wrapper functions around all three
      functions and makes the versions that actually do the work be called
      "do_xxx()", leaving just the wrapper that gets the lock and calls the
      worker function.
      
      So the rule becomes simply that "do_xxxx()" has to be called with the
      lock held, and now do_register_framebuffer() can just call
      do_remove_conflicting_framebuffers(), and that in turn can call
      _do_unregister_framebuffer(), and there is no deadlock, and we can hold
      the registration lock over the whole sequence, fixing the races.
      
      It also makes error cases simpler, and fixes one situation where we
      would return from unregister_framebuffer() without releasing the lock,
      pointed out by Bruno Prémont.
      Tested-by: default avatarBruno Prémont <bonbons@linux-vserver.org>
      Tested-by: default avatarAnca Emanuel <anca.emanuel@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      712f3147