1. 14 1月, 2014 4 次提交
    • B
      mtd: nand: use __packed shorthand · e2e6b7b7
      Brian Norris 提交于
      To be consistent with the rest of include/linux/mtd/nand.h, we should
      use the __packed shorthand instead of __attribute__((packed)).
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      Acked-by: NHuang Shijie <b32955@freescale.com>
      e2e6b7b7
    • B
      mtd: nand: support Micron READ RETRY · 8429bb39
      Brian Norris 提交于
      Micron provides READ RETRY support via the ONFI vendor-specific
      parameter block (to indicate how many read-retry modes are available)
      and the ONFI {GET,SET}_FEATURES commands with a vendor-specific feature
      address (to support reading/switching the current read-retry mode).
      
      The recommended sequence is as follows:
      
        1. Perform PAGE_READ operation
        2. If no ECC error, we are done
        3. Run SET_FEATURES with feature address 89h, mode 1
        4. Retry PAGE_READ operation
        5. If ECC error and there are remaining supported modes, increment the
           mode and return to step 3. Otherwise, this is a true ECC error.
        6. Run SET_FEATURES with feature address 89h, mode 0, to return to the
           default state.
      
      This patch implements the chip->setup_read_retry() callback for
      Micron and fills in the chip->read_retries.
      
      Tested on Micron MT29F32G08CBADA, which supports 8 read-retry modes.
      
      The Micron vendor-specific table was checked against the datasheets for
      the following Micron NAND:
      
      Needs retry   Cell-type    Part number          Vendor revision    Byte 180
      -----------   ---------    ----------------     ---------------    ------------
      No            SLC          MT29F16G08ABABA      1                  Reserved (0)
      No            MLC          MT29F32G08CBABA      1                  Reserved (0)
      No            SLC          MT29F1G08AACWP       1                  0
      Yes           MLC          MT29F32G08CBADA      1                  08h
      Yes           MLC          MT29F64G08CBABA      2                  08h
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      Acked-by: NHuang Shijie <b32955@freescale.com>
      8429bb39
    • B
      mtd: nand: add generic READ RETRY support · ba84fb59
      Brian Norris 提交于
      Modern MLC (and even SLC?) NAND can experience a large number of
      bitflips (beyond the recommended correctability capacity) due to drifts
      in the voltage threshold (Vt). These bitflips can cause ECC errors to
      occur well within the expected lifetime of the flash. To account for
      this, some manufacturers provide a mechanism for shifting the Vt
      threshold after a corrupted read.
      
      The generic pattern seems to be that a particular flash has N read retry
      modes (where N = 0, traditionally), and after an ECC failure, the host
      should reconfigure the flash to use the next available mode, then retry
      the read operation. This process repeats until all bitfips can be
      corrected or until the host has tried all available retry modes.
      
      This patch adds the infrastructure support for a
      vendor-specific/flash-specific callback, used for setting the read-retry
      mode (i.e., voltage threshold).
      
      For now, this patch always returns the flash to mode 0 (the default
      mode) after a successful read-retry, according to the flowchart found in
      Micron's datasheets. This may need to change in the future if it is
      determined that eventually, mode 0 is insufficient for the majority of
      the flash cells (and so for performance reasons, we should leave the
      flash in mode 1, 2, etc.).
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      Acked-by: NHuang Shijie <b32955@freescale.com>
      ba84fb59
    • B
      6f0065b0
  2. 12 1月, 2014 2 次提交
  3. 04 1月, 2014 6 次提交
  4. 25 12月, 2013 1 次提交
  5. 22 12月, 2013 1 次提交
    • B
      aio/migratepages: make aio migrate pages sane · 8e321fef
      Benjamin LaHaise 提交于
      The arbitrary restriction on page counts offered by the core
      migrate_page_move_mapping() code results in rather suspicious looking
      fiddling with page reference counts in the aio_migratepage() operation.
      To fix this, make migrate_page_move_mapping() take an extra_count parameter
      that allows aio to tell the code about its own reference count on the page
      being migrated.
      
      While cleaning up aio_migratepage(), make it validate that the old page
      being passed in is actually what aio_migratepage() expects to prevent
      misbehaviour in the case of races.
      Signed-off-by: NBenjamin LaHaise <bcrl@kvack.org>
      8e321fef
  6. 21 12月, 2013 3 次提交
  7. 19 12月, 2013 5 次提交
  8. 17 12月, 2013 3 次提交
  9. 13 12月, 2013 7 次提交
  10. 12 12月, 2013 2 次提交
  11. 11 12月, 2013 6 次提交
    • P
      sched/fair: Rework sched_fair time accounting · 9dbdb155
      Peter Zijlstra 提交于
      Christian suffers from a bad BIOS that wrecks his i5's TSC sync. This
      results in him occasionally seeing time going backwards - which
      crashes the scheduler ...
      
      Most of our time accounting can actually handle that except the most
      common one; the tick time update of sched_fair.
      
      There is a further problem with that code; previously we assumed that
      because we get a tick every TICK_NSEC our time delta could never
      exceed 32bits and math was simpler.
      
      However, ever since Frederic managed to get NO_HZ_FULL merged; this is
      no longer the case since now a task can run for a long time indeed
      without getting a tick. It only takes about ~4.2 seconds to overflow
      our u32 in nanoseconds.
      
      This means we not only need to better deal with time going backwards;
      but also means we need to be able to deal with large deltas.
      
      This patch reworks the entire code and uses mul_u64_u32_shr() as
      proposed by Andy a long while ago.
      
      We express our virtual time scale factor in a u32 multiplier and shift
      right and the 32bit mul_u64_u32_shr() implementation reduces to a
      single 32x32->64 multiply if the time delta is still short (common
      case).
      
      For 64bit a 64x64->128 multiply can be used if ARCH_SUPPORTS_INT128.
      Reported-and-Tested-by: NChristian Engelmayer <cengelma@gmx.at>
      Signed-off-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: fweisbec@gmail.com
      Cc: Paul Turner <pjt@google.com>
      Cc: Stanislaw Gruszka <sgruszka@redhat.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Link: http://lkml.kernel.org/r/20131118172706.GI3866@twins.programming.kicks-ass.netSigned-off-by: NIngo Molnar <mingo@kernel.org>
      9dbdb155
    • P
      math64: Add mul_u64_u32_shr() · be5e610c
      Peter Zijlstra 提交于
      Introduce mul_u64_u32_shr() as proposed by Andy a while back; it
      allows using 64x64->128 muls on 64bit archs and recent GCC
      which defines __SIZEOF_INT128__ and __int128.
      
      (This new method will be used by the scheduler.)
      Signed-off-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: fweisbec@gmail.com
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Link: http://lkml.kernel.org/n/tip-hxjoeuzmrcaumR0uZwjpe2pv@git.kernel.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      be5e610c
    • P
      sched: Remove PREEMPT_NEED_RESCHED from generic code · ba1f14fb
      Peter Zijlstra 提交于
      While hunting a preemption issue with Alexander, Ben noticed that the
      currently generic PREEMPT_NEED_RESCHED stuff is horribly broken for
      load-store architectures.
      
      We currently rely on the IPI to fold TIF_NEED_RESCHED into
      PREEMPT_NEED_RESCHED, but when this IPI lands while we already have
      a load for the preempt-count but before the store, the store will erase
      the PREEMPT_NEED_RESCHED change.
      
      The current preempt-count only works on load-store archs because
      interrupts are assumed to be completely balanced wrt their preempt_count
      fiddling; the previous preempt_count load will match the preempt_count
      state after the interrupt and therefore nothing gets lost.
      
      This patch removes the PREEMPT_NEED_RESCHED usage from generic code and
      pushes it into x86 arch code; the generic code goes back to relying on
      TIF_NEED_RESCHED.
      
      Boot tested on x86_64 and compile tested on ppc64.
      Reported-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Reported-and-Tested-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Link: http://lkml.kernel.org/r/20131128132641.GP10022@twins.programming.kicks-ass.netSigned-off-by: NIngo Molnar <mingo@kernel.org>
      ba1f14fb
    • N
      sctp: properly latch and use autoclose value from sock to association · 9f70f46b
      Neil Horman 提交于
      Currently, sctp associations latch a sockets autoclose value to an association
      at association init time, subject to capping constraints from the max_autoclose
      sysctl value.  This leads to an odd situation where an application may set a
      socket level autoclose timeout, but sliently sctp will limit the autoclose
      timeout to something less than that.
      
      Fix this by modifying the autoclose setsockopt function to check the limit, cap
      it and warn the user via syslog that the timeout is capped.  This will allow
      getsockopt to return valid autoclose timeout values that reflect what subsequent
      associations actually use.
      
      While were at it, also elimintate the assoc->autoclose variable, it duplicates
      whats in the timeout array, which leads to multiple sources for the same
      information, that may differ (as the former isn't subject to any capping).  This
      gives us the timeout information in a canonical place and saves some space in
      the association structure as well.
      Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
      Acked-by: NVlad Yasevich <vyasevich@gmail.com>
      CC: Wang Weidong <wangweidong1@huawei.com>
      CC: David Miller <davem@davemloft.net>
      CC: Vlad Yasevich <vyasevich@gmail.com>
      CC: netdev@vger.kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9f70f46b
    • S
      net: unix: allow set_peek_off to fail · 12663bfc
      Sasha Levin 提交于
      unix_dgram_recvmsg() will hold the readlock of the socket until recv
      is complete.
      
      In the same time, we may try to setsockopt(SO_PEEK_OFF) which will hang until
      unix_dgram_recvmsg() will complete (which can take a while) without allowing
      us to break out of it, triggering a hung task spew.
      
      Instead, allow set_peek_off to fail, this way userspace will not hang.
      Signed-off-by: NSasha Levin <sasha.levin@oracle.com>
      Acked-by: NPavel Emelyanov <xemul@parallels.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      12663bfc
    • H
      x86, build, icc: Remove uninitialized_var() from compiler-intel.h · 503cf95c
      H. Peter Anvin 提交于
      When compiling with icc, <linux/compiler-gcc.h> ends up included
      because the icc environment defines __GNUC__.  Thus, we neither need
      nor want to have this macro defined in both compiler-gcc.h and
      compiler-intel.h, and the fact that they are inconsistent just makes
      the compiler spew warnings.
      Reported-by: NSunil K. Pandey <sunil.k.pandey@intel.com>
      Cc: Kevin B. Smith <kevin.b.smith@intel.com>
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      Link: http://lkml.kernel.org/n/tip-0mbwou1zt7pafij09b897lg3@git.kernel.org
      Cc: <stable@vger.kernel.org>
      503cf95c