1. 01 9月, 2012 2 次提交
    • W
      openrisc: delay: fix handling of counter overflow · 807607f7
      Will Deacon 提交于
      If the counter overflows during a __delay operation, we will exit the
      loop prematurely. For example, calling __delay(0x100) with the counter
      at 0xffffff00 gives us a target of 0x0. The unsigned comparison in the
      while loop will likely be false on the first iteration (if the counter
      is now anything other than 0) and we will return early.
      
      This patch fixes the problem by comparing deltas in the loop rather than
      absolute values.
      
      Cc: Jon Masters <jcm@redhat.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NJonas Bonn <jonas@southpole.se>
      807607f7
    • W
      openrisc: delay: fix loops calculation for __const_udelay · 43916466
      Will Deacon 提交于
      The openrisc implementation of __const_udelay casts the result of a
      32-bit multiplication to 64 bits and passes the top 32 bits to __delay.
      Since there are no casts on the arguments, this results in a __delay of
      zero, regardless of the xloops parameter.
      
      This patch fixes the problem by casting xloops to (unsigned long long),
      ensuring that the multiplication is not truncated.
      
      Cc: Jon Masters <jcm@redhat.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NJonas Bonn <jonas@southpole.se>
      43916466
  2. 23 7月, 2011 1 次提交