1. 17 May, 2018 10 commits
  2. 16 May, 2018 17 commits
    • Maxime Ripard's avatar
      media: dt-bindings: media: Add Cadence MIPI-CSI2 TX Device Tree bindings · 844ef042
      Maxime Ripard authored
      
      
      The Cadence MIPI-CSI2 TX controller is a CSI2 bridge that supports up to 4
      video streams and can output on up to 4 CSI-2 lanes, depending on the
      hardware implementation.
      
      It can operate with an external D-PHY, an internal one or no D-PHY at all
      in some configurations.
      Acked-by: default avatarBenoit Parrot <bparrot@ti.com>
      Acked-by: Rob Herring's avatarRob Herring <robh@kernel.org>
      Reviewed-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@bootlin.com>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      844ef042
    • Maxime Ripard's avatar
      media: v4l: cadence: Add Cadence MIPI-CSI2 RX driver · 1fc3b37f
      Maxime Ripard authored
      
      
      The Cadence CSI-2 RX Controller is an hardware block meant to be used as a
      bridge between a CSI-2 bus and pixel grabbers.
      
      It supports operating with internal or external D-PHY, with up to 4 lanes,
      or without any D-PHY. The current code only supports the latter case.
      
      It also support dynamic mapping of the CSI-2 virtual channels to the
      associated pixel grabbers, but that isn't allowed at the moment either.
      Acked-by: default avatarBenoit Parrot <bparrot@ti.com>
      Reviewed-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@bootlin.com>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      1fc3b37f
    • Maxime Ripard's avatar
      media: dt-bindings: media: Add Cadence MIPI-CSI2 RX Device Tree bindings · 3290aa63
      Maxime Ripard authored
      
      
      The Cadence MIPI-CSI2 RX controller is a CSI2RX bridge that supports up to
      4 CSI-2 lanes, and can route the frames to up to 4 streams, depending on
      the hardware implementation.
      
      It can operate with an external D-PHY, an internal one or no D-PHY at all
      in some configurations.
      Acked-by: Rob Herring's avatarRob Herring <robh@kernel.org>
      Acked-by: default avatarBenoit Parrot <bparrot@ti.com>
      Reviewed-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      Reviewed-by: Laurent Pinchart's avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@bootlin.com>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      3290aa63
    • Sakari Ailus's avatar
      media: staging: atomisp: Remove driver · 51b8dc51
      Sakari Ailus authored
      
      
      The atomisp driver has a long list of todo items and little has been done
      to address these lately while more has been added. The driver is also not
      functional. In other words, the driver would not be getting out of staging
      in the foreseeable future. At the same time it consumes developer
      resources in order to maintain the flaky code base. Remove it.
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      51b8dc51
    • Mauro Carvalho Chehab's avatar
      media: atomisp-mt9m114: comment out unused stuff · 6522aa1b
      Mauro Carvalho Chehab authored
      
      
      There are lots of data structs defined there but aren't used
      anywhere.
      
      Comment them out. Gets rid of those warnings:
      
      drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:1808:45: warning: 'mt9m114_entity_ops' defined but not used [-Wunused-const-variable=]
       static const struct media_entity_operations mt9m114_entity_ops = {
                                                   ^~~~~~~~~~~~~~~~~~
      In file included from drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:35:0:
      drivers/staging/media/atomisp/i2c/mt9m114.h:805:34: warning: 'mt9m114_iq' defined but not used [-Wunused-const-variable=]
       static struct misensor_reg const mt9m114_iq[] = {
                                        ^~~~~~~~~~
      drivers/staging/media/atomisp/i2c/mt9m114.h:797:34: warning: 'mt9m114_antiflicker_60hz' defined but not used [-Wunused-const-variable=]
       static struct misensor_reg const mt9m114_antiflicker_60hz[] = {
                                        ^~~~~~~~~~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/mt9m114.h:789:34: warning: 'mt9m114_antiflicker_50hz' defined but not used [-Wunused-const-variable=]
       static struct misensor_reg const mt9m114_antiflicker_50hz[] = {
                                        ^~~~~~~~~~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/mt9m114.h:682:34: warning: 'mt9m114_720_480P_init' defined but not used [-Wunused-const-variable=]
       static struct misensor_reg const mt9m114_720_480P_init[] = {
                                        ^~~~~~~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/mt9m114.h:533:34: warning: 'mt9m114_960P_init' defined but not used [-Wunused-const-variable=]
       static struct misensor_reg const mt9m114_960P_init[] = {
                                        ^~~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/mt9m114.h:518:34: warning: 'mt9m114_wakeup_reg' defined but not used [-Wunused-const-variable=]
       static struct misensor_reg const mt9m114_wakeup_reg[] = {
                                        ^~~~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/mt9m114.h:504:34: warning: 'mt9m114_streaming' defined but not used [-Wunused-const-variable=]
       static struct misensor_reg const mt9m114_streaming[] = {
                                        ^~~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/mt9m114.h:497:34: warning: 'mt9m114_suspend' defined but not used [-Wunused-const-variable=]
       static struct misensor_reg const mt9m114_suspend[] = {
                                        ^~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/mt9m114.h:393:34: warning: 'mt9m114_exitstandby' defined but not used [-Wunused-const-variable=]
       static struct misensor_reg const mt9m114_exitstandby[] = {
                                        ^~~~~~~~~~~~~~~~~~~
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      6522aa1b
    • Mauro Carvalho Chehab's avatar
      media: atomisp-mt9m114: remove dead data · 357486ec
      Mauro Carvalho Chehab authored
      
      
      It seems that, originally, the logic would allow selecting between
      fine and coarse integration. However, only coarse seems to be
      implemented.
      
      Get rid of this warning:
      
        drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c: In function 'mt9m114_s_exposure':
        drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:1003:6: warning: variable 'exposure_local' set but not used [-Wunused-but-set-variable]
          u16 exposure_local[3];
              ^~~~~~~~~~~~~~
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      357486ec
    • Mauro Carvalho Chehab's avatar
      media: atomisp-gc0310: return errors at gc0310_init() · 0015b190
      Mauro Carvalho Chehab authored
      
      
      If something wrong gets there, return the error.
      
      Get rid of this warning:
      
        drivers/staging/media/atomisp/i2c/atomisp-gc0310.c: In function 'gc0310_init':
        drivers/staging/media/atomisp/i2c/atomisp-gc0310.c:713:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
          int ret;
              ^~~
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      0015b190
    • Mauro Carvalho Chehab's avatar
      media: atomisp: ov2680: don't declare unused vars · e5c0680f
      Mauro Carvalho Chehab authored
      
      
      drivers/staging/media/atomisp/i2c/atomisp-ov2680.c: In function ‘__ov2680_set_exposure’:
      drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:400:10: warning: variable ‘hts’ set but not used [-Wunused-but-set-variable]
        u16 vts,hts;
                ^~~
      drivers/staging/media/atomisp/i2c/atomisp-ov2680.c: In function ‘ov2680_detect’:
      drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:1164:5: warning: variable ‘revision’ set but not used [-Wunused-but-set-variable]
        u8 revision;
           ^~~~~~~~
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      e5c0680f
    • Mauro Carvalho Chehab's avatar
      media: staging: atomisp: Comment out several unused sensor resolutions · db01f7cc
      Mauro Carvalho Chehab authored
      
      
      The register settings for several resolutions aren't used
      currently. So, comment them out.
      
      Fix those warnings:
      
      In file included from drivers/staging/media/atomisp/i2c/atomisp-gc2235.c:35:0:
      drivers/staging/media/atomisp/i2c/gc2235.h:340:32: warning: 'gc2235_960_640_30fps' defined but not used [-Wunused-const-variable=]
       static struct gc2235_reg const gc2235_960_640_30fps[] = {
                                      ^~~~~~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/gc2235.h:287:32: warning: 'gc2235_1296_736_30fps' defined but not used [-Wunused-const-variable=]
       static struct gc2235_reg const gc2235_1296_736_30fps[] = {
                                      ^~~~~~~~~~~~~~~~~~~~~
      In file included from drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:35:0:
      drivers/staging/media/atomisp/i2c/ov2722.h:999:32: warning: 'ov2722_720p_30fps' defined but not used [-Wunused-const-variable=]
       static struct ov2722_reg const ov2722_720p_30fps[] = {
                                      ^~~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov2722.h:787:32: warning: 'ov2722_1M3_30fps' defined but not used [-Wunused-const-variable=]
       static struct ov2722_reg const ov2722_1M3_30fps[] = {
                                      ^~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov2722.h:476:32: warning: 'ov2722_VGA_30fps' defined but not used [-Wunused-const-variable=]
       static struct ov2722_reg const ov2722_VGA_30fps[] = {
                                      ^~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov2722.h:367:32: warning: 'ov2722_480P_30fps' defined but not used [-Wunused-const-variable=]
       static struct ov2722_reg const ov2722_480P_30fps[] = {
                                      ^~~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov2722.h:257:32: warning: 'ov2722_QVGA_30fps' defined but not used [-Wunused-const-variable=]
       static struct ov2722_reg const ov2722_QVGA_30fps[] = {
                                      ^~~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/atomisp-ov2680.c: In function '__ov2680_set_exposure':
      In file included from drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:35:0:
      At top level:
      drivers/staging/media/atomisp/i2c/ov2680.h:736:33: warning: 'ov2680_1616x1082_30fps' defined but not used [-Wunused-const-variable=]
        static struct ov2680_reg const ov2680_1616x1082_30fps[] = {
                                       ^~~~~~~~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov2680.h:649:33: warning: 'ov2680_1456x1096_30fps' defined but not used [-Wunused-const-variable=]
        static struct ov2680_reg const ov2680_1456x1096_30fps[]= {
                                       ^~~~~~~~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov2680.h:606:33: warning: 'ov2680_1296x976_30fps' defined but not used [-Wunused-const-variable=]
        static struct ov2680_reg const ov2680_1296x976_30fps[] = {
                                       ^~~~~~~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov2680.h:563:33: warning: 'ov2680_720p_30fps' defined but not used [-Wunused-const-variable=]
        static struct ov2680_reg const ov2680_720p_30fps[] = {
                                       ^~~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov2680.h:520:33: warning: 'ov2680_800x600_30fps' defined but not used [-Wunused-const-variable=]
        static struct ov2680_reg const ov2680_800x600_30fps[] = {
                                       ^~~~~~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov2680.h:475:33: warning: 'ov2680_720x592_30fps' defined but not used [-Wunused-const-variable=]
        static struct ov2680_reg const ov2680_720x592_30fps[] = {
                                       ^~~~~~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov2680.h:433:33: warning: 'ov2680_656x496_30fps' defined but not used [-Wunused-const-variable=]
        static struct ov2680_reg const ov2680_656x496_30fps[] = {
                                       ^~~~~~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov2680.h:389:33: warning: 'ov2680_QVGA_30fps' defined but not used [-Wunused-const-variable=]
        static struct ov2680_reg const ov2680_QVGA_30fps[] = {
                                       ^~~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov2680.h:346:33: warning: 'ov2680_CIF_30fps' defined but not used [-Wunused-const-variable=]
        static struct ov2680_reg const ov2680_CIF_30fps[] = {
                                       ^~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov2680.h:301:33: warning: 'ov2680_QCIF_30fps' defined but not used [-Wunused-const-variable=]
        static struct ov2680_reg const ov2680_QCIF_30fps[] = {
                                       ^~~~~~~~~~~~~~~~~
      In file included from drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:36:0:
      drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:988:32: warning: 'ov5693_1424x1168_30fps' defined but not used [-Wunused-const-variable=]
       static struct ov5693_reg const ov5693_1424x1168_30fps[] = {
                                      ^~~~~~~~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:954:32: warning: 'ov5693_2592x1944_30fps' defined but not used [-Wunused-const-variable=]
       static struct ov5693_reg const ov5693_2592x1944_30fps[] = {
                                      ^~~~~~~~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:889:32: warning: 'ov5693_2592x1456_30fps' defined but not used [-Wunused-const-variable=]
       static struct ov5693_reg const ov5693_2592x1456_30fps[] = {
                                      ^~~~~~~~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:862:32: warning: 'ov5693_1940x1096' defined but not used [-Wunused-const-variable=]
       static struct ov5693_reg const ov5693_1940x1096[] = {
                                      ^~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:796:32: warning: 'ov5693_1636p_30fps' defined but not used [-Wunused-const-variable=]
       static struct ov5693_reg const ov5693_1636p_30fps[] = {
                                      ^~~~~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:758:32: warning: 'ov5693_1296x736' defined but not used [-Wunused-const-variable=]
       static struct ov5693_reg const ov5693_1296x736[] = {
                                      ^~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:730:32: warning: 'ov5693_976x556' defined but not used [-Wunused-const-variable=]
       static struct ov5693_reg const ov5693_976x556[] = {
                                      ^~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:672:32: warning: 'ov5693_736x496' defined but not used [-Wunused-const-variable=]
       static struct ov5693_reg const ov5693_736x496[] = {
                                      ^~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:643:32: warning: 'ov5693_192x160' defined but not used [-Wunused-const-variable=]
       static struct ov5693_reg const ov5693_192x160[] = {
                                      ^~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:616:32: warning: 'ov5693_368x304' defined but not used [-Wunused-const-variable=]
       static struct ov5693_reg const ov5693_368x304[] = {
                                      ^~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:587:32: warning: 'ov5693_336x256' defined but not used [-Wunused-const-variable=]
       static struct ov5693_reg const ov5693_336x256[] = {
                                      ^~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:540:32: warning: 'ov5693_1296x976' defined but not used [-Wunused-const-variable=]
       static struct ov5693_reg const ov5693_1296x976[] = {
                                      ^~~~~~~~~~~~~~~
      drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:509:32: warning: 'ov5693_654x496' defined but not used [-Wunused-const-variable=]
       static struct ov5693_reg const ov5693_654x496[] = {
                                      ^~~~~~~~~~~~~~
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      db01f7cc
    • Mauro Carvalho Chehab's avatar
      media: staging: atomisp-gc2235: don't fill an unused var · d8a665c9
      Mauro Carvalho Chehab authored
      
      
      The code with uses the dummy var is commented out. So,
      coment out its definition/initialization.
      
      Fix this warning:
      
        drivers/staging/media/atomisp/i2c/atomisp-gc2235.c: In function 'gc2235_get_intg_factor':
        drivers/staging/media/atomisp/i2c/atomisp-gc2235.c:249:26: warning: variable 'dummy' set but not used [-Wunused-but-set-variable]
          u16 reg_val, reg_val_h, dummy;
                                  ^~~~~
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      d8a665c9
    • Mauro Carvalho Chehab's avatar
      media: atomisp: ov2680.h: fix identation · 746d60e9
      Mauro Carvalho Chehab authored
      
      
      The identation for several tables there are broken.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      746d60e9
    • Mauro Carvalho Chehab's avatar
      media: staging: atomisp: reenable warnings for I2C · 8196b832
      Mauro Carvalho Chehab authored
      
      
      When atomisp got merged, there were so many warnings with W=1
      that we simply disabled the ones that were causing troubles.
      
      Since then, several changes got applied to atomisp, and the
      number of warnings are a way smaller than it used to be.
      
      So, let's reenable warnings there and fix the issues.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      8196b832
    • Mauro Carvalho Chehab's avatar
      media: staging: atomisp: get rid of __KERNEL macros · 313c5197
      Mauro Carvalho Chehab authored
      
      
      There's no sense for a Kernel driver to have __KERNEL macros
      on it.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      313c5197
    • Shaokun Zhang's avatar
      media: atomisp: fix misleading addr information · 22457cb2
      Shaokun Zhang authored
      IA_CSS_ERROR shows the ddr_buffer_addr as a decimal value with a '0x'
      prefix, which is somewhat misleading.
      
      Let's fix it to print hexadecimal, as was intended.
      
      Fixes: 158aeefc
      
      ("[media] atomisp: Add __printf validation and fix fallout")
      
      Cc: Alan Cox <alan@linux.intel.com>
      Cc: Joe Perches <joe@perches.com>
      Signed-off-by: default avatarShaokun Zhang <zhangshaokun@hisilicon.com>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      22457cb2
    • YueHaibing's avatar
      media: staging: atomisp: Using module_pci_driver · 0de3d73b
      YueHaibing authored
      
      
      Remove boilerplate code by using macro module_pci_driver.
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      0de3d73b
    • Colin Ian King's avatar
      media: atomisp: fix spelling mistake: "diregard" -> "disregard" · e6c023af
      Colin Ian King authored
      
      
      Trivial fix to spelling mistake in ia_css_print message text
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      e6c023af
    • Mauro Carvalho Chehab's avatar
      media: dvb_ca_en50221: prevent using slot_info for Spectre attacs · 4f5ab5d7
      Mauro Carvalho Chehab authored
      
      
      slot can be controlled by user-space, hence leading to
      a potential exploitation of the Spectre variant 1 vulnerability,
      as warned by smatch:
      	drivers/media/dvb-core/dvb_ca_en50221.c:1479 dvb_ca_en50221_io_write() warn: potential spectre issue 'ca->slot_info' (local cap)
      Acked-by: default avatar"Jasmin J." <jasmin@anw.at>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      4f5ab5d7
  3. 15 May, 2018 1 commit
  4. 14 May, 2018 10 commits
  5. 11 May, 2018 2 commits
    • Mauro Carvalho Chehab's avatar
      media: dvb_frontend: cleanup some coding style errors · 09c2cc98
      Mauro Carvalho Chehab authored
      
      
      This is a core media file... it shoudn't have so many coding
      style issues! The last patch ended by being submitted with
      an error like that, very likely due to some cut and paste
      issue.
      
      Maybe it is time to clean it up. Do it with the auto
      fix logic:
      
       ./scripts/checkpatch.pl -f drivers/media/dvb-core/dvb_frontend.c --strict --fix-inplace
      
      Then manually fix the errors introduced by it.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      09c2cc98
    • Max Kellermann's avatar
      media: dvbdev: add a mutex protecting the "mdev" pointer · f17c403a
      Max Kellermann authored
      During destruction, a race condition in
      dvb_media_controller_disable_source() can cause a kernel crash,
      because the "mdev" pointer has been read successfully while another
      task executes dvb_usb_media_device_unregister(), which destroys the
      object.  Example for such a crash:
      
          general protection fault: 0000 [#1
      
      ] SMP
          CPU: 1 PID: 301 Comm: vdr Not tainted 4.8.1-nuc+ #102
          [142B blob data]
          task: ffff8802301f2040 task.stack: ffff880233728000
          RIP: 0010:[<ffffffff816c296b>]  [<ffffffff816c296b>] dvb_frontend_release+0xcb/0x120
          RSP: 0018:ffff88023372bdd8  EFLAGS: 00010202
          RAX: 001fd55c000000da RBX: ffff880236bad810 RCX: 0000000000000000
          RDX: ffff880235bd81f0 RSI: 0000000000000246 RDI: ffff880235bd81e8
          RBP: ffff88023372be00 R08: 0000000000000000 R09: 0000000000000000
          R10: 0000000000000000 R11: ffff88022f009910 R12: 0000000000000000
          R13: ffff880235a21a80 R14: ffff880235bd8000 R15: ffff880235bb8a78
          FS:  0000000000000000(0000) GS:ffff88023fd00000(0000) knlGS:0000000000000000
          CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
          CR2: 00007f96edd69818 CR3: 0000000002406000 CR4: 00000000001006e0
          Stack:
           ffff88022f009900 0000000000000008 ffff880235bb8a78 ffff8802344fbb20
           ffff880236437b40 ffff88023372be48 ffffffff8117a81e ffff880235bb8a78
           ffff88022f009910 ffff8802335a7400 ffff8802301f2040 ffff88022f009900
          Call Trace:
           [<ffffffff8117a81e>] __fput+0xde/0x1d0
           [<ffffffff8117a949>] ____fput+0x9/0x10
           [<ffffffff810a9fce>] task_work_run+0x7e/0xa0
           [<ffffffff81094bab>] do_exit+0x27b/0xa50
           [<ffffffff810407e3>] ? __do_page_fault+0x1c3/0x430
           [<ffffffff81095402>] do_group_exit+0x42/0xb0
           [<ffffffff8109547f>] SyS_exit_group+0xf/0x10
           [<ffffffff8108bedb>] entry_SYSCALL_64_fastpath+0x13/0x8f
          Code: 31 c9 49 8d be e8 01 00 00 ba 01 00 00 00 be 03 00 00 00 e8 68 2d a0 ff 48 8b 83 10 03 00 00 48 8b 80 88 00 00 00 48 85 c0 74 12 <48> 8b 80 88 02 00 00 48 85 c0 74 06 49 8b 7d
          RIP  [<ffffffff816c296b>] dvb_frontend_release+0xcb/0x120
      
      [mchehab+samsung@kernel.org: fix a Coding Style issue]
      Signed-off-by: default avatarMax Kellermann <max.kellermann@gmail.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      f17c403a