1. 06 10月, 2013 12 次提交
    • T
      sysfs: add sysfs_bin_read() · 2f0c6b75
      Tejun Heo 提交于
      sysfs bin file handling will be merged into the regular file support.
      This patch prepares the read path.
      
      Copy fs/sysfs/bin.c::read() to fs/sysfs/file.c and make it use
      sysfs_open_file instead of bin_buffer.  The function is identical copy
      except for the use of sysfs_open_file.
      
      The new function is added to sysfs_bin_operations.  This isn't used
      yet but will eventually replace fs/sysfs/bin.c.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2f0c6b75
    • T
      sysfs: prepare path write for unified regular / bin file handling · f9b9a621
      Tejun Heo 提交于
      sysfs bin file handling will be merged into the regular file support.
      This patch prepares the write path.
      
      bin file write is almost identical to regular file write except that
      the write length is capped by the inode size and @off is passed to the
      write method.  This patch adds bin file handling to sysfs_write_file()
      so that it can handle both regular and bin files.
      
      A new file_operations struct sysfs_bin_operations is added, which
      currently only hosts sysfs_write_file() and generic_file_llseek().
      This isn't used yet but will eventually replace fs/sysfs/bin.c.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f9b9a621
    • T
      sysfs: collapse fs/sysfs/bin.c::fill_read() into read() · 3ff65d3c
      Tejun Heo 提交于
      read() is simple enough and fill_read() being in a separate function
      doesn't add anything.  Let's collapse it into read().  This will make
      merging bin file handling with regular file.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3ff65d3c
    • T
      sysfs: skip bin_buffer->buffer while reading · 91270162
      Tejun Heo 提交于
      After b31ca3f5 ("sysfs: fix deadlock"), bin read() first writes
      data to bb->buffer and bounces it to a transient kernel buffer which
      is then copied out to userland.  The double bouncing doesn't add
      anything.  Let's just use the transient buffer directly.
      
      While at it, rename @temp to @buf for clarity.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      91270162
    • T
      sysfs: use seq_file when reading regular files · 13c589d5
      Tejun Heo 提交于
      sysfs read path implements its own buffering scheme between userland
      and kernel callbacks, which essentially is a degenerate duplicate of
      seq_file.  This patch replaces the custom read buffering
      implementation in sysfs with seq_file.
      
      While the amount of code reduction is small, this reduces low level
      hairiness and enables future development of a new versatile API based
      on seq_file so that sysfs features can be shared with other
      subsystems.
      
      As write path was already converted to not use sysfs_open_file->page,
      this patch makes ->page and ->count unused and removes them.
      
      Userland behavior remains the same except for some extreme corner
      cases - e.g. sysfs will now regenerate the content each time a file is
      read after a non-contiguous seek whereas the original code would keep
      using the same content.  While this is a userland visible behavior
      change, it is extremely unlikely to be noticeable and brings sysfs
      behavior closer to that of procfs.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Kay Sievers <kay@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      13c589d5
    • T
      sysfs: use transient write buffer · 8ef445f0
      Tejun Heo 提交于
      There isn't much to be gained by keeping around kernel buffer while a
      file is open especially as the read path planned to be converted to
      use seq_file and won't use the buffer.  This patch makes
      sysfs_write_file() use per-write transient buffer instead of
      sysfs_open_file->page.
      
      This simplifies the write path, enables removing sysfs_open_file->page
      once read path is updated and will help merging bin file write path
      which already requires the use of a transient buffer due to a locking
      order issue.
      
      As the function comments of flush_write_buffer() and
      sysfs_write_buffer() are being updated anyway, reformat them so that
      they're more conventional.
      
      v2: Use min_t() instead of min() in sysfs_write_file() to avoid build
          warning on arm.  Reported by build test robot.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: kbuild test robot <fengguang.wu@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8ef445f0
    • T
      sysfs: add sysfs_open_file->sd and ->file · bcafe4ee
      Tejun Heo 提交于
      sysfs will be converted to use seq_file for read path, which will make
      it difficult to pass around multiple pointers directly.  This patch
      adds sysfs_open_file->sd and ->file so that we can reach all the
      necessary data structures from sysfs_open_file.
      
      flush_write_buffer() is updated to drop @dentry which was used to
      discover the sysfs_dirent as it's now available through
      sysfs_open_file->sd.
      
      This patch doesn't cause any behavior difference.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bcafe4ee
    • T
      sysfs: rename sysfs_buffer to sysfs_open_file · 58282d8d
      Tejun Heo 提交于
      sysfs read path will be converted to use seq_file which will handle
      buffering making sysfs_buffer a misnomer.  Rename sysfs_buffer to
      sysfs_open_file, and sysfs_open_dirent->buffers to ->files.
      
      This path is pure rename.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      58282d8d
    • T
      sysfs: add sysfs_open_file_mutex · c75ec764
      Tejun Heo 提交于
      Add a separate mutex to protect sysfs_open_dirent->buffers list.  This
      will allow performing sleepable operations while traversing
      sysfs_buffers, which will be renamed to sysfs_open_file.
      
      Note that currently sysfs_open_dirent->buffers list isn't being used
      for anything and this patch doesn't make any functional difference.
      It will be used to merge regular and bin file supports.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c75ec764
    • T
      sysfs: remove sysfs_buffer->ops · 375b611e
      Tejun Heo 提交于
      Currently, sysfs_ops is fetched during sysfs_open_file() and cached in
      sysfs_buffer->ops to be used while the file is open.  This patch
      removes the caching and makes each operation directly fetch sysfs_ops.
      
      This patch doesn't introduce any behavior difference and is to prepare
      for merging regular and bin file supports.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      375b611e
    • T
      sysfs: remove sysfs_buffer->needs_read_fill · aea585ef
      Tejun Heo 提交于
      ->needs_read_fill is used to implement the following behaviors.
      
      1. Ensure buffer filling on the first read.
      2. Force buffer filling after a write.
      3. Force buffer filling after a successful poll.
      
      However, #2 and #3 don't really work as sysfs doesn't reset file
      position.  While the read buffer would be refilled, the next read
      would continue from the position after the last read or write,
      requiring an explicit seek to the start for it to be useful, which
      makes ->needs_read_fill superflous as read buffer is always refilled
      if f_pos == 0.
      
      Update sysfs_read_file() to test buffer->page for #1 instead and
      remove ->needs_read_fill.  While this changes behavior in extreme
      corner cases - e.g. re-reading a sysfs file after seeking to non-zero
      position after a write or poll, it's highly unlikely to lead to actual
      breakage.  This change is to prepare for using seq_file in the read
      path.
      
      While at it, reformat a comment in fill_write_buffer().
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Kay Sievers <kay@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aea585ef
    • T
      sysfs: remove unused sysfs_buffer->pos · 89e51dab
      Tejun Heo 提交于
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      89e51dab
  2. 04 10月, 2013 5 次提交
    • T
      sysfs: introduce [__]sysfs_remove() · 250f7c3f
      Tejun Heo 提交于
      Given a sysfs_dirent, there is no reason to have multiple versions of
      removal functions.  A function which removes the specified
      sysfs_dirent and its descendants is enough.
      
      This patch intorduces [__}sysfs_remove() which replaces all internal
      variations of removal functions.  This will be the only removal
      function in the planned new sysfs_dirent based interface.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      250f7c3f
    • T
      sysfs: make __sysfs_remove_dir() recursive · bcdde7e2
      Tejun Heo 提交于
      Currently, sysfs directory removal is inconsistent in that it would
      remove any files directly under it but wouldn't recurse into
      directories.  Thanks to group subdirectories, this doesn't even match
      with kobject boundaries.  sysfs is in the process of being separated
      out so that it can be used by multiple subsystems and we want to have
      a consistent behavior - either removal of a sysfs_dirent should remove
      every descendant entries or none instead of something inbetween.
      
      This patch implements proper recursive removal in
      __sysfs_remove_dir().  The function now walks its subtree in a
      post-order walk to remove all descendants.
      
      This is a behavior change but kobject / driver layer, which currently
      is the only consumer, has already been updated to handle duplicate
      removal attempts, so nothing should be broken after this change.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bcdde7e2
    • T
      kobject: grab an extra reference on kobject->sd to allow duplicate deletes · 26ea12de
      Tejun Heo 提交于
      sysfs currently has a rather weird behavior regarding removals.  A
      directory removal would delete all files directly under it but
      wouldn't recurse into subdirectories, which, while a bit inconsistent,
      seems to make sense at the first glance as each directory is
      supposedly associated with a kobject and each kobject can take care of
      the directory deletion; however, this doesn't really hold as we have
      groups which can be directories without a kobject associated with it
      and require explicit deletions.
      
      We're in the process of separating out sysfs from kboject / driver
      core and want a consistent behavior.  A removal should delete either
      only the specified node or everything under it.  I think it is helpful
      to support recursive atomic removal and later patches will implement
      it.
      
      Such change means that a sysfs_dirent associated with kobject may be
      deleted before the kobject itself is removed if one of its ancestor
      gets removed before it.  As sysfs_remove_dir() puts the base ref, we
      may end up with dangling pointer on descendants.  This can be solved
      by holding an extra reference on the sd from kobject.
      
      Acquire an extra reference on the associated sysfs_dirent on directory
      creation and put it after removal.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      26ea12de
    • T
      sysfs: remove sysfs_addrm_cxt->parent_sd · d69ac5a0
      Tejun Heo 提交于
      sysfs_addrm_start/finish() enclose sysfs_dirent additions and
      deletions and sysfs_addrm_cxt is used to record information necessary
      to finish the operations.  Currently, sysfs_addrm_start() takes
      @parent_sd, records it in sysfs_addrm_cxt, and assumes that all
      operations in the block are performed under that @parent_sd.
      
      This assumption has been fine until now but we want to make some
      operations behave recursively and, while having @parent_sd recorded in
      sysfs_addrm_cxt doesn't necessarily prevents that, it becomes
      confusing.
      
      This patch removes sysfs_addrm_cxt->parent_sd and makes
      sysfs_add_one() take an explicit @parent_sd parameter.  Note that
      sysfs_remove_one() doesn't need the extra argument as its parent is
      always known from the target @sd.
      
      While at it, add __acquires/releases() notations to
      sysfs_addrm_start/finish() respectively.
      
      This patch doesn't make any functional difference.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d69ac5a0
    • W
      fs/debugfs: add declaration for no CONFIG_DEBUG_FS · 5b880214
      Weijie Yang 提交于
      Two function declarations are absence if not define CONFIG_DEBUG_FS
      in include/linux/debugfs.h
      Signed-off-by: NWeijie Yang <weijie.yang@samsung.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5b880214
  3. 30 9月, 2013 9 次提交
    • G
      Merge 3.12-rc3 into driver-core-next · 88502b9c
      Greg Kroah-Hartman 提交于
      We want the driver core and sysfs fixes in here to make merges and
      development easier.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      88502b9c
    • L
      Linux 3.12-rc3 · 15c03dd4
      Linus Torvalds 提交于
      15c03dd4
    • L
      Merge tag 'usb-3.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 30ceb4ec
      Linus Torvalds 提交于
      Pull USB fixes from Greg KH:
       "Here are a number of USB driver fixes for 3.12-rc3.
      
        These are all for host controller issues that have been reported, and
        there's a fix for an annoying error message that gets printed every
        time you remove a USB 3 device from the system that's been bugging me
        for a while"
      
      * tag 'usb-3.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        usb: dwc3: add support for Merrifield
        USB: fsl/ehci: fix failure of checking PHY_CLK_VALID during reinitialization
        USB: Fix breakage in ffs_fs_mount()
        fsl/usb: Resolve PHY_CLK_VLD instability issue for ULPI phy
        usb/core/devio.c: Don't reject control message to endpoint with wrong direction bit
        usb: chipidea: USB_CHIPIDEA should depend on HAS_DMA
        usb: chipidea: udc: free pending TD at removal procedure
        usb: chipidea: imx: Add usb_phy_shutdown at probe's error path
        usb: chipidea: Fix memleak for ci->hw_bank.regmap when removal
        usb: chipidea: udc: fix the oops after rmmod gadget
        USB: fix PM config symbol in uhci-hcd, ehci-hcd, and xhci-hcd
        USB: OHCI: accept very late isochronous URBs
        USB: UHCI: accept very late isochronous URBs
        USB: iMX21: accept very late isochronous URBs
        usbcore: check usb device's state before sending a Set SEL control transfer
        xhci: Fix race between ep halt and URB cancellation
        usb: Fix xHCI host issues on remote wakeup.
        xhci: Ensure a command structure points to the correct trb on the command ring
        xhci: Fix oops happening after address device timeout
      30ceb4ec
    • L
      Merge tag 'tty-3.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 26c019fc
      Linus Torvalds 提交于
      Pull tty/serial fixes from Greg KH:
       "Here are some serial at tty driver fixes for 3.12-rc3
      
        The serial driver fixes some kref leaks, documentation is moved to the
        proper places, and the tty and n_tty fixes resolve some reported
        regressions.  There is still one outstanding tty regression fix that
        isn't in here yet, as I want to test it out some more, it will be sent
        for 3.12-rc4 if it checks out"
      
      * tag 'tty-3.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        tty: ar933x_uart: move devicetree binding documentation
        tty: Fix SIGTTOU not sent with tcflush()
        n_tty: Fix EOF push index when termios changes
        serial: pch_uart: remove unnecessary tty_port_tty_get
        serial: pch_uart: fix tty-kref leak in dma-rx path
        serial: pch_uart: fix tty-kref leak in rx-error path
        serial: tegra: fix tty-kref leak
      26c019fc
    • L
      Merge tag 'staging-3.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 31795c40
      Linus Torvalds 提交于
      Pull staging fixes from Greg KH:
       "Here are some staging driver fixes, MAINTAINER updates, and a new
        device id.  All of these have been in the linux-next tree, and are
        pretty simple patches"
      
      * tag 'staging-3.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        staging: r8188eu: Add new device ID
        staging: imx-drm: Fix probe failure
        staging: vt6656: [BUG] iwctl_siwencodeext return if device not open
        staging: vt6656: [BUG] main_usb.c oops on device_close move flag earlier.
        staging: vt6656: rxtx.c [BUG] s_vGetFreeContext dead lock on null apTD.
        Staging: rtl8192u: r819xU_cmdpkt: checking NULL value after doing dev_alloc_skb
        staging: usbip: Orphan usbip
        staging: r8188eu: Add files for new drive: Cocci spatch "noderef"
        staging: r8188eu: Cocci spatch "noderef"
        staging: octeon-usb: Cocci spatch "noderef"
        staging: r8188eu: Add files for new drive: Cocci spatch "noderef"
        MAINTAINERS: staging: dgnc and dgap drivers: add maintainer
        staging: lustre: Cocci spatch "noderef"
      31795c40
    • L
      Merge tag 'driver-core-3.12-rc3' of... · 434ac47d
      Linus Torvalds 提交于
      Merge tag 'driver-core-3.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
      
      Pull driver core / sysfs fixes from Greg KH:
       "Here are 2 fixes for 3.12-rc3.  One fixes a sysfs problem with
        mounting caused by 3.12-rc1, and the other is a bug reported by the
        chromeos developers with the driver core.
      
        Both have been in linux-next for a bit"
      
      * tag 'driver-core-3.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        driver core : Fix use after free of dev->parent in device_shutdown
        sysfs: Allow mounting without CONFIG_NET
      434ac47d
    • L
      Merge tag 'char-misc-3.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · c23c2234
      Linus Torvalds 提交于
      Pull char/misc driver fixes from Greg KH:
       "Here are some HyperV and MEI driver fixes for 3.12-rc3.  They resolve
        some issues that people have been reporting for them"
      
      * tag 'char-misc-3.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        Drivers: hv: vmbus: Terminate vmbus version negotiation on timeout
        Drivers: hv: util: Correctly support ws2008R2 and earlier
        mei: cancel stall timers in mei_reset
        mei: bus: stop wait for read during cl state transition
        mei: make me client counters less error prone
      c23c2234
    • L
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · cac66535
      Linus Torvalds 提交于
      Pull perf revert from Ingo Molnar:
       "This fixes the 'perf top' regression Markus Trippelsdorf reported"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        Revert "perf symbols: Demangle cloned functions"
      cac66535
    • L
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · b97b869a
      Linus Torvalds 提交于
      Pull drm fixes from Dave Airlie:
       "Nothing too major, radeon still has some dpm changes for off by
        default.
      
        Radeon, intel, msm:
         - radeon: a few more dpm fixes (still off by default), uvd fixes
         - i915: runtime warn backtrace and regression fix
         - msm: iommu changes fallout"
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (27 commits)
        drm/msm: use drm_gem_dumb_destroy helper
        drm/msm: deal with mach/iommu.h removal
        drm/msm: Remove iommu include from mdp4_kms.c
        drm/msm: Odd PTR_ERR usage
        drm/i915: Fix up usage of SHRINK_STOP
        drm/radeon: fix hdmi audio on DCE3.0/3.1 asics
        drm/i915: preserve pipe A quirk in i9xx_set_pipeconf
        drm/i915/tv: clear adjusted_mode.flags
        drm/i915/dp: increase i2c-over-aux retry interval on AUX DEFER
        drm/radeon/cik: fix overflow in vram fetch
        drm/radeon: add missing hdmi callbacks for rv6xx
        drm/i915: Use a temporary va_list for two-pass string handling
        drm/radeon/uvd: lower msg&fb buffer requirements on UVD3
        drm/radeon: disable tests/benchmarks if accel is disabled
        drm/radeon: don't set default clocks for SI when DPM is disabled
        drm/radeon/dpm/ci: filter clocks based on voltage/clk dep tables
        drm/radeon/dpm/si: filter clocks based on voltage/clk dep tables
        drm/radeon/dpm/ni: filter clocks based on voltage/clk dep tables
        drm/radeon/dpm/btc: filter clocks based on voltage/clk dep tables
        drm/radeon/dpm: fetch the max clk from voltage dep tables helper
        ...
      b97b869a
  4. 29 9月, 2013 13 次提交
  5. 28 9月, 2013 1 次提交