02 Mar, 2016

1 commit


01 Mar, 2016

1 commit


29 Feb, 2016

2 commits

  • When CONFIG_PM is unset, we get a harmless warning for this driver:

    drivers/iommu/mtk_iommu.c:665:12: error: 'mtk_iommu_suspend' defined but not used [-Werror=unused-function]
    drivers/iommu/mtk_iommu.c:680:12: error: 'mtk_iommu_resume' defined but not used [-Werror=unused-function]

    Marking the functions as __maybe_unused gits rid of the two functions
    and lets the compiler silently drop the object code, while still
    doing syntax checking on them for build-time verification.

    Signed-off-by: Arnd Bergmann
    Fixes: 0df4fabe208d ("iommu/mediatek: Add mt8173 IOMMU driver")
    Signed-off-by: Joerg Roedel

    Arnd Bergmann
     
  • The newly added Mediatek IOMMU driver uses the IOMMU_DMA infrastructure,
    but unlike other such drivers, it does not select 'ARM_DMA_USE_IOMMU',
    which is a prerequisite, leading to a link error:

    warning: (MTK_IOMMU) selects IOMMU_DMA which has unmet direct dependencies (IOMMU_SUPPORT && NEED_SG_DMA_LENGTH)
    drivers/iommu/built-in.o: In function `iommu_put_dma_cookie':
    mtk_iommu.c:(.text+0x11fe): undefined reference to `put_iova_domain'
    drivers/iommu/built-in.o: In function `iommu_dma_init_domain':
    mtk_iommu.c:(.text+0x1316): undefined reference to `init_iova_domain'
    drivers/iommu/built-in.o: In function `__iommu_dma_unmap':
    mtk_iommu.c:(.text+0x1380): undefined reference to `find_iova'

    This adds the same select that the other drivers have. On a related
    note, I wonder if we should just always select ARM_DMA_USE_IOMMU
    whenever any IOMMU driver is enabled. Are there any cases where
    we would enable an IOMMU but not use it?

    Signed-off-by: Arnd Bergmann
    Fixes: 0df4fabe208d ("iommu/mediatek: Add mt8173 IOMMU driver")
    Signed-off-by: Joerg Roedel

    Arnd Bergmann
     

25 Feb, 2016

3 commits


21 Feb, 2016

4 commits

  • Pull x86 fixes from Ingo Molnar:
    "This is unusually large, partly due to the EFI fixes that prevent
    accidental deletion of EFI variables through efivarfs that may brick
    machines. These fixes are somewhat involved to maintain compatibility
    with existing install methods and other usage modes, while trying to
    turn off the 'rm -rf' bricking vector.

    Other fixes are for large page ioremap()s and for non-temporal
    user-memcpy()s"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/mm: Fix vmalloc_fault() to handle large pages properly
    hpet: Drop stale URLs
    x86/uaccess/64: Handle the caching of 4-byte nocache copies properly in __copy_user_nocache()
    x86/uaccess/64: Make the __copy_user_nocache() assembly code more readable
    lib/ucs2_string: Correct ucs2 -> utf8 conversion
    efi: Add pstore variables to the deletion whitelist
    efi: Make efivarfs entries immutable by default
    efi: Make our variable validation list include the guid
    efi: Do variable name validation tests in utf8
    efi: Use ucs2_as_utf8 in efivarfs instead of open coding a bad version
    lib/ucs2_string: Add ucs2 -> utf8 helper functions

    Linus Torvalds
     
  • Pull dmaengine fixes from Vinod Koul:
    "A few fixes for drivers, nothing major here.

    Fixes are: iotdma fix to restart channels, new ID for wildcat PCH,
    residue fix for edma, disable irq for non-cyclic in dw"

    * tag 'dmaengine-fix-4.5-rc5' of git://git.infradead.org/users/vkoul/slave-dma:
    dmaengine: dw: disable BLOCK IRQs for non-cyclic xfer
    dmaengine: edma: fix residue race for cyclic
    dmaengine: dw: pci: add ID for WildcatPoint PCH
    dmaengine: IOATDMA: fix timer code that continues to restart channels during idle

    Linus Torvalds
     
  • Pull clk driver fixes from Stephen Boyd:
    "An assortment of vendor specific clk drivers fixes, most notably
    fallout from adding Tegra210 and rockchip rk3036/rk3368 drivers this
    cycle.

    There's also the random smattering of sparse/checker fixes, a build
    "fix" to get the Tango clk driver to compile because the Kconfig
    symbol was renamed after the fact, and a clk gpio fix for a patch
    mismerge"

    * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (28 commits)
    clk: gpio: Really allow an optional clock= DT property
    Revert "clk: qcom: Specify LE device endianness"
    clk: versatile: mask VCO bits before writing
    clk: tegra: super: Fix sparse warnings for functions not declared as static
    clk: tegra: Fix sparse warnings for functions not declared as static
    clk: tegra: Fix sparse warning for pll_m
    clk: tegra: Use definition for pll_u override bit
    clk: tegra: Fix warning caused by pll_u failing to lock
    clk: tegra: Fix clock sources for Tegra210 EMC
    clk: tegra: Add the APB2APE audio clock on Tegra210
    clk: tegra: Add missing of_node_put()
    clk: tegra: Fix PLLE SS coefficients
    clk: tegra: Fix typos around clearing PLLE bits during enable
    clk: tegra: Do not disable PLLE when under hardware control
    clk: tegra: Fix pllx dyn step calculation
    clk: tegra: pll: Fix potential sleeping-while-atomic
    clk: tegra: Fix the misnaming of nvenc from msenc
    clk: tegra: Fix naming of MISC registers
    clk: tango4: rename ARCH_TANGOX to ARCH_TANGO
    clk: scpi: Fix checking return value of platform_device_register_simple()
    ...

    Linus Torvalds
     
  • Pull more drm fixes from Dave Airlie:
    "Some more fixes trickled in:

    A bunch of VC4 ones since it's a pretty new driver not much chance of
    regressions, and it fixes GPU resets.

    Also one atomic fix, one set of fixes for a common bug in TTM cleanup,
    and one i915 hotplug fix"

    * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
    drm/nouveau: use post-decrement in error handling
    drm/atomic: Allow for holes in connector state, v2.
    drm/i915: Fix hpd live status bits for g4x
    drm/vc4: Use runtime PM to power cycle the device when the GPU hangs.
    drm/vc4: Enable runtime PM.
    drm/vc4: Fix spurious GPU resets due to BO reuse.
    drm/vc4: Drop error message on seqno wait timeouts.
    drm/vc4: Fix -ERESTARTSYS error return from BO waits.
    drm/vc4: Return an ERR_PTR from BO creation instead of NULL.
    drm/vc4: Fix the clear color for the first tile rendered.
    drm/vc4: Validate that WAIT_BO padding is cleared.
    drm/radeon: use post-decrement in error handling
    drm/amdgpu: use post-decrement in error handling

    Linus Torvalds
     

20 Feb, 2016

2 commits

  • Pull s390 fixes from Martin Schwidefsky:
    "Several bug fixes:

    - There are four different stack tracers, and three of them have
    bugs. For 4.5 the bugs are fixed and we prepare a cleanup patch
    for the next merge window.

    - Three bug fixes for the dasd driver in regard to parallel access
    volumes and the new max_dev_sectors block device queue limit

    - The irq restore optimization needs a fixup for memcpy_real

    - The diagnose trace code has a conflict with lockdep"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
    s390/dasd: fix performance drop
    s390/maccess: reduce stnsm instructions
    s390/diag: avoid lockdep recursion
    s390/dasd: fix refcount for PAV reassignment
    s390/dasd: prevent incorrect length error under z/VM after PAV changes
    s390: fix DAT off memory access, e.g. on kdump
    s390/oprofile: fix address range for asynchronous stack
    s390/perf_event: fix address range for asynchronous stack
    s390/stacktrace: add save_stack_trace_regs()
    s390/stacktrace: save full stack traces
    s390/stacktrace: add missing end marker
    s390/stacktrace: fix address ranges for asynchronous and panic stack
    s390/stacktrace: fix save_stack_trace_tsk() for current task

    Linus Torvalds
     
  • Pull Pin control fixes from Linus Walleij:
    "Pin control fixes for the v4.5 series, all are individual driver
    fixes:

    - Fix the PXA2xx driver to export its init function so we do not
    break modular compiles.
    - Hide unused functions in the Nomadik driver.
    - Fix up direction control in the Mediatek driver.
    - Toggle the sunxi GPIO lines to input when you read them on the H3
    GPIO controller, lest you only get garbage.
    - Fix up the number of settings in the MVEBU driver.
    - Fix a serious SMP race condition in the Samsung driver"

    * tag 'pinctrl-v4.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
    pinctrl: samsung: fix SMP race condition
    pinctrl: mvebu: fix num_settings in mpp group assignment
    pinctrl: sunxi: H3 requires irq_read_needs_mux
    pinctrl: mediatek: fix direction control issue
    pinctrl: nomadik: hide unused functions
    pinctrl: pxa: export pxa2xx_pinctrl_init()

    Linus Torvalds
     

19 Feb, 2016

7 commits

  • We need to use post-decrement to get the dma_map_page undone also for
    i==0, and to avoid some very unpleasant behaviour if dma_map_page
    failed already at i==0.

    Signed-off-by: Rasmus Villemoes
    Reviewed-by: Ben Skeggs
    Signed-off-by: Dave Airlie

    Rasmus Villemoes
     
  • Because we record connector_mask using 1 << drm_connector_index now
    the connector_mask should stay the same even when other connectors
    are removed. This was not the case with MST, in that case when removing
    a connector all other connectors may change their index.

    This is fixed by waiting until the first get_connector_state to allocate
    connector_state, and force reallocation when state is too small.

    As a side effect connector arrays no longer have to be preallocated,
    and can be allocated on first use which means a less allocations in
    the page flip only path.

    Changes since v1:
    - Whitespace. (Ville)
    - Call ida_remove when destroying the connector. (Ville)
    - u32 alloc -> int. (Ville)

    Fixes: 14de6c44d149 ("drm/atomic: Remove drm_atomic_connectors_for_crtc.")
    Signed-off-by: Maarten Lankhorst
    Cc: Ville Syrjälä
    Reviewed-by: Lyude
    Reviewed-by: Ville Syrjälä
    Signed-off-by: Dave Airlie

    Maarten Lankhorst
     
  • We mis-merged the original patch from Russell here and so the
    patch went almost all the way, except that we still failed to
    probe when there wasn't a clocks property in the DT node. Allow
    that case by making a negative value from
    of_clk_get_parent_count() into "no parents", like the original
    patch did.

    Fixes: 7ed88aa2efa5 ("clk: fix clk-gpio.c with optional clock= DT property")
    Cc: Russell King
    Cc: Michael Turquette
    Signed-off-by: Stephen Boyd

    Stephen Boyd
     
  • This pull request fixes GPU reset (which was disabled shortly after
    V3D integration due to build breakage) and waits for idle in the
    presence of signals (which X likes to do a lot).

    * tag 'drm-vc4-fixes-2016-02-17' of github.com:anholt/linux:
    drm/vc4: Use runtime PM to power cycle the device when the GPU hangs.
    drm/vc4: Enable runtime PM.
    drm/vc4: Fix spurious GPU resets due to BO reuse.
    drm/vc4: Drop error message on seqno wait timeouts.
    drm/vc4: Fix -ERESTARTSYS error return from BO waits.
    drm/vc4: Return an ERR_PTR from BO creation instead of NULL.
    drm/vc4: Fix the clear color for the first tile rendered.
    drm/vc4: Validate that WAIT_BO padding is cleared.

    Dave Airlie
     
  • Just two small fixes in the ttm_tt_populate error handling; one for radeon,
    one for amdgpu.

    * 'drm-fixes-4.5' of git://people.freedesktop.org/~agd5f/linux:
    drm/radeon: use post-decrement in error handling
    drm/amdgpu: use post-decrement in error handling

    Dave Airlie
     
  • single g4x hpd fix.

    * tag 'drm-intel-fixes-2016-02-18' of git://anongit.freedesktop.org/drm-intel:
    drm/i915: Fix hpd live status bits for g4x

    Dave Airlie
     
  • Pull SCSI fixes from James Bottomley:
    "Two simple fixes.

    One prevents a soft lockup on some target removal scenarios and the
    other prevents us trying to probe the marvell console device, which
    causes it to time out and need the bus resetting"

    * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
    scsi: fix soft lockup in scsi_remove_target() on module removal
    SCSI: Add Marvell configuration device to VPD blacklist

    Linus Torvalds
     

18 Feb, 2016

2 commits

  • Pull block fixes from Jens Axboe:
    "A collection of fixes from the past few weeks that should go into 4.5.
    This contains:

    - Overflow fix for sysfs discard show function from Alan.

    - A stacking limit init fix for max_dev_sectors, so we don't end up
    artificially capping some use cases. From Keith.

    - Have blk-mq proper end unstarted requests on a dying queue, instead
    of pushing that to the driver. From Keith.

    - NVMe:
    - Update to Kconfig description for NVME_SCSI, since it was
    vague and having it on is important for some SUSE distros.
    From Christoph.
    - Set of fixes from Keith, around surprise removal. Also kills
    the no-merge flag, so it supports merging.

    - Set of fixes for lightnvm from Matias, Javier, and Wenwei.

    - Fix null_blk oops when asked for lightnvm, but not available. From
    Matias.

    - Copy-to-user EINTR fix from Hannes, fixing a case where SG_IO fails
    if interrupted by a signal.

    - Two floppy fixes from Jiri, fixing signal handling and blocking
    open.

    - A use-after-free fix for O_DIRECT, from Mike Krinkin.

    - A block module ref count fix from Roman Pen.

    - An fs IO wait accounting fix for O_DSYNC from Stephane Gasparini.

    - Smaller reallo fix for xen-blkfront from Bob Liu.

    - Removal of an unused struct member in the deadline IO scheduler,
    from Tahsin.

    - Also from Tahsin, properly initialize inode struct members
    associated with cgroup writeback, if enabled.

    - From Tejun, ensure that we keep the superblock pinned during cgroup
    writeback"

    * 'for-linus' of git://git.kernel.dk/linux-block: (25 commits)
    blk: fix overflow in queue_discard_max_hw_show
    writeback: initialize inode members that track writeback history
    writeback: keep superblock pinned during cgroup writeback association switches
    bio: return EINTR if copying to user space got interrupted
    NVMe: Rate limit nvme IO warnings
    NVMe: Poll device while still active during remove
    NVMe: Requeue requests on suspended queues
    NVMe: Allow request merges
    NVMe: Fix io incapable return values
    blk-mq: End unstarted requests on dying queue
    block: Initialize max_dev_sectors to 0
    null_blk: oops when initializing without lightnvm
    block: fix module reference leak on put_disk() call for cgroups throttle
    nvme: fix Kconfig description for BLK_DEV_NVME_SCSI
    kernel/fs: fix I/O wait not accounted for RW O_DSYNC
    floppy: refactor open() flags handling
    lightnvm: allow to force mm initialization
    lightnvm: check overflow and correct mlc pairs
    lightnvm: fix request intersection locking in rrpc
    lightnvm: warn if irqs are disabled in lock laddr
    ...

    Linus Torvalds
     
  • Pull DeviceTree fixes from Rob Herring:

    - Fix irq msi-map calculation for nonzero rid-base.

    - Binding doc updates for GICv3, fsl-imx-uart, and S3C RTC.

    * tag 'devicetree-fixes-for-4.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
    rtc: s3c: Document required clocks in the DT binding
    serial: fsl-imx-uart: Fix typo in fsl,dte-mode description
    dt-bindings: arm, gic-v3: require that reserved cells are always 0
    of/irq: Fix msi-map calculation for nonzero rid-base

    Linus Torvalds
     

17 Feb, 2016

18 commits

  • As the number of io-pgtable implementations grows beyond 1, it's time
    to rationalise the quirks mechanism before things have a chance to
    start getting really ugly and out-of-hand.

    To that end:
    - Indicate exactly which quirks each format can/does support.
    - Fail creating a table if a caller wants unsupported quirks.
    - Properly document where each quirk applies and why.

    Reviewed-by: Laurent Pinchart
    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • In certain unmapping situations it is quite possible to end up issuing
    back-to-back TLB synchronisations, which at best is a waste of time and
    effort, and at worst causes some hardware to get rather confused. Whilst
    the pagetable implementations, or the IOMMU drivers, or both, could keep
    track of things to avoid this happening, it seems to make the most sense
    to prevent code duplication and add some simple state tracking in the
    common interface between the two.

    Reviewed-by: Laurent Pinchart
    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • Add some simple wrappers to avoid having the guts of the TLB operations
    spilled all over the page table implementations, and to provide a point
    to implement extra common functionality.

    Acked-by: Will Deacon
    Acked-by: Laurent Pinchart
    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • Add a nearly-complete ARMv7 short descriptor implementation, omitting
    only a few legacy and CPU-centric aspects which shouldn't be necessary
    for IOMMU API use anyway.

    Reviewed-by: Yong Wu
    Tested-by: Yong Wu
    Signed-off-by: Yong Wu
    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • Looks like g4x hpd live status bits actually agree with the spec. At
    least they do on the machine I have, and apparently on Nick Bowler's
    g4x as well.

    So gm45 may be the only platform where they don't agree. At least
    that seems to be the case based on the (somewhat incomplete)
    logs/dumps in [1], and Daniel has also tested this on his gm45
    sometime in the past.

    So let's change the bits to match the spec on g4x. That actually makes
    the g4x bits identical to vlv/chv so we can just share the code
    between those platforms, leaving gm45 as the special case.

    [1] https://bugzilla.kernel.org/show_bug.cgi?id=52361

    Cc: Shashank Sharma
    Cc: Sonika Jindal
    Cc: Daniel Vetter
    Cc: Jani Nikula
    Cc: Nick Bowler
    References: https://lists.freedesktop.org/archives/dri-devel/2016-February/100382.html
    Reported-by: Nick Bowler
    Cc: stable@vger.kernel.org
    Fixes: 237ed86c693d ("drm/i915: Check live status before reading edid")
    Signed-off-by: Ville Syrjälä
    Link: http://patchwork.freedesktop.org/patch/msgid/1455127145-20087-1-git-send-email-ville.syrjala@linux.intel.com
    Reviewed-by: Daniel Vetter
    (cherry picked from commit 0780cd36c7af70c55981ee624084f0f48cae9b95)
    Signed-off-by: Jani Nikula

    Ville Syrjälä
     
  • Looks like the HPET spec at intel.com got moved.
    It isn't hard to find so drop the link, just mention
    the revision assumed.

    Suggested-by: Thomas Gleixner
    Signed-off-by: Michael S. Tsirkin
    Acked-by: Greg Kroah-Hartman
    Cc: Arnd Bergmann
    Cc: Clemens Ladisch
    Cc: Jonathan Corbet
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: linux-doc@vger.kernel.org
    Link: http://lkml.kernel.org/r/1455145462-3877-1-git-send-email-mst@redhat.com
    Signed-off-by: Ingo Molnar

    Michael S. Tsirkin
     
  • Commit ca369d51b ("sd: Fix device-imposed transfer length limits")
    introduced a new queue limit max_dev_sectors which limits the maximum
    sectors for requests. The default value leads to small dasd requests
    and therefor to a performance drop.
    Set the max_dev_sectors value to the same value as the max_hw_sectors
    to use the maximum available request size for DASD devices.

    Signed-off-by: Stefan Haberland
    Cc: stable@vger.kernel.org # 4.4+
    Signed-off-by: Martin Schwidefsky

    Stefan Haberland
     
  • The qxl_gem_prime_mmap() function returns ENOSYS instead of -ENOSYS

    Signed-off-by: Anton Protopopov
    Signed-off-by: Dave Airlie

    Anton Protopopov
     
  • In the display resume path, move the calls to drm_vblank_on()
    after the point when the display engine is running again.

    Since changes were made to drm_update_vblank_count() in Linux 4.4+
    to emulate hw vblank counters via vblank timestamping, the function
    drm_vblank_on() now needs working high precision vblank timestamping
    and therefore working scanout position queries at time of call.
    These don't work before the display engine gets restarted, causing
    miscalculation of vblank counter increments and thereby large forward
    jumps in vblank count at display resume. These jumps can cause client
    hangs on resume, or desktop hangs in the case of composited desktops.

    Fix this Linux 4.4 regression by reordering calls accordingly.

    Signed-off-by: Mario Kleiner
    Cc: # 4.4+
    Cc: Ben Skeggs
    Cc: ville.syrjala@linux.intel.com
    Cc: daniel.vetter@ffwll.ch
    Cc: dri-devel@lists.freedesktop.org
    Reviewed-by: Daniel Vetter
    Signed-off-by: Dave Airlie

    Mario Kleiner
     
  • Make sure that drm_vblank_get/put() stay balanced in
    case drm_vblank_get fails, by skipping the corresponding
    put.

    Signed-off-by: Mario Kleiner
    Reviewed-by: Daniel Vetter
    Cc: michel@daenzer.net
    Cc: dri-devel@lists.freedesktop.org
    Cc: alexander.deucher@amd.com
    Cc: christian.koenig@amd.com
    Signed-off-by: Dave Airlie

    Mario Kleiner
     
  • drm_vblank_offdelay can have three different types of values:

    < 0 is to be always treated the same as dev->vblank_disable_immediate
    = 0 is to be treated as "never disable vblanks"
    > 0 is to be treated as disable immediate if kms driver wants it
    that way via dev->vblank_disable_immediate. Otherwise it is
    a disable timeout in msecs.

    This got broken in Linux 3.18+ for the implementation of
    drm_vblank_on. If the user specified a value of zero which should
    always reenable vblank irqs in this function, a kms driver could
    override the users choice by setting vblank_disable_immediate
    to true. This patch fixes the regression and keeps the user in
    control.

    v2: Only reenable vblank if there are clients left or the user
    requested to "never disable vblanks" via offdelay 0. Enabling
    vblanks even in the "delayed disable" case (offdelay > 0) was
    specifically added by Ville in commit cd19e52aee922
    ("drm: Kick start vblank interrupts at drm_vblank_on()"),
    but after discussion it turns out that this was done by accident.

    Citing Ville: "I think it just ended up as a mess due to changing
    some of the semantics of offdelay
    Reviewed-by: Daniel Vetter

    Cc: # 3.18+
    Cc: michel@daenzer.net
    Cc: vbabka@suse.cz
    Cc: ville.syrjala@linux.intel.com
    Cc: daniel.vetter@ffwll.ch
    Cc: dri-devel@lists.freedesktop.org
    Cc: alexander.deucher@amd.com
    Cc: christian.koenig@amd.com
    Signed-off-by: Dave Airlie

    Mario Kleiner
     
  • Changes to drm_update_vblank_count() in Linux 4.4 broke the
    behaviour of the pre/post modeset functions as the new update
    code doesn't deal with hw vblank counter resets inbetween calls
    to drm_vblank_pre_modeset an drm_vblank_post_modeset, as it
    should.

    This causes mistreatment of such hw counter resets as counter
    wraparound, and thereby large forward jumps of the software
    vblank counter which in turn cause vblank event dispatching
    and vblank waits to fail/hang --> userspace clients hang.

    This symptom was reported on radeon-kms to cause a infinite
    hang of KDE Plasma 5 shell's login procedure, preventing users
    from logging in.

    Fix this by detecting when drm_update_vblank_count() is called
    inside a pre->post modeset interval. If so, clamp valid vblank
    increments to the safe values 0 and 1, pretty much restoring
    the update behavior of the old update code of Linux 4.3 and
    earlier. Also reset the last recorded hw vblank count at call
    to drm_vblank_post_modeset() to be safe against hw that after
    modesetting, dpms on etc. only fires its first vblank irq after
    drm_vblank_post_modeset() was already called.

    Reported-by: Vlastimil Babka
    Signed-off-by: Mario Kleiner
    Reviewed-by: Daniel Vetter
    Tested-by: Vlastimil Babka

    Cc: # 4.4+
    Cc: michel@daenzer.net
    Cc: vbabka@suse.cz
    Cc: ville.syrjala@linux.intel.com
    Cc: daniel.vetter@ffwll.ch
    Cc: dri-devel@lists.freedesktop.org
    Cc: alexander.deucher@amd.com
    Cc: christian.koenig@amd.com
    Signed-off-by: Dave Airlie

    Mario Kleiner
     
  • This fixes a regression introduced by the new drm_update_vblank_count()
    implementation in Linux 4.4:

    Restrict the bump of the software vblank counter in drm_update_vblank_count()
    to a safe maximum value of +1 whenever there is the possibility that
    concurrent readers of vblank timestamps could be active at the moment,
    as the current implementation of the timestamp caching and updating is
    not safe against concurrent readers for calls to store_vblank() with a
    bump of anything but +1. A bump != 1 would very likely return corrupted
    timestamps to userspace, because the same slot in the cache could
    be concurrently written by store_vblank() and read by one of those
    readers in a non-atomic fashion and without the read-retry logic
    detecting this collision.

    Concurrent readers can exist while drm_update_vblank_count() is called
    from the drm_vblank_off() or drm_vblank_on() functions or other non-vblank-
    irq callers. However, all those calls are happening with the vbl_lock
    locked thereby preventing a drm_vblank_get(), so the vblank refcount
    can't increase while drm_update_vblank_count() is executing. Therefore
    a zero vblank refcount during execution of that function signals that
    is safe for arbitrary counter bumps if called from outside vblank irq,
    whereas a non-zero count is not safe.

    Whenever the function is called from vblank irq, we have to assume concurrent
    readers could show up any time during its execution, even if the refcount
    is currently zero, as vblank irqs are usually only enabled due to the
    presence of readers, and because when it is called from vblank irq it
    can't hold the vbl_lock to protect it from sudden bumps in vblank refcount.
    Therefore also restrict bumps to +1 when the function is called from vblank
    irq.

    Such bumps of more than +1 can happen at other times than reenabling
    vblank irqs, e.g., when regular vblank interrupts get delayed by more
    than 1 frame due to long held locks, long irq off periods, realtime
    preemption on RT kernels, or system management interrupts.

    A better solution would be to rewrite the timestamp caching to use
    full seqlocks to allow concurrent writes and reads for arbitrary
    vblank counter increments.

    v2: Add code comment that this is essentially a hack and should
    be replaced by a full seqlock implementation for caching of
    timestamps.

    Signed-off-by: Mario Kleiner
    Reviewed-by: Daniel Vetter

    Cc: # 4.4+
    Cc: michel@daenzer.net
    Cc: vbabka@suse.cz
    Cc: ville.syrjala@linux.intel.com
    Cc: daniel.vetter@ffwll.ch
    Cc: dri-devel@lists.freedesktop.org
    Cc: alexander.deucher@amd.com
    Cc: christian.koenig@amd.com
    Signed-off-by: Dave Airlie

    Mario Kleiner
     
  • Otherwise if a kms driver calls into drm_vblank_off() more than once
    before calling drm_vblank_on() again, the redundant calls to
    vblank_disable_and_save() will call drm_update_vblank_count()
    while hw vblank counters and vblank timestamping are in a undefined
    state during modesets, dpms off etc.

    At least with the legacy drm helpers it is not unusual to
    get multiple calls to drm_vblank_off and drm_vblank_on, e.g.,
    half a dozen calls to drm_vblank_off and two calls to drm_vblank_on
    were observed on radeon-kms during dpms-off -> dpms-on transition.

    We don't no-op calls from atomic modesetting drivers, as they
    should do a proper job of tracking hw state.

    Fixes large jumps of the software maintained vblank counter due to
    the hardware vblank counter resetting to zero during dpms off or
    modeset, e.g., if radeon-kms is modified to use drm_vblank_off/on
    instead of drm_vblank_pre/post_modeset().

    This fixes a regression caused by the changes made to
    drm_update_vblank_count() in Linux 4.4.

    v2: Don't no-op on atomic modesetting drivers, per suggestion
    of Daniel Vetter.

    Signed-off-by: Mario Kleiner
    Reviewed-by: Daniel Vetter
    Cc: # 4.4+
    Cc: michel@daenzer.net
    Cc: vbabka@suse.cz
    Cc: ville.syrjala@linux.intel.com
    Cc: alexander.deucher@amd.com
    Cc: christian.koenig@amd.com
    Signed-off-by: Dave Airlie

    Mario Kleiner
     
  • This avoids integer overflows on 32bit machines when calculating
    reloc_info size, as reported by Alan Cox.

    Cc: stable@vger.kernel.org
    Cc: gnomes@lxorguk.ukuu.org.uk
    Signed-off-by: Gerd Hoffmann
    Reviewed-by: Daniel Vetter
    Signed-off-by: Dave Airlie

    Gerd Hoffmann
     
  • …/daeinki/drm-exynos into drm-fixes

    Summary:
    - fix compilation warnings on ARM64bit.
    - fix mic driver initialization.
    . MIC is a part of KMS so it converts it to use component framework
    like other KMS drivers did.
    - fix wrong driver state and disable clock order on DECON driver.
    - fix incorrect use of dma_mmap_attrs function.

    * 'exynos-drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos:
    drm/exynos/decon: fix disable clocks order
    drm/exynos: fix incorrect cpu address for dma_mmap_attrs()
    drm/exynos: exynos5433_decon: fix wrong state in decon_vblank_enable
    drm/exynos: exynos5433_decon: fix wrong state assignment in decon_enable
    drm/exynos: dsi: restore support for drm bridge
    drm/exynos: mic: make all functions static
    drm/exynos: mic: convert to component framework
    drm/exynos: mic: use devm_clk interface
    drm/exynos: fix types for compilation on 64bit architectures
    drm/exynos: ipp: fix incorrect format specifiers in debug messages
    drm/exynos: depend on ARCH_EXYNOS for DRM_EXYNOS

    Dave Airlie
     
  • This reverts commit cfcfa086d43ced33e1099b9befb12f17fca102e1.

    This causes the tiling properties to break in some unexpected ways,

    Revert it for now.

    Cc: stable@vger.kernel.org
    Signed-off-by: Dave Airlie

    Dave Airlie
     
  • This gets us functional GPU reset again, like we had until a refactor
    at merge time. Tested with a little patch to stuff in a broken binner
    job every 100 frames.

    Signed-off-by: Eric Anholt

    Eric Anholt