1. 28 May, 2012 22 commits
    • Mauro Carvalho Chehab's avatar
      i82860_edac: convert driver to use the new edac ABI · 84c3a684
      Mauro Carvalho Chehab authored
      The legacy edac ABI is going to be removed. Port the driver to use
      and benefit from the new API functionality.
      
      Cc: Michal Marek <mmarek@suse.cz>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      84c3a684
    • Mauro Carvalho Chehab's avatar
      i82443bxgx_edac: convert driver to use the new edac ABI · 40f562b1
      Mauro Carvalho Chehab authored
      The legacy edac ABI is going to be removed. Port the driver to use
      and benefit from the new API functionality.
      
      Cc: Tim Small <tim@buttersideup.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      40f562b1
    • Mauro Carvalho Chehab's avatar
      i7core_edac: convert driver to use the new edac ABI · 0975c16f
      Mauro Carvalho Chehab authored
      The legacy edac ABI is going to be removed. Port the driver to use
      and benefit from the new API functionality.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      0975c16f
    • Mauro Carvalho Chehab's avatar
      i7300_edac: convert driver to use the new edac ABI · 70e2a837
      Mauro Carvalho Chehab authored
      The legacy edac ABI is going to be removed. Port the driver to use
      and benefit from the new API functionality.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      70e2a837
    • Mauro Carvalho Chehab's avatar
      i5400_edac: convert driver to use the new edac ABI · 296da591
      Mauro Carvalho Chehab authored
      The legacy edac ABI is going to be removed. Port the driver to use
      and benefit from the new API functionality.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      296da591
    • Mauro Carvalho Chehab's avatar
      i5100_edac: convert driver to use the new edac ABI · d1afaa0a
      Mauro Carvalho Chehab authored
      The legacy edac ABI is going to be removed. Port the driver to use
      and benefit from the new API functionality.
      
      Cc: "Niklas Söderlund" <niklas.soderlund@ericsson.com>
      Cc: Borislav Petkov <borislav.petkov@amd.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      d1afaa0a
    • Mauro Carvalho Chehab's avatar
      i5000_edac: convert driver to use the new edac ABI · 702df640
      Mauro Carvalho Chehab authored
      The legacy edac ABI is going to be removed. Port the driver to use
      and benefit from the new API functionality.
      
      Cc: Doug Thompson <norsk5@yahoo.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      702df640
    • Mauro Carvalho Chehab's avatar
      i3200_edac: convert driver to use the new edac ABI · 95b93287
      Mauro Carvalho Chehab authored
      The legacy edac ABI is going to be removed. Port the driver to use
      and benefit from the new API functionality.
      
      Cc: Hitoshi Mitake <h.mitake@gmail.com>
      Cc: Borislav Petkov <borislav.petkov@amd.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      95b93287
    • Mauro Carvalho Chehab's avatar
      i3000_edac: convert driver to use the new edac ABI · 884906f1
      Mauro Carvalho Chehab authored
      The legacy edac ABI is going to be removed. Port the driver to use
      and benefit from the new API functionality.
      
      Cc: Jason Uhlenkott <juhlenko@akamai.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      884906f1
    • Mauro Carvalho Chehab's avatar
      e7xxx_edac: convert driver to use the new edac ABI · 30ac4406
      Mauro Carvalho Chehab authored
      The legacy edac ABI is going to be removed. Port the driver to use
      and benefit from the new API functionality.
      
      Cc: Doug Thompson <norsk5@yahoo.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      30ac4406
    • Mauro Carvalho Chehab's avatar
      e752x_edac: convert driver to use the new edac ABI · ce11ce17
      Mauro Carvalho Chehab authored
      The legacy edac ABI is going to be removed. Port the driver to use
      and benefit from the new API functionality.
      
      Cc: Mark Gross <mark.gross@intel.com>
      Cc: Doug Thompson <norsk5@yahoo.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      ce11ce17
    • Mauro Carvalho Chehab's avatar
      cpc925_edac: convert driver to use the new edac ABI · df62b1e6
      Mauro Carvalho Chehab authored
      The legacy edac ABI is going to be removed. Port the driver to use
      and benefit from the new API functionality.
      
      Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Michal Marek <mmarek@suse.cz>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      df62b1e6
    • Mauro Carvalho Chehab's avatar
      cell_edac: convert driver to use the new edac ABI · 6458fc08
      Mauro Carvalho Chehab authored
      The legacy edac ABI is going to be removed. Port the driver to use
      and benefit from the new API functionality.
      
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Joe Perches <joe@perches.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      6458fc08
    • Mauro Carvalho Chehab's avatar
      amd76x_edac: convert driver to use the new edac ABI · d8c34af4
      Mauro Carvalho Chehab authored
      The legacy edac ABI is going to be removed. Port the driver to use
      and benefit from the new API functionality.
      
      Cc: Michal Marek <mmarek@suse.cz>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      d8c34af4
    • Mauro Carvalho Chehab's avatar
      amd64_edac: convert driver to use the new edac ABI · ab5a503c
      Mauro Carvalho Chehab authored
      The legacy edac ABI is going to be removed. Port the driver to use
      and benefit from the new API functionality.
      
      Cc: Doug Thompson <norsk5@yahoo.com>
      Cc: Borislav Petkov <borislav.petkov@amd.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      ab5a503c
    • Mauro Carvalho Chehab's avatar
      edac: Change internal representation to work with layers · 4275be63
      Mauro Carvalho Chehab authored
      Change the EDAC internal representation to work with non-csrow
      based memory controllers.
      
      There are lots of those memory controllers nowadays, and more
      are coming. So, the EDAC internal representation needs to be
      changed, in order to work with those memory controllers, while
      preserving backward compatibility with the old ones.
      
      The edac core was written with the idea that memory controllers
      are able to directly access csrows.
      
      This is not true for FB-DIMM and RAMBUS memory controllers.
      
      Also, some recent advanced memory controllers don't present a per-csrows
      view. Instead, they view memories as DIMMs, instead of ranks.
      
      So, change the allocation and error report routines to allow
      them to work with all types of architectures.
      
      This will allow the removal of several hacks with FB-DIMM and RAMBUS
      memory controllers.
      
      Also, several tests were done on different platforms using different
      x86 drivers.
      
      TODO: a multi-rank DIMMs are currently represented by multiple DIMM
      entries in struct dimm_info. That means that changing a label for one
      rank won't change the same label for the other ranks at the same DIMM.
      This bug is present since the beginning of the EDAC, so it is not a big
      deal. However, on several drivers, it is possible to fix this issue, but
      it should be a per-driver fix, as the csrow => DIMM arrangement may not
      be equal for all. So, don't try to fix it here yet.
      
      I tried to make this patch as short as possible, preceding it with
      several other patches that simplified the logic here. Yet, as the
      internal API changes, all drivers need changes. The changes are
      generally bigger in the drivers for FB-DIMMs.
      
      Cc: Aristeu Rozanski <arozansk@redhat.com>
      Cc: Doug Thompson <norsk5@yahoo.com>
      Cc: Borislav Petkov <borislav.petkov@amd.com>
      Cc: Mark Gross <mark.gross@intel.com>
      Cc: Jason Uhlenkott <juhlenko@akamai.com>
      Cc: Tim Small <tim@buttersideup.com>
      Cc: Ranganathan Desikan <ravi@jetztechnologies.com>
      Cc: "Arvind R." <arvino55@gmail.com>
      Cc: Olof Johansson <olof@lixom.net>
      Cc: Egor Martovetsky <egor@pasemi.com>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: Michal Marek <mmarek@suse.cz>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Joe Perches <joe@perches.com>
      Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Hitoshi Mitake <h.mitake@gmail.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: "Niklas Söderlund" <niklas.soderlund@ericsson.com>
      Cc: Shaohui Xie <Shaohui.Xie@freescale.com>
      Cc: Josh Boyer <jwboyer@gmail.com>
      Cc: linuxppc-dev@lists.ozlabs.org
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      4275be63
    • Mauro Carvalho Chehab's avatar
      edac.h: Add generic layers for describing a memory location · 982216a4
      Mauro Carvalho Chehab authored
      The edac core were written with the idea that memory controllers
      are able to directly access csrows, and that the channels are
      used inside a csrows select.
      
      This is not true for FB-DIMM and RAMBUS memory controllers.
      
      Also, some recent advanced memory controllers don't present a per-csrows
      view. Instead, they view memories as DIMMs, instead of ranks, accessed
      via csrow/channel.
      
      So, changes are needed in order to allow the EDAC core to
      work with all types of architectures.
      
      In preparation for handling non-csrows based memory controllers,
      add some memory structs and a macro:
      
      enum hw_event_mc_err_type: describes the type of error
      			   (corrected, uncorrected, fatal)
      
      To be used by the new edac_mc_handle_error function;
      
      enum edac_mc_layer: describes the type of a given memory
      architecture layer (branch, channel, slot, csrow).
      
      struct edac_mc_layer: describes the properties of a memory
      		      layer (type, size, and if the layer
      		      will be used on a virtual csrow.
      
      EDAC_DIMM_PTR() - as the number of layers can vary from 1 to 3,
      this macro converts from an address with up to 3 layers into
      a linear address.
      Reviewed-by: default avatarBorislav Petkov <bp@amd64.org>
      Cc: Doug Thompson <norsk5@yahoo.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      982216a4
    • Mauro Carvalho Chehab's avatar
      edac: rewrite edac_align_ptr() · 93e4fe64
      Mauro Carvalho Chehab authored
      The edac_align_ptr() function is used to prepare data for a single
      memory allocation kzalloc() call. It counts how many bytes are needed
      by some data structure.
      
      Using it as-is is not that trivial, as the quantity of memory elements
      reserved is not there, but, instead, it is on a next call.
      
      In order to avoid mistakes when using it, move the number of allocated
      elements into it, making easier to use it.
      Reviewed-by: default avatarBorislav Petkov <bp@amd64.org>
      Cc: Aristeu Rozanski <arozansk@redhat.com>
      Cc: Doug Thompson <norsk5@yahoo.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      93e4fe64
    • Mauro Carvalho Chehab's avatar
      edac: move nr_pages to dimm struct · a895bf8b
      Mauro Carvalho Chehab authored
      The number of pages is a dimm property. Move it to the dimm struct.
      
      After this change, it is possible to add sysfs nodes for the DIMM's that
      will properly represent the DIMM stick properties, including its size.
      
      A TODO fix here is to properly represent dual-rank/quad-rank DIMMs when
      the memory controller represents the memory via chip select rows.
      Reviewed-by: default avatarAristeu Rozanski <arozansk@redhat.com>
      Acked-by: default avatarBorislav Petkov <borislav.petkov@amd.com>
      Acked-by: default avatarChris Metcalf <cmetcalf@tilera.com>
      Cc: Doug Thompson <norsk5@yahoo.com>
      Cc: Mark Gross <mark.gross@intel.com>
      Cc: Jason Uhlenkott <juhlenko@akamai.com>
      Cc: Tim Small <tim@buttersideup.com>
      Cc: Ranganathan Desikan <ravi@jetztechnologies.com>
      Cc: "Arvind R." <arvino55@gmail.com>
      Cc: Olof Johansson <olof@lixom.net>
      Cc: Egor Martovetsky <egor@pasemi.com>
      Cc: Michal Marek <mmarek@suse.cz>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Joe Perches <joe@perches.com>
      Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Hitoshi Mitake <h.mitake@gmail.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: "Niklas Söderlund" <niklas.soderlund@ericsson.com>
      Cc: Shaohui Xie <Shaohui.Xie@freescale.com>
      Cc: Josh Boyer <jwboyer@gmail.com>
      Cc: linuxppc-dev@lists.ozlabs.org
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      a895bf8b
    • Mauro Carvalho Chehab's avatar
      edac: Don't initialize csrow's first_page & friends when not needed · 5e2af0c0
      Mauro Carvalho Chehab authored
      Almost all edac	drivers	initialize csrow_info->first_page,
      csrow_info->last_page and csrow_info->page_mask. Those vars are
      used inside the EDAC core, in order to calculate the csrow affected
      by an error, by using the routine edac_mc_find_csrow_by_page().
      
      However, very few drivers actually use it:
              e752x_edac.c
              e7xxx_edac.c
              i3000_edac.c
              i82443bxgx_edac.c
              i82860_edac.c
              i82875p_edac.c
              i82975x_edac.c
              r82600_edac.c
      
      There also a few other drivers that have their own calculus
      formula internally using those vars.
      
      All the others are just wasting time by initializing those
      data.
      
      While initializing data without using them won't cause any troubles, as
      those information is stored at the wrong place (at csrows structure), it
      is better to remove what is unused, in order to simplify the next patch.
      Reviewed-by: default avatarAristeu Rozanski <arozansk@redhat.com>
      Acked-by: default avatarBorislav Petkov <borislav.petkov@amd.com>
      Acked-by: default avatarChris Metcalf <cmetcalf@tilera.com>
      Cc: Doug Thompson <norsk5@yahoo.com>
      Cc: Hitoshi Mitake <h.mitake@gmail.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: "Niklas Söderlund" <niklas.soderlund@ericsson.com>
      Cc: Josh Boyer <jwboyer@gmail.com>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      5e2af0c0
    • Mauro Carvalho Chehab's avatar
      edac: move dimm properties to struct dimm_info · 084a4fcc
      Mauro Carvalho Chehab authored
      On systems based on chip select rows, all channels need to use memories
      with the same properties, otherwise the memories on channels A and B
      won't be recognized.
      
      However, such assumption is not true for all types of memory
      controllers.
      
      Controllers for FB-DIMM's don't have such requirements.
      
      Also, modern Intel controllers seem to be capable of handling such
      differences.
      
      So, we need to get rid of storing the DIMM information into a per-csrow
      data, storing it, instead at the right place.
      
      The first step is to move grain, mtype, dtype and edac_mode to the
      per-dimm struct.
      Reviewed-by: default avatarAristeu Rozanski <arozansk@redhat.com>
      Reviewed-by: default avatarBorislav Petkov <borislav.petkov@amd.com>
      Acked-by: default avatarChris Metcalf <cmetcalf@tilera.com>
      Cc: Doug Thompson <norsk5@yahoo.com>
      Cc: Borislav Petkov <borislav.petkov@amd.com>
      Cc: Mark Gross <mark.gross@intel.com>
      Cc: Jason Uhlenkott <juhlenko@akamai.com>
      Cc: Tim Small <tim@buttersideup.com>
      Cc: Ranganathan Desikan <ravi@jetztechnologies.com>
      Cc: "Arvind R." <arvino55@gmail.com>
      Cc: Olof Johansson <olof@lixom.net>
      Cc: Egor Martovetsky <egor@pasemi.com>
      Cc: Michal Marek <mmarek@suse.cz>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Joe Perches <joe@perches.com>
      Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Hitoshi Mitake <h.mitake@gmail.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: James Bottomley <James.Bottomley@parallels.com>
      Cc: "Niklas Söderlund" <niklas.soderlund@ericsson.com>
      Cc: Shaohui Xie <Shaohui.Xie@freescale.com>
      Cc: Josh Boyer <jwboyer@gmail.com>
      Cc: Mike Williams <mike@mikebwilliams.com>
      Cc: linuxppc-dev@lists.ozlabs.org
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      084a4fcc
    • Mauro Carvalho Chehab's avatar
      edac: Create a dimm struct and move the labels into it · a7d7d2e1
      Mauro Carvalho Chehab authored
      The way a DIMM is currently represented implies that they're
      linked into a per-csrow struct. However, some drivers don't see
      csrows, as they're ridden behind some chip like the AMB's
      on FBDIMM's, for example.
      
      This forced drivers to fake^Wvirtualize a csrow struct, and to create
      a mess under csrow/channel original's concept.
      
      Move the DIMM labels into a per-DIMM struct, and add there
      the real location of the socket, in terms of csrow/channel.
      Latter patches will modify the location to properly represent the
      memory architecture.
      
      All other drivers will use a per-csrow type of location.
      Some of those drivers will require a latter conversion, as
      they also fake the csrows internally.
      
      TODO: While this patch doesn't change the existing behavior, on
      csrows-based memory controllers, a csrow/channel pair points to a memory
      rank. There's a known bug at the EDAC core that allows having different
      labels for the same DIMM, if it has more than one rank. A latter patch
      is need to merge the several ranks for a DIMM into the same dimm_info
      struct, in order to avoid having different labels for the same DIMM.
      
      The edac_mc_alloc() will now contain a per-dimm initialization loop that
      will be changed by latter patches in order to match other types of
      memory architectures.
      Reviewed-by: default avatarAristeu Rozanski <arozansk@redhat.com>
      Reviewed-by: default avatarBorislav Petkov <borislav.petkov@amd.com>
      Cc: Doug Thompson <norsk5@yahoo.com>
      Cc: Ranganathan Desikan <ravi@jetztechnologies.com>
      Cc: "Arvind R." <arvino55@gmail.com>
      Cc: "Niklas Söderlund" <niklas.soderlund@ericsson.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      a7d7d2e1
  2. 20 May, 2012 1 commit
  3. 19 May, 2012 10 commits
    • Linus Torvalds's avatar
      Merge tag 'parisc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/parisc-2.6 · d6c77973
      Linus Torvalds authored
      Pull PA-RISC fixes from James Bottomley:
       "This is a set of three bug fixes that gets parisc running again on
        systems with PA1.1 processors.
      
        Two fix regressions introduced in 2.6.39 and one fixes a prefetch bug
        that only affects PA7300LC processors.  We also have another pending
        fix to do with the sectional arrangement of vmlinux.lds, but there's a
        query on it during testing on one particular system type, so I'll hold
        off sending it in for now."
      
      * tag 'parisc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/parisc-2.6:
        [PARISC] fix panic on prefetch(NULL) on PA7300LC
        [PARISC] fix crash in flush_icache_page_asm on PA1.1
        [PARISC] fix PA1.1 oops on boot
      d6c77973
    • Linus Torvalds's avatar
      Merge branch 'x86/ld-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 5d120458
      Linus Torvalds authored
      Pull x86 linker bug workarounds from Peter Anvin.
      
      GNU ld-2.22.52.0.[12] (*) has an unfortunate bug where it incorrectly
      turns certain relocation entries absolute.  Section-relative symbols
      that are part of otherwise empty sections are silently changed them to
      absolute.  We rely on section-relative symbols staying section-relative,
      and actually have several sections in the linker script solely for this
      purpose.
      
      See for example
      
         http://sourceware.org/bugzilla/show_bug.cgi?id=14052
      
      We could just black-list the buggy linker, but it appears that it got
      shipped in at least F17, and possibly other distros too, so it's sadly
      not some rare unusual case.
      
      This backports the workaround from the x86/trampoline branch, and as
      Peter says: "This is not a minimal fix, not at all, but it is a tested
      code base."
      
      * 'x86/ld-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86, relocs: When printing an error, say relative or absolute
        x86, relocs: Workaround for binutils 2.22.52.0.1 section bug
        x86, realmode: 16-bit real-mode code support for relocs tool
      
      (*) That's a manly release numbering system. Stupid, sure. But manly.
      5d120458
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.dk/linux-block · 14e931a2
      Linus Torvalds authored
      Pull block layer fixes from Jens Axboe:
       "A few small, but important fixes.  Most of them are marked for stable
        as well
      
         - Fix failure to release a semaphore on error path in mtip32xx.
         - Fix crashable condition in bio_get_nr_vecs().
         - Don't mark end-of-disk buffers as mapped, limit it to i_size.
         - Fix for build problem with CONFIG_BLOCK=n on arm at least.
         - Fix for a buffer overlow on UUID partition printing.
         - Trivial removal of unused variables in dac960."
      
      * 'for-linus' of git://git.kernel.dk/linux-block:
        block: fix buffer overflow when printing partition UUIDs
        Fix blkdev.h build errors when BLOCK=n
        bio allocation failure due to bio_get_nr_vecs()
        block: don't mark buffers beyond end of disk as mapped
        mtip32xx: release the semaphore on an error path
        dac960: Remove unused variables from DAC960_CreateProcEntries()
      14e931a2
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · a2ae9787
      Linus Torvalds authored
      Pull one more networking bug-fix from David Miller:
       "One last straggler.
      
        Eric Dumazet's pktgen unload oops fix was not entirely complete, but
        all the cases should be handled properly now....  fingers crossed."
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
        pktgen: fix module unload for good
      a2ae9787
    • Hugh Dickins's avatar
      memcg,thp: fix res_counter:96 regression · 62ade86a
      Hugh Dickins authored
      Occasionally, testing memcg's move_charge_at_immigrate on rc7 shows
      a flurry of hundreds of warnings at kernel/res_counter.c:96, where
      res_counter_uncharge_locked() does WARN_ON(counter->usage < val).
      
      The first trace of each flurry implicates __mem_cgroup_cancel_charge()
      of mc.precharge, and an audit of mc.precharge handling points to
      mem_cgroup_move_charge_pte_range()'s THP handling in commit 12724850
      ("memcg: avoid THP split in task migration").
      
      Checking !mc.precharge is good everywhere else, when a single page is to
      be charged; but here the "mc.precharge -= HPAGE_PMD_NR" likely to
      follow, is liable to result in underflow (a lot can change since the
      precharge was estimated).
      
      Simply check against HPAGE_PMD_NR: there's probably a better
      alternative, trying precharge for more, splitting if unsuccessful; but
      this one-liner is safer for now - no kernel/res_counter.c:96 warnings
      seen in 26 hours.
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      62ade86a
    • H. Peter Anvin's avatar
      x86, relocs: When printing an error, say relative or absolute · 24ab82bd
      H. Peter Anvin authored
      When the relocs tool throws an error, let the error message say if it
      is an absolute or relative symbol.  This should make it a lot more
      clear what action the programmer needs to take and should help us find
      the reason if additional symbol bugs show up.
      Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
      Cc: <stable@vger.kernel.org>
      24ab82bd
    • H. Peter Anvin's avatar
      x86, relocs: Workaround for binutils 2.22.52.0.1 section bug · a3e854d9
      H. Peter Anvin authored
      GNU ld 2.22.52.0.1 has a bug that it blindly changes symbols from
      section-relative to absolute if they are in a section of zero length.
      This turns the symbols __init_begin and __init_end into absolute
      symbols.  Let the relocs program know that those should be treated as
      relative symbols.
      Reported-by: default avatarIngo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
      Cc: H.J. Lu <hjl.tools@gmail.com>
      Cc: <stable@vger.kernel.org>
      Cc: Jarkko Sakkinen <jarkko.sakkinen@intel.com>
      a3e854d9
    • H. Peter Anvin's avatar
      x86, realmode: 16-bit real-mode code support for relocs tool · 6520fe55
      H. Peter Anvin authored
      A new option is added to the relocs tool called '--realmode'.
      This option causes the generation of 16-bit segment relocations
      and 32-bit linear relocations for the real-mode code. When
      the real-mode code is moved to the low-memory during kernel
      initialization, these relocation entries can be used to
      relocate the code properly.
      
      In the assembly code 16-bit segment relocations must be relative
      to the 'real_mode_seg' absolute symbol. Linear relocations must be
      relative to a symbol prefixed with 'pa_'.
      
      16-bit segment relocation is used to load cs:ip in 16-bit code.
      Linear relocations are used in the 32-bit code for relocatable
      data references. They are declared in the linker script of the
      real-mode code.
      
      The relocs tool is moved to arch/x86/tools/relocs.c, and added new
      target archscripts that can be used to build scripts needed building
      an architecture.  be compiled before building the arch/x86 tree.
      
      [ hpa: accelerating this because it detects invalid absolute
        relocations, a serious bug in binutils 2.22.52.0.x which currently
        produces bad kernels. ]
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      Link: http://lkml.kernel.org/r/1336501366-28617-2-git-send-email-jarkko.sakkinen@intel.comSigned-off-by: default avatarJarkko Sakkinen <jarkko.sakkinen@intel.com>
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      Cc: <stable@vger.kernel.org>
      6520fe55
    • Linus Torvalds's avatar
      Merge tag 'dm-3.4-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm · b1dab2f0
      Linus Torvalds authored
      Pull a dm fix from Alasdair G Kergon:
       "A fix to the thin provisioning userspace interface."
      
      * tag 'dm-3.4-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm:
        dm thin: fix table output when pool target disables discard passdown internally
      b1dab2f0
    • Mike Snitzer's avatar
      dm thin: fix table output when pool target disables discard passdown internally · f402693d
      Mike Snitzer authored
      When the thin pool target clears the discard_passdown parameter
      internally, it incorrectly changes the table line reported to userspace.
      This breaks dumb string comparisons on these table lines in generic
      userspace device-mapper library code and leads to tables being reloaded
      repeatedly when nothing is actually meant to be changing.
      
      This patch corrects this by no longer changing the table line when
      discard passdown was disabled.
      
      We can still tell when discard passdown is overridden by looking for the
      message "Discard unsupported by data device (sdX): Disabling discard passdown."
      
      This automatic detection is also moved from the 'load' to the 'resume'
      so that it is re-evaluated should the properties of underlying devices
      change.
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Acked-by: default avatarJoe Thornber <ejt@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      f402693d
  4. 18 May, 2012 7 commits
    • Linus Torvalds's avatar
      Merge tag 'md-3.4-fixes' of git://neil.brown.name/md · 2f05af8b
      Linus Torvalds authored
      Pull one more md bugfix from NeilBrown:
       "Fix bug in recent fix to RAID10.
      
        Without this patch, recovery will crash"
      
      * tag 'md-3.4-fixes' of git://neil.brown.name/md:
        md/raid10: fix transcription error in calc_sectors conversion.
      2f05af8b
    • Linus Torvalds's avatar
      Merge branch 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile · 8394edf3
      Linus Torvalds authored
      Pull tile tree bugfix from Chris Metcalf:
       "This fixes a security vulnerability (and correctness bug) in tilegx"
      
      * 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
        tilegx: enable SYSCALL_WRAPPERS support
      8394edf3
    • NeilBrown's avatar
      md/raid10: fix transcription error in calc_sectors conversion. · b0d634d5
      NeilBrown authored
      The old code was
      		sector_div(stride, fc);
      the new code was
      		sector_dir(size, conf->near_copies);
      
      'size' is right (the stride various wasn't really needed), but
      'fc' means 'far_copies', and that is an important difference.
      
      Signed-off-by: NeilBrown <neilb@suse.de>       
      b0d634d5
    • Linus Torvalds's avatar
      Merge branch 'akpm' (Andrew's patch-bomb) · 73f1f5dd
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton.
      
      * emailed from Andrew Morton <akpm@linux-foundation.org>: (4 patches)
        frv: delete incorrect task prototypes causing compile fail
        slub: missing test for partial pages flush work in flush_all()
        fs, proc: fix ABBA deadlock in case of execution attempt of map_files/ entries
        drivers/rtc/rtc-pl031.c: configure correct wday for 2000-01-01
      73f1f5dd
    • Linus Torvalds's avatar
      proc: move fd symlink i_mode calculations into tid_fd_revalidate() · 30a08bf2
      Linus Torvalds authored
      Instead of doing the i_mode calculations at proc_fd_instantiate() time,
      move them into tid_fd_revalidate(), which is where the other inode state
      (notably uid/gid information) is updated too.
      
      Otherwise we'll end up with stale i_mode information if an fd is re-used
      while the dentry still hangs around.  Not that anything really *cares*
      (symlink permissions don't really matter), but Tetsuo Handa noticed that
      the owner read/write bits don't always match the state of the
      readability of the file descriptor, and we _used_ to get this right a
      long time ago in a galaxy far, far away.
      
      Besides, aside from fixing an ugly detail (that has apparently been this
      way since commit 61a28784: "proc: Remove the hard coded inode
      numbers" in 2006), this removes more lines of code than it adds.  And it
      just makes sense to update i_mode in the same place we update i_uid/gid.
      
      Al Viro correctly points out that we could just do the inode fill in the
      inode iops ->getattr() function instead.  However, that does require
      somewhat slightly more invasive changes, and adds yet *another* lookup
      of the file descriptor.  We need to do the revalidate() for other
      reasons anyway, and have the file descriptor handy, so we might as well
      fill in the information at this point.
      Reported-by: default avatarTetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Acked-by: default avatarEric Biederman <ebiederm@xmission.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      30a08bf2
    • Eric Dumazet's avatar
      pktgen: fix module unload for good · d4b11335
      Eric Dumazet authored
      commit c57b5468 (pktgen: fix crash at module unload) did a very poor
      job with list primitives.
      
      1) list_splice() arguments were in the wrong order
      
      2) list_splice(list, head) has undefined behavior if head is not
      initialized.
      
      3) We should use the list_splice_init() variant to clear pktgen_threads
      list.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d4b11335
    • Chris Metcalf's avatar
      tilegx: enable SYSCALL_WRAPPERS support · e6d9668e
      Chris Metcalf authored
      Some discussion with the glibc mailing lists revealed that this was
      necessary for 64-bit platforms with MIPS-like sign-extension rules
      for 32-bit values.  The original symptom was that passing (uid_t)-1 to
      setreuid() was failing in programs linked -pthread because of the "setxid"
      mechanism for passing setxid-type function arguments to the syscall code.
      SYSCALL_WRAPPERS handles ensuring that all syscall arguments end up with
      proper sign-extension and is thus the appropriate fix for this problem.
      
      On other platforms (s390, powerpc, sparc64, and mips) this was fixed
      in 2.6.28.6.  The general issue is tracked as CVE-2009-0029.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarChris Metcalf <cmetcalf@tilera.com>
      e6d9668e