1. 23 8月, 2010 3 次提交
  2. 07 8月, 2010 1 次提交
  3. 05 8月, 2010 1 次提交
  4. 03 8月, 2010 2 次提交
  5. 01 8月, 2010 2 次提交
  6. 31 7月, 2010 7 次提交
  7. 29 7月, 2010 2 次提交
    • P
      powerpc: Clean up obsolete code relating to decrementer and timebase · d75d68cf
      Paul Mackerras 提交于
      Since the decrementer and timekeeping code was moved over to using
      the generic clockevents and timekeeping infrastructure, several
      variables and functions have been obsolete and effectively unused.
      This deletes them.
      
      In particular, wakeup_decrementer() is no longer needed since the
      generic code reprograms the decrementer as part of the process of
      resuming the timekeeping code, which happens during sysdev resume.
      Thus the wakeup_decrementer calls in the suspend_enter methods for
      52xx platforms have been removed.  The call in the powermac cpu
      frequency change code has been replaced by set_dec(1), which will
      cause a timer interrupt as soon as interrupts are enabled, and the
      generic code will then reprogram the decrementer with the correct
      value.
      
      This also simplifies the generic_suspend_en/disable_irqs functions
      and makes them static since they are not referenced outside time.c.
      The preempt_enable/disable calls are removed because the generic
      code has disabled all but the boot cpu at the point where these
      functions are called, so we can't be moved to another cpu.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      d75d68cf
    • P
      powerpc: Rework VDSO gettimeofday to prevent time going backwards · 0e469db8
      Paul Mackerras 提交于
      Currently it is possible for userspace to see the result of
      gettimeofday() going backwards by 1 microsecond, assuming that
      userspace is using the gettimeofday() in the VDSO.  The VDSO
      gettimeofday() algorithm computes the time in "xsecs", which are
      units of 2^-20 seconds, or approximately 0.954 microseconds,
      using the algorithm
      
      	now = (timebase - tb_orig_stamp) * tb_to_xs + stamp_xsec
      
      and then converts the time in xsecs to seconds and microseconds.
      
      The kernel updates the tb_orig_stamp and stamp_xsec values every
      tick in update_vsyscall().  If the length of the tick is not an
      integer number of xsecs, then some precision is lost in converting
      the current time to xsecs.  For example, with CONFIG_HZ=1000, the
      tick is 1ms long, which is 1048.576 xsecs.  That means that
      stamp_xsec will advance by either 1048 or 1049 on each tick.
      With the right conditions, it is possible for userspace to get
      (timebase - tb_orig_stamp) * tb_to_xs being 1049 if the kernel is
      slightly late in updating the vdso_datapage, and then for stamp_xsec
      to advance by 1048 when the kernel does update it, and for userspace
      to then see (timebase - tb_orig_stamp) * tb_to_xs being zero due to
      integer truncation.  The result is that time appears to go backwards
      by 1 microsecond.
      
      To fix this we change the VDSO gettimeofday to use a new field in the
      VDSO datapage which stores the nanoseconds part of the time as a
      fractional number of seconds in a 0.32 binary fraction format.
      (Or put another way, as a 32-bit number in units of 0.23283 ns.)
      This is convenient because we can use the mulhwu instruction to
      convert it to either microseconds or nanoseconds.
      
      Since it turns out that computing the time of day using this new field
      is simpler than either using stamp_xsec (as gettimeofday does) or
      stamp_xtime.tv_nsec (as clock_gettime does), this converts both
      gettimeofday and clock_gettime to use the new field.  The existing
      __do_get_tspec function is converted to use the new field and take
      a parameter in r7 that indicates the desired resolution, 1,000,000
      for microseconds or 1,000,000,000 for nanoseconds.  The __do_get_xsec
      function is then unused and is deleted.
      
      The new algorithm is
      
      	now = ((timebase - tb_orig_stamp) << 12) * tb_to_xs
      		+ (stamp_xtime_seconds << 32) + stamp_sec_fraction
      
      with 'now' in units of 2^-32 seconds.  That is then converted to
      seconds and either microseconds or nanoseconds with
      
      	seconds = now >> 32
      	partseconds = ((now & 0xffffffff) * resolution) >> 32
      
      The 32-bit VDSO code also makes a further simplification: it ignores
      the bottom 32 bits of the tb_to_xs value, which is a 0.64 format binary
      fraction.  Doing so gets rid of 4 multiply instructions.  Assuming
      a timebase frequency of 1GHz or less and an update interval of no
      more than 10ms, the upper 32 bits of tb_to_xs will be at least
      4503599, so the error from ignoring the low 32 bits will be at most
      2.2ns, which is more than an order of magnitude less than the time
      taken to do gettimeofday or clock_gettime on our fastest processors,
      so there is no possibility of seeing inconsistent values due to this.
      
      This also moves update_gtod() down next to its only caller, and makes
      update_vsyscall use the time passed in via the wall_time argument rather
      than accessing xtime directly.  At present, wall_time always points to
      xtime, but that could change in future.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      0e469db8
  8. 27 7月, 2010 4 次提交
  9. 26 7月, 2010 1 次提交
    • L
      powerpc/40x: Distinguish AMCC PowerPC 405EX and 405EXr correctly · ff349103
      Lee Nipper 提交于
      The recent AMCC 405EX Rev D without Security uses a PVR value
      that matches the old 405EXr Rev A/B with Security.
      The 405EX Rev D without Security would be shown
      incorrectly as an 405EXr. The pvr_mask of 0xffff0004
      is no longer sufficient to distinguish the 405EX from 405EXr.
      
      This patch replaces 2 entries in the cpu_specs table
      and adds 8 more, each using pvr_mask of 0xffff000f
      and appropriate pvr_value to distinguish the AMCC
      PowerPC 405EX and 405EXr instances.
      The cpu_name for these entries now includes the
      Rev, in similar fashion to the 440GX.
      Signed-off-by: NLee Nipper <lee.nipper@gmail.com>
      Signed-off-by: NJosh Boyer <jwboyer@linux.vnet.ibm.com>
      ff349103
  10. 24 7月, 2010 5 次提交
    • J
      of: remove of_default_bus_ids · c0dd394c
      Jonas Bonn 提交于
      This list used was by only two platforms with all other platforms defining an
      own list of valid bus id's to pass to of_platform_bus_probe.  This patch:
      
      i)   copies the default list to the two platforms that depended on it (powerpc)
      ii)  remove the usage of of_default_bus_ids in of_platform_bus_probe
      iii) removes the definition of the list from all architectures that defined it
      
      Passing a NULL 'matches' parameter to of_platform_bus_probe is still valid; the
      function returns no error in that case as the NULL value is equivalent to an
      empty list.
      Signed-off-by: NJonas Bonn <jonas@southpole.se>
      [grant.likely@secretlab.ca: added __initdata annotations, warn on and return error on missing match table, and fix whitespace errors]
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      c0dd394c
    • J
      of: make of_find_device_by_node generic · c6085584
      Jonas Bonn 提交于
      There's no need for this function to be architecture specific and all four
      architectures defining it had the same definition.  The function has been
      moved to drivers/of/platform.c.
      Signed-off-by: NJonas Bonn <jonas@southpole.se>
      [grant.likely@secretlab.ca: moved to drivers/of/platform.c, simplified code, and added kerneldoc comment]
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      c6085584
    • G
      powerpc: remove references to of_device and to_of_device · a454dc50
      Grant Likely 提交于
      of_device is just a #define alias to platform_device.  This patch
      replaces all references to it with platform_device.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      a454dc50
    • G
      of/platform: remove all of_bus_type and of_platform_bus_type references · 1ab1d63a
      Grant Likely 提交于
      Both of_bus_type and of_platform_bus_type are just #define aliases
      for the platform bus.  This patch removes all references to them and
      switches to the of_register_platform_driver()/of_unregister_platform_driver()
      API for registering.
      
      Subsequent patches will convert each user of of_register_platform_driver()
      into plain platform_drivers without the of_platform_driver shim.  At which
      point the of_register_platform_driver()/of_unregister_platform_driver()
      functions can be removed.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      1ab1d63a
    • G
      of: Merge of_platform_bus_type with platform_bus_type · eca39301
      Grant Likely 提交于
      of_platform_bus was being used in the same manner as the platform_bus.
      The only difference being that of_platform_bus devices are generated
      from data in the device tree, and platform_bus devices are usually
      statically allocated in platform code.  Having them separate causes
      the problem of device drivers having to be registered twice if it
      was possible for the same device to appear on either bus.
      
      This patch removes of_platform_bus_type and registers all of_platform
      bus devices and drivers on the platform bus instead.  A previous patch
      made the of_device structure an alias for the platform_device structure,
      and a shim is used to adapt of_platform_drivers to the platform bus.
      
      After all of of_platform_bus drivers are converted to be normal platform
      drivers, the shim code can be removed.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      eca39301
  11. 23 7月, 2010 1 次提交
  12. 19 7月, 2010 2 次提交
  13. 14 7月, 2010 3 次提交
  14. 12 7月, 2010 1 次提交
    • M
      powerpc/fsl-booke: Fix address issue when using relocatable kernels · 77154a20
      Matthew McClintock 提交于
      When booting a relocatable kernel it needs to jump to the correct
      start address, which for BookE parts is usually unchanged
      regardless of the physical memory offset.
      
      Recent changes cause problems with how we calculate the start
      address, it was always adding the RMO into the start address
      which is incorrect. This patch only adds in the RMO offset
      if we are in the kexec code path, as it needs the RMO to work
      correctly.
      
      Instead of adding the RMO offset in in the common code path, we
      can just set r6 to the RMO offset in the kexec code path instead
      of to zero, and finally perform the masking in the common code
      path
      Signed-off-by: NMatthew McClintock <msm@freescale.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      77154a20
  15. 09 7月, 2010 5 次提交