Skip to content
Snippets Groups Projects
  1. Feb 22, 2019
  2. Dec 14, 2018
  3. Nov 05, 2018
  4. Oct 08, 2018
    • Mikulas Patocka's avatar
      udlfb: handle unplug properly · 68a958a9
      Mikulas Patocka authored
      
      The udlfb driver maintained an open count and cleaned up itself when the
      count reached zero. But the console is also counted in the reference count
      - so, if the user unplugged the device, the open count would not drop to
      zero and the driver stayed loaded with console attached. If the user
      re-plugged the adapter, it would create a device /dev/fb1, show green
      screen and the access to the console would be lost.
      
      The framebuffer subsystem has reference counting on its own - in order to
      fix the unplug bug, we rely the framebuffer reference counting. When the
      user unplugs the adapter, we call unregister_framebuffer unconditionally.
      unregister_framebuffer will unbind the console, wait until all users stop
      using the framebuffer and then call the fb_destroy method. The fb_destroy
      cleans up the USB driver.
      
      This patch makes the following changes:
      * Drop dlfb->kref and rely on implicit framebuffer reference counting
        instead.
      * dlfb_usb_disconnect calls unregister_framebuffer, the rest of driver
        cleanup is done in the function dlfb_ops_destroy. dlfb_ops_destroy will
        be called by the framebuffer subsystem when no processes have the
        framebuffer open or mapped.
      * We don't use workqueue during initialization, but initialize directly
        from dlfb_usb_probe. The workqueue could race with dlfb_usb_disconnect
        and this racing would produce various kinds of memory corruption.
      * We use usb_get_dev and usb_put_dev to make sure that the USB subsystem
        doesn't free the device under us.
      
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      cc: Dave Airlie <airlied@redhat.com>
      Cc: Bernie Thompson <bernie@plugable.com>,
      Cc: Ladislav Michl <ladis@linux-mips.org>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      68a958a9
  5. Jul 25, 2018
    • Mikulas Patocka's avatar
      udlfb: allow reallocating the framebuffer · 7433914e
      Mikulas Patocka authored
      
      This patch changes udlfb so that it may reallocate the framebuffer when
      setting higher-resolution mode. If we boot the system without monitor
      attached, udlfb creates a framebuffer with the size 800x600. This patch
      makes it possible to select higher videomode with the fbset command when
      a monitor is attached.
      
      Note that there is no reliable way to prevent the system from touching the
      old framebuffer, so we must not free it. We add it to the list
      dlfb->deferred_free and free it when the driver is unloaded.
      
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      [b.zolnierkie: sparse fixes]
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      7433914e
    • Mikulas Patocka's avatar
      udlfb: set optimal write delay · bb24153a
      Mikulas Patocka authored
      
      The default delay 5 jiffies is too much when the kernel is compiled with
      HZ=100 - it results in jumpy cursor in Xwindow.
      
      In order to find out the optimal delay, I benchmarked the driver on
      1280x720x30fps video. I found out that with HZ=1000, 10ms is acceptable,
      but with HZ=250 or HZ=300, we need 4ms, so that the video is played
      without any frame skips.
      
      This patch changes the delay to this value.
      
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      bb24153a
    • Mikulas Patocka's avatar
      udlfb: make a local copy of fb_ops · 2c29cfc3
      Mikulas Patocka authored
      
      The defio subsystem overwrites the method fb_osp->mmap. That method is
      stored in module's static data - and that means that if we have multiple
      diplaylink adapters, they will over write each other's method.
      
      In order to avoid interference between multiple adapters, we copy the
      fb_ops structure to a device-local memory.
      
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      2c29cfc3
    • Mikulas Patocka's avatar
      udlfb: don't switch if we are switching to the same videomode · 564f1807
      Mikulas Patocka authored
      
      The udlfb driver reprograms the hardware everytime the user switches the
      console, that makes quite unusable when working on the console.
      
      This patch makes the driver remember the videomode we are in and avoid
      reprogramming the hardware if we switch to the same videomode.
      
      We mask the "activate" field and the "FB_VMODE_SMOOTH_XPAN" flag when
      comparing the videomode, because they cause spurious switches when
      switching to and from the Xserver.
      
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      564f1807
    • Mikulas Patocka's avatar
      udlfb: fix semaphore value leak · 9d0aa601
      Mikulas Patocka authored
      
      I observed that the performance of the udl fb driver degrades over time.
      On a freshly booted machine, it takes 6 seconds to do "ls -la /usr/bin";
      after some time of use, the same operation takes 14 seconds.
      
      The reason is that the value of "limit_sem" decays over time.
      
      The udl driver uses a semaphore "limit_set" to specify how many free urbs
      are there on dlfb->urbs.list. If the count is zero, the "down" operation
      will sleep until some urbs are added to the freelist.
      
      In order to avoid some hypothetical deadlock, the driver will not call
      "up" immediately, but it will offload it to a workqueue. The problem is
      that if we call "schedule_delayed_work" on the same work item multiple
      times, the work item may only be executed once.
      
      This is happening:
      * some urb completes
      * dlfb_urb_completion adds it to the free list
      * dlfb_urb_completion calls schedule_delayed_work to schedule the function
        dlfb_release_urb_work to increase the semaphore count
      * as the urb is on the free list, some other task grabs it and submits it
      * the submitted urb completes, dlfb_urb_completion is called again
      * dlfb_urb_completion calls schedule_delayed_work, but the work is already
        scheduled, so it does nothing
      * finally, dlfb_release_urb_work is called, it increases the semaphore
        count by 1, although it should increase it by 2
      
      So, the semaphore count is decreasing over time, and this causes gradual
      performance degradation.
      
      Note that in the current kernel, the "up" function may be called from
      interrupt and it may race with the "down" function called by another
      thread, so we don't have to offload the call of "up" to a workqueue at
      all. This patch removes the workqueue code. The patch also changes
      "down_interruptible" to "down" in dlfb_free_urb_list, so that we will
      clean up the driver properly even if a signal arrives.
      
      With this patch, the performance of udlfb no longer degrades.
      
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Cc: stable@vger.kernel.org
      [b.zolnierkie: fix immediatelly -> immediately typo]
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      9d0aa601
    • vkorjani's avatar
      drm: Add support for pps and compression mode command packet · ea107a18
      vkorjani authored
      
      After enabling DSC we need to send compression mode command packet
      and pps data packet, for which 2 new data types are added
      07h  Compression Mode Data Type Write , short write, 2 parameters
      0Ah  PPS Long Write (word count determines number of bytes)
      This patch adds support to send these packets.
      
      Cc: David Airlie <airlied@linux.ie>
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: dri-devel@lists.freedesktop.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-fbdev@vger.kernel.org
      
      Changes in v3:
      - None
      
      Signed-off-by: default avatarvkorjani <vikas.korjani@intel.com>
      [seanpaul removed pps_write_buffer fn, added types to packet_format helpers]
      Signed-off-by: default avatarSean Paul <seanpaul@chromium.org>
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      ea107a18
  6. May 14, 2018
  7. May 05, 2018
    • Mauro Carvalho Chehab's avatar
      media: include/video/omapfb_dss.h: use IS_ENABLED() · f10379aa
      Mauro Carvalho Chehab authored
      
      Just checking for ifdefs cause build issues as reported by
      kernel test:
      
      config: openrisc-allmodconfig (attached as .config)
      compiler: or1k-linux-gcc (GCC) 6.0.0 20160327 (experimental)
      
      All errors (new ones prefixed by >>):
      
         drivers/video/fbdev/omap2/omapfb/omapfb-main.c: In function 'omapfb_init_connections':
      >> drivers/video/fbdev/omap2/omapfb/omapfb-main.c:2396:8: error: implicit declaration of function 'omapdss_find_mgr_from_display' [-Werror=implicit-function-declaration]
           mgr = omapdss_find_mgr_from_display(def_dssdev);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         drivers/video/fbdev/omap2/omapfb/omapfb-main.c:2396:6: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
           mgr = omapdss_find_mgr_from_display(def_dssdev);
               ^
         drivers/video/fbdev/omap2/omapfb/omapfb-main.c: In function 'omapfb_find_default_display':
      >> drivers/video/fbdev/omap2/omapfb/omapfb-main.c:2430:13: error: implicit declaration of function 'omapdss_get_default_display_name' [-Werror=implicit-function-declaration]
           def_name = omapdss_get_default_display_name();
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         drivers/video/fbdev/omap2/omapfb/omapfb-main.c:2430:11: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
           def_name = omapdss_get_default_display_name();
                    ^
      
      So, use IS_ENABLED() instead.
      
      Fixes: 771f7be8 ("media: omapfb: omapfb_dss.h: add stubs to build with COMPILE_TEST && DRM_OMAP")
      
      Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Cc: tomi.valkeinen@ti.com
      Cc: linux-omap@vger.kernel.org
      Cc: linux-fbdev@vger.kernel.org
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      f10379aa
  8. May 04, 2018
  9. Mar 12, 2018
  10. Jan 15, 2018
  11. Jan 01, 2018
  12. Dec 19, 2017
  13. Nov 09, 2017
  14. Nov 02, 2017
    • Greg Kroah-Hartman's avatar
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman authored
      
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      
      Reviewed-by: default avatarKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: default avatarPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  15. Jun 08, 2017
  16. Jun 01, 2017
  17. May 10, 2017
    • Nicolas Dichtel's avatar
      uapi: export all headers under uapi directories · fcc8487d
      Nicolas Dichtel authored
      
      Regularly, when a new header is created in include/uapi/, the developer
      forgets to add it in the corresponding Kbuild file. This error is usually
      detected after the release is out.
      
      In fact, all headers under uapi directories should be exported, thus it's
      useless to have an exhaustive list.
      
      After this patch, the following files, which were not exported, are now
      exported (with make headers_install_all):
      asm-arc/kvm_para.h
      asm-arc/ucontext.h
      asm-blackfin/shmparam.h
      asm-blackfin/ucontext.h
      asm-c6x/shmparam.h
      asm-c6x/ucontext.h
      asm-cris/kvm_para.h
      asm-h8300/shmparam.h
      asm-h8300/ucontext.h
      asm-hexagon/shmparam.h
      asm-m32r/kvm_para.h
      asm-m68k/kvm_para.h
      asm-m68k/shmparam.h
      asm-metag/kvm_para.h
      asm-metag/shmparam.h
      asm-metag/ucontext.h
      asm-mips/hwcap.h
      asm-mips/reg.h
      asm-mips/ucontext.h
      asm-nios2/kvm_para.h
      asm-nios2/ucontext.h
      asm-openrisc/shmparam.h
      asm-parisc/kvm_para.h
      asm-powerpc/perf_regs.h
      asm-sh/kvm_para.h
      asm-sh/ucontext.h
      asm-tile/shmparam.h
      asm-unicore32/shmparam.h
      asm-unicore32/ucontext.h
      asm-x86/hwcap2.h
      asm-xtensa/kvm_para.h
      drm/armada_drm.h
      drm/etnaviv_drm.h
      drm/vgem_drm.h
      linux/aspeed-lpc-ctrl.h
      linux/auto_dev-ioctl.h
      linux/bcache.h
      linux/btrfs_tree.h
      linux/can/vxcan.h
      linux/cifs/cifs_mount.h
      linux/coresight-stm.h
      linux/cryptouser.h
      linux/fsmap.h
      linux/genwqe/genwqe_card.h
      linux/hash_info.h
      linux/kcm.h
      linux/kcov.h
      linux/kfd_ioctl.h
      linux/lightnvm.h
      linux/module.h
      linux/nbd-netlink.h
      linux/nilfs2_api.h
      linux/nilfs2_ondisk.h
      linux/nsfs.h
      linux/pr.h
      linux/qrtr.h
      linux/rpmsg.h
      linux/sched/types.h
      linux/sed-opal.h
      linux/smc.h
      linux/smc_diag.h
      linux/stm.h
      linux/switchtec_ioctl.h
      linux/vfio_ccw.h
      linux/wil6210_uapi.h
      rdma/bnxt_re-abi.h
      
      Note that I have removed from this list the files which are generated in every
      exported directories (like .install or .install.cmd).
      
      Thanks to Julien Floret <julien.floret@6wind.com> for the tip to get all
      subdirs with a pure makefile command.
      
      For the record, note that exported files for asm directories are a mix of
      files listed by:
       - include/uapi/asm-generic/Kbuild.asm;
       - arch/<arch>/include/uapi/asm/Kbuild;
       - arch/<arch>/include/asm/Kbuild.
      
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Acked-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      Acked-by: default avatarMark Salter <msalter@redhat.com>
      Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      fcc8487d
  18. Apr 21, 2017
  19. Mar 21, 2017
  20. Mar 16, 2017
  21. Mar 15, 2017
  22. Feb 07, 2017
  23. Nov 14, 2016
  24. Nov 07, 2016
  25. Nov 02, 2016
  26. Oct 20, 2016
  27. Sep 27, 2016
Loading