1. 27 4月, 2016 1 次提交
    • R
      nios2: memset: use the right constraint modifier for the %4 output operand · a8950e49
      Romain Perier 提交于
      Depending on the size of the area to be memset'ed, the nios2 memset implementation
      either uses a naive loop (for buffers smaller or equal than 8 bytes) or a more optimized
      implementation (for buffers larger than 8 bytes). This implementation does 4-byte stores
      rather than 1-byte stores to speed up memset.
      
      However, we discovered that on our nios2 platform, memset() was not properly setting the
      buffer to the expected value. A memset of 0xff would not set the entire buffer to 0xff, but to:
      
      0xff 0x00 0xff 0x00 0xff 0x00 0xff 0x00 ...
      
      Which is obviously incorrect. Our investigation has revealed that the problem lies in the
      incorrect constraints used in the inline assembly.
      
      The following piece of assembly, from the nios2 memset implementation, is supposed to
      create a 4-byte value that repeats 4 times the 1-byte pattern passed as memset argument:
      
      /* fill8 %3, %5 (c & 0xff) */
      "       slli    %4, %5, 8\n"
      "       or      %4, %4, %5\n"
      "       slli    %3, %4, 16\n"
      "       or      %3, %3, %4\n"
      
      However, depending on the compiler and optimization level, this code might be compiled as:
      
      34:	280a923a 	slli	r5,r5,8
      38:	294ab03a 	or	r5,r5,r5
      3c:	2808943a 	slli	r4,r5,16
      40:	2148b03a 	or	r4,r4,r5
      
      This is wrong because r5 gets used both for %5 and %4, which leads to the final pattern
      stored in r4 to be 0xff00ff00 rather than the expected 0xffffffff.
      
      %4 is defined with the "=r" constraint, i.e as an output operand. However, as explained in
      http://www.ethernut.de/en/documents/arm-inline-asm.html, this does not prevent gcc from
      using the same register for an output operand (%4) and input operand (%5). By using the
      constraint modifier '&', we indicate that the register should be used for output only. With this
      change, we get the following assembly output:
      
      34:	2810923a 	slli	r8,r5,8
      38:	4150b03a 	or	r8,r8,r5
      3c:	400e943a 	slli	r7,r8,16
      40:	3a0eb03a 	or	r7,r7,r8
      
      Which correctly produces the 0xffffffff pattern when 0xff is passed as the memset() pattern.
      
      It is worth mentioning the observed consequence of this bug: we were hitting the kernel
      BUG() in mm/bootmem.c:__free() that verifies when marking a page as free that it was
      previously marked as occupied (i.e that the bit was set to 1). The entire bootmem bitmap is
      set to 0xff bit via a memset() during the bootmem initialization. The bootmem_free() call right
      after the initialization was finding some bits to be set to 0, which didn't make sense since the
      bitmap has just been memset'ed to 0xff. Except that due to the bug explained above, the
      bitmap was in fact initialized to 0xff00ff00.
      
      Thanks to Marek Vasut for his help and feedback.
      Signed-off-by: NRomain Perier <romain.perier@free-electrons.com>
      Acked-by: NMarek Vasut <marex@denx.de>
      Acked-by: NLey Foon Tan <lftan@altera.com>
      a8950e49
  2. 25 4月, 2016 1 次提交
  3. 24 4月, 2016 11 次提交
  4. 23 4月, 2016 6 次提交
    • L
      Merge tag 'pinctrl-v4.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · 09502d9f
      Linus Torvalds 提交于
      Pull pin control fixes from Linus Walleij:
       "Some pin control driver fixes came in.  One headed for stable and the
        other two are just ordinary merge window fixes.
      
         - Make the i.MX driver select REGMAP as a dependency
         - Fix up the Mediatek debounce time unit
         - Fix a real hairy ffs vs __ffs issue in the Single pinctrl driver"
      
      * tag 'pinctrl-v4.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        pinctrl: single: Fix pcs_parse_bits_in_pinctrl_entry to use __ffs than ffs
        pinctrl: mediatek: correct debounce time unit in mtk_gpio_set_debounce
        pinctrl: imx: Kconfig: PINCTRL_IMX select REGMAP
      09502d9f
    • L
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · ddce1921
      Linus Torvalds 提交于
      Pull arm64 fixes from Catalin Marinas:
      
       - Cache invalidation fix for early CPU boot status update (incorrect
         cacheline)
      
       - of_put_node() missing in the spin_table code
      
       - EL1/El2 early init inconsistency when Virtualisation Host Extensions
         are present
      
       - RCU warning fix in the arm_pmu.c driver
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: Fix EL1/EL2 early init inconsistencies with VHE
        drivers/perf: arm-pmu: fix RCU usage on pmu resume from low-power
        arm64: spin-table: add missing of_node_put()
        arm64: fix invalidation of wrong __early_cpu_boot_status cacheline
      ddce1921
    • L
      Merge tag 'powerpc-4.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · ff061624
      Linus Torvalds 提交于
      Pull powerpc fixes from Michael Ellerman:
       "Three powerpc cpu feature fixes from Anton Blanchard:
      
         - scan_features() updated incorrect bits for REAL_LE
      
         - update cpu_user_features2 in scan_features()
      
         - update TM user feature bits in scan_features()"
      
      * tag 'powerpc-4.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc: Update TM user feature bits in scan_features()
        powerpc: Update cpu_user_features2 in scan_features()
        powerpc: scan_features() updates incorrect bits for REAL_LE
      ff061624
    • L
      Merge tag 'iommu-fixes-v4.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · 7c5047a1
      Linus Torvalds 提交于
      Pull IOMMU fixes from Joerg Roedel:
       "The fixes include:
      
         - Two patches to revert the use of default domains in the ARM SMMU
           driver.  Enabling this caused regressions which need more thorough
           fixing.  So the regressions are fixed for now by disabling the use
           of default domains.
      
         - A fix for a v4.4 regression in the AMD IOMMU driver which broke
           devices behind invisible PCIe-to-PCI bridges with IOMMU enabled"
      
      * tag 'iommu-fixes-v4.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
        iommu/arm-smmu: Don't allocate resources for bypass domains
        iommu/arm-smmu: Fix stream-match conflict with IOMMU_DOMAIN_DMA
        iommu/amd: Fix checking of pci dma aliases
      7c5047a1
    • L
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · d61fb48b
      Linus Torvalds 提交于
      Pull drm fixes from Dave Airlie:
       "i915, nouveau and amdgpu/radeon fixes in this:
      
        nouveau:
           Two fixes, one for a regression with dithering and one for a bug
           hit by the userspace drivers.
      
        i915:
           A few fixes, mostly things heading for stable, two important
           skylake GT3/4 hangs.
      
        radeon/amdgpu:
           Some audio, suspend/resume and some runtime PM fixes, along with
           two patches to harden the userptr ABI a bit"
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (24 commits)
        drm: Loongson-3 doesn't fully support wc memory
        drm/nouveau/gr/gf100: select a stream master to fixup tfb offset queries
        amdgpu/uvd: add uvd fw version for amdgpu
        drm/amdgpu: forbid mapping of userptr bo through radeon device file
        drm/radeon: forbid mapping of userptr bo through radeon device file
        drm/amdgpu: bump the afmt limit for CZ, ST, Polaris
        drm/amdgpu: use defines for CRTCs and AMFT blocks
        drm/dp/mst: Validate port in drm_dp_payload_send_msg()
        drm/nouveau/kms: fix setting of default values for dithering properties
        drm/radeon: print a message if ATPX dGPU power control is missing
        Revert "drm/radeon: disable runtime pm on PX laptops without dGPU power control"
        drm/amdgpu/acp: fix resume on CZ systems with AZ audio
        drm/radeon: add a quirk for a XFX R9 270X
        drm/radeon: print pci revision as well as pci ids on driver load
        drm/i915: Use fw_domains_put_with_fifo() on HSW
        drm/i915: Force ringbuffers to not be at offset 0
        drm/i915: Adjust size of PIPE_CONTROL used for gen8 render seqno write
        drm/i915/skl: Fix spurious gpu hang with gt3/gt4 revs
        drm/i915/skl: Fix rc6 based gpu/system hang
        drm/i915/userptr: Hold mmref whilst calling get-user-pages
        ...
      d61fb48b
    • L
      Merge tag 'sound-4.6-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · d4b05288
      Linus Torvalds 提交于
      Pull sound fixes from Takashi Iwai:
       "Again a relatively calm week without surprise: most of fixes are about
        HD-audio, including fixes for Cirrus codec regression and a race over
        regmap access.  Although both change are slightly unintuitive, the
        risk of further breakage is quite low, I hope.
      
        Other than that, all the rest are trivial"
      
      * tag 'sound-4.6-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hda - Fix possible race on regmap bypass flip
        ALSA: pcxhr: Fix missing mutex unlock
        ALSA: hda - add PCI ID for Intel Broxton-T
        ALSA: hda - Keep powering up ADCs on Cirrus codecs
        ALSA: hda/realtek - Add ALC3234 headset mode for Optiplex 9020m
        ALSA - hda: hdmi check NULL pointer in hdmi_set_chmap
        ALSA: hda - Don't trust the reported actual power state
      d4b05288
  5. 22 4月, 2016 21 次提交