1. 11 Dec, 2013 1 commit
    • Tejun Heo's avatar
      sysfs: bail early from kernfs_file_mmap() to avoid spurious lockdep warning · 9b2db6e1
      Tejun Heo authored
      This is v3.14 fix for the same issue that a8b14744 ("sysfs: give
      different locking key to regular and bin files") addresses for v3.13.
      Due to the extensive kernfs reorganization in v3.14 branch, the same
      fix couldn't be ported as-is.  The v3.13 fix was ignored while merging
      it into v3.14 branch.
      
      027a485d ("sysfs: use a separate locking class for open files
      depending on mmap") assigned different lockdep key to
      sysfs_open_file->mutex depending on whether the file implements mmap
      or not in an attempt to avoid spurious lockdep warning caused by
      merging of regular and bin file paths.
      
      While this restored some of the original behavior of using different
      locks (at least lockdep is concerned) for the different clases of
      files.  The restoration wasn't full because now the lockdep key
      assignment depends on whether the file has mmap or not instead of
      whether it's a regular file or not.
      
      This means that bin files which don't implement mmap will get assigned
      the same lockdep class as regular files.  This is problematic because
      file_operations for bin files still implements the mmap file operation
      and checking whether the sysfs file actually implements mmap happens
      in the file operation after grabbing @sysfs_open_file->mutex.  We
      still end up adding locking dependency from mmap locking to
      sysfs_open_file->mutex to the regular file mutex which triggers
      spurious circular locking warning.
      
      For v3.13, a8b14744 ("sysfs: give different locking key to regular
      and bin files") fixed it by giving sysfs_open_file->mutex different
      lockdep keys depending on whether the file is regular or bin instead
      of whether mmap exists or not; however, due to the way sysfs is now
      layered behind kernfs, this approach is no longer viable.  kernfs can
      tell whether a sysfs node has mmap implemented or not but can't tell
      whether a bin file from a regular one.
      
      This patch updates kernfs such that kernfs_file_mmap() checks
      SYSFS_FLAG_HAS_MMAP and bail before grabbing sysfs_open_file->mutex so
      that it doesn't add spurious locking dependency from mmap to
      sysfs_open_file->mutex and changes sysfs so that it specifies
      kernfs_ops->mmap iff the sysfs file implements mmap.  Combined, this
      ensures that sysfs_open_file->mutex is grabbed under mmap path iff the
      sysfs file actually implements mmap.  As sysfs_open_file->mutex is
      already given a different lockdep key if mmap is implemented, this
      removes the spurious locking dependency.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Reported-by: default avatarDave Jones <davej@redhat.com>
      Link: http://lkml.kernel.org/g/20131203184324.GA11320@redhat.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9b2db6e1
  2. 10 Dec, 2013 1 commit
    • Tejun Heo's avatar
      Merge branch 'driver-core-linus' into driver-core-next · 13ccb93f
      Tejun Heo authored
      a8b14744 ("sysfs: give different locking key to regular and bin
      files") in driver-core-linus modifies sysfs_open_file() so that it
      gives out different locking classes to sysfs_open_files depending on
      whether the file is bin or not.  Due to the massive kernfs
      reorganization in driver-core-next, this naturally causes merge
      conflict in fs/sysfs/file.c.
      
      Due to the way things are split between kernfs and sysfs in
      driver-core-next, the same fix can't easily be applied to
      driver-core-next.  This merge simply ignores the offending commit.  A
      following patch will implement a separate fix for the issue.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      13ccb93f
  3. 09 Dec, 2013 9 commits
  4. 08 Dec, 2013 3 commits
    • Tejun Heo's avatar
      sysfs: give different locking key to regular and bin files · a8b14744
      Tejun Heo authored
      027a485d ("sysfs: use a separate locking class for open files
      depending on mmap") assigned different lockdep key to
      sysfs_open_file->mutex depending on whether the file implements mmap
      or not in an attempt to avoid spurious lockdep warning caused by
      merging of regular and bin file paths.
      
      While this restored some of the original behavior of using different
      locks (at least lockdep is concerned) for the different clases of
      files.  The restoration wasn't full because now the lockdep key
      assignment depends on whether the file has mmap or not instead of
      whether it's a regular file or not.
      
      This means that bin files which don't implement mmap will get assigned
      the same lockdep class as regular files.  This is problematic because
      file_operations for bin files still implements the mmap file operation
      and checking whether the sysfs file actually implements mmap happens
      in the file operation after grabbing @sysfs_open_file->mutex.  We
      still end up adding locking dependency from mmap locking to
      sysfs_open_file->mutex to the regular file mutex which triggers
      spurious circular locking warning.
      
      Fix it by restoring the original behavior fully by differentiating
      lockdep key by whether the file is regular or bin, instead of the
      existence of mmap.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Reported-by: default avatarDave Jones <davej@redhat.com>
      Link: http://lkml.kernel.org/g/20131203184324.GA11320@redhat.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a8b14744
    • Bjorn Helgaas's avatar
      kobject: remove kset from sysfs immediately in kset_unregister() · 35a5fe69
      Bjorn Helgaas authored
      There's no "unlink from sysfs" interface for ksets, so I think callers of
      kset_unregister() expect the kset to be removed from sysfs immediately,
      without waiting for the last reference to be released.
      
      This patch makes the sysfs removal happen immediately, so the caller may
      create a new kset with the same name as soon as kset_unregister() returns.
      Without this, every caller has to call "kobject_del(&kset->kobj)" first
      unless it knows it will never create a new kset with the same name.
      
      This sometimes shows up on module unload and reload, where the reload fails
      because it tries to create a kobject with the same name as one from the
      original load that still exists.  CONFIG_DEBUG_KOBJECT_RELEASE=y makes this
      problem easier to hit.
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      35a5fe69
    • Bjorn Helgaas's avatar
      kobject: delay kobject release for random time · 89c86a64
      Bjorn Helgaas authored
      When CONFIG_DEBUG_KOBJECT_RELEASE=y, delay kobject release functions for a
      random time between 1 and 8 seconds, which effectively changes the order in
      which they're called.
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      89c86a64
  5. 06 Dec, 2013 11 commits
    • Linus Torvalds's avatar
      Linux 3.13-rc3 · 374b1057
      Linus Torvalds authored
      374b1057
    • Linus Torvalds's avatar
      Merge tag 'trace-fixes-3.13-rc2' of... · 843f4f4b
      Linus Torvalds authored
      Merge tag 'trace-fixes-3.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
      
      Pull tracing fix from Steven Rostedt:
       "A regression showed up that there's a large delay when enabling all
        events.  This was prevalent when FTRACE_SELFTEST was enabled which
        enables all events several times, and caused the system bootup to
        pause for over a minute.
      
        This was tracked down to an addition of a synchronize_sched()
        performed when system call tracepoints are unregistered.
      
        The synchronize_sched() is needed between the unregistering of the
        system call tracepoint and a deletion of a tracing instance buffer.
        But placing the synchronize_sched() in the unreg of *every* system
        call tracepoint is a bit overboard.  A single synchronize_sched()
        before the deletion of the instance is sufficient"
      
      * tag 'trace-fixes-3.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing: Only run synchronize_sched() at instance deletion time
      843f4f4b
    • Linus Torvalds's avatar
      Merge git://git.kvack.org/~bcrl/aio-next · c537aba0
      Linus Torvalds authored
      Pull aio fix from Benjamin LaHaise:
       "AIO fix from Gu Zheng that fixes a GPF that Dave Jones uncovered with
        trinity"
      
      * git://git.kvack.org/~bcrl/aio-next:
        aio: clean up aio ring in the fail path
      c537aba0
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 7adfff58
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "This is a set of nine fixes (and one author update).
      
        The libsas one should fix discovery in eSATA devices, the WRITE_SAME
        one is the largest, but it should fix a lot of problems we've been
        getting with the emulated RAID devices (they've been effectively lying
        about support and then firmware has been choking on the commands).
      
        The rest are various crash, hang or warn driver fixes"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        [SCSI] bfa: Fix crash when symb name set for offline vport
        [SCSI] enclosure: fix WARN_ON in dual path device removing
        [SCSI] pm80xx: Tasklets synchronization fix.
        [SCSI] pm80xx: Resetting the phy state.
        [SCSI] pm80xx: Fix for direct attached device.
        [SCSI] pm80xx: Module author addition
        [SCSI] hpsa: return 0 from driver probe function on success, not 1
        [SCSI] hpsa: do not discard scsi status on aborted commands
        [SCSI] Disable WRITE SAME for RAID and virtual host adapter drivers
        [SCSI] libsas: fix usage of ata_tf_to_fis
      7adfff58
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security · 470abdcf
      Linus Torvalds authored
      Pull IMA fixes from James Morris:
       "Here are two more fixes for IMA"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
        ima: properly free ima_template_entry structures
        ima: Do not free 'entry' before it is initialized
      470abdcf
    • Linus Torvalds's avatar
      Merge tag 'dt-fixes-for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux · 24cb4120
      Linus Torvalds authored
      Pull devicetree fixes from Rob Herring:
       - Various DT binding documentation updates
       - Add Kumar Gala and remove Stephen Warren as DT binding maintainers
      
      * tag 'dt-fixes-for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
        dt: binding: reword PowerPC 8xxx GPIO documentation
        ARM: tegra: delete nvidia,tegra20-spi.txt binding
        hwmon: ntc_thermistor: Fix typo (pullup-uV -> pullup-uv)
        of: add vendor prefix for GMT
        clk: exynos: Fix typos in DT bindings documentation
        of: Add vendor prefix for LG Corporation
        Documentation: net: fsl-fec.txt: Add phy-supply entry
        ARM: dts: doc: Document missing binding for omap5-mpu
        dt-bindings: add ARMv8 PMU binding
        MAINTAINERS: remove swarren from DT bindings
        MAINTAINERS: Add Kumar to Device Tree Binding maintainers group
      24cb4120
    • Gu Zheng's avatar
      aio: clean up aio ring in the fail path · d1b94327
      Gu Zheng authored
      Clean up the aio ring file in the fail path of aio_setup_ring
      and ioctx_alloc. And maybe it can fix the GPF issue reported by
      Dave Jones:
      https://lkml.org/lkml/2013/11/25/898Signed-off-by: default avatarGu Zheng <guz.fnst@cn.fujitsu.com>
      Signed-off-by: default avatarBenjamin LaHaise <bcrl@kvack.org>
      d1b94327
    • James Morris's avatar
      Merge branch 'free-memory' of... · bfb26328
      James Morris authored
      Merge branch 'free-memory' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity into for-linus
      bfb26328
    • Linus Torvalds's avatar
      Merge tag 'pm-3.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 002acf1f
      Linus Torvalds authored
      Pull power management fixes from Rafael Wysocki:
      
       - cpufreq regression fix from Bjørn Mork restoring the pre-3.12
         behavior of the framework during system suspend/hibernation to avoid
         garbage sysfs files from being left behind in case of a suspend error
      
       - PNP regression fix to restore the correct states of devices after
         resume from hibernation broken in 3.12.  From Dmitry Torokhov.
      
       - cpuidle fix to prevent cpuidle device unregistration from crashing
         due to a NULL pointer dereference if cpuidle has been disabled from
         the kernel command line.  From Konrad Rzeszutek Wilk.
      
       - intel_idle fix for the C6 state definition on Intel Avoton/Rangeley
         processors from Arne Bockholdt.
      
       - Power capping framework fix to make the energy_uj sysfs attribute
         work in accordance with the documentation.  From Srinivas Pandruvada.
      
       - epoll fix to make it ignore the EPOLLWAKEUP flag if the kernel has
         been compiled with CONFIG_PM_SLEEP unset (in which case that flag
         should not have any effect).  From Amit Pundir.
      
       - cpufreq fix to prevent governor sysfs files from being lost over
         system suspend/resume in some (arguably unusual) situations.  From
         Viresh Kumar.
      
      * tag 'pm-3.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        PowerCap: Fix mode for energy counter
        PNP: fix restoring devices after hibernation
        cpuidle: Check for dev before deregistering it.
        epoll: drop EPOLLWAKEUP if PM_SLEEP is disabled
        cpufreq: fix garbage kobjects on errors during suspend/resume
        cpufreq: suspend governors on system suspend/hibernate
        intel_idle: Fixed C6 state on Avoton/Rangeley processors
      002acf1f
    • Rafael J. Wysocki's avatar
      Merge branches 'pm-epoll', 'pnp' and 'powercap' · 8e703009
      Rafael J. Wysocki authored
      * pm-epoll:
        epoll: drop EPOLLWAKEUP if PM_SLEEP is disabled
      
      * pnp:
        PNP: fix restoring devices after hibernation
      
      * powercap:
        PowerCap: Fix mode for energy counter
      8e703009
    • Rafael J. Wysocki's avatar
      Merge branches 'pm-cpuidle' and 'pm-cpufreq' · 7cdcec99
      Rafael J. Wysocki authored
      * pm-cpuidle:
        cpuidle: Check for dev before deregistering it.
        intel_idle: Fixed C6 state on Avoton/Rangeley processors
      
      * pm-cpufreq:
        cpufreq: fix garbage kobjects on errors during suspend/resume
        cpufreq: suspend governors on system suspend/hibernate
      7cdcec99
  6. 05 Dec, 2013 14 commits
  7. 04 Dec, 2013 1 commit