1. 14 10月, 2010 7 次提交
  2. 13 10月, 2010 6 次提交
  3. 08 10月, 2010 1 次提交
  4. 09 9月, 2010 2 次提交
  5. 02 9月, 2010 8 次提交
    • J
      powerpc/chrp/nvram.c: Add of_node_put to avoid memory leak · 7cf9bac5
      Julia Lawall 提交于
      Add a call to of_node_put in the error handling code following a call to
      of_find_node_by_type.
      
      The semantic match that finds this problem is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r exists@
      local idexpression x;
      expression E,E1,E2;
      statement S;
      @@
      
      *x =
      (of_find_node_by_path
      |of_find_node_by_name
      |of_find_node_by_phandle
      |of_get_parent
      |of_get_next_parent
      |of_get_next_child
      |of_find_compatible_node
      |of_match_node
      |of_find_node_by_type
      |of_find_node_with_property
      |of_find_matching_node
      |of_parse_phandle
      )(...);
      ...
      if (x == NULL) S
      <... when != x = E
      *if (...) {
        ... when != of_node_put(x)
            when != if (...) { ... of_node_put(x); ... }
      (
        return <+...x...+>;
      |
      *  return ...;
      )
      }
      ...>
      (
      E2 = x;
      |
      of_node_put(x);
      )
      // </smpl>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      7cf9bac5
    • J
      powerpc/cell: Add of_node_put to avoid memory leak · 182f30e4
      Julia Lawall 提交于
      Add calls to of_node_put in the error handling code following calls to
      of_find_node_by_path and of_find_node_by_phandle.
      
      The semantic match that finds this problem is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r exists@
      local idexpression x;
      expression E,E1;
      statement S;
      @@
      
      *x =
      (of_find_node_by_path
      |of_find_node_by_name
      |of_find_node_by_phandle
      |of_get_parent
      |of_get_next_parent
      |of_get_next_child
      |of_find_compatible_node
      |of_match_node
      )(...);
      ...
      if (x == NULL) S
      <... when != x = E
      *if (...) {
        ... when != of_node_put(x)
            when != if (...) { ... of_node_put(x); ... }
      (
        return <+...x...+>;
      |
      *  return ...;
      )
      }
      ...>
      of_node_put(x);
      // </smpl>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      182f30e4
    • J
      powerpc/powermac/pfunc_core.c: Add of_node_put to avoid memory leak · 0373721b
      Julia Lawall 提交于
      Add a call to of_node_put in the error handling code following a call to
      of_find_node_by_phandle.
      
      The semantic match that finds this problem is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r exists@
      local idexpression x;
      expression E,E1;
      statement S;
      @@
      
      *x =
      (of_find_node_by_path
      |of_find_node_by_name
      |of_find_node_by_phandle
      |of_get_parent
      |of_get_next_parent
      |of_get_next_child
      |of_find_compatible_node
      |of_match_node
      )(...);
      ...
      if (x == NULL) S
      <... when != x = E
      *if (...) {
        ... when != of_node_put(x)
            when != if (...) { ... of_node_put(x); ... }
      (
        return <+...x...+>;
      |
      *  return ...;
      )
      }
      ...>
      of_node_put(x);
      // </smpl>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      0373721b
    • J
      powerpc/maple: Add of_node_put to avoid memory leak · a8e25c61
      Julia Lawall 提交于
      Add a call to of_node_put in the error handling code following a call to
      of_find_node_by_path.
      
      The semantic match that finds this problem is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r exists@
      local idexpression x;
      expression E,E1;
      statement S;
      @@
      
      *x =
      (of_find_node_by_path
      |of_find_node_by_name
      |of_find_node_by_phandle
      |of_get_parent
      |of_get_next_parent
      |of_get_next_child
      |of_find_compatible_node
      |of_match_node
      )(...);
      ...
      if (x == NULL) S
      <... when != x = E
      *if (...) {
        ... when != of_node_put(x)
            when != if (...) { ... of_node_put(x); ... }
      (
        return <+...x...+>;
      |
      *  return ...;
      )
      }
      ...>
      of_node_put(x);
      // </smpl>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      a8e25c61
    • P
      powerpc/pseries: Re-enable dispatch trace log userspace interface · 872e439a
      Paul Mackerras 提交于
      Since the cpu accounting code uses the hypervisor dispatch trace log
      now when CONFIG_VIRT_CPU_ACCOUNTING = y, the previous commit disabled
      access to it via files in the /sys/kernel/debug/powerpc/dtl/ directory
      in that case.  This restores those files.
      
      To do this, we now have a hook that the cpu accounting code will call
      as it processes each entry from the hypervisor dispatch trace log.
      The code in dtl.c now uses that to fill up its ring buffer, rather
      than having the hypervisor fill the ring buffer directly.
      
      This also fixes dtl_file_read() to handle overflow conditions a bit
      better and adds a spinlock to ensure that race conditions (multiple
      processes opening or reading the file concurrently) are handled
      correctly.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      872e439a
    • P
      powerpc: Account time using timebase rather than PURR · cf9efce0
      Paul Mackerras 提交于
      Currently, when CONFIG_VIRT_CPU_ACCOUNTING is enabled, we use the
      PURR register for measuring the user and system time used by
      processes, as well as other related times such as hardirq and
      softirq times.  This turns out to be quite confusing for users
      because it means that a program will often be measured as taking
      less time when run on a multi-threaded processor (SMT2 or SMT4 mode)
      than it does when run on a single-threaded processor (ST mode), even
      though the program takes longer to finish.  The discrepancy is
      accounted for as stolen time, which is also confusing, particularly
      when there are no other partitions running.
      
      This changes the accounting to use the timebase instead, meaning that
      the reported user and system times are the actual number of real-time
      seconds that the program was executing on the processor thread,
      regardless of which SMT mode the processor is in.  Thus a program will
      generally show greater user and system times when run on a
      multi-threaded processor than on a single-threaded processor.
      
      On pSeries systems on POWER5 or later processors, we measure the
      stolen time (time when this partition wasn't running) using the
      hypervisor dispatch trace log.  We check for new entries in the
      log on every entry from user mode and on every transition from
      kernel process context to soft or hard IRQ context (i.e. when
      account_system_vtime() gets called).  So that we can correctly
      distinguish time stolen from user time and time stolen from system
      time, without having to check the log on every exit to user mode,
      we store separate timestamps for exit to user mode and entry from
      user mode.
      
      On systems that have a SPURR (POWER6 and POWER7), we read the SPURR
      in account_system_vtime() (as before), and then apportion the SPURR
      ticks since the last time we read it between scaled user time and
      scaled system time according to the relative proportions of user
      time and system time over the same interval.  This avoids having to
      read the SPURR on every kernel entry and exit.  On systems that have
      PURR but not SPURR (i.e., POWER5), we do the same using the PURR
      rather than the SPURR.
      
      This disables the DTL user interface in /sys/debug/kernel/powerpc/dtl
      for now since it conflicts with the use of the dispatch trace log
      by the time accounting code.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      cf9efce0
    • P
      powerpc: Abstract indexing of lppaca structs · 8154c5d2
      Paul Mackerras 提交于
      Currently we have the lppaca structs as a simple array of NR_CPUS
      entries, taking up space in the data section of the kernel image.
      In future we would like to allocate them dynamically, so this
      abstracts out the accesses to the array, making it easier to
      change how we locate the lppaca for a given cpu in future.
      Specifically, lppaca[cpu] changes to lppaca_of(cpu).
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      8154c5d2
    • N
      powerpc/pseries: Correct rtas_data_buf locking in dlpar code · 93f68f1e
      Nathan Fontenot 提交于
      The dlpar code can cause a deadlock to occur when making the RTAS
      configure-connector call.  This occurs because we make kmalloc calls,
      which can block, while parsing the rtas_data_buf and holding the
      rtas_data_buf_lock.  This an cause issues if someone else attempts
      to grab the rtas_data_bug_lock.
      
      This patch alleviates this issue by copying the contents of the rtas_data_buf
      to a local buffer before parsing.  This allows us to only hold the
      rtas_data_buf_lock around the RTAS configure-connector calls.
      Signed-off-by: NNathan Fontenot <nfont@austin.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      93f68f1e
  6. 01 9月, 2010 4 次提交
  7. 24 8月, 2010 6 次提交
  8. 10 8月, 2010 2 次提交
    • A
      spufs conversion to ->evict_inode() · 0f3f63a4
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      0f3f63a4
    • C
      remove inode_setattr · 1025774c
      Christoph Hellwig 提交于
      Replace inode_setattr with opencoded variants of it in all callers.  This
      moves the remaining call to vmtruncate into the filesystem methods where it
      can be replaced with the proper truncate sequence.
      
      In a few cases it was obvious that we would never end up calling vmtruncate
      so it was left out in the opencoded variant:
      
       spufs: explicitly checks for ATTR_SIZE earlier
       btrfs,hugetlbfs,logfs,dlmfs: explicitly clears ATTR_SIZE earlier
       ufs: contains an opencoded simple_seattr + truncate that sets the filesize just above
      
      In addition to that ncpfs called inode_setattr with handcrafted iattrs,
      which allowed to trim down the opencoded variant.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      1025774c
  9. 07 8月, 2010 1 次提交
    • E
      powerpc/5200: add mpc5200_psc_ac97_gpio_reset · cfa6a88c
      Eric Millbrandt 提交于
      Work around a silicon bug in the ac97 reset functionality of the
      mpc5200(b).  The implementation of the ac97 "cold" reset is flawed.
      If the sync and output lines are high when reset is asserted the
      attached ac97 device may go into test mode.  Avoid this by
      reconfiguring the psc to gpio mode and generating the reset manually.
      
      From MPC5200B User's Manual:
      "Some AC97 devices goes to a test mode, if the Sync line is high
      during the Res line is low (reset phase). To avoid this behavior the
      Sync line must be also forced to zero during the reset phase. To do
      that, the pin muxing should switch to GPIO mode and the GPIO control
      register should be used to control the output lines."
      Signed-off-by: NEric Millbrandt <emillbrandt@dekaresearch.com>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      cfa6a88c
  10. 06 8月, 2010 1 次提交
  11. 05 8月, 2010 2 次提交