1. 10 Jun, 2017 3 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.dk/linux-block · 42211f6c
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "A set of fixes in the area of block IO, that should go into the next
        -rc release. This contains:
      
         - An OOPS fix from Dmitry, fixing a regression with the bio integrity
           code in this series.
      
         - Fix truncation of elevator io context cache name, from Eric
           Biggers.
      
         - NVMe pull from Christoph includes FC fixes from James, APST
           fixes/tweaks from Kai-Heng, removal fix from Rakesh, and an RDMA
           fix from Sagi.
      
         - Two tweaks for the block throttling code. One from Joseph Qi,
           fixing an oops from the timer code, and one from Shaohua, improving
           the behavior on rotatonal storage.
      
         - Two blk-mq fixes from Ming, fixing corner cases with the direct
           issue code.
      
         - Locking fix for bfq cgroups from Paolo"
      
      * 'for-linus' of git://git.kernel.dk/linux-block:
        block, bfq: access and cache blkg data only when safe
        Fix loop device flush before configure v3
        blk-throttle: set default latency baseline for harddisk
        blk-throttle: fix NULL pointer dereference in throtl_schedule_pending_timer
        nvme: relax APST default max latency to 100ms
        nvme: only consider exit latency when choosing useful non-op power states
        nvme-fc: fix missing put reference on controller create failure
        nvme-fc: on lldd/transport io error, terminate association
        nvme-rdma: fast fail incoming requests while we reconnect
        nvme-pci: fix multiple ctrl removal scheduling
        nvme: fix hang in remove path
        elevator: fix truncation of icq_cache_name
        blk-mq: fix direct issue
        blk-mq: pass correct hctx to blk_mq_try_issue_directly
        bio-integrity: Do not allocate integrity context for bio w/o data
      42211f6c
    • Linus Torvalds's avatar
      Merge tag 'sound-4.12-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 39e4edfd
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "This update contains a slightly hight amount of changes due to the
        pending ASoC fixes:
      
         - ALSA timer core got a couple of fixes for races between read and
           ioctl, leading to potential read of uninitialized kmalloced memory
      
         - ASoC core fixed the de-registration pattern for use-after-free bug
      
         - The rewrite of probe code in ASoC Intel Skylake for i915 component
      
         - ASoC R-snd got a series of fixes for SSI
      
         - ASoC simple-card, atmel, da7213, and rt286 trivial fixes
      
         - HD-audio ALC269 quirk and rearrangement of quirk table"
      
      * tag 'sound-4.12-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: timer: Fix missing queue indices reset at SNDRV_TIMER_IOCTL_SELECT
        ALSA: timer: Fix race between read and ioctl
        ALSA: hda/realtek - Reorder ALC269 ASUS quirk entries
        ALSA: hda/realtek: Fix mic and headset jack sense on Asus X705UD
        ASoC: rsnd: fixup parent_clk_name of AUDIO_CLKOUTx
        ASoC: Intel: Skylake: Fix to parse consecutive string tkns in manifest
        ASoC: Intel: Skylake: Fix IPC rx_list corruption
        ASoC: rsnd: SSI PIO adjust to 24bit mode
        MAINTAINERS: Update email address for patches to Wolfson parts
        ASoC: Fix use-after-free at card unregistration
        ASoC: simple-card: fix mic jack initialization
        ASoC: rsnd: don't call free_irq() on Parent SSI
        ASoC: atmel-classd: sync regcache when resuming
        ASoC: rsnd: don't use PDTA bit for 24bit on SSI
        ASoC: da7213: Fix incorrect usage of bitwise '&' operator for SRM check
        rt286: add Thinkpad Helix 2 to force_combo_jack_table
        ASoC: Intel: Skylake: Move i915 registration to worker thread
      39e4edfd
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-for-v4.12-rc5' of git://people.freedesktop.org/~airlied/linux · 6107cc58
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Intel, nouveau, rockchip, vmwgfx, imx, meson, mediatek and core fixes.
      
        Bit more spread out fixes this time, fixes for 7 drivers + a couple of
        core fixes.
      
        i915 and vmwgfx are the main ones. The vmwgfx ones fix a bunch of
        regressions in their atomic rework, and a few fixes destined for
        stable. i915 has some 4.12 regressions and older things that need to
        be fixed in stable as well.
      
        nouveau also has some runtime pm fixes and a timer list handling fix,
        otherwise a couple of core and small driver regression fixes"
      
      * tag 'drm-fixes-for-v4.12-rc5' of git://people.freedesktop.org/~airlied/linux: (37 commits)
        drm/i915: fix warning for unused variable
        drm/meson: Fix driver bind when only CVBS is available
        drm/i915: Fix 90/270 rotated coordinates for FBC
        drm/i915: Restore has_fbc=1 for ILK-M
        drm/i915: Workaround VLV/CHV DSI scanline counter hardware fail
        drm/i915: Fix logical inversion for gen4 quirking
        drm/i915: Guard against i915_ggtt_disable_guc() being invoked unconditionally
        drm/i915: Always recompute watermarks when distrust_bios_wm is set, v2.
        drm/i915: Prevent the system suspend complete optimization
        drm/i915/psr: disable psr2 for resolution greater than 32X20
        drm/i915: Hold a wakeref for probing the ring registers
        drm/i915: Short-circuit i915_gem_wait_for_idle() if already idle
        drm/i915: Disable decoupled MMIO
        drm/i915/guc: Remove stale comment for q_fail
        drm/vmwgfx: Bump driver minor and date
        drm/vmwgfx: Remove unused legacy cursor functions
        drm/vmwgfx: fix spelling mistake "exeeds" -> "exceeds"
        drm/vmwgfx: Fix large topology crash
        drm/vmwgfx: Make sure to update STDU when FB is updated
        drm/vmwgfx: Make sure backup_handle is always valid
        ...
      6107cc58
  2. 09 Jun, 2017 9 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus-4.12b-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · eb4125df
      Linus Torvalds authored
      Pull xen fix from Juergen Gross:
       "A fix for Xen on ARM when dealing with 64kB page size of a guest"
      
      * tag 'for-linus-4.12b-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen/privcmd: Support correctly 64KB page granularity when mapping memory
      eb4125df
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.12-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · a92f63cd
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "Mostly fairly minor, of note are:
      
         - Fix percpu allocations to be NUMA aware
      
         - Limit 4k page size config to 64TB virtual address space
      
         - Avoid needlessly restoring FP and vector registers
      
        Thanks to Aneesh Kumar K.V, Breno Leitao, Christophe Leroy, Frederic
        Barrat, Madhavan Srinivasan, Michael Bringmann, Nicholas Piggin,
        Vaibhav Jain"
      
      * tag 'powerpc-4.12-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/book3s64: Move PPC_DT_CPU_FTRs and enable it by default
        powerpc/mm/4k: Limit 4k page size config to 64TB virtual address space
        cxl: Fix error path on bad ioctl
        powerpc/perf: Fix Power9 test_adder fields
        powerpc/numa: Fix percpu allocations to be NUMA aware
        cxl: Avoid double free_irq() for psl,slice interrupts
        powerpc/kernel: Initialize load_tm on task creation
        powerpc/kernel: Fix FP and vector register restoration
        powerpc/64: Reclaim CPU_FTR_SUBCORE
        powerpc/hotplug-mem: Fix missing endian conversion of aa_index
        powerpc/sysdev/simple_gpio: Fix oops in gpio save_regs function
        powerpc/spufs: Fix coredump of SPU contexts
        powerpc/64s: Add dt_cpu_ftrs boot time setup option
      a92f63cd
    • Linus Torvalds's avatar
      Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 788a73f4
      Linus Torvalds authored
      Pull ARM SoC fixes from Olof Johansson:
       "Been sitting on these for a couple of weeks waiting on some larger
        batches to come in but it's been pretty quiet.
      
        Just your garden variety fixes here:
      
         - A few maintainers updates (ep93xx, Exynos, TI, Marvell)
         - Some PM fixes for Atmel/at91 and Marvell
         - A few DT fixes for Marvell, Versatile, TI Keystone, bcm283x
         - A reset driver patch to set module license for symbol access"
      
      * tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        MAINTAINERS: EP93XX: Update maintainership
        MAINTAINERS: remove kernel@stlinux.com obsolete mailing list
        ARM: dts: versatile: use #include "..." to include local DT
        MAINTAINERS: add device-tree files to TI DaVinci entry
        ARM: at91: select CONFIG_ARM_CPU_SUSPEND
        ARM: dts: keystone-k2l: fix broken Ethernet due to disabled OSR
        arm64: defconfig: enable some core options for 64bit Rockchip socs
        arm64: marvell: dts: fix interrupts in 7k/8k crypto nodes
        reset: hi6220: Set module license so that it can be loaded
        MAINTAINERS: add irqchip related drivers to Marvell EBU maintainers
        MAINTAINERS: sort F entries for Marvell EBU maintainers
        ARM: davinci: PM: Do not free useful resources in normal path in 'davinci_pm_init'
        ARM: davinci: PM: Free resources in error handling path in 'davinci_pm_init'
        ARM: dts: bcm283x: Reserve first page for firmware
        memory: atmel-ebi: mark PM ops as __maybe_unused
        MAINTAINERS: Remove Javier Martinez Canillas as reviewer for Exynos
      788a73f4
    • Dave Airlie's avatar
      Merge branch 'vmwgfx-fixes-4.12' of git://people.freedesktop.org/~thomash/linux into drm-fixes · 6e88007e
      Dave Airlie authored
      A bunch of fixes for vmwgfx 4.12 regressions and older stuff. In the latter
      case either trivial, cc'd stable or requiring backports for stable.
      
      * 'vmwgfx-fixes-4.12' of git://people.freedesktop.org/~thomash/linux:
        drm/vmwgfx: Bump driver minor and date
        drm/vmwgfx: Remove unused legacy cursor functions
        drm/vmwgfx: fix spelling mistake "exeeds" -> "exceeds"
        drm/vmwgfx: Fix large topology crash
        drm/vmwgfx: Make sure to update STDU when FB is updated
        drm/vmwgfx: Make sure backup_handle is always valid
        drm/vmwgfx: Handle vmalloc() failure in vmw_local_fifo_reserve()
        drm/vmwgfx: Don't create proxy surface for cursor
        drm/vmwgfx: limit the number of mip levels in vmw_gb_surface_define_ioctl()
      6e88007e
    • Dave Airlie's avatar
      Merge tag 'drm-intel-fixes-2017-06-08' of... · 3d76917f
      Dave Airlie authored
      Merge tag 'drm-intel-fixes-2017-06-08' of git://anongit.freedesktop.org/git/drm-intel into drm-fixes
      
      drm/i915 fixes for v4.12-rc5
      
      * tag 'drm-intel-fixes-2017-06-08' of git://anongit.freedesktop.org/git/drm-intel:
        drm/i915: fix warning for unused variable
        drm/i915: Fix 90/270 rotated coordinates for FBC
        drm/i915: Restore has_fbc=1 for ILK-M
        drm/i915: Workaround VLV/CHV DSI scanline counter hardware fail
        drm/i915: Fix logical inversion for gen4 quirking
        drm/i915: Guard against i915_ggtt_disable_guc() being invoked unconditionally
        drm/i915: Always recompute watermarks when distrust_bios_wm is set, v2.
        drm/i915: Prevent the system suspend complete optimization
        drm/i915/psr: disable psr2 for resolution greater than 32X20
        drm/i915: Hold a wakeref for probing the ring registers
        drm/i915: Short-circuit i915_gem_wait_for_idle() if already idle
        drm/i915: Disable decoupled MMIO
        drm/i915/guc: Remove stale comment for q_fail
        drm/i915: Serialize GTT/Aperture accesses on BXT
      3d76917f
    • Dave Airlie's avatar
      Merge tag 'drm-misc-fixes-2017-06-07' of git://anongit.freedesktop.org/git/drm-misc into drm-fixes · b62dba55
      Dave Airlie authored
      Driver Changes:
      - kirin: Use correct dt port for the bridge (John)
      - meson: Fix regression caused by adding HDMI support to allow board
      	 configurations without HDMI (Neil)
      
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Neil Armstrong <narmstrong@baylibre.com>
      
      * tag 'drm-misc-fixes-2017-06-07' of git://anongit.freedesktop.org/git/drm-misc:
        drm/meson: Fix driver bind when only CVBS is available
        drm: kirin: Fix drm_of_find_panel_or_bridge conversion
      b62dba55
    • Dave Airlie's avatar
      Merge branch 'mediatek-drm-fixes-4.12-rc1' of... · 97f607fe
      Dave Airlie authored
      Merge branch 'mediatek-drm-fixes-4.12-rc1' of https://github.com/ckhu-mediatek/linux.git-tags into drm-fixes
      
      mediatek fixes
      
      * 'mediatek-drm-fixes-4.12-rc1' of https://github.com/ckhu-mediatek/linux.git-tags:
        drm/mediatek: fix mtk_hdmi_setup_vendor_specific_infoframe mistake
        drm/mediatek: fix a timeout loop
      97f607fe
    • Dave Airlie's avatar
      Merge tag 'imx-drm-fixes-2017-06-08' of git://git.pengutronix.de/git/pza/linux into drm-fixes · dd44c957
      Dave Airlie authored
      imx-drm: PRE clock gating, panelless LDB, and VDIC CSI selection fixes
      
      - Keep the external clock input to the PRE ungated and only use the internal
        soft reset to keep the module in low power state, to avoid sporadic startup
        failures.
      - Ignore -ENODEV return values from drm_of_find_panel_or_bridge in the LDB
        driver to fix probing for devices that still do not specify a panel in the
        device tree.
      - Fix the CSI input selection to the VDIC. According to experiments, the real
        behaviour differs a bit from the documentation.
      
      * tag 'imx-drm-fixes-2017-06-08' of git://git.pengutronix.de/git/pza/linux:
        gpu: ipu-v3: Fix CSI selection for VDIC
        drm/imx: imx-ldb: Accept drm_of_find_panel_or_bridge failure
        gpu: ipu-v3: pre: only use internal clock gating
      dd44c957
    • Linus Torvalds's avatar
      Merge tag 'pm-4.12-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 0d22df90
      Linus Torvalds authored
      Pull power management fixes from Rafael Wysocki:
       "These revert one problematic commit related to system sleep and fix
        one recent intel_pstate regression.
      
        Specifics:
      
         - Revert a recent commit that attempted to avoid spurious wakeups
           from suspend-to-idle via ACPI SCI, but introduced regressions on
           some systems (Rafael Wysocki).
      
           We will get back to the problem it tried to address in the next
           cycle.
      
         - Fix a possible division by 0 during intel_pstate initialization
           due to a missing check (Rafael Wysocki)"
      
      * tag 'pm-4.12-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        Revert "ACPI / sleep: Ignore spurious SCI wakeups from suspend-to-idle"
        cpufreq: intel_pstate: Avoid division by 0 in min_perf_pct_min()
      0d22df90
  3. 08 Jun, 2017 13 commits
    • Linus Torvalds's avatar
      Merge tag 'modules-for-v4.12-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux · aea4156c
      Linus Torvalds authored
      Pull module maintainer address change from Jessica Yu:
       "A single patch that advertises my email address change"
      
      * tag 'modules-for-v4.12-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux:
        MAINTAINERS: update email address for Jessica Yu
      aea4156c
    • Rafael J. Wysocki's avatar
      Merge branches 'intel_pstate' and 'pm-sleep' · fbd78afe
      Rafael J. Wysocki authored
      * intel_pstate:
        cpufreq: intel_pstate: Avoid division by 0 in min_perf_pct_min()
      
      * pm-sleep:
        Revert "ACPI / sleep: Ignore spurious SCI wakeups from suspend-to-idle"
      fbd78afe
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk · dc0cf5a7
      Linus Torvalds authored
      Pull printk fix from Petr Mladek:
       "This reverts a fix added into 4.12-rc1. It caused the kernel log to be
        printed on another console when two consoles of the same type were
        defined, e.g. console=ttyS0 console=ttyS1.
      
        This configuration was never supported by kernel itself, but it
        started to make sense with systemd. In other words, the commit broke
        userspace"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk:
        Revert "printk: fix double printing with earlycon"
      dc0cf5a7
    • Linus Torvalds's avatar
      Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · d0aab7d4
      Linus Torvalds authored
      Pull crypto fixes from Herbert Xu:
       "This fixes a couple of places in the crypto code that were doing
        interruptible sleeps dangerously. They have been converted to use
        non-interruptible sleeps.
      
        This also fixes a bug in asymmetric_keys where it would trigger a
        use-after-free if a request returned EBUSY due to a full device queue"
      
      * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: gcm - wait for crypto op not signal safe
        crypto: drbg - wait for crypto op not signal safe
        crypto: asymmetric_keys - handle EBUSY due to backlog correctly
      d0aab7d4
    • Paolo Valente's avatar
      block, bfq: access and cache blkg data only when safe · 8f9bebc3
      Paolo Valente authored
      In blk-cgroup, operations on blkg objects are protected with the
      request_queue lock. This is no more the lock that protects
      I/O-scheduler operations in blk-mq. In fact, the latter are now
      protected with a finer-grained per-scheduler-instance lock. As a
      consequence, although blkg lookups are also rcu-protected, blk-mq I/O
      schedulers may see inconsistent data when they access blkg and
      blkg-related objects. BFQ does access these objects, and does incur
      this problem, in the following case.
      
      The blkg_lookup performed in bfq_get_queue, being protected (only)
      through rcu, may happen to return the address of a copy of the
      original blkg. If this is the case, then the blkg_get performed in
      bfq_get_queue, to pin down the blkg, is useless: it does not prevent
      blk-cgroup code from destroying both the original blkg and all objects
      directly or indirectly referred by the copy of the blkg. BFQ accesses
      these objects, which typically causes a crash for NULL-pointer
      dereference of memory-protection violation.
      
      Some additional protection mechanism should be added to blk-cgroup to
      address this issue. In the meantime, this commit provides a quick
      temporary fix for BFQ: cache (when safe) blkg data that might
      disappear right after a blkg_lookup.
      
      In particular, this commit exploits the following facts to achieve its
      goal without introducing further locks.  Destroy operations on a blkg
      invoke, as a first step, hooks of the scheduler associated with the
      blkg. And these hooks are executed with bfqd->lock held for BFQ. As a
      consequence, for any blkg associated with the request queue an
      instance of BFQ is attached to, we are guaranteed that such a blkg is
      not destroyed, and that all the pointers it contains are consistent,
      while that instance is holding its bfqd->lock. A blkg_lookup performed
      with bfqd->lock held then returns a fully consistent blkg, which
      remains consistent until this lock is held. In more detail, this holds
      even if the returned blkg is a copy of the original one.
      
      Finally, also the object describing a group inside BFQ needs to be
      protected from destruction on the blkg_free of the original blkg
      (which invokes bfq_pd_free). This commit adds private refcounting for
      this object, to let it disappear only after no bfq_queue refers to it
      any longer.
      
      This commit also removes or updates some stale comments on locking
      issues related to blk-cgroup operations.
      Reported-by: default avatarTomas Konir <tomas.konir@gmail.com>
      Reported-by: default avatarLee Tibbert <lee.tibbert@gmail.com>
      Reported-by: default avatarMarco Piazza <mpiazza@gmail.com>
      Signed-off-by: default avatarPaolo Valente <paolo.valente@linaro.org>
      Tested-by: default avatarTomas Konir <tomas.konir@gmail.com>
      Tested-by: default avatarLee Tibbert <lee.tibbert@gmail.com>
      Tested-by: default avatarMarco Piazza <mpiazza@gmail.com>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      8f9bebc3
    • Jens Axboe's avatar
      Merge branch 'nvme-4.12' of git://git.infradead.org/nvme into for-linus · 85d0331a
      Jens Axboe authored
      Christoph writes:
      
      "A few NVMe fixes for 4.12-rc, PCIe reset fixes and APST fixes, a
       RDMA reconnect fix, two FC fixes and a general controller removal fix."
      85d0331a
    • Jani Nikula's avatar
      drm/i915: fix warning for unused variable · ef6c4d75
      Jani Nikula authored
      drivers/gpu/drm/i915/intel_engine_cs.c: In function ‘intel_engine_is_idle’:
      drivers/gpu/drm/i915/intel_engine_cs.c:1103:27: error: unused variable ‘dev_priv’ [-Werror=unused-variable]
        struct drm_i915_private *dev_priv = engine->i915;
                                 ^~~~~~~~
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      ef6c4d75
    • James Wang's avatar
      Fix loop device flush before configure v3 · 64604957
      James Wang authored
      While installing SLES-12 (based on v4.4), I found that the installer
      will stall for 60+ seconds during LVM disk scan.  The root cause was
      determined to be the removal of a bound device check in loop_flush()
      by commit b5dd2f60 ("block: loop: improve performance via blk-mq").
      
      Restoring this check, examining ->lo_state as set by loop_set_fd()
      eliminates the bad behavior.
      
      Test method:
      modprobe loop max_loop=64
      dd if=/dev/zero of=disk bs=512 count=200K
      for((i=0;i<4;i++))do losetup -f disk; done
      mkfs.ext4 -F /dev/loop0
      for((i=0;i<4;i++))do mkdir t$i; mount /dev/loop$i t$i;done
      for f in `ls /dev/loop[0-9]*|sort`; do \
      	echo $f; dd if=$f of=/dev/null  bs=512 count=1; \
      	done
      
      Test output:  stock          patched
      /dev/loop0    18.1217e-05    8.3842e-05
      /dev/loop1     6.1114e-05    0.000147979
      /dev/loop10    0.414701      0.000116564
      /dev/loop11    0.7474        6.7942e-05
      /dev/loop12    0.747986      8.9082e-05
      /dev/loop13    0.746532      7.4799e-05
      /dev/loop14    0.480041      9.3926e-05
      /dev/loop15    1.26453       7.2522e-05
      
      Note that from loop10 onward, the device is not mounted, yet the
      stock kernel consumes several orders of magnitude more wall time
      than it does for a mounted device.
      (Thanks for Mike Galbraith <efault@gmx.de>, give a changelog review.)
      Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
      Reviewed-by: default avatarMing Lei <ming.lei@redhat.com>
      Signed-off-by: default avatarJames Wang <jnwang@suse.com>
      Fixes: b5dd2f60 ("block: loop: improve performance via blk-mq")
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      64604957
    • Michael Ellerman's avatar
      powerpc/book3s64: Move PPC_DT_CPU_FTRs and enable it by default · c6ee9619
      Michael Ellerman authored
      The PPC_DT_CPU_FTRs is a bit misplaced in menuconfig, it shows up with
      other general kernel options. It's really more at home in the "Platform
      Support" section, so move it there.
      
      Also enable it by default, for Book3s 64. It does mostly nothing unless
      the device tree properties are found, and we will want it enabled
      eventually in distro kernels, so turn it on to start getting more
      testing.
      
      Fixes: 5a61ef74 ("powerpc/64s: Support new device tree binding for discovering CPU features")
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      c6ee9619
    • Aneesh Kumar K.V's avatar
      powerpc/mm/4k: Limit 4k page size config to 64TB virtual address space · 92d9dfda
      Aneesh Kumar K.V authored
      Supporting 512TB requires us to do a order 3 allocation for level 1 page
      table (pgd). This results in page allocation failures with certain workloads.
      For now limit 4k linux page size config to 64TB.
      
      Fixes: f6eedbba ("powerpc/mm/hash: Increase VA range to 128TB")
      Reported-by: default avatarHugh Dickins <hughd@google.com>
      Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      92d9dfda
    • Frederic Barrat's avatar
      cxl: Fix error path on bad ioctl · cec422c1
      Frederic Barrat authored
      Fix error path if we can't copy user structure on CXL_IOCTL_START_WORK
      ioctl. We shouldn't unlock the context status mutex as it was not
      locked (yet).
      
      Fixes: 0712dc7e ("cxl: Fix issues when unmapping contexts")
      Cc: stable@vger.kernel.org # v3.19+
      Signed-off-by: default avatarFrederic Barrat <fbarrat@linux.vnet.ibm.com>
      Reviewed-by: default avatarVaibhav Jain <vaibhav@linux.vnet.ibm.com>
      Reviewed-by: default avatarAndrew Donnellan <andrew.donnellan@au1.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      cec422c1
    • Petr Mladek's avatar
      Revert "printk: fix double printing with earlycon" · dac8bbba
      Petr Mladek authored
      This reverts commit cf39bf58.
      
      The commit regression to users that define both console=ttyS1
      and console=ttyS0 on the command line, see
      https://lkml.kernel.org/r/20170509082915.GA13236@bistromath.localdomain
      
      The kernel log messages always appeared only on one serial port. It is
      even documented in Documentation/admin-guide/serial-console.rst:
      
      "Note that you can only define one console per device type (serial,
      video)."
      
      The above mentioned commit changed the order in which the command line
      parameters are searched. As a result, the kernel log messages go to
      the last mentioned ttyS* instead of the first one.
      
      We long thought that using two console=ttyS* on the command line
      did not make sense. But then we realized that console= parameters
      were handled also by systemd, see
      http://0pointer.de/blog/projects/serial-console.html
      
      "By default systemd will instantiate one serial-getty@.service on
      the main kernel console, if it is not a virtual terminal."
      
      where
      
      "[4] If multiple kernel consoles are used simultaneously, the main
      console is the one listed first in /sys/class/tty/console/active,
      which is the last one listed on the kernel command line."
      
      This puts the original report into another light. The system is running
      in qemu. The first serial port is used to store the messages into a file.
      The second one is used to login to the system via a socket. It depends
      on systemd and the historic kernel behavior.
      
      By other words, systemd causes that it makes sense to define both
      console=ttyS1 console=ttyS0 on the command line. The kernel fix
      caused regression related to userspace (systemd) and need to be
      reverted.
      
      In addition, it went out that the fix helped only partially.
      The messages still were duplicated when the boot console was
      removed early by late_initcall(printk_late_init). Then the entire
      log was replayed when the same console was registered as a normal one.
      
      Link: 20170606160339.GC7604@pathway.suse.cz
      Cc: Aleksey Makarov <aleksey.makarov@linaro.org>
      Cc: Sabrina Dubroca <sd@queasysnail.net>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Peter Hurley <peter@hurleysoftware.com>
      Cc: Jiri Slaby <jslaby@suse.com>
      Cc: Robin Murphy <robin.murphy@arm.com>,
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: "Nair, Jayachandran" <Jayachandran.Nair@cavium.com>
      Cc: linux-serial@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Reported-by: default avatarSabrina Dubroca <sd@queasysnail.net>
      Acked-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      dac8bbba
    • Jessica Yu's avatar
      MAINTAINERS: update email address for Jessica Yu · 462c5a82
      Jessica Yu authored
      I will be traveling in the upcoming months and it'll be much easier for me
      to access my kernel.org email rather than my work one. Change my email
      address in the MAINTAINERS file from jeyu@redhat.com to jeyu@kernel.org.
      Signed-off-by: default avatarJessica Yu <jeyu@redhat.com>
      462c5a82
  4. 07 Jun, 2017 15 commits
    • Shaohua Li's avatar
      blk-throttle: set default latency baseline for harddisk · 6679a90c
      Shaohua Li authored
      hard disk IO latency varies a lot depending on spindle move. The latency
      range could be from several microseconds to several milliseconds. It's
      pretty hard to get the baseline latency used by io.low.
      
      We will use a different stragety here. The idea is only using IO with
      spindle move to determine if cgroup IO is in good state. For HD, if io
      latency is small (< 1ms), we ignore the IO. Such IO is likely from
      sequential IO, and is helpless to help determine if a cgroup's IO is
      impacted by other cgroups. With this, we only account IO with big
      latency. Then we can choose a hardcoded baseline latency for HD (4ms,
      which is typical IO latency with seek).  With all these settings, the
      io.low latency works for both HD and SSD.
      Signed-off-by: default avatarShaohua Li <shli@fb.com>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      6679a90c
    • Neil Armstrong's avatar
      drm/meson: Fix driver bind when only CVBS is available · 8604889f
      Neil Armstrong authored
      While introducing HDMI support, component matching on connectors node
      were bypassed since no driver would actually bind on the DT node.
      But when only a CVBS connector is present, only a single node is found
      in the graph, but ignored and a NULL match table is given to the
      component code.
      
      This code permits bypassing the components framework by binding directly
      the DRM driver when no components needs to be loaded.
      
      Fixes: a41e82e6 ("drm/meson: Add support for components")
      Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
      Signed-off-by: default avatarSean Paul <seanpaul@chromium.org>
      Link: http://patchwork.freedesktop.org/patch/msgid/1496067352-8733-1-git-send-email-narmstrong@baylibre.com
      8604889f
    • Joseph Qi's avatar
      blk-throttle: fix NULL pointer dereference in throtl_schedule_pending_timer · a41b816c
      Joseph Qi authored
      I have encountered a NULL pointer dereference in
      throtl_schedule_pending_timer:
        [  413.735396] BUG: unable to handle kernel NULL pointer dereference at 0000000000000038
        [  413.735535] IP: [<ffffffff812ebbbf>] throtl_schedule_pending_timer+0x3f/0x210
        [  413.735643] PGD 22c8cf067 PUD 22cb34067 PMD 0
        [  413.735713] Oops: 0000 [#1] SMP
        ......
      
      This is caused by the following case:
        blk_throtl_bio
          throtl_schedule_next_dispatch  <= sq is top level one without parent
            throtl_schedule_pending_timer
              sq_to_tg(sq)->td->throtl_slice  <= sq_to_tg(sq) returns NULL
      
      Fix it by using sq_to_td instead of sq_to_tg(sq)->td, which will always
      return a valid td.
      
      Fixes: 297e3d85 ("blk-throttle: make throtl_slice tunable")
      Signed-off-by: default avatarJoseph Qi <qijiang.qj@alibaba-inc.com>
      Reviewed-by: default avatarShaohua Li <shli@fb.com>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      a41b816c
    • Ville Syrjälä's avatar
      drm/i915: Fix 90/270 rotated coordinates for FBC · 1065467e
      Ville Syrjälä authored
      The clipped src coordinates have already been rotated by 270 degrees for
      when the plane rotation is 90/270 degrees, hence the FBC code should no
      longer swap the width and height.
      
      Cc: stable@vger.kernel.org
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Fixes: b63a16f6 ("drm/i915: Compute display surface offset in the plane check hook for SKL+")
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170331180056.14086-4-ville.syrjala@linux.intel.comReviewed-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Tested-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      (cherry picked from commit 73714c05)
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      1065467e
    • Ville Syrjälä's avatar
      drm/i915: Restore has_fbc=1 for ILK-M · 27fe407c
      Ville Syrjälä authored
      Restore the lost has_fbc flag for mobile ILK.
      
      Cc: Carlos Santa <carlos.santa@intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Fixes: a1323380 ("drm/i915: Introduce GEN5_FEATURES for device info")
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170606133229.12439-1-ville.syrjala@linux.intel.comReviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      (cherry picked from commit c2d1a0ce)
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      27fe407c
    • Ville Syrjälä's avatar
      drm/i915: Workaround VLV/CHV DSI scanline counter hardware fail · 8f4d3809
      Ville Syrjälä authored
      The scanline counter is bonkers on VLV/CHV DSI. The scanline counter
      increment is not lined up with the start of vblank like it is on
      every other platform and output type. This causes problems for
      both the vblank timestamping and atomic update vblank evasion.
      
      On my FFRD8 machine at least, the scanline counter increment
      happens about 1/3 of a scanline ahead of the start of vblank (which
      is where all register latching happens still). That means we can't
      trust the scanline counter to tell us whether we're in vblank or not
      while we're on that particular line. In order to keep vblank
      timestamping in working condition when called from the vblank irq,
      we'll leave scanline_offset at one, which means that the entire
      line containing the start of vblank is considered to be inside
      the vblank.
      
      For the vblank evasion we'll need to consider that entire line
      to be bad, since we can't tell whether the registers already
      got latched or not. And we can't actually use the start of vblank
      interrupt to get us past that line as the interrupt would fire
      too soon, and then we'd up waiting for the next start of vblank
      instead. One way around that would using the frame start
      interrupt instead since that wouldn't fire until the next
      scanline, but that would require some bigger changes in the
      interrupt code. So for simplicity we'll just poll until we get
      past the bad line.
      
      v2: Adjust the comments a bit
      
      Cc: stable@vger.kernel.org
      Cc: Jonas Aaberg <cja@gmx.net>
      Tested-by: default avatarJonas Aaberg <cja@gmx.net>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99086Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20161215174734.28779-1-ville.syrjala@linux.intel.comTested-by: default avatarMika Kahola <mika.kahola@intel.com>
      Reviewed-by: default avatarMika Kahola <mika.kahola@intel.com>
      (cherry picked from commit ec1b4ee2)
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      8f4d3809
    • Chris Wilson's avatar
      drm/i915: Fix logical inversion for gen4 quirking · 5857dbfa
      Chris Wilson authored
      The assertion that we want to make before disabling the pin of the pages
      for the unknown swizzling quirk is that the quirk is indeed active, and
      that the quirk is disabled before we do apply it to the pages.
      
      Fixes: 2c3a3f44 ("drm/i915: Fix pages pin counting around swizzle quirk")
      Fixes: 957870f9 ("drm/i915: Split out i915_gem_object_set_tiling()")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170521124014.27678-1-chris@chris-wilson.co.uk
      Reviewed-bhy: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      (cherry picked from commit 20bb3771)
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      5857dbfa
    • Chris Wilson's avatar
      drm/i915: Guard against i915_ggtt_disable_guc() being invoked unconditionally · d90c9890
      Chris Wilson authored
      Commit 7c3f86b6 ("drm/i915: Invalidate the guc ggtt TLB upon
      insertion") added the restoration of the invalidation routine after the
      GuC was disabled, but missed that the GuC was unconditionally disabled
      when not used. This then overwrites the invalidate routine for the older
      chipsets, causing havoc and breaking resume as the most obvious victim.
      
      We place the guard inside i915_ggtt_disable_guc() to be backport
      friendly (the bug was introduced into v4.11) but it would be preferred
      to be in more control over when this was guard (i.e. do not try and
      teardown the data structures before we have enabled them). That should
      be true with the reorganisation of the guc loaders.
      Reported-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Fixes: 7c3f86b6 ("drm/i915: Invalidate the guc ggtt TLB upon insertion")
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Oscar Mateo <oscar.mateo@intel.com>
      Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
      Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
      Cc: <stable@vger.kernel.org> # v4.11+
      Link: http://patchwork.freedesktop.org/patch/msgid/20170531190514.3691-1-chris@chris-wilson.co.ukReviewed-by: default avatarMichel Thierry <michel.thierry@intel.com>
      (cherry picked from commit cb60606d)
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      d90c9890
    • Maarten Lankhorst's avatar
      drm/i915: Always recompute watermarks when distrust_bios_wm is set, v2. · 4e3aed84
      Maarten Lankhorst authored
      On some systems there can be a race condition in which no crtc state is
      added to the first atomic commit. This results in all crtc's having a
      null DDB allocation, causing a FIFO underrun on any update until the
      first modeset.
      
      Changes since v1:
      - Do not take the connection_mutex, this is already done below.
      Reported-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Inspired-by: default avatarMahesh Kumar <mahesh1.kumar@intel.com>
      Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Fixes: 98d39494 ("drm/i915/gen9: Compute DDB allocation at atomic
      check time (v4)")
      Cc: <stable@vger.kernel.org> # v4.8+
      Cc: Mahesh Kumar <mahesh1.kumar@intel.com>
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170531154236.27180-1-maarten.lankhorst@linux.intel.comReviewed-by: default avatarMahesh Kumar <mahesh1.kumar@intel.com>
      Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      
      (cherry picked from commit 367d73d2)
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      4e3aed84
    • Imre Deak's avatar
      drm/i915: Prevent the system suspend complete optimization · 6ab92afc
      Imre Deak authored
      Since
      
      commit bac2a909
      Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Date:   Wed Jan 21 02:17:42 2015 +0100
      
          PCI / PM: Avoid resuming PCI devices during system suspend
      
      PCI devices will default to allowing the system suspend complete
      optimization where devices are not woken up during system suspend if
      they were already runtime suspended. This however breaks the i915/HDA
      drivers for two reasons:
      
      - The i915 driver has system suspend specific steps that it needs to
        run, that bring the device to a different state than its runtime
        suspended state.
      
      - The HDA driver's suspend handler requires power that it will request
        from the i915 driver's power domain handler. This in turn requires the
        i915 driver to runtime resume itself, but this won't be possible if the
        suspend complete optimization is in effect: in this case the i915
        runtime PM is disabled and trying to get an RPM reference returns
        -EACCESS.
      
      Solve this by requiring the PCI/PM core to resume the device during
      system suspend which in effect disables the suspend complete optimization.
      
      Regardless of the above commit the optimization stayed disabled for DRM
      devices until
      
      commit d14d2a84
      Author: Lukas Wunner <lukas@wunner.de>
      Date:   Wed Jun 8 12:49:29 2016 +0200
      
          drm: Remove dev_pm_ops from drm_class
      
      so this patch is in practice a fix for this commit. Another reason for
      the bug staying hidden for so long is that the optimization for a device
      is disabled if it's disabled for any of its children devices. i915 may
      have a backlight device as its child which doesn't support runtime PM
      and so doesn't allow the optimization either.  So if this backlight
      device got registered the bug stayed hidden.
      
      Credits to Marta, Tomi and David who enabled pstore logging,
      that caught one instance of this issue across a suspend/
      resume-to-ram and Ville who rememberd that the optimization was enabled
      for some devices at one point.
      
      The first WARN triggered by the problem:
      
      [ 6250.746445] WARNING: CPU: 2 PID: 17384 at drivers/gpu/drm/i915/intel_runtime_pm.c:2846 intel_runtime_pm_get+0x6b/0xd0 [i915]
      [ 6250.746448] pm_runtime_get_sync() failed: -13
      [ 6250.746451] Modules linked in: snd_hda_intel i915 vgem snd_hda_codec_hdmi x86_pkg_temp_thermal intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul
      snd_hda_codec_realtek snd_hda_codec_generic ghash_clmulni_intel e1000e snd_hda_codec snd_hwdep snd_hda_core ptp mei_me pps_core snd_pcm lpc_ich mei prime_
      numbers i2c_hid i2c_designware_platform i2c_designware_core [last unloaded: i915]
      [ 6250.746512] CPU: 2 PID: 17384 Comm: kworker/u8:0 Tainted: G     U  W       4.11.0-rc5-CI-CI_DRM_334+ #1
      [ 6250.746515] Hardware name:                  /NUC5i5RYB, BIOS RYBDWi35.86A.0362.2017.0118.0940 01/18/2017
      [ 6250.746521] Workqueue: events_unbound async_run_entry_fn
      [ 6250.746525] Call Trace:
      [ 6250.746530]  dump_stack+0x67/0x92
      [ 6250.746536]  __warn+0xc6/0xe0
      [ 6250.746542]  ? pci_restore_standard_config+0x40/0x40
      [ 6250.746546]  warn_slowpath_fmt+0x46/0x50
      [ 6250.746553]  ? __pm_runtime_resume+0x56/0x80
      [ 6250.746584]  intel_runtime_pm_get+0x6b/0xd0 [i915]
      [ 6250.746610]  intel_display_power_get+0x1b/0x40 [i915]
      [ 6250.746646]  i915_audio_component_get_power+0x15/0x20 [i915]
      [ 6250.746654]  snd_hdac_display_power+0xc8/0x110 [snd_hda_core]
      [ 6250.746661]  azx_runtime_resume+0x218/0x280 [snd_hda_intel]
      [ 6250.746667]  pci_pm_runtime_resume+0x76/0xa0
      [ 6250.746672]  __rpm_callback+0xb4/0x1f0
      [ 6250.746677]  ? pci_restore_standard_config+0x40/0x40
      [ 6250.746682]  rpm_callback+0x1f/0x80
      [ 6250.746686]  ? pci_restore_standard_config+0x40/0x40
      [ 6250.746690]  rpm_resume+0x4ba/0x740
      [ 6250.746698]  __pm_runtime_resume+0x49/0x80
      [ 6250.746703]  pci_pm_suspend+0x57/0x140
      [ 6250.746709]  dpm_run_callback+0x6f/0x330
      [ 6250.746713]  ? pci_pm_freeze+0xe0/0xe0
      [ 6250.746718]  __device_suspend+0xf9/0x370
      [ 6250.746724]  ? dpm_watchdog_set+0x60/0x60
      [ 6250.746730]  async_suspend+0x1a/0x90
      [ 6250.746735]  async_run_entry_fn+0x34/0x160
      [ 6250.746741]  process_one_work+0x1f2/0x6d0
      [ 6250.746749]  worker_thread+0x49/0x4a0
      [ 6250.746755]  kthread+0x107/0x140
      [ 6250.746759]  ? process_one_work+0x6d0/0x6d0
      [ 6250.746763]  ? kthread_create_on_node+0x40/0x40
      [ 6250.746768]  ret_from_fork+0x2e/0x40
      [ 6250.746778] ---[ end trace 102a62fd2160f5e6 ]---
      
      v2:
      - Use the new pci_dev->needs_resume flag, to avoid any overhead during
        the ->pm_prepare hook. (Rafael)
      
      v3:
      - Update commit message to reference the actual regressing commit.
        (Lukas)
      
      v4:
      - Rebase on v4 of patch 1/2.
      
      Fixes: d14d2a84 ("drm: Remove dev_pm_ops from drm_class")
      References: https://bugs.freedesktop.org/show_bug.cgi?id=100378
      References: https://bugs.freedesktop.org/show_bug.cgi?id=100770
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: Marta Lofstedt <marta.lofstedt@intel.com>
      Cc: David Weinehall <david.weinehall@linux.intel.com>
      Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Lukas Wunner <lukas@wunner.de>
      Cc: linux-pci@vger.kernel.org
      Cc: <stable@vger.kernel.org> # v4.10.x: 4d071c32 - PCI/PM: Add needs_resume flag
      Cc: <stable@vger.kernel.org> # v4.10.x
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reported-and-tested-by: default avatarMarta Lofstedt <marta.lofstedt@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1493726649-32094-2-git-send-email-imre.deak@intel.com
      (cherry picked from commit adfdf85d)
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      6ab92afc
    • Nagaraju, Vathsala's avatar
      drm/i915/psr: disable psr2 for resolution greater than 32X20 · bd709898
      Nagaraju, Vathsala authored
      psr1 is also disabled for panel resolution  greater than 32X20.
      Added psr2 check to disable only for psr2 panels having resolution
      greater than 32X20.
      
      issue was introduced by
      commit-id : "acf45d11"
      commit message: "PSR2 is restricted to work with panel resolutions
      upto 3200x2000, move the check to intel_psr_match_conditions and fully
      block psr."
      
      v2: (Rodrigo)
         Add previous commit details which introduced the issue
      
      Fixes: acf45d11 ("drm/i915/psr: disable psr2 for resolution greater than 32X20")
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Jim Bride <jim.bride@linux.intel.com>
      Cc: Yaroslav Shabalin <yaroslav.shabalin@gmail.com>
      Reported-by: default avatarYaroslav Shabalin <yaroslav.shabalin@gmail.com>
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarvathsala nagaraju <vathsala.nagaraju@intel.com>
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/49935bdff896ee3140bed471012b9f9110a863a4.1495729964.git.vathsala.nagaraju@intel.com
      (cherry picked from commit bef8c056)
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      bd709898
    • Chris Wilson's avatar
      drm/i915: Hold a wakeref for probing the ring registers · d9533f19
      Chris Wilson authored
      Allow intel_engine_is_idle() to be called outside of the GT wakeref by
      acquiring the device runtime pm for ourselves. This allows the function
      to act as check after we assume the engine is idle and we release the GT
      wakeref held whilst we have requests. At the moment, we do not call it
      outside of an awake context but taking the wakeref as required makes it
      more convenient to use for quick debugging in future.
      
      [ 2613.401647] RPM wakelock ref not held during HW access
      [ 2613.401684] ------------[ cut here ]------------
      [ 2613.401720] WARNING: CPU: 5 PID: 7739 at drivers/gpu/drm/i915/intel_drv.h:1787 gen6_read32+0x21f/0x2b0 [i915]
      [ 2613.401731] Modules linked in: snd_hda_intel i915 vgem snd_hda_codec_hdmi x86_pkg_temp_thermal intel_powerclamp snd_hda_codec_realtek coretemp snd_hda_codec_generic crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_hda_codec snd_hwdep snd_hda_core snd_pcm r8169 mii mei_me lpc_ich mei prime_numbers [last unloaded: i915]
      [ 2613.401823] CPU: 5 PID: 7739 Comm: drv_missed_irq Tainted: G     U          4.12.0-rc2-CI-CI_DRM_421+ #1
      [ 2613.401825] Hardware name: MSI MS-7924/Z97M-G43(MS-7924), BIOS V1.12 02/15/2016
      [ 2613.401840] task: ffff880409e3a740 task.stack: ffffc900084dc000
      [ 2613.401861] RIP: 0010:gen6_read32+0x21f/0x2b0 [i915]
      [ 2613.401863] RSP: 0018:ffffc900084dfce8 EFLAGS: 00010292
      [ 2613.401869] RAX: 000000000000002a RBX: ffff8804016a8000 RCX: 0000000000000006
      [ 2613.401871] RDX: 0000000000000006 RSI: ffffffff81cbf2d9 RDI: ffffffff81c9e3a7
      [ 2613.401874] RBP: ffffc900084dfd18 R08: ffff880409e3afc8 R09: 0000000000000000
      [ 2613.401877] R10: 000000008a1c483f R11: 0000000000000000 R12: 000000000000209c
      [ 2613.401879] R13: 0000000000000001 R14: ffff8804016a8000 R15: ffff8804016ac150
      [ 2613.401882] FS:  00007f39ef3dd8c0(0000) GS:ffff88041fb40000(0000) knlGS:0000000000000000
      [ 2613.401885] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 2613.401887] CR2: 00000000023717c8 CR3: 00000002e7b34000 CR4: 00000000001406e0
      [ 2613.401889] Call Trace:
      [ 2613.401912]  intel_engine_is_idle+0x76/0x90 [i915]
      [ 2613.401931]  i915_gem_wait_for_idle+0xe6/0x1e0 [i915]
      [ 2613.401951]  fault_irq_set+0x40/0x90 [i915]
      [ 2613.401970]  i915_ring_test_irq_set+0x42/0x50 [i915]
      [ 2613.401976]  simple_attr_write+0xc7/0xe0
      [ 2613.401981]  full_proxy_write+0x4f/0x70
      [ 2613.401987]  __vfs_write+0x23/0x120
      [ 2613.401992]  ? rcu_read_lock_sched_held+0x75/0x80
      [ 2613.401996]  ? rcu_sync_lockdep_assert+0x2a/0x50
      [ 2613.401999]  ? __sb_start_write+0xfa/0x1f0
      [ 2613.402004]  vfs_write+0xc5/0x1d0
      [ 2613.402008]  ? trace_hardirqs_on_caller+0xe7/0x1c0
      [ 2613.402013]  SyS_write+0x44/0xb0
      [ 2613.402020]  entry_SYSCALL_64_fastpath+0x1c/0xb1
      [ 2613.402022] RIP: 0033:0x7f39eded6670
      [ 2613.402025] RSP: 002b:00007fffdcdcb1a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
      [ 2613.402030] RAX: ffffffffffffffda RBX: ffffffff81470203 RCX: 00007f39eded6670
      [ 2613.402033] RDX: 0000000000000001 RSI: 000000000041bc33 RDI: 0000000000000006
      [ 2613.402036] RBP: ffffc900084dff88 R08: 00007f39ef3dd8c0 R09: 0000000000000001
      [ 2613.402038] R10: 0000000000000000 R11: 0000000000000246 R12: 000000000041bc33
      [ 2613.402041] R13: 0000000000000006 R14: 0000000000000000 R15: 0000000000000000
      [ 2613.402046]  ? __this_cpu_preempt_check+0x13/0x20
      [ 2613.402052] Code: 01 9b fa e0 0f ff e9 28 fe ff ff 80 3d 6a dd 0e 00 00 0f 85 29 fe ff ff 48 c7 c7 48 19 29 a0 c6 05 56 dd 0e 00 01 e8 da 9a fa e0 <0f> ff e9 0f fe ff ff b9 01 00 00 00 ba 01 00 00 00 44 89 e6 48
      [ 2613.402199] ---[ end trace 31f0cfa93ab632bf ]---
      
      Fixes: 5400367a ("drm/i915: Ensure the engine is idle before manually changing HWS")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170530121334.17364-2-chris@chris-wilson.co.ukReviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      (cherry picked from commit a091d4ee)
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      d9533f19
    • Chris Wilson's avatar
      drm/i915: Short-circuit i915_gem_wait_for_idle() if already idle · e0da1963
      Chris Wilson authored
      If the device is asleep (no GT wakeref), we know the GPU is already idle.
      If we add an early return, we can avoid touching registers and checking
      hw state outside of the assumed GT wakelock. This prevents causing such
      errors whilst debugging:
      
      [ 2613.401647] RPM wakelock ref not held during HW access
      [ 2613.401684] ------------[ cut here ]------------
      [ 2613.401720] WARNING: CPU: 5 PID: 7739 at drivers/gpu/drm/i915/intel_drv.h:1787 gen6_read32+0x21f/0x2b0 [i915]
      [ 2613.401731] Modules linked in: snd_hda_intel i915 vgem snd_hda_codec_hdmi x86_pkg_temp_thermal intel_powerclamp snd_hda_codec_realtek coretemp snd_hda_codec_generic crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_hda_codec snd_hwdep snd_hda_core snd_pcm r8169 mii mei_me lpc_ich mei prime_numbers [last unloaded: i915]
      [ 2613.401823] CPU: 5 PID: 7739 Comm: drv_missed_irq Tainted: G     U          4.12.0-rc2-CI-CI_DRM_421+ #1
      [ 2613.401825] Hardware name: MSI MS-7924/Z97M-G43(MS-7924), BIOS V1.12 02/15/2016
      [ 2613.401840] task: ffff880409e3a740 task.stack: ffffc900084dc000
      [ 2613.401861] RIP: 0010:gen6_read32+0x21f/0x2b0 [i915]
      [ 2613.401863] RSP: 0018:ffffc900084dfce8 EFLAGS: 00010292
      [ 2613.401869] RAX: 000000000000002a RBX: ffff8804016a8000 RCX: 0000000000000006
      [ 2613.401871] RDX: 0000000000000006 RSI: ffffffff81cbf2d9 RDI: ffffffff81c9e3a7
      [ 2613.401874] RBP: ffffc900084dfd18 R08: ffff880409e3afc8 R09: 0000000000000000
      [ 2613.401877] R10: 000000008a1c483f R11: 0000000000000000 R12: 000000000000209c
      [ 2613.401879] R13: 0000000000000001 R14: ffff8804016a8000 R15: ffff8804016ac150
      [ 2613.401882] FS:  00007f39ef3dd8c0(0000) GS:ffff88041fb40000(0000) knlGS:0000000000000000
      [ 2613.401885] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 2613.401887] CR2: 00000000023717c8 CR3: 00000002e7b34000 CR4: 00000000001406e0
      [ 2613.401889] Call Trace:
      [ 2613.401912]  intel_engine_is_idle+0x76/0x90 [i915]
      [ 2613.401931]  i915_gem_wait_for_idle+0xe6/0x1e0 [i915]
      [ 2613.401951]  fault_irq_set+0x40/0x90 [i915]
      [ 2613.401970]  i915_ring_test_irq_set+0x42/0x50 [i915]
      [ 2613.401976]  simple_attr_write+0xc7/0xe0
      [ 2613.401981]  full_proxy_write+0x4f/0x70
      [ 2613.401987]  __vfs_write+0x23/0x120
      [ 2613.401992]  ? rcu_read_lock_sched_held+0x75/0x80
      [ 2613.401996]  ? rcu_sync_lockdep_assert+0x2a/0x50
      [ 2613.401999]  ? __sb_start_write+0xfa/0x1f0
      [ 2613.402004]  vfs_write+0xc5/0x1d0
      [ 2613.402008]  ? trace_hardirqs_on_caller+0xe7/0x1c0
      [ 2613.402013]  SyS_write+0x44/0xb0
      [ 2613.402020]  entry_SYSCALL_64_fastpath+0x1c/0xb1
      [ 2613.402022] RIP: 0033:0x7f39eded6670
      [ 2613.402025] RSP: 002b:00007fffdcdcb1a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
      [ 2613.402030] RAX: ffffffffffffffda RBX: ffffffff81470203 RCX: 00007f39eded6670
      [ 2613.402033] RDX: 0000000000000001 RSI: 000000000041bc33 RDI: 0000000000000006
      [ 2613.402036] RBP: ffffc900084dff88 R08: 00007f39ef3dd8c0 R09: 0000000000000001
      [ 2613.402038] R10: 0000000000000000 R11: 0000000000000246 R12: 000000000041bc33
      [ 2613.402041] R13: 0000000000000006 R14: 0000000000000000 R15: 0000000000000000
      [ 2613.402046]  ? __this_cpu_preempt_check+0x13/0x20
      [ 2613.402052] Code: 01 9b fa e0 0f ff e9 28 fe ff ff 80 3d 6a dd 0e 00 00 0f 85 29 fe ff ff 48 c7 c7 48 19 29 a0 c6 05 56 dd 0e 00 01 e8 da 9a fa e0 <0f> ff e9 0f fe ff ff b9 01 00 00 00 ba 01 00 00 00 44 89 e6 48
      [ 2613.402199] ---[ end trace 31f0cfa93ab632bf ]---
      
      Fixes: 25112b64 ("drm/i915: Wait for all engines to be idle as part of i915_gem_wait_for_idle()")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170530121334.17364-1-chris@chris-wilson.co.ukReviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      (cherry picked from commit 863e9fde)
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      e0da1963
    • Kai Chen's avatar
      drm/i915: Disable decoupled MMIO · 4c4c5655
      Kai Chen authored
      The decoupled MMIO feature doesn't work as intended by HW team. Enabling
      it with forcewake will only make debugging efforts more difficult, so
      let's disable it.
      
      Fixes: 85ee17eb ("drm/i915/bxt: Broxton decoupled MMIO")
      Cc: Zhe Wang <zhe1.wang@intel.com>
      Cc: Praveen Paneri <praveen.paneri@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: intel-gfx@lists.freedesktop.org
      Cc: <stable@vger.kernel.org> # v4.10+
      Signed-off-by: default avatarKai Chen <kai.chen@intel.com>
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170523215812.18328-2-kai.chen@intel.com
      (cherry picked from commit 0051c10a)
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      4c4c5655
    • Michal Wajdeczko's avatar
      drm/i915/guc: Remove stale comment for q_fail · 4ca9a582
      Michal Wajdeczko authored
      This member was dropped long time ago.
      
      Fixes: 774439e1 ("drm/i915/guc: re-optimise i915_guc_client layout")
      Signed-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170518113104.54400-1-michal.wajdeczko@intel.comReviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      (cherry picked from commit 4afc67be)
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      4ca9a582