1. 28 5月, 2012 2 次提交
  2. 27 5月, 2012 15 次提交
    • L
      Merge branch 'generic-string-functions' · 1e2aec87
      Linus Torvalds 提交于
      This makes <asm/word-at-a-time.h> actually live up to its promise of
      allowing architectures to help tune the string functions that do their
      work a word at a time.
      
      David had already taken the x86 strncpy_from_user() function, modified
      it to work on sparc, and then done the extra work to make it generically
      useful.  This then expands on that work by making x86 use that generic
      version, completing the circle.
      
      But more importantly, it fixes up the word-at-a-time interfaces so that
      it's now easy to also support things like strnlen_user(), and pretty
      much most random string functions.
      
      David reports that it all works fine on sparc, and Jonas Bonn reported
      that an earlier version of this worked on OpenRISC too.  It's pretty
      easy for architectures to add support for this and just replace their
      private versions with the generic code.
      
      * generic-string-functions:
        sparc: use the new generic strnlen_user() function
        x86: use the new generic strnlen_user() function
        lib: add generic strnlen_user() function
        word-at-a-time: make the interfaces truly generic
        x86: use generic strncpy_from_user routine
      1e2aec87
    • L
      Merge branch 'i2c-embedded/for-next' of git://git.pengutronix.de/git/wsa/linux · ae32adc1
      Linus Torvalds 提交于
      Pull i2c-embedded changes from Wolfram Sang:
       "Major changes:
      
         - lots of devicetree additions for existing drivers.  I tried hard to
           make sure the bindings are proper.  In more complicated cases, I
           requested acks from people having more experience with them than
           me.  That took a bit of extra time and also some time went into
           discussions with developers about what bindings are and what not.
           I have the feeling that the workflow with bindings should be
           improved to scale better.  I will spend some more thought on
           this...
      
         - i2c-muxes are succesfully used meanwhile, so we dropped
           EXPERIMENTAL for them and renamed the drivers to a standard pattern
           to match the rest of the subsystem.  They can also be used with
           devicetree now.
      
         - ixp2000 was removed since the whole platform goes away.
      
         - cleanups (strlcpy instead of strcpy, NULL instead of 0)
      
         - The rest is typical driver fixes I assume.
      
        All patches have been in linux-next at least since v3.4-rc6."
      
      Fixed up trivial conflict in arch/arm/mach-lpc32xx/common.c due to the
      same patch already having come in through the arm/soc trees, with
      additional patches on top of it.
      
      * 'i2c-embedded/for-next' of git://git.pengutronix.de/git/wsa/linux: (35 commits)
        i2c: davinci: Free requested IRQ in remove
        i2c: ocores: register OF i2c devices
        i2c: tegra: notify transfer-complete after clearing status.
        I2C: xiic: Add OF binding support
        i2c: Rename last mux driver to standard pattern
        i2c: tegra: fix 10bit address configuration
        i2c: muxes: rename first set of drivers to a standard pattern
        of/i2c: implement of_find_i2c_adapter_by_node
        i2c: implement i2c_verify_adapter
        i2c-s3c2410: Add HDMIPHY quirk for S3C2440
        i2c-s3c2410: Rework device type handling
        i2c: muxes are not EXPERIMENTAL anymore
        i2c/of: Automatically populate i2c mux busses from device tree data.
        i2c: Add a struct device * parameter to i2c_add_mux_adapter()
        of/i2c: call i2c_verify_client from of_find_i2c_device_by_node
        i2c: designware: Add clk_{un}prepare() support
        i2c: designware: add PM support
        i2c: ixp2000: remove driver
        i2c: pnx: add device tree support
        i2c: imx: don't use strcpy but strlcpy
        ...
      ae32adc1
    • L
      Merge tag 'cleanup-initcall' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · f465d145
      Linus Torvalds 提交于
      Pull sweeping late_initcall cleanup for arm-soc from Olof Johansson:
       "This is a patch series from Shawn Guo that moves from individual
        late_initcalls() to using a member in the machine structure to invoke
        a platform's late initcalls.
      
        This cleanup is a step in the move towards multiplatform kernels since
        it would reduce the need to check for compatible platforms in each and
        every initcall."
      
      Fix up trivial conflicts in arch/arm/mach-{exynos/mach-universal_c210.c,
      imx/mach-cpuimx51.c, omap2/board-generic.c} due to changes nearby (and,
      in the case of cpuimx51.c the board support being deleted)
      
      * tag 'cleanup-initcall' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        ARM: ux500: use machine specific hook for late init
        ARM: tegra: use machine specific hook for late init
        ARM: shmobile: use machine specific hook for late init
        ARM: sa1100: use machine specific hook for late init
        ARM: s3c64xx: use machine specific hook for late init
        ARM: prima2: use machine specific hook for late init
        ARM: pnx4008: use machine specific hook for late init
        ARM: omap2: use machine specific hook for late init
        ARM: omap1: use machine specific hook for late init
        ARM: msm: use machine specific hook for late init
        ARM: imx: use machine specific hook for late init
        ARM: exynos: use machine specific hook for late init
        ARM: ep93xx: use machine specific hook for late init
        ARM: davinci: use machine specific hook for late init
        ARM: provide a late_initcall hook for platform initialization
      f465d145
    • L
      Merge tag 'soc2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 30b84288
      Linus Torvalds 提交于
      Pull arm-soc: soc specific changes (part 2) from Olof Johansson:
       "This adds support for the spear13xx platform, which has first been
        under review a long time ago and finally been completed after generic
        spear work has gone into the clock, dt and pinctrl branches.
      
        Also a number of updates for the samsung socs are part of this branch."
      
      Fix up trivial conflicts in drivers/gpio/gpio-samsung.c that look much
      worse than they are: the exonys5 init code was refactored in commit
      fd454997 ("gpio: samsung: refactor gpiolib init for exynos4/5"), and
      then commit f10590c9 ("ARM: EXYNOS: add GPC4 bank instance") added a
      new gpio chip define and did tiny updates to the init code.
      
      So the conflict diff looks like hell, but it's actually a fairly simple
      change.
      
      * tag 'soc2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (34 commits)
        ARM: exynos: fix building with CONFIG_OF disabled
        ARM: EXYNOS: Add AUXDATA for i2c controllers
        ARM: dts: Update device tree source files for EXYNOS5250
        ARM: EXYNOS: Add device tree support for interrupt combiner
        ARM: EXYNOS: Add irq_domain support for interrupt combiner
        ARM: EXYNOS: Remove a new bus_type instance for EXYNOS5
        ARM: EXYNOS: update irqs for EXYNOS5250 SoC
        ARM: EXYNOS: Add pre-divider and fout mux clocks for bpll and mpll
        ARM: EXYNOS: add GPC4 bank instance
        ARM: EXYNOS: Redefine IRQ_MCT_L0,1 definition
        ARM: EXYNOS: Modify the GIC physical address for static io-mapping
        ARM: EXYNOS: Add watchdog timer clock instance
        pinctrl: SPEAr1310: Fix pin numbers for clcd_high_res
        SPEAr: Update MAINTAINERS and Documentation
        SPEAr13xx: Add defconfig
        SPEAr13xx: Add compilation support
        SPEAr13xx: Add dts and dtsi files
        pinctrl: Add SPEAr13xx pinctrl drivers
        pinctrl: SPEAr: Create macro for declaring GPIO PINS
        SPEAr13xx: Add common clock framework support
        ...
      30b84288
    • L
      Merge tag 'dt2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 84a442b9
      Linus Torvalds 提交于
      Pull arm-soc device tree conversions (part 2) from Olof Johansson:
       "These continue the device tree work from part 1, this set is for the
        tegra, mxs and imx platforms, all of which have dependencies on clock
        or pinctrl changes submitted earlier."
      
      Fix up trivial conflicts due to nearby changes in
      drivers/{gpio/gpio,i2c/busses/i2c}-mxs.c
      
      * tag 'dt2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (73 commits)
        ARM: dt: tegra: invert status=disable vs status=okay
        ARM: dt: tegra: consistent basic property ordering
        ARM: dt: tegra: sort nodes based on bus order
        ARM: dt: tegra: remove duplicate device_type property
        ARM: dt: tegra: consistenly use lower-case for hex constants
        ARM: dt: tegra: format regs properties consistently
        ARM: dt: tegra: gpio comment cleanup
        ARM: dt: tegra: remove unnecessary unit addresses
        ARM: dt: tegra: whitespace cleanup
        ARM: dt: tegra cardhu: fix typo in SDHCI node name
        ARM: dt: tegra: cardhu: register core regulator tps62361
        ARM: dt: tegra30.dtsi: Add SMMU node
        ARM: dt: tegra20.dtsi: Add GART node
        ARM: dt: tegra30.dtsi: Add Memory Controller(MC) nodes
        ARM: dt: tegra20.dtsi: Add Memory Controller(MC) nodes
        ARM: dt: tegra: Add device tree support for AHB
        ARM: dts: enable audio support for imx28-evk
        ARM: dts: enable i2c device for imx28-evk
        i2c: mxs: add device tree probe support
        ARM: dts: enable mmc for imx28-evk
        ...
      84a442b9
    • L
      Merge tag 'stmp-dev' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 39b6cc66
      Linus Torvalds 提交于
      Pull arm-soc stmp-dev library code from Olof Johansson:
       "A number of devices are using a common register layout, this adds
        support code for it in lib/stmp_device.c so we do not need to
        duplicate it in each driver."
      
      Fix up trivial conflicts in drivers/i2c/busses/i2c-mxs.c and
      lib/Makefile
      
      * tag 'stmp-dev' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        i2c: mxs: use global reset function
        lib: add support for stmp-style devices
      39b6cc66
    • L
      Merge tag 'clock' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 27953437
      Linus Torvalds 提交于
      Pull arm-soc clock driver changes from Olof Johansson:
       "The new clock subsystem was merged in linux-3.4 without any users,
        this now moves the first three platforms over to it: imx, mxs and
        spear.
      
        The series also contains the changes for the clock subsystem itself,
        since Mike preferred to have it together with the platforms that
        require these changes, in order to avoid interdependencies and
        conflicts."
      
      Fix up trivial conflicts in arch/arm/mach-kirkwood/common.c (code
      removed in one branch, added OF support in another) and
      drivers/dma/imx-sdma.c (independent changes next to each other).
      
      * tag 'clock' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (97 commits)
        clk: Fix CLK_SET_RATE_GATE flag validation in clk_set_rate().
        clk: Provide dummy clk_unregister()
        SPEAr: Update defconfigs
        SPEAr: Add SMI NOR partition info in dts files
        SPEAr: Switch to common clock framework
        SPEAr: Call clk_prepare() before calling clk_enable
        SPEAr: clk: Add General Purpose Timer Synthesizer clock
        SPEAr: clk: Add Fractional Synthesizer clock
        SPEAr: clk: Add Auxiliary Synthesizer clock
        SPEAr: clk: Add VCO-PLL Synthesizer clock
        SPEAr: Add DT bindings for SPEAr's timer
        ARM i.MX: remove now unused clock files
        ARM: i.MX6: implement clocks using common clock framework
        ARM i.MX35: implement clocks using common clock framework
        ARM i.MX5: implement clocks using common clock framework
        ARM: Kirkwood: Replace clock gating
        ARM: Orion: Audio: Add clk/clkdev support
        ARM: Orion: PCIE: Add support for clk
        ARM: Orion: XOR: Add support for clk
        ARM: Orion: CESA: Add support for clk
        ...
      27953437
    • L
      Merge tag 'cleanup2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 2c757fd5
      Linus Torvalds 提交于
      Pull arm-soc cleanups (part 2) from Olof Johansson:
       "More cleanups, continuing an earlier set with omap and samsung
        specific cleanups.  These could not go into the first set because they
        have dependencies on various other series that in turn depend on the
        first cleanups."
      
      Fixed up conflicts in arch/arm/plat-omap/counter_32k.c due to commit
      bd0493ea: "move read_{boot,persistent}_clock to the architecture
      level" that changed how the persistent clocks were handled.  And trivial
      conflicts in arch/arm/mach-omap1/common.h due to just independent
      changes close to each other.
      
      * tag 'cleanup2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (35 commits)
        ARM: SAMSUNG: merge plat-s5p into plat-samsung
        ARM: SAMSUNG: move options for common s5p into plat-samsung/Kconfig
        ARM: SAMSUNG: move setup code for s5p mfc and mipiphy into plat-samsung
        ARM: SAMSUNG: move platform device for s5p uart into plat-samsung
        ARM: SAMSUNG: move hr timer for common s5p into plat-samsung
        ARM: SAMSUNG: move pm part for common s5p into plat-samsung
        ARM: SAMSUNG: move interrupt part for common s5p into plat-samsung
        ARM: SAMSUNG: move clock part for common s5p into plat-samsung
        ARM: S3C24XX: Use common macro to define resources on dev-uart.c
        ARM: S3C24XX: move common clock init into common.c
        ARM: S3C24XX: move common power-management code to mach-s3c24xx
        ARM: S3C24XX: move plat-s3c24xx/dev-uart.c into common.c
        ARM: S3C24XX: move plat-s3c24xx/cpu.c
        ARM: OMAP2+: Kconfig: convert SOC_OMAPAM33XX to SOC_AM33XX
        ARM: OMAP2+: Kconfig: convert SOC_OMAPTI81XX to SOC_TI81XX
        GPMC: add ECC control definitions
        ARM: OMAP2+: dmtimer: remove redundant sysconfig context restore
        ARM: OMAP: AM35xx: convert 3517 detection/flags to AM35xx
        ARM: OMAP: AM35xx: remove redunant cpu_is checks for AM3505
        ARM: OMAP1: Pass dma request lines in platform data to MMC driver
        ...
      2c757fd5
    • L
      Merge tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · ce53044c
      Linus Torvalds 提交于
      Pull arm-soc driver specific updates from Olof Johansson:
       "These changes are specific to some driver that may be used by multiple
        boards or socs.  The most significant change in here is the move of
        the samsung iommu code from a platform specific in-kernel interface to
        the generic iommu subsystem."
      
      Fix up trivial conflicts in arch/arm/mach-exynos/Kconfig
      
      * tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (28 commits)
        mmc: dt: Consolidate DT bindings
        iommu/exynos: Add iommu driver for EXYNOS Platforms
        ARM: davinci: optimize the DMA ISR
        ARM: davinci: implement DEBUG_LL port choice
        ARM: tegra: Add SMMU enabler in AHB
        ARM: tegra: Add Tegra AHB driver
        Input: pxa27x_keypad add choice to set direct_key_mask
        Input: pxa27x_keypad direct key may be low active
        Input: pxa27x_keypad bug fix for direct_key_mask
        Input: pxa27x_keypad keep clock on as wakeup source
        ARM: dt: tegra: pinmux changes for USB ULPI
        ARM: tegra: add USB ULPI PHY reset GPIO to device tree
        ARM: tegra: don't hard-code USB ULPI PHY reset_gpio
        ARM: tegra: change pll_p_out4's rate to 24MHz
        ARM: tegra: fix pclk rate
        ARM: tegra: reparent sclk to pll_c_out1
        ARM: tegra: Add pllc clock init table
        ARM: dt: tegra cardhu: basic audio support
        ARM: dt: tegra30.dtsi: Add audio-related nodes
        ARM: tegra: add AUXDATA required for audio
        ...
      ce53044c
    • L
      Merge tag 'defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 0877aa39
      Linus Torvalds 提交于
      Pull arm-soc defconfig updates from Olof Johansson:
       "For the first time, we have one branch that collects just updates to
        defconfig files, mostly for adapting to changes in other subsystems."
      
      * tag 'defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        ARM: PRIMA2: add prima2_defconfig for CSR SiRFprimaII
        ARM: tegra: update defconfig
        ARM: tegra: update defconfig
        ARM: imx_v6_v7_defconfig: Add SPI NOR support
        ARM: imx_v4_v5_defconfig: Let CONFIG_MACH_IMX27_DT be built by default
      0877aa39
    • D
      sparc: use the new generic strnlen_user() function · 2c66f623
      David Miller 提交于
      This throws away the sparc-specific functions in favor of the generic
      optimized version.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2c66f623
    • L
      x86: use the new generic strnlen_user() function · 5723aa99
      Linus Torvalds 提交于
      This throws away the old x86-specific functions in favor of the generic
      optimized version.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5723aa99
    • L
      lib: add generic strnlen_user() function · a08c5356
      Linus Torvalds 提交于
      This adds a new generic optimized strnlen_user() function that uses the
      <asm/word-at-a-time.h> infrastructure to portably do efficient string
      handling.
      
      In many ways, strnlen is much simpler than strncpy, and in particular we
      can always pre-align the words we load from memory.  That means that all
      the worries about alignment etc are a non-issue, so this one can easily
      be used on any architecture.  You obviously do have to do the
      appropriate word-at-a-time.h macros.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a08c5356
    • L
      word-at-a-time: make the interfaces truly generic · 36126f8f
      Linus Torvalds 提交于
      This changes the interfaces in <asm/word-at-a-time.h> to be a bit more
      complicated, but a lot more generic.
      
      In particular, it allows us to really do the operations efficiently on
      both little-endian and big-endian machines, pretty much regardless of
      machine details.  For example, if you can rely on a fast population
      count instruction on your architecture, this will allow you to make your
      optimized <asm/word-at-a-time.h> file with that.
      
      NOTE! The "generic" version in include/asm-generic/word-at-a-time.h is
      not truly generic, it actually only works on big-endian.  Why? Because
      on little-endian the generic algorithms are wasteful, since you can
      inevitably do better. The x86 implementation is an example of that.
      
      (The only truly non-generic part of the asm-generic implementation is
      the "find_zero()" function, and you could make a little-endian version
      of it.  And if the Kbuild infrastructure allowed us to pick a particular
      header file, that would be lovely)
      
      The <asm/word-at-a-time.h> functions are as follows:
      
       - WORD_AT_A_TIME_CONSTANTS: specific constants that the algorithm
         uses.
      
       - has_zero(): take a word, and determine if it has a zero byte in it.
         It gets the word, the pointer to the constant pool, and a pointer to
         an intermediate "data" field it can set.
      
         This is the "quick-and-dirty" zero tester: it's what is run inside
         the hot loops.
      
       - "prep_zero_mask()": take the word, the data that has_zero() produced,
         and the constant pool, and generate an *exact* mask of which byte had
         the first zero.  This is run directly *outside* the loop, and allows
         the "has_zero()" function to answer the "is there a zero byte"
         question without necessarily getting exactly *which* byte is the
         first one to contain a zero.
      
         If you do multiple byte lookups concurrently (eg "hash_name()", which
         looks for both NUL and '/' bytes), after you've done the prep_zero_mask()
         phase, the result of those can be or'ed together to get the "either
         or" case.
      
       - The result from "prep_zero_mask()" can then be fed into "find_zero()"
         (to find the byte offset of the first byte that was zero) or into
         "zero_bytemask()" (to find the bytemask of the bytes preceding the
         zero byte).
      
         The existence of zero_bytemask() is optional, and is not necessary
         for the normal string routines.  But dentry name hashing needs it, so
         if you enable DENTRY_WORD_AT_A_TIME you need to expose it.
      
      This changes the generic strncpy_from_user() function and the dentry
      hashing functions to use these modified word-at-a-time interfaces.  This
      gets us back to the optimized state of the x86 strncpy that we lost in
      the previous commit when moving over to the generic version.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      36126f8f
    • L
      x86: use generic strncpy_from_user routine · 4ae73f2d
      Linus Torvalds 提交于
      The generic strncpy_from_user() is not really optimal, since it is
      designed to work on both little-endian and big-endian.  And on
      little-endian you can simplify much of the logic to find the first zero
      byte, since little-endian arithmetic doesn't have to worry about the
      carry bit propagating into earlier bytes (only later bytes, which we
      don't care about).
      
      But I have patches to make the generic routines use the architecture-
      specific <asm/word-at-a-time.h> infrastructure, so that we can regain
      the little-endian optimizations.  But before we do that, switch over to
      the generic routines to make the patches each do just one well-defined
      thing.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4ae73f2d
  3. 26 5月, 2012 23 次提交
    • L
      Merge tag 'x86-mce-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras · 786f02b7
      Linus Torvalds 提交于
      Pull x86/mce merge window patches from Tony Luck:
       "Including two that make error_context() checks less sucky"
      
      * tag 'x86-mce-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
        x86/mce: Add instruction recovery signatures to mce-severity table
        x86/mce: Fix check for processor context when machine check was taken.
        MCE: Fix vm86 handling for 32bit mce handler
        x86/mce Add validation check before GHES error is recorded
        x86/mce: Avoid reading every machine check bank register twice.
      786f02b7
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile · fa2af6e4
      Linus Torvalds 提交于
      Pull tile updates from Chris Metcalf:
       "These changes cover a range of new arch/tile features and
        optimizations.  They've been through LKML review and on linux-next for
        a month or so.  There's also one bug-fix that just missed 3.4, which
        I've marked for stable."
      
      Fixed up trivial conflict in arch/tile/Kconfig (new added tile Kconfig
      entries clashing with the generic timer/clockevents changes).
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
        tile: default to tilegx_defconfig for ARCH=tile
        tile: fix bug where fls(0) was not returning 0
        arch/tile: mark TILEGX as not EXPERIMENTAL
        tile/mm/fault.c: Port OOM changes to handle_page_fault
        arch/tile: add descriptive text if the kernel reports a bad trap
        arch/tile: allow querying cpu module information from the hypervisor
        arch/tile: fix hardwall for tilegx and generalize for idn and ipi
        arch/tile: support multiple huge page sizes dynamically
        mm: add new arch_make_huge_pte() method for tile support
        arch/tile: support kexec() for tilegx
        arch/tile: support <asm/cachectl.h> header for cacheflush() syscall
        arch/tile: Allow tilegx to build with either 16K or 64K page size
        arch/tile: optimize get_user/put_user and friends
        arch/tile: support building big-endian kernel
        arch/tile: allow building Linux with transparent huge pages enabled
        arch/tile: use interrupt critical sections less
      fa2af6e4
    • D
      intel-iommu: Move duplicate list-mangling code into unlink_domain_info() helper · 109b9b04
      David Woodhouse 提交于
      Now we have four copies of this code, Linus "suggested" it was about time
      we stopped copying it and turned it into a helper.
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      109b9b04
    • D
      intel-iommu: Add device info into list before doing context mapping · e2ad23d0
      David Woodhouse 提交于
      Add device info into list before doing context mapping, because device
      info will be used by iommu_enable_dev_iotlb(). Without it, ATS won't get
      enabled as it should be.
      
      ATS, while a dubious decision from a security point of view, can be very
      important for performance.
      Signed-off-by: NXudong Hao <xudong.hao@intel.com>
      Signed-off-by: NXiantao Zhang <xiantao.zhang@intel.com>
      Acked-by: NChris Wright <chrisw@sous-sol.org>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      Cc: stable@kernel.org
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e2ad23d0
    • C
      tile: default to tilegx_defconfig for ARCH=tile · 1fcb78e9
      Chris Metcalf 提交于
      There is no "ARCH=tile" (just like there is no "ARCH=x86") so we need
      to pick a default configuration, either tilepro or tilegx, when users
      specify ARCH=tile.  We'll use tilegx, since that's our current chip.
      Reported-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      1fcb78e9
    • C
      tile: fix bug where fls(0) was not returning 0 · 9f1d62be
      Chris Metcalf 提交于
      This is because __builtin_clz(0) returns 64 for the "undefined" case
      of 0, since the builtin just does a right-shift 32 and "clz" instruction.
      So, use the alpha approach of casting to u32 and using __builtin_clzll().
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      9f1d62be
    • C
      arch/tile: mark TILEGX as not EXPERIMENTAL · acd1a19e
      Chris Metcalf 提交于
      Also create a TILEPRO config setting to use for #ifdefs where it
      is cleaner to do so, and make the 64BIT setting depend directly
      on the setting of TILEGX.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      acd1a19e
    • K
      tile/mm/fault.c: Port OOM changes to handle_page_fault · 4ce6bea2
      Kautuk Consul 提交于
      Commit d065bd81
      (mm: retry page fault when blocking on disk transfer) and
      commit 37b23e05
      (x86,mm: make pagefault killable)
      
      The above commits introduced changes into the x86 pagefault handler
      for making the page fault handler retryable as well as killable.
      
      These changes reduce the mmap_sem hold time, which is crucial
      during OOM killer invocation.
      
      Port these changes to tile.
      Signed-off-by: NKautuk Consul <consul.kautuk@gmail.com>
      [cmetcalf@tilera.com: initialize "flags" after "write" updated.]
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      4ce6bea2
    • C
      arch/tile: add descriptive text if the kernel reports a bad trap · c6f696f6
      Chris Metcalf 提交于
      If the kernel unexpectedly takes a bad trap, it's convenient to
      have it report the type of trap as part of the error.  This gives
      customers a bit more context before they call up customer support.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      c6f696f6
    • C
      arch/tile: allow querying cpu module information from the hypervisor · 8703d6e0
      Chris Metcalf 提交于
      This just adds a few more attributes to the information Linux
      can query from the hypervisor for the /sys/hypervisor/board/ directory,
      providing part, serial#, revision#, and description for cpu modules
      (as opposed to the board itself, or any mezzanine boards).
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      8703d6e0
    • C
      arch/tile: fix hardwall for tilegx and generalize for idn and ipi · b8ace083
      Chris Metcalf 提交于
      The hardwall drain code was not properly implemented for tilegx,
      just tilepro, so you couldn't reliably restart an application that
      made use of the udn.
      
      In addition, the code was only applicable to the udn (user dynamic
      network).  On tilegx there is a second user network that is available
      (the "idn"), and there is support for having I/O shims deliver
      user-level interrupts to applications ("ipi") which functions in a
      very similar way to the inter-core permissions used for udn/idn.
      So this change also generalizes the code from supporting just the udn
      to supports udn/idn/ipi on tilegx.
      
      By default we now use /dev/hardwall/{udn,idn,ipi} with separate
      minor numbers for the three devices.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      b8ace083
    • C
      arch/tile: support multiple huge page sizes dynamically · 621b1955
      Chris Metcalf 提交于
      This change adds support for a new "super" bit in the PTE, using the new
      arch_make_huge_pte() method.  The Tilera hypervisor sees the bit set at a
      given level of the page table and gangs together 4, 16, or 64 consecutive
      pages from that level of the hierarchy to create a larger TLB entry.
      
      One extra "super" page size can be specified at each of the three levels
      of the page table hierarchy on tilegx, using the "hugepagesz" argument
      on the boot command line.  A new hypervisor API is added to allow Linux
      to tell the hypervisor how many PTEs to gang together at each level of
      the page table.
      
      To allow pre-allocating huge pages larger than the buddy allocator can
      handle, this change modifies the Tilera bootmem support to put all of
      memory on tilegx platforms into bootmem.
      
      As part of this change I eliminate the vestigial CONFIG_HIGHPTE support,
      which never worked anyway, and eliminate the hv_page_size() API in favor
      of the standard vma_kernel_pagesize() API.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      621b1955
    • C
      mm: add new arch_make_huge_pte() method for tile support · d9ed9faa
      Chris Metcalf 提交于
      The tile support for multiple-size huge pages requires tagging
      the hugetlb PTE with a "super" bit for PTEs that are multiples of
      the basic size of a pagetable span.  To set that bit properly
      we need to tweak the PTe in make_huge_pte() based on the vma.
      
      This change provides the API for a subsequent tile-specific
      change to use.
      Reviewed-by: NHillf Danton <dhillf@gmail.com>
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      d9ed9faa
    • C
      arch/tile: support kexec() for tilegx · fc0c49f5
      Chris Metcalf 提交于
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      fc0c49f5
    • C
      arch/tile: support <asm/cachectl.h> header for cacheflush() syscall · cd6f32aa
      Chris Metcalf 提交于
      We already had a syscall that did some dcache flushing, but it was
      not used in practice.  Make it MIPS compatible instead so it can
      do both the DCACHE and ICACHE actions.  We have code that wants to
      be able to use the ICACHE flush mode from userspace so this change
      enables that.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      cd6f32aa
    • C
      arch/tile: Allow tilegx to build with either 16K or 64K page size · d5d14ed6
      Chris Metcalf 提交于
      This change introduces new flags for the hv_install_context()
      API that passes a page table pointer to the hypervisor.  Clients
      can explicitly request 4K, 16K, or 64K small pages when they
      install a new context.  In practice, the page size is fixed at
      kernel compile time and the same size is always requested every
      time a new page table is installed.
      
      The <hv/hypervisor.h> header changes so that it provides more abstract
      macros for managing "page" things like PFNs and page tables.  For
      example there is now a HV_DEFAULT_PAGE_SIZE_SMALL instead of the old
      HV_PAGE_SIZE_SMALL.  The various PFN routines have been eliminated and
      only PA- or PTFN-based ones remain (since PTFNs are always expressed
      in fixed 2KB "page" size).  The page-table management macros are
      renamed with a leading underscore and take page-size arguments with
      the presumption that clients will use those macros in some single
      place to provide the "real" macros they will use themselves.
      
      I happened to notice the old hv_set_caching() API was totally broken
      (it assumed 4KB pages) so I changed it so it would nominally work
      correctly with other page sizes.
      
      Tag modules with the page size so you can't load a module built with
      a conflicting page size.  (And add a test for SMP while we're at it.)
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      d5d14ed6
    • C
      arch/tile: optimize get_user/put_user and friends · 47d632f9
      Chris Metcalf 提交于
      Use direct load/store for the get_user/put_user.
      
      Previously, we would call out to a helper routine that would do the
      appropriate thing and then return, handling the possible exception
      internally.  Now we inline the load or store, along with a "we succeeded"
      indication in a register; if the load or store faults, we write a
      "we failed" indication into the same register and then return to the
      following instruction.  This is more efficient and gives us more compact
      code, as well as being more in line with what other architectures do.
      
      The special futex assembly source file for TILE-Gx also disappears in
      this change; we just use the same inlining idiom there as well, putting
      the appropriate atomic operations directly into futex_atomic_op_inuser()
      (and thus into the FUTEX_WAIT function).
      
      The underlying atomic copy_from_user, copy_to_user functions were
      renamed using the (cryptic) x86 convention as copy_from_user_ll and
      copy_to_user_ll.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      47d632f9
    • C
      arch/tile: support building big-endian kernel · 1efea40d
      Chris Metcalf 提交于
      The toolchain supports big-endian mode now, so add support for building
      the kernel to run big-endian as well.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      1efea40d
    • C
      arch/tile: allow building Linux with transparent huge pages enabled · 73636b1a
      Chris Metcalf 提交于
      The change adds some infrastructure for managing tile pmd's more generally,
      using pte_pmd() and pmd_pte() methods to translate pmd values to and
      from ptes, since on TILEPro a pmd is really just a nested structure
      holding a pgd (aka pte).  Several existing pmd methods are moved into
      this framework, and a whole raft of additional pmd accessors are defined
      that are used by the transparent hugepage framework.
      
      The tile PTE now has a "client2" bit.  The bit is used to indicate a
      transparent huge page is in the process of being split into subpages.
      
      This change also fixes a generic bug where the return value of the
      generic pmdp_splitting_flush() was incorrect.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      73636b1a
    • C
      arch/tile: use interrupt critical sections less · 51007004
      Chris Metcalf 提交于
      In general we want to avoid ever touching memory while within an
      interrupt critical section, since the page fault path goes through
      a different path from the hypervisor when in an interrupt critical
      section, and we carefully decided with tilegx that we didn't need
      to support this path in the kernel.  (On tilepro we did implement
      that path as part of supporting atomic instructions in software.)
      
      In practice we always need to touch the kernel stack, since that's
      where we store the interrupt state before releasing the critical
      section, but this change cleans up a few things.  The IRQ_ENABLE
      macro is split up so that when we want to enable interrupts in a
      deferred way (e.g. for cpu_idle or for interrupt return) we can
      read the per-cpu enable mask before entering the critical section.
      The cache-migration code is changed to use interrupt masking instead
      of interrupt critical sections.  And, the interrupt-entry code is
      changed so that we defer loading "tp" from per-cpu data until after
      we have released the interrupt critical section.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      51007004
    • L
      Merge tag 'tag-for-linus-3.5' of git://git.linaro.org/people/sumitsemwal/linux-dma-buf · da89fb16
      Linus Torvalds 提交于
      Pull dma-buf updates from Sumit Semwal:
       "Here's the first signed-tag pull request for dma-buf framework.  It
        includes the following key items:
         - mmap support
         - vmap support
         - related documentation updates
      
        These are needed by various drivers to allow mmap/vmap of dma-buf
        shared buffers.  Dave Airlie has some prime patches dependent on the
        vmap pull as well."
      
      * tag 'tag-for-linus-3.5' of git://git.linaro.org/people/sumitsemwal/linux-dma-buf:
        dma-buf: add initial vmap documentation
        dma-buf: minor documentation fixes.
        dma-buf: add vmap interface
        dma-buf: mmap support
      da89fb16
    • L
      Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma · d5adf235
      Linus Torvalds 提交于
      Pull slave-dmaengine updates from Vinod Koul:
       "Nothing exciting this time, odd fixes in a bunch of drivers"
      
      * 'next' of git://git.infradead.org/users/vkoul/slave-dma:
        dmaengine: at_hdmac: take maxburst from slave configuration
        dmaengine: at_hdmac: remove ATC_DEFAULT_CTRLA constant
        dmaengine: at_hdmac: remove some at_dma_slave comments
        dma: imx-sdma: make channel0 operations atomic
        dmaengine: Fixup dmaengine_prep_slave_single() to be actually useful
        dmaengine: Use dma_sg_len(sg) instead of sg->length
        dmaengine: Use sg_dma_address instead of sg_phys
        DMA: PL330: Remove duplicate header file inclusion
        dma: imx-sdma: keep the callbacks invoked in the tasklet
        dmaengine: dw_dma: add Device Tree probing capability
        dmaengine: dw_dmac: Add clk_{un}prepare() support
        dma/amba-pl08x: add support for the Nomadik variant
        dma/amba-pl08x: check for terminal count status only
      d5adf235
    • L
      Merge branch 'for-linus' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping · d484864d
      Linus Torvalds 提交于
      Pull CMA and ARM DMA-mapping updates from Marek Szyprowski:
       "These patches contain two major updates for DMA mapping subsystem
        (mainly for ARM architecture).  First one is Contiguous Memory
        Allocator (CMA) which makes it possible for device drivers to allocate
        big contiguous chunks of memory after the system has booted.
      
        The main difference from the similar frameworks is the fact that CMA
        allows to transparently reuse the memory region reserved for the big
        chunk allocation as a system memory, so no memory is wasted when no
        big chunk is allocated.  Once the alloc request is issued, the
        framework migrates system pages to create space for the required big
        chunk of physically contiguous memory.
      
        For more information one can refer to nice LWN articles:
      
         - 'A reworked contiguous memory allocator':
      		http://lwn.net/Articles/447405/
      
         - 'CMA and ARM':
      		http://lwn.net/Articles/450286/
      
         - 'A deep dive into CMA':
      		http://lwn.net/Articles/486301/
      
         - and the following thread with the patches and links to all previous
           versions:
      		https://lkml.org/lkml/2012/4/3/204
      
        The main client for this new framework is ARM DMA-mapping subsystem.
      
        The second part provides a complete redesign in ARM DMA-mapping
        subsystem.  The core implementation has been changed to use common
        struct dma_map_ops based infrastructure with the recent updates for
        new dma attributes merged in v3.4-rc2.  This allows to use more than
        one implementation of dma-mapping calls and change/select them on the
        struct device basis.  The first client of this new infractructure is
        dmabounce implementation which has been completely cut out of the
        core, common code.
      
        The last patch of this redesign update introduces a new, experimental
        implementation of dma-mapping calls on top of generic IOMMU framework.
        This lets ARM sub-platform to transparently use IOMMU for DMA-mapping
        calls if one provides required IOMMU hardware.
      
        For more information please refer to the following thread:
      		http://www.spinics.net/lists/arm-kernel/msg175729.html
      
        The last patch merges changes from both updates and provides a
        resolution for the conflicts which cannot be avoided when patches have
        been applied on the same files (mainly arch/arm/mm/dma-mapping.c)."
      
      Acked by Andrew Morton <akpm@linux-foundation.org>:
       "Yup, this one please.  It's had much work, plenty of review and I
        think even Russell is happy with it."
      
      * 'for-linus' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping: (28 commits)
        ARM: dma-mapping: use PMD size for section unmap
        cma: fix migration mode
        ARM: integrate CMA with DMA-mapping subsystem
        X86: integrate CMA with DMA-mapping subsystem
        drivers: add Contiguous Memory Allocator
        mm: trigger page reclaim in alloc_contig_range() to stabilise watermarks
        mm: extract reclaim code from __alloc_pages_direct_reclaim()
        mm: Serialize access to min_free_kbytes
        mm: page_isolation: MIGRATE_CMA isolation functions added
        mm: mmzone: MIGRATE_CMA migration type added
        mm: page_alloc: change fallbacks array handling
        mm: page_alloc: introduce alloc_contig_range()
        mm: compaction: export some of the functions
        mm: compaction: introduce isolate_freepages_range()
        mm: compaction: introduce map_pages()
        mm: compaction: introduce isolate_migratepages_range()
        mm: page_alloc: remove trailing whitespace
        ARM: dma-mapping: add support for IOMMU mapper
        ARM: dma-mapping: use alloc, mmap, free from dma_ops
        ARM: dma-mapping: remove redundant code and do the cleanup
        ...
      
      Conflicts:
      	arch/x86/include/asm/dma-mapping.h
      d484864d