1. 16 2月, 2014 1 次提交
    • K
      of: search the best compatible match first in __of_match_node() · 06b29e76
      Kevin Hao 提交于
      Currently, of_match_node compares each given match against all node's
      compatible strings with of_device_is_compatible.
      
      To achieve multiple compatible strings per node with ordering from
      specific to generic, this requires given matches to be ordered from
      specific to generic. For most of the drivers this is not true and also
      an alphabetical ordering is more sane there.
      
      Therefore, this patch introduces a function to match each of the node's
      compatible strings against all given compatible matches without type and
      name first, before checking the next compatible string. This implies
      that node's compatibles are ordered from specific to generic while
      given matches can be in any order. If we fail to find such a match
      entry, then fall-back to the old method in order to keep compatibility.
      
      Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
      Signed-off-by: NKevin Hao <haokexin@gmail.com>
      Tested-by: NStephen Chivers <schivers@csc.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      06b29e76
  2. 15 2月, 2014 8 次提交
  3. 14 2月, 2014 24 次提交
  4. 13 2月, 2014 7 次提交
    • O
      md/raid5: Fix CPU hotplug callback registration · 789b5e03
      Oleg Nesterov 提交于
      Subsystems that want to register CPU hotplug callbacks, as well as perform
      initialization for the CPUs that are already online, often do it as shown
      below:
      
      	get_online_cpus();
      
      	for_each_online_cpu(cpu)
      		init_cpu(cpu);
      
      	register_cpu_notifier(&foobar_cpu_notifier);
      
      	put_online_cpus();
      
      This is wrong, since it is prone to ABBA deadlocks involving the
      cpu_add_remove_lock and the cpu_hotplug.lock (when running concurrently
      with CPU hotplug operations).
      
      Interestingly, the raid5 code can actually prevent double initialization and
      hence can use the following simplified form of callback registration:
      
      	register_cpu_notifier(&foobar_cpu_notifier);
      
      	get_online_cpus();
      
      	for_each_online_cpu(cpu)
      		init_cpu(cpu);
      
      	put_online_cpus();
      
      A hotplug operation that occurs between registering the notifier and calling
      get_online_cpus(), won't disrupt anything, because the code takes care to
      perform the memory allocations only once.
      
      So reorganize the code in raid5 this way to fix the deadlock with callback
      registration.
      
      Cc: linux-raid@vger.kernel.org
      Cc: stable@vger.kernel.org (v2.6.32+)
      Fixes: 36d1c647Signed-off-by: NOleg Nesterov <oleg@redhat.com>
      [Srivatsa: Fixed the unregister_cpu_notifier() deadlock, added the
      free_scratch_buffer() helper to condense code further and wrote the changelog.]
      Signed-off-by: NSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: NNeilBrown <neilb@suse.de>
      789b5e03
    • D
      intel_pstate: Remove energy reporting from pstate_sample tracepoint · 709c078e
      Dirk Brandewie 提交于
      Remove the reporting of energy since it does not provide any useful
      information about the state of the driver and will be a maintainance
      headache going forward since the RAPL energy units register is not
      architectural and subject to change between micro-architectures
      
      References: https://bugzilla.kernel.org/show_bug.cgi?id=69831
      Fixes: b69880f9 (intel_pstate: Add trace point to report internal state.)
      Signed-off-by: NDirk Brandewie <dirk.j.brandewie@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      709c078e
    • O
      dma: mv_xor: Silence a bunch of LPAE-related warnings · 31fd8f5b
      Olof Johansson 提交于
      Enabling some of the mvebu platforms in the multiplatform config for ARM
      enabled these drivers, which also triggered a bunch of warnings when LPAE
      is enabled (thus making phys_addr_t 64-bit).
      
      Most changes are switching printk formats, but also a bit of changes to what
      used to be array-based pointer arithmetic that could just be done with the
      address types instead.
      
      The warnings were:
      
      drivers/dma/mv_xor.c: In function 'mv_xor_tx_submit':
      drivers/dma/mv_xor.c:500:3: warning: format '%x' expects argument of type
          'unsigned int', but argument 4 has type 'dma_addr_t' [-Wformat]
      drivers/dma/mv_xor.c: In function 'mv_xor_alloc_chan_resources':
      drivers/dma/mv_xor.c:553:13: warning: cast to pointer from integer of
          different size [-Wint-to-pointer-cast]
      drivers/dma/mv_xor.c:555:4: warning: cast from pointer to integer of
          different size [-Wpointer-to-int-cast]
      drivers/dma/mv_xor.c: In function 'mv_xor_prep_dma_memcpy':
      drivers/dma/mv_xor.c:584:2: warning: format '%x' expects argument of type
          'unsigned int', but argument 5 has type 'dma_addr_t' [-Wformat]
      drivers/dma/mv_xor.c:584:2: warning: format '%x' expects argument of type
          'unsigned int', but argument 6 has type 'dma_addr_t' [-Wformat]
      drivers/dma/mv_xor.c: In function 'mv_xor_prep_dma_xor':
      drivers/dma/mv_xor.c:628:2: warning: format '%u' expects argument of type
          'unsigned int', but argument 7 has type 'dma_addr_t' [-Wformat]
      Acked-by: NVinod Koul <vinod.koul@intel.com>
      Acked-by: NJason Cooper <jason@lakedaemon.net>
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      31fd8f5b
    • S
      Target/sbc: Fix protection copy routine · d6a65fdc
      Sagi Grimberg 提交于
      Need to take into account that protection sg_list
      (copy-buffer) may consist of multiple entries.
      
      Changes from v0:
      - Changed commit description
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      d6a65fdc
    • J
      IB/srpt: replace strict_strtoul() with kstrtoul() · 9d8abf45
      Jingoo Han 提交于
      The usage of strict_strtoul() is not preferred, because
      strict_strtoul() is obsolete. Thus, kstrtoul() should be
      used.
      Signed-off-by: NJingoo Han <jg1.han@samsung.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      9d8abf45
    • R
      target: Simplify command completion by removing CMD_T_FAILED flag · 3dca1471
      Roland Dreier 提交于
      The CMD_T_FAILED flag is set used in one place to record the result of a
      trivial test, and it is only tested once, few lines later.  We might as
      well make the code simpler and easier to read by directly doing the test
      of "success" where we want to use it.
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      3dca1471
    • N
      iser-target: Fix leak on failure in isert_conn_create_fastreg_pool · a80e21b3
      Nicholas Bellinger 提交于
      This patch fixes a memory leak for fr_desc upon failure of
      isert_create_fr_desc() in isert_conn_create_fastreg_pool()
      code.
      
      As reported by Coverity 1166659:
      
      *** CID 1166659:  Resource leak  (RESOURCE_LEAK)
      /drivers/infiniband/ulp/isert/ib_isert.c: 470 in isert_conn_create_fastreg_pool()
      464                      isert_conn, isert_conn->conn_fr_pool_size);
      465
      466             return 0;
      467
      468     err:
      469             isert_conn_free_fastreg_pool(isert_conn);
      >>>     CID 1166659:  Resource leak  (RESOURCE_LEAK)
      >>>     Variable "fr_desc" going out of scope leaks the storage it points to.
      470             return ret;
      471     }
      472
      473     static int
      474     isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
      475     {
      
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      a80e21b3