1. 28 1月, 2014 5 次提交
    • M
      leds: lp5523: Support LED MUX configuration on running a pattern · 93ad8a1d
      Milo Kim 提交于
      There are two ways to run a pattern in LP5523.
      One is using legacy sysfs files such as 'enginex_mode','enginex_load' and
      'enginex_leds'. ('x' is from 1 to 3).
      Among them, 'enginex_leds' are used for selecting specific LED channel MUX.
      (MUX means which LEDs are used for running a pattern from LED 1 to 9.)
      
      The other way is using the firmware interface.
      In this mode, the default LED MUX strings are used.
      In other words, LED MUX is not configurable on the fly.
      
      This patch enables dynamic LED MUX configuration when the firmware is loaded.
      By accessing the sysfs file 'enginex_leds', the LED channels can be configured.
      To synchronize the operation mode, each engine mode should be set to 'LOAD'.
      
      The documentation is updated as well.
      
      Cc: Pali Rohár <pali.rohar@gmail.com>
      Signed-off-by: NMilo Kim <milo.kim@ti.com>
      Signed-off-by: NBryan Wu <cooloney@gmail.com>
      93ad8a1d
    • M
      leds: lp5521/5523: Fix multiple engine usage bug · 28c9266b
      Milo Kim 提交于
      Whenever the engine is loaded by the user-application, the operation mode is
      reset first. But it has a problem in case of multiple engine used because
      previous engine settings are cleared.
      The driver should update not whole 8bits but each engine bit by masking.
      
      On the other hands, whole engines should be reset when the driver is unloaded
      and on initializing the LP5523 driver.
      So, new functions are used for this handling - lp5521/5523_stop_all_engines().
      
      Cc: Pali Rohár <pali.rohar@gmail.com>
      Signed-off-by: NMilo Kim <milo.kim@ti.com>
      Signed-off-by: NBryan Wu <cooloney@gmail.com>
      28c9266b
    • N
      LEDS: tca6507 - fix up some comments. · 1f431afd
      NeilBrown 提交于
      In particular fix the capitalisation of GPIO and LED and
      correct TCA6507_MAKE_CPIO, but also rewrite the comment about
      platform-data to include reference to devicetree.
      
      Also re-wrap comments to fit 80 columns.
      Reported-by: NBryan Wu <cooloney@gmail.com>
      Signed-off-by: NNeilBrown <neilb@suse.de>
      Signed-off-by: NBryan Wu <cooloney@gmail.com>
      1f431afd
    • N
      LEDS: tca6507: add device-tree support for GPIO configuration. · 10ead6e5
      NeilBrown 提交于
      The 7 lines driven by the TCA6507 can either drive LEDs or act as output-only
      GPIOs.
      
      To make this distinction in devicetree we use the "compatible" property.
      
      If the device attached to a line is "compatible" with "gpio", we treat it
      like a GPIO.  If it is "compatible" with "led" (or if no "compatible" value
      is set) we treat it like an LED.
      
      (cooloney@gmail.com: fix typo in the subject)
      Signed-off-by: NNeilBrown <neilb@suse.de>
      Signed-off-by: NBryan Wu <cooloney@gmail.com>
      10ead6e5
    • N
      LEDS: tca6507 - fix bugs in parsing of device-tree configuration. · 9334129e
      NeilBrown 提交于
      1/ The led_info array must be allocated to allow the full number
        of LEDs even if not all are present.  The array maybe be sparsely
        filled but it is indexed by device address so we must at least
        allocate as many slots as the highest address used.  It is easiest
        just to allocate all 7.
      
      2/ range check the 'reg' value properly.
      
      3/ led.flags must be initialised to zero, else all leds could
         be treated as GPIOs (depending on what happens to be on the stack).
      Signed-off-by: NNeilBrown <neilb@suse.de>
      Signed-off-by: NBryan Wu <cooloney@gmail.com>
      9334129e
  2. 23 12月, 2013 2 次提交
  3. 22 12月, 2013 5 次提交
    • J
      powercap / RAPL: add support for ValleyView Soc · ed93b714
      Jacob Pan 提交于
      This patch adds support for RAPL on Intel ValleyView based SoC
      platforms, such as Baytrail.
      
      Besides adding CPU ID, special energy unit encoding is handled
      for ValleyView.
      Signed-off-by: NJacob Pan <jacob.jun.pan@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      ed93b714
    • J
      cpufreq: Use CONFIG_CPU_FREQ_DEFAULT_* to set initial policy for setpolicy drivers · a27a9ab7
      Jason Baron 提交于
      When configuring a default governor (via CONFIG_CPU_FREQ_DEFAULT_*) with the
      intel_pstate driver, the desired default policy is not properly set. For
      example, setting 'CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE' ends up with the
      'powersave' policy being set.
      
      Fix by configuring the correct default policy, if either 'powersave' or
      'performance' are requested. Otherwise, fallback to what the driver originally
      set via its 'init' routine.
      Signed-off-by: NJason Baron <jbaron@akamai.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a27a9ab7
    • V
      cpufreq: remove sysfs files for CPUs which failed to come back after resume · 42f921a6
      Viresh Kumar 提交于
      There are cases where cpufreq_add_dev() may fail for some CPUs
      during system resume. With the current code we will still have
      sysfs cpufreq files for those CPUs and struct cpufreq_policy
      would be already freed for them. Hence any operation on those
      sysfs files would result in kernel warnings.
      
      Example of problems resulting from resume errors (from Bjørn Mork):
      
      WARNING: CPU: 0 PID: 6055 at fs/sysfs/file.c:343 sysfs_open_file+0x77/0x212()
      missing sysfs attribute operations for kobject: (null)
      Modules linked in: [stripped as irrelevant]
      CPU: 0 PID: 6055 Comm: grep Tainted: G      D      3.13.0-rc2 #153
      Hardware name: LENOVO 2776LEG/2776LEG, BIOS 6EET55WW (3.15 ) 12/19/2011
       0000000000000009 ffff8802327ebb78 ffffffff81380b0e 0000000000000006
       ffff8802327ebbc8 ffff8802327ebbb8 ffffffff81038635 0000000000000000
       ffffffff811823c7 ffff88021a19e688 ffff88021a19e688 ffff8802302f9310
      Call Trace:
       [<ffffffff81380b0e>] dump_stack+0x55/0x76
       [<ffffffff81038635>] warn_slowpath_common+0x7c/0x96
       [<ffffffff811823c7>] ? sysfs_open_file+0x77/0x212
       [<ffffffff810386e3>] warn_slowpath_fmt+0x41/0x43
       [<ffffffff81182dec>] ? sysfs_get_active+0x6b/0x82
       [<ffffffff81182382>] ? sysfs_open_file+0x32/0x212
       [<ffffffff811823c7>] sysfs_open_file+0x77/0x212
       [<ffffffff81182350>] ? sysfs_schedule_callback+0x1ac/0x1ac
       [<ffffffff81122562>] do_dentry_open+0x17c/0x257
       [<ffffffff8112267e>] finish_open+0x41/0x4f
       [<ffffffff81130225>] do_last+0x80c/0x9ba
       [<ffffffff8112dbbd>] ? inode_permission+0x40/0x42
       [<ffffffff81130606>] path_openat+0x233/0x4a1
       [<ffffffff81130b7e>] do_filp_open+0x35/0x85
       [<ffffffff8113b787>] ? __alloc_fd+0x172/0x184
       [<ffffffff811232ea>] do_sys_open+0x6b/0xfa
       [<ffffffff811233a7>] SyS_openat+0xf/0x11
       [<ffffffff8138c812>] system_call_fastpath+0x16/0x1b
      
      To fix this, remove those sysfs files or put the associated kobject
      in case of such errors. Also, to make it simple, remove the cpufreq
      sysfs links from all the CPUs (except for the policy->cpu) during
      suspend, as that operation won't result in a loss of sysfs file
      permissions and we can create those links during resume just fine.
      
      Fixes: 5302c3fb ("cpufreq: Perform light-weight init/teardown during suspend/resume")
      Reported-and-tested-by: NBjørn Mork <bjorn@mork.no>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Cc: 3.12+ <stable@vger.kernel.org> # 3.12+
      [rjw: Changelog]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      42f921a6
    • M
      null_blk: support submit_queues on use_per_node_hctx · fc1bc354
      Matias Bjørling 提交于
      In the case of both the submit_queues param and use_per_node_hctx param
      are used. We limit the number af submit_queues to the number of online
      nodes.
      
      If the submit_queues is a multiple of nr_online_nodes, its trivial. Simply map
      them to the nodes. For example: 8 submit queues are mapped as node0[0,1],
      node1[2,3], ...
      If uneven, we are left with an uneven number of submit_queues that must be
      mapped. These are mapped toward the first node and onward. E.g. 5
      submit queues mapped onto 4 nodes are mapped as node0[0,1], node1[2], ...
      Signed-off-by: NMatias Bjorling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      fc1bc354
    • M
      null_blk: set use_per_node_hctx param to false · 20005244
      Matias Bjørling 提交于
      The defaults for the module is to instantiate itself with blk-mq and a
      submit queue for each CPU node in the system.
      
      To save resources, initialize instead with a single submit queue.
      Signed-off-by: NMatias Bjorling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      20005244
  4. 21 12月, 2013 8 次提交
  5. 20 12月, 2013 6 次提交
  6. 19 12月, 2013 9 次提交
    • M
      null_blk: warning on ignored submit_queues param · d15ee6b1
      Matias Bjorling 提交于
      Let the user know when the number of submission queues are being
      ignored.
      Signed-off-by: NMatias Bjorling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      d15ee6b1
    • M
      null_blk: refactor init and init errors code paths · 2d263a78
      Matias Bjorling 提交于
      Simplify the initialization logic of the three block-layers.
      
      - The queue initialization is split into two parts. This allows reuse of
        code when initializing the sq-, bio- and mq-based layers.
      - Set submit_queues default value to 0 and always set it at init time.
      - Simplify the init error code paths.
      Signed-off-by: NMatias Bjorling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      2d263a78
    • M
      null_blk: mem garbage on NUMA systems during init · 0c56010c
      Matias Bjorling 提交于
      For NUMA systems, initializing the blk-mq layer and using per node hctx.
      We initialize submit queues to 1, while blk-mq nr_hw_queues is
      initialized to the number of NUMA nodes.
      
      This makes the null_init_hctx function overwrite memory outside of what
      it allocated.  In my case it lead to writing garbage into struct
      request_queue's mq_map.
      Signed-off-by: NMatias Bjorling <m@bjorling.me>
      Cc: Jens Axboe <axboe@kernel.dk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0c56010c
    • R
      drivers: block: Mark the functions as static in skd_main.c · a26ba7fa
      Rashika Kheria 提交于
      Mark functions skd_skmsg_state_to_str() and skd_skreq_state_to_str() as
      static in skd_main.c because they are not used outside this file.
      
      This eliminates the following warnings in skd_main.c:
      drivers/block/skd_main.c:5272:13: warning: no previous prototype for ‘skd_skmsg_state_to_str’ [-Wmissing-prototypes]
      drivers/block/skd_main.c:5284:13: warning: no previous prototype for ‘skd_skreq_state_to_str’ [-Wmissing-prototypes]
      Signed-off-by: NRashika Kheria <rashika.kheria@gmail.com>
      Reviewed-by: NJosh Triplett <josh@joshtriplett.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      a26ba7fa
    • N
      target/file: Update hw_max_sectors based on current block_size · 95cadace
      Nicholas Bellinger 提交于
      This patch allows FILEIO to update hw_max_sectors based on the current
      max_bytes_per_io.  This is required because vfs_[writev,readv]() can accept
      a maximum of 2048 iovecs per call, so the enforced hw_max_sectors really
      needs to be calculated based on block_size.
      
      This addresses a >= v3.5 bug where block_size=512 was rejecting > 1M
      sized I/O requests, because FD_MAX_SECTORS was hardcoded to 2048 for
      the block_size=4096 case.
      
      (v2: Use max_bytes_per_io instead of ->update_hw_max_sectors)
      Reported-by: NHenrik Goldman <hg@x-formation.com>
      Cc: <stable@vger.kernel.org> #3.5+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      95cadace
    • N
      iser-target: Move INIT_WORK setup into isert_create_device_ib_res · 2853c2b6
      Nicholas Bellinger 提交于
      This patch moves INIT_WORK setup for cq_desc->cq_[rx,tx]_work into
      isert_create_device_ib_res(), instead of being done each callback
      invocation in isert_cq_[rx,tx]_callback().
      
      This also fixes a 'INFO: trying to register non-static key' warning
      when cancel_work_sync() is called before INIT_WORK has setup the
      struct work_struct.
      Reported-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Cc: <stable@vger.kernel.org> #3.12+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      2853c2b6
    • N
      iscsi-target: Fix incorrect np->np_thread NULL assignment · db6077fd
      Nicholas Bellinger 提交于
      When shutting down a target there is a race condition between
      iscsit_del_np() and __iscsi_target_login_thread().
      The latter sets the thread pointer to NULL, and the former
      tries to issue kthread_stop() on that pointer without any
      synchronization.
      
      This patch moves the np->np_thread NULL assignment into
      iscsit_del_np(), after kthread_stop() has completed. It also
      removes the signal_pending() + np_state check, and only
      exits when kthread_should_stop() is true.
      Reported-by: NHannes Reinecke <hare@suse.de>
      Cc: <stable@vger.kernel.org> #3.12+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      db6077fd
    • D
      net_dma: mark broken · 77873803
      Dan Williams 提交于
      net_dma can cause data to be copied to a stale mapping if a
      copy-on-write fault occurs during dma.  The application sees missing
      data.
      
      The following trace is triggered by modifying the kernel to WARN if it
      ever triggers copy-on-write on a page that is undergoing dma:
      
       WARNING: CPU: 24 PID: 2529 at lib/dma-debug.c:485 debug_dma_assert_idle+0xd2/0x120()
       ioatdma 0000:00:04.0: DMA-API: cpu touching an active dma mapped page [pfn=0x16bcd9]
       Modules linked in: iTCO_wdt iTCO_vendor_support ioatdma lpc_ich pcspkr dca
       CPU: 24 PID: 2529 Comm: linbug Tainted: G        W    3.13.0-rc1+ #353
        00000000000001e5 ffff88016f45f688 ffffffff81751041 ffff88017ab0ef70
        ffff88016f45f6d8 ffff88016f45f6c8 ffffffff8104ed9c ffffffff810f3646
        ffff8801768f4840 0000000000000282 ffff88016f6cca10 00007fa2bb699349
       Call Trace:
        [<ffffffff81751041>] dump_stack+0x46/0x58
        [<ffffffff8104ed9c>] warn_slowpath_common+0x8c/0xc0
        [<ffffffff810f3646>] ? ftrace_pid_func+0x26/0x30
        [<ffffffff8104ee86>] warn_slowpath_fmt+0x46/0x50
        [<ffffffff8139c062>] debug_dma_assert_idle+0xd2/0x120
        [<ffffffff81154a40>] do_wp_page+0xd0/0x790
        [<ffffffff811582ac>] handle_mm_fault+0x51c/0xde0
        [<ffffffff813830b9>] ? copy_user_enhanced_fast_string+0x9/0x20
        [<ffffffff8175fc2c>] __do_page_fault+0x19c/0x530
        [<ffffffff8175c196>] ? _raw_spin_lock_bh+0x16/0x40
        [<ffffffff810f3539>] ? trace_clock_local+0x9/0x10
        [<ffffffff810fa1f4>] ? rb_reserve_next_event+0x64/0x310
        [<ffffffffa0014c00>] ? ioat2_dma_prep_memcpy_lock+0x60/0x130 [ioatdma]
        [<ffffffff8175ffce>] do_page_fault+0xe/0x10
        [<ffffffff8175c862>] page_fault+0x22/0x30
        [<ffffffff81643991>] ? __kfree_skb+0x51/0xd0
        [<ffffffff813830b9>] ? copy_user_enhanced_fast_string+0x9/0x20
        [<ffffffff81388ea2>] ? memcpy_toiovec+0x52/0xa0
        [<ffffffff8164770f>] skb_copy_datagram_iovec+0x5f/0x2a0
        [<ffffffff8169d0f4>] tcp_rcv_established+0x674/0x7f0
        [<ffffffff816a68c5>] tcp_v4_do_rcv+0x2e5/0x4a0
        [..]
       ---[ end trace e30e3b01191b7617 ]---
       Mapped at:
        [<ffffffff8139c169>] debug_dma_map_page+0xb9/0x160
        [<ffffffff8142bf47>] dma_async_memcpy_pg_to_pg+0x127/0x210
        [<ffffffff8142cce9>] dma_memcpy_pg_to_iovec+0x119/0x1f0
        [<ffffffff81669d3c>] dma_skb_copy_datagram_iovec+0x11c/0x2b0
        [<ffffffff8169d1ca>] tcp_rcv_established+0x74a/0x7f0:
      
      ...the problem is that the receive path falls back to cpu-copy in
      several locations and this trace is just one of the areas.  A few
      options were considered to fix this:
      
      1/ sync all dma whenever a cpu copy branch is taken
      
      2/ modify the page fault handler to hold off while dma is in-flight
      
      Option 1 adds yet more cpu overhead to an "offload" that struggles to compete
      with cpu-copy.  Option 2 adds checks for behavior that is already documented as
      broken when using get_user_pages().  At a minimum a debug mode is warranted to
      catch and flag these violations of the dma-api vs get_user_pages().
      
      Thanks to David for his reproducer.
      
      Cc: <stable@vger.kernel.org>
      Cc: Dave Jiang <dave.jiang@intel.com>
      Cc: Vinod Koul <vinod.koul@intel.com>
      Cc: Alexander Duyck <alexander.h.duyck@intel.com>
      Reported-by: NDavid Whipple <whipple@securedatainnovations.ch>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      77873803
    • W
      dma: pl330: ensure DMA descriptors are zero-initialised · 0baf8f6a
      Will Deacon 提交于
      I see the following splat with 3.13-rc1 when attempting to perform DMA:
      
      [  253.004516] Alignment trap: not handling instruction e1902f9f at [<c0204b40>]
      [  253.004583] Unhandled fault: alignment exception (0x221) at 0xdfdfdfd7
      [  253.004646] Internal error: : 221 [#1] PREEMPT SMP ARM
      [  253.004691] Modules linked in: dmatest(+) [last unloaded: dmatest]
      [  253.004798] CPU: 0 PID: 671 Comm: kthreadd Not tainted 3.13.0-rc1+ #2
      [  253.004864] task: df9b0900 ti: df03e000 task.ti: df03e000
      [  253.004937] PC is at dmaengine_unmap_put+0x14/0x34
      [  253.005010] LR is at pl330_tasklet+0x3c8/0x550
      [  253.005087] pc : [<c0204b44>]    lr : [<c0207478>]    psr: a00e0193
      [  253.005087] sp : df03fe48  ip : 00000000  fp : df03bf18
      [  253.005178] r10: bf00e108  r9 : 00000001  r8 : 00000000
      [  253.005245] r7 : df837040  r6 : dfb41800  r5 : df837048  r4 : df837000
      [  253.005316] r3 : dfdfdfcf  r2 : dfb41f80  r1 : df837048  r0 : dfdfdfd7
      [  253.005384] Flags: NzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
      [  253.005459] Control: 30c5387d  Table: 9fb9ba80  DAC: fffffffd
      [  253.005520] Process kthreadd (pid: 671, stack limit = 0xdf03e248)
      
      This is due to desc->txd.unmap containing garbage (uninitialised memory).
      
      Rather than add another dummy initialisation to _init_desc, instead
      ensure that the descriptors are zero-initialised during allocation and
      remove the dummy, per-field initialisation.
      
      Cc: Andriy Shevchenko <andriy.shevchenko@intel.com>
      Acked-by: NJassi Brar <jassisinghbrar@gmail.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Acked-by: NVinod Koul <vinod.koul@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      0baf8f6a
  7. 18 12月, 2013 5 次提交