Skip to content
  1. Sep 01, 2018
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 420f51f4
      Linus Torvalds authored
      Pull arm64 fixes from Will Deacon:
       "A few arm64 fixes came in this week, specifically fixing some nasty
        truncation of return values from firmware calls and resolving a
        VM_BUG_ON due to accessing uninitialised struct pages corresponding to
        NOMAP pages.
      
        Summary:
      
         - Fix typos in SVE documentation
      
         - Fix type-checking and implicit truncation for SMCCC calls
      
         - Force CONFIG_HOLES_IN_ZONE=y so that SLAB doesn't fall over NOMAP
           regions"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: mm: always enable CONFIG_HOLES_IN_ZONE
        arm/arm64: smccc-1.1: Handle function result as parameters
        arm/arm64: smccc-1.1: Make return values unsigned long
        Documentation/arm64/sve: Couple of improvements and typos
      420f51f4
  2. Aug 31, 2018
    • Linus Torvalds's avatar
      Merge tag 'for-linus-4.19b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · 4290d5b9
      Linus Torvalds authored
      Pull xen fixes from Juergen Gross:
      
       - minor cleanup avoiding a warning when building with new gcc
      
       - a patch to add a new sysfs node for Xen frontend/backend drivers to
         make it easier to obtain the state of a pv device
      
       - two fixes for 32-bit pv-guests to avoid intermediate L1TF vulnerable
         PTEs
      
      * tag 'for-linus-4.19b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        x86/xen: remove redundant variable save_pud
        xen: export device state to sysfs
        x86/pae: use 64 bit atomic xchg function in native_ptep_get_and_clear
        x86/xen: don't write ptes directly in 32-bit PV guests
      4290d5b9
    • Linus Torvalds's avatar
      Merge tag 'm68k-for-v4.19-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k · 01f6543a
      Linus Torvalds authored
      Pull m68k fix from Geert Uytterhoeven:
       "Just a single fix for a bug introduced during the merge window: fix
        wrong date and time on PMU-based Macs"
      
      * tag 'm68k-for-v4.19-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k:
        m68k/mac: Use correct PMU response format
      01f6543a
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 754cf4b2
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
      
       - regression fixes for i801 and designware
      
       - better API and leak fix for releasing DMA safe buffers
      
       - better greppable strings for the bitbang algorithm
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: sh_mobile: fix leak when using DMA bounce buffer
        i2c: sh_mobile: define start_ch() void as it only returns 0 anyhow
        i2c: refactor function to release a DMA safe buffer
        i2c: algos: bit: make the error messages grepable
        i2c: designware: Re-init controllers with pm_disabled set on resume
        i2c: i801: Allow ACPI AML access I/O ports not reserved for SMBus
      754cf4b2
    • James Morse's avatar
      arm64: mm: always enable CONFIG_HOLES_IN_ZONE · f52bb98f
      James Morse authored
      Commit 6d526ee2
      
       ("arm64: mm: enable CONFIG_HOLES_IN_ZONE for NUMA")
      only enabled HOLES_IN_ZONE for NUMA systems because the NUMA code was
      choking on the missing zone for nomap pages. This problem doesn't just
      apply to NUMA systems.
      
      If the architecture doesn't set HAVE_ARCH_PFN_VALID, pfn_valid() will
      return true if the pfn is part of a valid sparsemem section.
      
      When working with multiple pages, the mm code uses pfn_valid_within()
      to test each page it uses within the sparsemem section is valid. On
      most systems memory comes in MAX_ORDER_NR_PAGES chunks which all
      have valid/initialised struct pages. In this case pfn_valid_within()
      is optimised out.
      
      Systems where this isn't true (e.g. due to nomap) should set
      HOLES_IN_ZONE and provide HAVE_ARCH_PFN_VALID so that mm tests each
      page as it works with it.
      
      Currently non-NUMA arm64 systems can't enable HOLES_IN_ZONE, leading to
      a VM_BUG_ON():
      
      | page:fffffdff802e1780 is uninitialized and poisoned
      | raw: ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff
      | raw: ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff
      | page dumped because: VM_BUG_ON_PAGE(PagePoisoned(p))
      | ------------[ cut here ]------------
      | kernel BUG at include/linux/mm.h:978!
      | Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
      [...]
      | CPU: 1 PID: 25236 Comm: dd Not tainted 4.18.0 #7
      | Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015
      | pstate: 40000085 (nZcv daIf -PAN -UAO)
      | pc : move_freepages_block+0x144/0x248
      | lr : move_freepages_block+0x144/0x248
      | sp : fffffe0071177680
      [...]
      | Process dd (pid: 25236, stack limit = 0x0000000094cc07fb)
      | Call trace:
      |  move_freepages_block+0x144/0x248
      |  steal_suitable_fallback+0x100/0x16c
      |  get_page_from_freelist+0x440/0xb20
      |  __alloc_pages_nodemask+0xe8/0x838
      |  new_slab+0xd4/0x418
      |  ___slab_alloc.constprop.27+0x380/0x4a8
      |  __slab_alloc.isra.21.constprop.26+0x24/0x34
      |  kmem_cache_alloc+0xa8/0x180
      |  alloc_buffer_head+0x1c/0x90
      |  alloc_page_buffers+0x68/0xb0
      |  create_empty_buffers+0x20/0x1ec
      |  create_page_buffers+0xb0/0xf0
      |  __block_write_begin_int+0xc4/0x564
      |  __block_write_begin+0x10/0x18
      |  block_write_begin+0x48/0xd0
      |  blkdev_write_begin+0x28/0x30
      |  generic_perform_write+0x98/0x16c
      |  __generic_file_write_iter+0x138/0x168
      |  blkdev_write_iter+0x80/0xf0
      |  __vfs_write+0xe4/0x10c
      |  vfs_write+0xb4/0x168
      |  ksys_write+0x44/0x88
      |  sys_write+0xc/0x14
      |  el0_svc_naked+0x30/0x34
      | Code: aa1303e0 90001a01 91296421 94008902 (d4210000)
      | ---[ end trace 1601ba47f6e883fe ]---
      
      Remove the NUMA dependency.
      
      Link: https://www.spinics.net/lists/arm-kernel/msg671851.html
      Cc: <stable@vger.kernel.org>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Reported-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Reviewed-by: default avatarPavel Tatashin <pavel.tatashin@microsoft.com>
      Tested-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarJames Morse <james.morse@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      f52bb98f
    • Finn Thain's avatar
      m68k/mac: Use correct PMU response format · 0986b16a
      Finn Thain authored
      Now that the 68k Mac port has adopted the via-pmu driver, it must decode
      the PMU response accordingly otherwise the date and time will be wrong.
      
      Fixes: ebd72227
      
       ("macintosh/via-pmu: Replace via-pmu68k driver with via-pmu driver")
      Signed-off-by: default avatarFinn Thain <fthain@telegraphics.com.au>
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      0986b16a
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2018-08-31' of git://anongit.freedesktop.org/drm/drm · 4658aff6
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Regular fixes pull:
      
         - Mediatek has a bunch of fixes to their RDMA and Overlay engines.
      
         - i915 has some Cannonlake/Geminilake watermark workarounds, LSPCON
           fix, HDCP free fix, audio fix and a ppgtt reference counting fix.
      
         - amdgpu has some SRIOV, Kasan, memory leaks and other misc fixes"
      
      * tag 'drm-fixes-2018-08-31' of git://anongit.freedesktop.org/drm/drm: (35 commits)
        drm/i915/audio: Hook up component bindings even if displays are disabled
        drm/i915: Increase LSPCON timeout
        drm/i915: Stop holding a ref to the ppgtt from each vma
        drm/i915: Free write_buf that we allocated with kzalloc.
        drm/i915: Fix glk/cnl display w/a #1175
        drm/amdgpu: Need to set moved to true when evict bo
        drm/amdgpu: Remove duplicated power source update
        drm/amd/display: Fix memory leak caused by missed dc_sink_release
        drm/amdgpu: fix holding mn_lock while allocating memory
        drm/amdgpu: Power on uvd block when hw_fini
        drm/amdgpu: Update power state at the end of smu hw_init.
        drm/amdgpu: Fix vce initialize failed on Kaveri/Mullins
        drm/amdgpu: Enable/disable gfx PG feature in rlc safe mode
        drm/amdgpu: Adjust the VM size based on system memory size v2
        drm/mediatek: fix connection from RDMA2 to DSI1
        drm/mediatek: update some variable name from ovl to comp
        drm/mediatek: use layer_nr function to get layer number to init plane
        drm/mediatek: add function to return RDMA layer number
        drm/mediatek: add function to return OVL layer number
        drm/mediatek: add function to get layer number for component
        ...
      4658aff6
    • Stephen Rothwell's avatar
      disable stringop truncation warnings for now · 217c3e01
      Stephen Rothwell authored
      
      
      They are too noisy
      
      Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      217c3e01
    • Linus Torvalds's avatar
      Merge tag 'pm-4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · b6935d2a
      Linus Torvalds authored
      Pull power management fixes from Rafael Wysocki:
       "These address a corner case in the menu cpuidle governor and fix error
        handling in the PM core's generic clock management code.
      
        Specifics:
      
         - Make the menu cpuidle governor avoid stopping the scheduler tick if
           the predicted idle duration exceeds the tick period length, but the
           selected idle state is shallow and deeper idle states with high
           target residencies are available (Rafael Wysocki).
      
         - Make the PM core's generic clock management code use a proper data
           type for one variable to make error handling work (Dan Carpenter)"
      
      * tag 'pm-4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        cpuidle: menu: Retain tick when shallow state is selected
        PM / clk: signedness bug in of_pm_clk_add_clks()
      b6935d2a
    • Rafael J. Wysocki's avatar
      Merge branch 'pm-core' · a0b9c4de
      Rafael J. Wysocki authored
      Merge a generic clock management fix for 4.19-rc2.
      
      * pm-core:
        PM / clk: signedness bug in of_pm_clk_add_clks()
      a0b9c4de
    • Wolfram Sang's avatar
      i2c: sh_mobile: fix leak when using DMA bounce buffer · cebc07d8
      Wolfram Sang authored
      
      
      We only freed the bounce buffer after successful DMA, missing the cases
      where DMA setup may have gone wrong. Use a better location which always
      gets called after each message and use 'stop_after_dma' as a flag for a
      successful transfer.
      
      Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
      Reviewed-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      cebc07d8
    • Wolfram Sang's avatar
      i2c: sh_mobile: define start_ch() void as it only returns 0 anyhow · 531db501
      Wolfram Sang authored
      
      
      After various refactoring over the years, start_ch() doesn't return
      errno anymore, so make the function return void. This saves the error
      handling when calling it which in turn eases cleanup of resources of a
      future patch.
      
      Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
      Reviewed-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      531db501
    • Wolfram Sang's avatar
      i2c: refactor function to release a DMA safe buffer · 82fe39a6
      Wolfram Sang authored
      
      
      a) rename to 'put' instead of 'release' to match 'get' when obtaining
         the buffer
      b) change the argument order to have the buffer as first argument
      c) add a new argument telling the function if the message was
         transferred. This allows the function to be used also in cases
         where setting up DMA failed, so the buffer needs to be freed without
         syncing to the message buffer.
      
      Also convert the only user.
      
      Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
      Reviewed-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      82fe39a6
    • Jan Kundrát's avatar
      i2c: algos: bit: make the error messages grepable · 1204d12a
      Jan Kundrát authored
      
      
      Yep, I went looking for one of these, and I wasn't able to find it
      easily.  That's worse than a line which is 82-chars long, IMHO.
      
      Signed-off-by: default avatarJan Kundrát <jan.kundrat@cesnet.cz>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      1204d12a
    • Hans de Goede's avatar
      i2c: designware: Re-init controllers with pm_disabled set on resume · 9d9a152e
      Hans de Goede authored
      On Bay Trail and Cherry Trail devices we set the pm_disabled flag for I2C
      busses which the OS shares with the PUNIT as these need special handling.
      Until now we called dev_pm_syscore_device(dev, true) for I2C controllers
      with this flag set to keep these I2C controllers always on.
      
      After commit 12864ff8 ("ACPI / LPSS: Avoid PM quirks on suspend and
      resume from hibernation"), this no longer works. This commit modifies
      lpss_iosf_exit_d3_state() to only run if lpss_iosf_enter_d3_state() has ran
      before it, so that it does not run on a resume from hibernate (or from S3).
      
      On these systems the conditions for lpss_iosf_enter_d3_state() to run
      never become true, so lpss_iosf_exit_d3_state() never gets called and
      the 2 LPSS DMA controllers never get forced into D0 mode, instead they
      are left in their default automatic power-on when needed mode.
      
      The not forcing of D0 mode for the DMA controllers enables these systems
      to properly enter S0ix modes, which is a good thing.
      
      But after entering S0ix modes the I2C controller connected to the PMIC
      no longer works, leading to e.g. broken battery monitoring.
      
      The _PS3 method for this I2C controller looks like this:
      
                  Method (_PS3, 0, NotSerialized)  // _PS3: Power State 3
                  {
                      If ((((PMID == 0x04) || (PMID == 0x05)) || (PMID == 0x06)))
                      {
                          Return (Zero)
                      }
      
                      PSAT |= 0x03
                      Local0 = PSAT /* \_SB_.I2C5.PSAT */
                  }
      
      Where PMID = 0x05, so we enter the Return (Zero) path on these systems.
      
      So even if we were to not call dev_pm_syscore_device(dev, true) the
      I2C controller will be left in D0 rather then be switched to D3.
      
      Yet on other Bay and Cherry Trail devices S0ix is not entered unless *all*
      I2C controllers are in D3 mode. This combined with the I2C controller no
      longer working now that we reach S0ix states on these systems leads to me
      believing that the PUNIT itself puts the I2C controller in D3 when all
      other conditions for entering S0ix states are true.
      
      Since now the I2C controller is put in D3 over a suspend/resume we must
      re-initialize it afterwards and that does indeed fix it no longer working.
      
      This commit implements this fix by:
      
      1) Making the suspend_late callback a no-op if pm_disabled is set and
      making the resume_early callback skip the clock re-enable (since it now was
      not disabled) while still doing the necessary I2C controller re-init.
      
      2) Removing the dev_pm_syscore_device(dev, true) call, so that the suspend
      and resume callbacks are actually called. Normally this would cause the
      ACPI pm code to call _PS3 putting the I2C controller in D3, wreaking havoc
      since it is shared with the PUNIT, but in this special case the _PS3 method
      is a no-op so we can safely allow a "fake" suspend / resume.
      
      Fixes: 12864ff8
      
       ("ACPI / LPSS: Avoid PM quirks on suspend and resume ...")
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=200861
      Cc: 4.15+ <stable@vger.kernel.org> # 4.15+
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Acked-by: default avatarJarkko Nikula <jarkko.nikula@linux.intel.com>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      9d9a152e
    • Mika Westerberg's avatar
      i2c: i801: Allow ACPI AML access I/O ports not reserved for SMBus · 7fd6d98b
      Mika Westerberg authored
      
      
      Commit 7ae81952cda ("i2c: i801: Allow ACPI SystemIO OpRegion to conflict
      with PCI BAR") made it possible for AML code to access SMBus I/O ports
      by installing custom SystemIO OpRegion handler and blocking i80i driver
      access upon first AML read/write to this OpRegion.
      
      However, while ThinkPad T560 does have SystemIO OpRegion declared under
      the SMBus device, it does not access any of the SMBus registers:
      
          Device (SMBU)
          {
              ...
      
              OperationRegion (SMBP, PCI_Config, 0x50, 0x04)
              Field (SMBP, DWordAcc, NoLock, Preserve)
              {
                  ,   5,
                  TCOB,   11,
                  Offset (0x04)
              }
      
              Name (TCBV, 0x00)
              Method (TCBS, 0, NotSerialized)
              {
                  If ((TCBV == 0x00))
                  {
                  TCBV = (\_SB.PCI0.SMBU.TCOB << 0x05)
                  }
      
                  Return (TCBV) /* \_SB_.PCI0.SMBU.TCBV */
              }
      
              OperationRegion (TCBA, SystemIO, TCBS (), 0x10)
              Field (TCBA, ByteAcc, NoLock, Preserve)
              {
                  Offset (0x04),
                  ,   9,
                  CPSC,   1
              }
          }
      
      Problem with the current approach is that it blocks all I/O port access
      and because this system has touchpad connected to the SMBus controller
      after first AML access (happens during suspend/resume cycle) the
      touchpad fails to work anymore.
      
      Fix this so that we allow ACPI AML I/O port access if it does not touch
      the region reserved for the SMBus.
      
      Fixes: 7ae81952cda ("i2c: i801: Allow ACPI SystemIO OpRegion to conflict with PCI BAR")
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=200737
      Reported-by: default avatarYussuf Khalil <dev@pp3345.net>
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Reviewed-by: default avatarJean Delvare <jdelvare@suse.de>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      7fd6d98b
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20180830' of git://git.kernel.dk/linux-block · fb646385
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "Small collection of fixes that should go into this series. This pull
        contains:
      
         - NVMe pull request with three small fixes (via Christoph)
      
         - Kill useless NULL check before kmem_cache_destroy (Chengguang Xu)
      
         - Xen block driver pull request with persistent grant flushing fixes
           (Juergen Gross)
      
         - Final wbt fixes, wrapping up the changes for this series. These
           have been heavily tested (me)
      
         - cdrom info leak fix (Scott Bauer)
      
         - ATA dma quirk for SQ201 (Linus Walleij)
      
         - Straight forward bsg refcount_t conversion (John Pittman)"
      
      * tag 'for-linus-20180830' of git://git.kernel.dk/linux-block:
        cdrom: Fix info leak/OOB read in cdrom_ioctl_drive_status
        nvmet: free workqueue object if module init fails
        nvme-fcloop: Fix dropped LS's to removed target port
        nvme-pci: add a memory barrier to nvme_dbbuf_update_and_check_event
        block: bsg: move atomic_t ref_count variable to refcount API
        block: remove unnecessary condition check
        ata: ftide010: Add a quirk for SQ201
        blk-wbt: remove dead code
        blk-wbt: improve waking of tasks
        blk-wbt: abstract out end IO completion handler
        xen/blkback: remove unused pers_gnts_lock from struct xen_blkif_ring
        xen/blkback: move persistent grants flags to bool
        xen/blkfront: reorder tests in xlblk_init()
        xen/blkfront: cleanup stale persistent grants
        xen/blkback: don't keep persistent grants too long
      fb646385
    • Linus Torvalds's avatar
      Merge tag 'mtd/for-4.19-rc2' of git://git.infradead.org/linux-mtd · 9f8f16c8
      Linus Torvalds authored
      Pull mtd fixes from Boris Brezillon:
       "Raw NAND fixes:
      
         - denali: Fix a regression caused by the nand_scan() rework
      
         - docg4: Fix a build error when gcc decides to not iniline some
           functions (can be reproduced with gcc 4.1.2):
      
      * tag 'mtd/for-4.19-rc2' of git://git.infradead.org/linux-mtd:
        mtd: rawnand: denali: do not pass zero maxchips to nand_scan()
        mtd: rawnand: docg4: Remove wrong __init annotations
      9f8f16c8
    • Linus Torvalds's avatar
      Merge tag 'mmc-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc · 48f8e8e9
      Linus Torvalds authored
      Pull MMC fixes from Ulf Hansson:
       "MMC core:
         - Fix unsupported parallel dispatch of requests
      
        MMC host:
         - atmel-mci/android-goldfish: Fixup logic of sg_copy_{from,to}_buffer
         - renesas_sdhi_internal_dmac: Prevent IRQ-storm due of DMAC IRQs
         - renesas_sdhi_internal_dmac: Fixup bad register offset"
      
      * tag 'mmc-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
        mmc: renesas_sdhi_internal_dmac: mask DMAC interrupts
        mmc: renesas_sdhi_internal_dmac: fix #define RST_RESERVED_BITS
        mmc: block: Fix unsupported parallel dispatch of requests
        mmc: android-goldfish: fix bad logic of sg_copy_{from,to}_buffer conversion
        mmc: atmel-mci: fix bad logic of sg_copy_{from,to}_buffer conversion
      48f8e8e9
  3. Aug 30, 2018
    • Marc Zyngier's avatar
      arm/arm64: smccc-1.1: Handle function result as parameters · 755a8bf5
      Marc Zyngier authored
      
      
      If someone has the silly idea to write something along those lines:
      
      	extern u64 foo(void);
      
      	void bar(struct arm_smccc_res *res)
      	{
      		arm_smccc_1_1_smc(0xbad, foo(), res);
      	}
      
      they are in for a surprise, as this gets compiled as:
      
      	0000000000000588 <bar>:
      	 588:   a9be7bfd        stp     x29, x30, [sp, #-32]!
      	 58c:   910003fd        mov     x29, sp
      	 590:   f9000bf3        str     x19, [sp, #16]
      	 594:   aa0003f3        mov     x19, x0
      	 598:   aa1e03e0        mov     x0, x30
      	 59c:   94000000        bl      0 <_mcount>
      	 5a0:   94000000        bl      0 <foo>
      	 5a4:   aa0003e1        mov     x1, x0
      	 5a8:   d4000003        smc     #0x0
      	 5ac:   b4000073        cbz     x19, 5b8 <bar+0x30>
      	 5b0:   a9000660        stp     x0, x1, [x19]
      	 5b4:   a9010e62        stp     x2, x3, [x19, #16]
      	 5b8:   f9400bf3        ldr     x19, [sp, #16]
      	 5bc:   a8c27bfd        ldp     x29, x30, [sp], #32
      	 5c0:   d65f03c0        ret
      	 5c4:   d503201f        nop
      
      The call to foo "overwrites" the x0 register for the return value,
      and we end up calling the wrong secure service.
      
      A solution is to evaluate all the parameters before assigning
      anything to specific registers, leading to the expected result:
      
      	0000000000000588 <bar>:
      	 588:   a9be7bfd        stp     x29, x30, [sp, #-32]!
      	 58c:   910003fd        mov     x29, sp
      	 590:   f9000bf3        str     x19, [sp, #16]
      	 594:   aa0003f3        mov     x19, x0
      	 598:   aa1e03e0        mov     x0, x30
      	 59c:   94000000        bl      0 <_mcount>
      	 5a0:   94000000        bl      0 <foo>
      	 5a4:   aa0003e1        mov     x1, x0
      	 5a8:   d28175a0        mov     x0, #0xbad
      	 5ac:   d4000003        smc     #0x0
      	 5b0:   b4000073        cbz     x19, 5bc <bar+0x34>
      	 5b4:   a9000660        stp     x0, x1, [x19]
      	 5b8:   a9010e62        stp     x2, x3, [x19, #16]
      	 5bc:   f9400bf3        ldr     x19, [sp, #16]
      	 5c0:   a8c27bfd        ldp     x29, x30, [sp], #32
      	 5c4:   d65f03c0        ret
      
      Reported-by: default avatarJulien Grall <julien.grall@arm.com>
      Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      755a8bf5
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-4.19-rc2' of... · 58c3f14f
      Linus Torvalds authored
      Merge tag 'riscv-for-linus-4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux
      
      Pull RISC-V fixes from Palmer Dabbelt:
       "RISC-V Fixes and Cleanups for 4.19-rc2
      
        This contains a handful of patches that filtered their way in during
        the merge window but just didn't make the deadline. It includes:
      
         - Additional documentation in the riscv,cpu-intc device tree binding
           that resulted from some feedback I missed in the original patch
           set.
      
         - A build fix that provides the definition of tlb_flush() before
           including tlb.h, which fixes a RISC-V build regression introduced
           during this merge window.
      
         - A cosmetic cleanup to sys_riscv_flush_icache()"
      
      * tag 'riscv-for-linus-4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux:
        RISC-V: Use a less ugly workaround for unused variable warnings
        riscv: tlb: Provide definition of tlb_flush() before including tlb.h
        dt-bindings: riscv,cpu-intc: Cleanups from a missed review
      58c3f14f
    • Dave Airlie's avatar
      Merge tag 'drm-intel-fixes-2018-08-29' of... · 49a51c4b
      Dave Airlie authored
      
      Merge tag 'drm-intel-fixes-2018-08-29' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
      
      - fix for GLK and CNL watermark workaround
      - fix for display affecting NUCs with LSPCON
      - freeing an allocated write_buf on hdcp
      - audio hook when display is disabled
      - vma stop holding ppgtt reference
      
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180829234512.GA32468@intel.com
      49a51c4b
    • Dave Airlie's avatar
      Merge branch 'drm-fixes-4.19' of git://people.freedesktop.org/~agd5f/linux into drm-fixes · 185c3cfa
      Dave Airlie authored
      
      
      Fixes for 4.19:
      - SR-IOV fixes
      - Kasan and page fault fix on device removal
      - S3 stability fix for CZ/ST
      - VCE regression fixes for CIK parts
      - Avoid holding the mn_lock when allocating memory
      - DC memory leak fix
      - BO eviction fix
      
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Alex Deucher <alexdeucher@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180829202555.2653-1-alexander.deucher@amd.com
      185c3cfa
    • Dave Airlie's avatar
      Merge branch 'mediatek-drm-fixes-4.19' of... · 852fde0a
      Dave Airlie authored
      
      Merge branch 'mediatek-drm-fixes-4.19' of https://github.com/ckhu-mediatek/linux.git-tags into drm-fixes
      
      "Here are some fixes for mediatek drm driver."
      
      Mostly fixes around the RDMA and Overlay
      
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: CK Hu <ck.hu@mediatek.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/1535346194.27648.5.camel@mtksdaap41
      852fde0a
    • Ard Biesheuvel's avatar
      powerpc: disable support for relative ksymtab references · ff69279a
      Ard Biesheuvel authored
      
      
      The newly added code that emits ksymtab entries as pairs of 32-bit
      relative references interacts poorly with the way powerpc lays out its
      address space: when a module exports a per-CPU variable, the primary
      module region covering the ksymtab entry -and thus the 32-bit relative
      reference- is too far away from the actual per-CPU variable's base
      address (to which the per-CPU offsets are applied to obtain the
      respective address of each CPU's copy), resulting in corruption when the
      module loader attempts to resolve symbol references of modules that are
      loaded on top and link to the exported per-CPU symbol.
      
      So let's disable this feature on powerpc.  Even though it implements
      CONFIG_RELOCATABLE, it does not implement CONFIG_RANDOMIZE_BASE and so
      KASLR kernels (which are the main target of the feature) do not exist on
      powerpc anyway.
      
      Reported-by: default avatarAndreas Schwab <schwab@linux-m68k.org>
      Suggested-by: default avatarNicholas Piggin <nicholas.piggin@gmail.com>
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ff69279a
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-linus-v4.19-rc2' of... · af3a5fe4
      Linus Torvalds authored
      Merge tag 'hwmon-for-linus-v4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull hwmon fixes from Guenter Roeck:
      
       - Fix potential Spectre v1 in nct6775
      
       - Add error checking to adt7475 driver
      
       - Fix reading shunt resistor value in ina2xx driver
      
      * tag 'hwmon-for-linus-v4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (nct6775) Fix potential Spectre v1
        hwmon: (adt7475) Make adt7475_read_word() return errors
        hwmon: (adt7475) Potential error pointer dereferences
        hwmon: (ina2xx) fix sysfs shunt resistor read access
      af3a5fe4
    • Linus Torvalds's avatar
      Merge tag 'for_v4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs · f3f106da
      Linus Torvalds authored
      Pull misc fs fixes from Jan Kara:
      
       - make UDF to properly mount media created by Win7
      
       - make isofs to properly refuse devices with large physical block size
      
       - fix a Spectre gadget in quotactl(2)
      
       - fix a warning in fsnotify code hit by syzkaller
      
      * tag 'for_v4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
        udf: Fix mounting of Win7 created UDF filesystems
        udf: Remove dead code from udf_find_fileset()
        fs/quota: Fix spectre gadget in do_quotactl
        fs/quota: Replace XQM_MAXQUOTAS usage with MAXQUOTAS
        isofs: reject hardware sector size > 2048 bytes
        fsnotify: fix false positive warning on inode delete
      f3f106da
    • Linus Torvalds's avatar
      Merge tag 'nios2-v4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2 · ff81a521
      Linus Torvalds authored
      Pull nios2 fix from Ley Foon Tan:
       "remove duplicate DEBUG_STACK_USAGE symbol defintions"
      
      * tag 'nios2-v4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2:
        nios2: kconfig: remove duplicate DEBUG_STACK_USAGE symbol defintions
      ff81a521
    • Chris Wilson's avatar
      drm/i915/audio: Hook up component bindings even if displays are disabled · 80ab3169
      Chris Wilson authored
      If the display has been disabled by modparam, we still want to connect
      together the HW bits and bobs with the associated drivers so that we can
      continue to manage their runtime power gating.
      
      Fixes: 10810944
      
       ("drm/i915: Check num_pipes before initializing audio component")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Elaine Wang <elaine.wang@intel.com>
      Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180817100241.4628-1-chris@chris-wilson.co.uk
      (cherry picked from commit 35a5fd9e
      
      )
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      80ab3169
    • Fredrik Schön's avatar
      drm/i915: Increase LSPCON timeout · 299c2a90
      Fredrik Schön authored
      100 ms is not enough time for the LSPCON adapter on Intel NUC devices to
      settle. This causes dropped display modes at boot or screen reconfiguration.
      Empirical testing can reproduce the error up to a timeout of 190 ms. Basic
      boot and stress testing at 200 ms has not (yet) failed.
      
      Increase timeout to 400 ms to get some margin of error.
      
      Changes from v1:
      The initial suggestion of 1000 ms was lowered due to concerns about delaying
      valid timeout cases.
      Update patch metadata.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107503
      Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1570392
      Fixes: 357c0ae9
      
       ("drm/i915/lspcon: Wait for expected LSPCON mode to settle")
      Cc: Shashank Sharma <shashank.sharma@intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: <stable@vger.kernel.org> # v4.11+
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Reviewed-by: default avatarShashank Sharma <shashank.sharma@intel.com>
      Signed-off-by: default avatarFredrik Schön <fredrik.schon@gmail.com>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180817200728.8154-1-fredrik.schon@gmail.com
      (cherry picked from commit 59f1c8ab
      
      )
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      299c2a90
    • Chris Wilson's avatar
      drm/i915: Stop holding a ref to the ppgtt from each vma · f013027e
      Chris Wilson authored
      
      
      The context owns both the ppgtt and the vma within it, and our activity
      tracking on the context ensures that we do not release active ppgtt. As
      the context fulfils our obligations for active memory tracking, we can
      relinquish the reference from the vma.
      
      This fixes a silly transient refleak from closed vma being kept alive
      until the entire system was idle, keeping all vm alive as well.
      
      Reported-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Testcase: igt/gem_ctx_create/files
      Fixes: 3365e226
      
       ("drm/i915: Lazily unbind vma on close")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
      Tested-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180816073448.19396-1-chris@chris-wilson.co.uk
      (cherry picked from commit a4417b7b
      
      )
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      f013027e
    • Linus Torvalds's avatar
      Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · b4df50de
      Linus Torvalds authored
      Pull crypto fixes from Herbert Xu:
      
       - Check for the right CPU feature bit in sm4-ce on arm64.
      
       - Fix scatterwalk WARN_ON in aes-gcm-ce on arm64.
      
       - Fix unaligned fault in aesni on x86.
      
       - Fix potential NULL pointer dereference on exit in chtls.
      
       - Fix DMA mapping direction for RSA in caam.
      
       - Fix error path return value for xts setkey in caam.
      
       - Fix address endianness when DMA unmapping in caam.
      
       - Fix sleep-in-atomic in vmx.
      
       - Fix command corruption when queue is full in cavium/nitrox.
      
      * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: cavium/nitrox - fix for command corruption in queue full case with backlog submissions.
        crypto: vmx - Fix sleep-in-atomic bugs
        crypto: arm64/aes-gcm-ce - fix scatterwalk API violation
        crypto: aesni - Use unaligned loads from gcm_context_data
        crypto: chtls - fix null dereference chtls_free_uld()
        crypto: arm64/sm4-ce - check for the right CPU feature bit
        crypto: caam - fix DMA mapping direction for RSA forms 2 & 3
        crypto: caam/qi - fix error path in xts setkey
        crypto: caam/jr - fix descriptor DMA unmapping
      b4df50de
    • Jens Axboe's avatar
      Merge branch 'nvme-4.19' of git://git.infradead.org/nvme into for-linus · 52bd456a
      Jens Axboe authored
      Pull NVMe fixes from Christoph.
      
      * 'nvme-4.19' of git://git.infradead.org/nvme:
        nvmet: free workqueue object if module init fails
        nvme-fcloop: Fix dropped LS's to removed target port
        nvme-pci: add a memory barrier to nvme_dbbuf_update_and_check_event
      52bd456a
  4. Aug 29, 2018