1. 21 10月, 2014 1 次提交
  2. 16 10月, 2014 2 次提交
  3. 10 10月, 2014 4 次提交
    • S
      zram: use notify_free to account all free notifications · 015254da
      Sergey Senozhatsky 提交于
      `notify_free' device attribute accounts the number of slot free
      notifications and internally represents the number of zram_free_page()
      calls.  Slot free notifications are sent only when device is used as a
      swap device, hence `notify_free' is used only for swap devices.  Since
      f4659d8e (zram: support REQ_DISCARD) ZRAM handles yet another one
      free notification (also via zram_free_page() call) -- REQ_DISCARD
      requests, which are sent by a filesystem, whenever some data blocks are
      discarded.  However, there is no way to know the number of notifications
      in the latter case.
      
      Use `notify_free' to account the number of pages freed by
      zram_bio_discard() and zram_slot_free_notify().  Depending on usage
      scenario `notify_free' represents:
      
       a) the number of pages freed because of slot free notifications, which is
         equal to the number of swap_slot_free_notify() calls, so there is no
         behaviour change
      
       b) the number of pages freed because of REQ_DISCARD notifications
      Signed-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: NMinchan Kim <minchan@kernel.org>
      Acked-by: NJerome Marchand <jmarchan@redhat.com>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Chao Yu <chao2.yu@samsung.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      015254da
    • M
      zram: report maximum used memory · 461a8eee
      Minchan Kim 提交于
      Normally, zram user could get maximum memory usage zram consumed via
      polling mem_used_total with sysfs in userspace.
      
      But it has a critical problem because user can miss peak memory usage
      during update inverval of polling.  For avoiding that, user should poll it
      with shorter interval(ie, 0.0000000001s) with mlocking to avoid page fault
      delay when memory pressure is heavy.  It would be troublesome.
      
      This patch adds new knob "mem_used_max" so user could see the maximum
      memory usage easily via reading the knob and reset it via "echo 0 >
      /sys/block/zram0/mem_used_max".
      Signed-off-by: NMinchan Kim <minchan@kernel.org>
      Reviewed-by: NDan Streetman <ddstreet@ieee.org>
      Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Jerome Marchand <jmarchan@redhat.com>
      Cc: <juno.choi@lge.com>
      Cc: <seungho1.park@lge.com>
      Cc: Luigi Semenzato <semenzato@google.com>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Seth Jennings <sjennings@variantweb.net>
      Reviewed-by: NDavid Horner <ds2horner@gmail.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      461a8eee
    • M
      zram: zram memory size limitation · 9ada9da9
      Minchan Kim 提交于
      Since zram has no control feature to limit memory usage, it makes hard to
      manage system memrory.
      
      This patch adds new knob "mem_limit" via sysfs to set up the a limit so
      that zram could fail allocation once it reaches the limit.
      
      In addition, user could change the limit in runtime so that he could
      manage the memory more dynamically.
      
      Initial state is no limit so it doesn't break old behavior.
      
      [akpm@linux-foundation.org: fix typo, per Sergey]
      Signed-off-by: NMinchan Kim <minchan@kernel.org>
      Cc: Dan Streetman <ddstreet@ieee.org>
      Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Jerome Marchand <jmarchan@redhat.com>
      Cc: <juno.choi@lge.com>
      Cc: <seungho1.park@lge.com>
      Cc: Luigi Semenzato <semenzato@google.com>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Seth Jennings <sjennings@variantweb.net>
      Cc: David Horner <ds2horner@gmail.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9ada9da9
    • Z
      memory-hotplug: add sysfs valid_zones attribute · ed2f2400
      Zhang Zhen 提交于
      Currently memory-hotplug has two limits:
      
      1. If the memory block is in ZONE_NORMAL, you can change it to
         ZONE_MOVABLE, but this memory block must be adjacent to ZONE_MOVABLE.
      
      2. If the memory block is in ZONE_MOVABLE, you can change it to
         ZONE_NORMAL, but this memory block must be adjacent to ZONE_NORMAL.
      
      With this patch, we can easy to know a memory block can be onlined to
      which zone, and don't need to know the above two limits.
      
      Updated the related Documentation.
      
      [akpm@linux-foundation.org: use conventional comment layout]
      [akpm@linux-foundation.org: fix build with CONFIG_MEMORY_HOTREMOVE=n]
      [akpm@linux-foundation.org: remove unused local zone_prev]
      Signed-off-by: NZhang Zhen <zhenzhang.zhang@huawei.com>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Toshi Kani <toshi.kani@hp.com>
      Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
      Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ed2f2400
  4. 08 10月, 2014 1 次提交
  5. 07 10月, 2014 1 次提交
  6. 03 10月, 2014 1 次提交
  7. 02 10月, 2014 1 次提交
    • Y
      PCI/MSI: Add "msi_bus" sysfs MSI/MSI-X control for endpoints · 468ff15a
      Yijing Wang 提交于
      The "msi_bus" sysfs file for bridges sets a bus flag to allow or disallow
      future driver requests for MSI or MSI-X.  Previously, the sysfs file
      existed for endpoints but did nothing.
      
      Add "msi_bus" support for endpoints, so an administrator can prevent the
      use of MSI and MSI-X for individual devices.
      
      Note that as for bridges, these changes only affect future driver requests
      for MSI or MSI-X, so drivers may need to be reloaded.
      
      Add documentation for the "msi_bus" sysfs file.
      
      [bhelgaas: changelog, comments, add "subordinate", add endpoint printk,
      rework bus_flags setting, make bus_flags printk unconditional]
      Signed-off-by: NYijing Wang <wangyijing@huawei.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      468ff15a
  8. 27 9月, 2014 1 次提交
  9. 24 9月, 2014 2 次提交
  10. 16 9月, 2014 1 次提交
    • J
      f2fs: give an option to enable in-place-updates during fsync to users · c1ce1b02
      Jaegeuk Kim 提交于
      If user wrote F2FS_IPU_FSYNC:4 in /sys/fs/f2fs/ipu_policy, f2fs_sync_file
      only starts to try in-place-updates.
      And, if the number of dirty pages is over /sys/fs/f2fs/min_fsync_blocks, it
      keeps out-of-order manner. Otherwise, it triggers in-place-updates.
      
      This may be used by storage showing very high random write performance.
      
      For example, it can be used when,
      
      Seq. writes (Data) + wait + Seq. writes (Node)
      
      is pretty much slower than,
      
      Rand. writes (Data)
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      c1ce1b02
  11. 27 8月, 2014 1 次提交
  12. 26 8月, 2014 1 次提交
  13. 21 8月, 2014 2 次提交
  14. 09 8月, 2014 8 次提交
    • V
      nilfs2: add /sys/fs/nilfs2/<device>/mounted_snapshots/<snapshot> group · a5a7332a
      Vyacheslav Dubeyko 提交于
      This patch adds creation of <snapshot> group for every mounted
      snapshot in /sys/fs/nilfs2/<device>/mounted_snapshots group.
      
      The group contains details about mounted snapshot:
      (1) inodes_count - show number of inodes for snapshot.
      (2) blocks_count - show number of blocks for snapshot.
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Michael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a5a7332a
    • V
      nilfs2: add /sys/fs/nilfs2/<device>/mounted_snapshots group · a2ecb791
      Vyacheslav Dubeyko 提交于
      This patch adds creation of /sys/fs/nilfs2/<device>/mounted_snapshots
      group.
      
      The mounted_snapshots group contains group for every
      mounted snapshot.
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Michael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a2ecb791
    • V
      nilfs2: add /sys/fs/nilfs2/<device>/checkpoints group · 02a0ba1c
      Vyacheslav Dubeyko 提交于
      This patch adds creation of /sys/fs/nilfs2/<device>/checkpoints
      group.
      
      The checkpoints group contains attributes that describe
      details about volume's checkpoints:
      (1) checkpoints_number - show number of checkpoints on volume.
      (2) snapshots_number - show number of snapshots on volume.
      (3) last_seg_checkpoint - show checkpoint number of the latest segment.
      (4) next_checkpoint - show next checkpoint number.
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Michael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      02a0ba1c
    • V
      nilfs2: add /sys/fs/nilfs2/<device>/segments group · ef43d5cd
      Vyacheslav Dubeyko 提交于
      This patch adds creation of /sys/fs/nilfs2/<device>/segments
      group.
      
      The segments group contains attributes that describe
      details about volume's segments:
      (1) segments_number - show number of segments on volume.
      (2) blocks_per_segment - show number of blocks in segment.
      (3) clean_segments - show count of clean segments.
      (4) dirty_segments - show count of dirty segments.
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Michael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ef43d5cd
    • V
      nilfs2: add /sys/fs/nilfs2/<device>/segctor group · abc968db
      Vyacheslav Dubeyko 提交于
      This patch adds creation of /sys/fs/nilfs2/<device>/segctor
      group.
      
      The segctor group contains attributes that describe
      segctor thread activity details:
      (1) last_pseg_block - show start block number of the latest segment.
      (2) last_seg_sequence - show sequence value of the latest segment.
      (3) last_seg_checkpoint - show checkpoint number of the latest segment.
      (4) current_seg_sequence - show segment sequence counter.
      (5) current_last_full_seg - show index number of the latest full segment.
      (6) next_full_seg - show index number of the full segment index
      to be used next.
      (7) next_pseg_offset - show offset of next partial segment in
      the current full segment.
      (8) next_checkpoint - show next checkpoint number.
      (9) last_seg_write_time - show write time of the last segment
      in human-readable format.
      (10) last_seg_write_time_secs - show write time of the last segment
      in seconds.
      (11) last_nongc_write_time - show write time of the last segment
      not for cleaner operation in human-readable format.
      (12) last_nongc_write_time_secs - show write time of the last segment
      not for cleaner operation in seconds.
      (13) dirty_data_blocks_count - show number of dirty data blocks.
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Michael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      abc968db
    • V
      nilfs2: add /sys/fs/nilfs2/<device>/superblock group · caa05d49
      Vyacheslav Dubeyko 提交于
      This patch adds creation of /sys/fs/nilfs2/<device>/superblock
      group.
      
      The superblock group contains attributes that describe
      superblock's details:
      (1) sb_write_time - show previous write time of super block in
      human-readable format.
      (2) sb_write_time_secs - show previous write time of super block
      in seconds.
      (3) sb_write_count - show write count of super block.
      (4) sb_update_frequency - show/set interval of periodical update
      of superblock (in seconds). You can set preferable frequency of
      superblock update by command:
      
      echo <value> > /sys/fs/nilfs2/<device>/superblock/sb_update_frequency
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Michael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      caa05d49
    • V
      nilfs2: add /sys/fs/nilfs2/<device> group · da7141fb
      Vyacheslav Dubeyko 提交于
      This patch adds creation of /sys/fs/nilfs2/<device> group.
      
      The <device> group contains attributes that describe file
      system partition's details:
      (1) revision - show NILFS file system revision.
      (2) blocksize - show volume block size in bytes.
      (3) device_size - show volume size in bytes.
      (4) free_blocks - show count of free blocks on volume.
      (5) uuid - show volume's UUID.
      (6) volume_name - show volume's name.
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Michael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      da7141fb
    • V
      nilfs2: add /sys/fs/nilfs2/features group · aebe17f6
      Vyacheslav Dubeyko 提交于
      This patchset implements creation of sysfs groups and attributes with
      the purpose to show NILFS2 volume details, internal state of the driver
      and to manage internal state of NILFS2 driver.
      
      Sysfs is a virtual file system that exports information about devices
      and drivers from the kernel device model to user space, and is also used
      for configuration.  NILFS2 is a complex file system that has segctor
      thread, GC thread, checkpoint/snapshot model and so on.  Sysfs namespace
      provides native and easy way for: (1) getting info and statistics about
      volume state; (2) getting info and configuration of internal subsystems
      (segctor thread); (3) snapshots management.
      
      Suggested patchset provides basis for managing segctor thread behaviour
      and manipulation by snapshots.  Currently, it informs only about segctor
      thread's internal parameters and about mounted snapshots.  But sysfs
      interface can provide easy and simple way for deep management of segctor
      thread and snapshots.
      
      This patchset provides opportunity to manage interval of periodical
      update of superblock (in seconds).  Default value is 10 seconds.  Now a
      user can increase this value by means of
      nilfs2/<device>/superblock/sb_update_frequency attribute in the case of
      necessity.
      
      Also the patchset provides opportunity to get information easily about
      key volumes's parameters (free blocks, superblock write count,
      superblock update frequency, latest segment info, dirty data blocks
      count, count of clean segments, count of dirty segments and so on) in
      real time manner.  Such information can be used in scripts for subtle
      management of filesystem.
      
      Implemented functionality creates such groups:
      (1) /sys/fs/nilfs2 - root group
      (2) /sys/fs/nilfs2/features - group contains attributes that describe NILFS
      file system driver features
      (3) /sys/fs/nilfs2/<device> - group contains attributes that describe file
      system partition's details
      (4) /sys/fs/nilfs2/<device>/superblock - group contains attributes that describe
      superblock's details
      (5) /sys/fs/nilfs2/<device>/segctor - group contains attributes that describe
      segctor thread activity details
      (6) /sys/fs/nilfs2/<device>/segments - group contains attributes that describe
      details about volume's segments
      (7) /sys/fs/nilfs2/<device>/checkpoints - group contains attributes that describe
      details about volume's checkpoints
      (8) /sys/fs/nilfs2/<device>/mounted_snapshots - group contains group for every
      mounted snapshot
      (9) /sys/fs/nilfs2/<device>/mounted_snapshots/<snapshot> - group contains
      details about mounted snapshot
      
      This patch (of 9):
      
      This patch adds code of creation /sys/fs/nilfs2 group and
      /sys/fs/nilfs2/features group.
      
      The features group contains attributes that describe NILFS
      file system driver features:
      (1) revision - show current revision of NILFS file system driver.
      
      There are two formats of timestamp output - seconds and human-readable
      format.  Every showed timestamp has two sysfs files (time-<xxx> and
      time-<xxx>-secs).  One sysfs file (time-<xxx>) shows time in
      human-readable format.  Another sysfs file (time-<xxx>-secs) shows time in
      seconds.
      
      It was reported by Michael Semon that timestamp output in human-readable
      format should be changed from "2014-4-12 14:5:38" to "2014-04-12
      14:05:38".  Second version of the patch fixes this issue.
      Reported-by: NMichael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      aebe17f6
  15. 08 8月, 2014 1 次提交
  16. 07 8月, 2014 1 次提交
  17. 01 8月, 2014 1 次提交
  18. 29 7月, 2014 2 次提交
  19. 26 7月, 2014 1 次提交
  20. 25 7月, 2014 1 次提交
  21. 20 7月, 2014 1 次提交
  22. 18 7月, 2014 2 次提交
    • Y
      serial/uart/8250: Add tunable RX interrupt trigger I/F of FIFO buffers · aef9a7bd
      Yoshihiro YUNOMAE 提交于
      Add tunable RX interrupt trigger I/F of FIFO buffers.
      
      Serial devices are used as not only message communication devices but control
      or sending communication devices. For the latter uses, normally small data
      will be exchanged, so user applications want to receive data unit as soon as
      possible for real-time tendency. If we have a sensor which sends a 1 byte data
      each time and must control a device based on the sensor feedback, the RX
      interrupt should be triggered for each data.
      
      According to HW specification of serial UART devices, RX interrupt trigger
      can be changed, but the trigger is hard-coded. For example, RX interrupt trigger
      in 16550A can be set to 1, 4, 8, or 14 bytes for HW, but current driver sets
      the trigger to only 8bytes.
      
      This patch makes some devices change RX interrupt trigger from userland.
      
      <How to use>
      - Read current setting
       # cat /sys/class/tty/ttyS0/rx_trig_bytes
       8
      
      - Write user setting
       # echo 1 > /sys/class/tty/ttyS0/rx_trig_bytes
       # cat /sys/class/tty/ttyS0/rx_trig_bytes
       1
      
      <Support uart devices>
      - 16550A and Tegra (1, 4, 8, or 14 bytes)
      - 16650V2 (8, 16, 24, or 28 bytes)
      - 16654 (8, 16, 56, or 60 bytes)
      - 16750 (1, 16, 32, or 56 bytes)
      
      <Change log>
      Changes in V9:
       - Use attr_group instead of dev_spec_attr_group of uart_port structure
      
      Changes in V8:
       - Divide this patch from V7's patch based on Greg's comment
      
      Changes in V7:
       - Add Documentation
       - Change I/F name from rx_int_trig to rx_trig_bytes because the name
         rx_int_trig is hard to understand how users specify the value
      
      Changes in V6:
       - Move FCR_RX_TRIG_* definition in 8250.h to include/uapi/linux/serial_reg.h,
         rename those to UART_FCR_R_TRIG_*, and use UART_FCR_TRIGGER_MASK to
         UART_FCR_R_TRIG_BITS()
       - Change following function names:
          convert_fcr2val() => fcr_get_rxtrig_bytes()
          convert_val2rxtrig() => bytes_to_fcr_rxtrig()
       - Fix typo in serial8250_do_set_termios()
       - Delete the verbose error message pr_info() in bytes_to_fcr_rxtrig()
       - Rename *rx_int_trig/rx_trig* to *rxtrig* for several functions or variables
         (but UI remains rx_int_trig)
       - Change the meaningless variable name 'val' to 'bytes' following functions:
          fcr_get_rxtrig_bytes(), bytes_to_fcr_rxtrig(), do_set_rxtrig(),
          do_serial8250_set_rxtrig(), and serial8250_set_attr_rxtrig()
       - Use up->fcr in order to get rxtrig_bytes instead of rx_trig_raw in
         fcr_get_rxtrig_bytes()
       - Use conf_type->rxtrig_bytes[0] instead of switch statement for support check
         in register_dev_spec_attr_grp()
       - Delete the checking whether a user changed FCR or not when minimum buffer
         is needed in serial8250_do_set_termios()
      
      Changes in V5.1:
       - Fix FCR_RX_TRIG_MAX_STATE definition
      
      Changes in V5:
       - Support Tegra, 16650V2, 16654, and 16750
       - Store default FCR value to up->fcr when the port is first created
       - Add rx_trig_byte[] in uart_config[] for each device and use rx_trig_byte[]
         in convert_fcr2val() and convert_val2rxtrig()
      
      Changes in V4:
       - Introduce fifo_bug flag in uart_8250_port structure
         This is enabled only when parity is enabled and UART_BUG_PARITY is enabled
         for up->bugs. If this flag is enabled, user cannot set RX trigger.
       - Return -EOPNOTSUPP when it does not support device at convert_fcr2val() and
         at convert_val2rxtrig()
       - Set the nearest lower RX trigger when users input a meaningless value at
         convert_val2rxtrig()
       - Check whether p->fcr is existing at serial8250_clear_and_reinit_fifos()
       - Set fcr = up->fcr in the begging of serial8250_do_set_termios()
      
      Changes in V3:
       - Change I/F from ioctl(2) to sysfs(rx_int_trig)
      
      Changed in V2:
       - Use _IOW for TIOCSFIFORTRIG definition
       - Pass the interrupt trigger value itself
      Signed-off-by: NYoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aef9a7bd
    • P
      USB: Add LVS Test device driver · ce21bfe6
      Pratyush Anand 提交于
      OTG3 and EH Compliance Plan 1.0 talks about Super Speed OTG Verification
      system (SS-OVS) which consists of an excersizer and analyzer.
      
      USB Compliance Suite from Lecroy or Ellisys can act as such SS-OVS for
      Link Layer Validation (LVS).
      
      Some modifications are needed for an embedded Linux USB host to pass all
      these tests.  Most of these tests require just Link to be in U0. They do
      not work with default Linux USB stack since, default stack does port
      reset and then starts sending setup packet, which is not expected by
      Link Layer Validation (LVS) device of Lecroy Compliance Suit.  Then,
      There are many Link Layer Tests which need host to generate specific
      traffic.
      
      This patch supports specific traffic generation cases. As of now all the
      host Lecroy Link Layer-USBIF tests (except TD7.26) passes
      with this patch for single run using  Lecroy USB Compliance Suite
      Version 1.98 Build 239 and Lecroy USB Protocol Analyzer version 4.80
      Build 1603. Therefore patch seems to be a good candidate for inclusion.
      Further modification can be done on top of it.
      
      lvstest driver will not bind to any device by default. It can bind
      manually to a super speed USB host controller root hub. Therefore, regular
      hub driver must be unbound before this driver is bound. For example, if
      2-0:1.0 is the xhci root hub, then execute following to unbind hub driver.
      
       echo 2-0:1.0 > /sys/bus/usb/drivers/hub/unbind
      
      Then write Linux Foundation's vendor ID which is used by root hubs and
      SS root hub's device ID into new_id file. Writing IDs into new_id file
      will also bind the lvs driver with any available SS root hub interfaces.
      
       echo "1D6B 3" > /sys/bus/usb/drivers/lvs/new_id
      
      Now connect LVS device with root hub port.
      
      Test case specific traffic can be generated as follows whenever needed:
      
      1. To issue "Get Device descriptor" command for TD.7.06:
       echo  > /sys/bus/usb/devices/2-0\:1.0/get_dev_desc
      
      2. To set U1 timeout to 127 for TD.7.18
       echo 127 > /sys/bus/usb/devices/2-0\:1.0/u1_timeout
      
      3. To set U2 timeout to 0 for TD.7.18
       echo 0 > /sys/bus/usb/devices/2-0\:1.0/u2_timeout
      
      4. To issue "Hot Reset" for TD.7.29
       echo  > /sys/bus/usb/devices/2-0\:1.0/hot_reset
      
      5. To issue "U3 Entry" for TD.7.35
       echo  > /sys/bus/usb/devices/2-0\:1.0/u3_entry
      
      6. To issue "U3 Exit" for TD.7.36
       echo  > /sys/bus/usb/devices/2-0\:1.0/u3_exit
      Signed-off-by: NPratyush Anand <pratyush.anand@st.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ce21bfe6
  23. 17 7月, 2014 2 次提交
  24. 16 7月, 2014 1 次提交
    • T
      net: add name_assign_type netdev attribute · 685343fc
      Tom Gundersen 提交于
      Based on a patch by David Herrmann.
      
      The name_assign_type attribute gives hints where the interface name of a
      given net-device comes from. These values are currently defined:
        NET_NAME_ENUM:
          The ifname is provided by the kernel with an enumerated
          suffix, typically based on order of discovery. Names may
          be reused and unpredictable.
        NET_NAME_PREDICTABLE:
          The ifname has been assigned by the kernel in a predictable way
          that is guaranteed to avoid reuse and always be the same for a
          given device. Examples include statically created devices like
          the loopback device and names deduced from hardware properties
          (including being given explicitly by the firmware). Names
          depending on the order of discovery, or in any other way on the
          existence of other devices, must not be marked as PREDICTABLE.
        NET_NAME_USER:
          The ifname was provided by user-space during net-device setup.
        NET_NAME_RENAMED:
          The net-device has been renamed from userspace. Once this type is set,
          it cannot change again.
        NET_NAME_UNKNOWN:
          This is an internal placeholder to indicate that we yet haven't yet
          categorized the name. It will not be exposed to userspace, rather
          -EINVAL is returned.
      
      The aim of these patches is to improve user-space renaming of interfaces. As
      a general rule, userspace must rename interfaces to guarantee that names stay
      the same every time a given piece of hardware appears (at boot, or when
      attaching it). However, there are several situations where userspace should
      not perform the renaming, and that depends on both the policy of the local
      admin, but crucially also on the nature of the current interface name.
      
      If an interface was created in repsonse to a userspace request, and userspace
      already provided a name, we most probably want to leave that name alone. The
      main instance of this is wifi-P2P devices created over nl80211, which currently
      have a long-standing bug where they are getting renamed by udev. We label such
      names NET_NAME_USER.
      
      If an interface, unbeknown to us, has already been renamed from userspace, we
      most probably want to leave also that alone. This will typically happen when
      third-party plugins (for instance to udev, but the interface is generic so could
      be from anywhere) renames the interface without informing udev about it. A
      typical situation is when you switch root from an installer or an initrd to the
      real system and the new instance of udev does not know what happened before
      the switch. These types of problems have caused repeated issues in the past. To
      solve this, once an interface has been renamed, its name is labelled
      NET_NAME_RENAMED.
      
      In many cases, the kernel is actually able to name interfaces in such a
      way that there is no need for userspace to rename them. This is the case when
      the enumeration order of devices, or in fact any other (non-parent) device on
      the system, can not influence the name of the interface. Examples include
      statically created devices, or any naming schemes based on hardware properties
      of the interface. In this case the admin may prefer to use the kernel-provided
      names, and to make that possible we label such names NET_NAME_PREDICTABLE.
      We want the kernel to have tho possibilty of performing predictable interface
      naming itself (and exposing to userspace that it has), as the information
      necessary for a proper naming scheme for a certain class of devices may not
      be exposed to userspace.
      
      The case where renaming is almost certainly desired, is when the kernel has
      given the interface a name using global device enumeration based on order of
      discovery (ethX, wlanY, etc). These naming schemes are labelled NET_NAME_ENUM.
      
      Lastly, a fallback is left as NET_NAME_UNKNOWN, to indicate that a driver has
      not yet been ported. This is mostly useful as a transitionary measure, allowing
      us to label the various naming schemes bit by bit.
      
      v8: minor documentation fixes
      v9: move comment to the right commit
      Signed-off-by: NTom Gundersen <teg@jklm.no>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Reviewed-by: NKay Sievers <kay@vrfy.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      685343fc