1. 09 8月, 2017 4 次提交
  2. 08 8月, 2017 9 次提交
  3. 27 7月, 2017 2 次提交
  4. 26 7月, 2017 17 次提交
  5. 21 7月, 2017 8 次提交
    • M
      media: s3c-camif: use LINUX_VERSION_CODE for driver's version · dbaed9f0
      Mauro Carvalho Chehab 提交于
      We seldomly increment version numbers on drivers, because... we
      usually forget ;-)
      
      So, instead, just make it identical to the Kernel version, as what
      we do on all other drivers.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      Acked-by: NSylwester Nawrocki <snawrocki@kernel.org>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      dbaed9f0
    • P
      media: platform: davinci: drop VPFE_CMD_S_CCDC_RAW_PARAMS · d75cf014
      Prabhakar Lad 提交于
      drop VPFE_CMD_S_CCDC_RAW_PARAMS ioctl from dm355/dm644x following reasons:
      
      - This ioctl was never in public api and was only defined in kernel header.
      - The function set_params constantly mixes up pointers and phys_addr_t
        numbers.
      - This is part of a 'VPFE_CMD_S_CCDC_RAW_PARAMS' ioctl command that is
        described as an 'experimental ioctl that will change in future kernels'.
      - The code to allocate the table never gets called after we copy_from_user
        the user input over the kernel settings, and then compare them
        for inequality.
      - We then go on to use an address provided by user space as both the
        __user pointer for input and pass it through phys_to_virt to come up
        with a kernel pointer to copy the data to. This looks like a trivially
        exploitable root hole.
      Signed-off-by: NLad, Prabhakar <prabhakar.csengg@gmail.com>
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      d75cf014
    • P
      media: platform: davinci: return -EINVAL for VPFE_CMD_S_CCDC_RAW_PARAMS ioctl · 6759b019
      Prabhakar Lad 提交于
      this patch makes sure VPFE_CMD_S_CCDC_RAW_PARAMS ioctl no longer works
      for vpfe_capture driver with a minimal patch suitable for backporting.
      
      - This ioctl was never in public api and was only defined in kernel header.
      - The function set_params constantly mixes up pointers and phys_addr_t
        numbers.
      - This is part of a 'VPFE_CMD_S_CCDC_RAW_PARAMS' ioctl command that is
        described as an 'experimental ioctl that will change in future kernels'.
      - The code to allocate the table never gets called after we copy_from_user
        the user input over the kernel settings, and then compare them
        for inequality.
      - We then go on to use an address provided by user space as both the
        __user pointer for input and pass it through phys_to_virt to come up
        with a kernel pointer to copy the data to. This looks like a trivially
        exploitable root hole.
      
      Due to these reasons we make sure this ioctl now returns -EINVAL and backport
      this patch as far as possible.
      
      Fixes: 5f15fbb6 ("V4L/DVB (12251): v4l: dm644x ccdc module for vpfe capture driver")
      Signed-off-by: NLad, Prabhakar <prabhakar.csengg@gmail.com>
      Cc: <stable@vger.kernel.org>      # for v3.7 and up
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      6759b019
    • S
      media: venus: don't abuse dma_alloc for non-DMA allocations · a6e2d36b
      Stanimir Varbanov 提交于
      In venus_boot(), we pass a pointer to a phys_addr_t
      into dmam_alloc_coherent, which the compiler warns about:
      
      platform/qcom/venus/firmware.c: In function 'venus_boot':
      platform/qcom/venus/firmware.c:63:49: error: passing argument 3 of 'dmam_alloc_coherent' from incompatible pointer type [-Werror=incompatible-pointer-types]
      
      To avoid the error refactor venus_boot function by discard
      dma_alloc_coherent invocation because we don't want to map the
      memory for the device.  Something more, the usage of
      DMA mapping API is actually wrong and the current
      implementation relies on several bugs in DMA mapping code.
      When these bugs are fixed that will break firmware loading,
      so fix this now to avoid future troubles.
      
      The meaning of venus_boot is to copy the content of the
      firmware buffer into reserved (and memblock removed)
      block of memory and pass that physical address to the
      trusted zone for authentication and mapping through iommu
      form the secure world. After iommu mapping is done the iova
      is passed as ane entry point to the remote processor.
      
      After this change memory-region property is parsed manually
      and the physical address is memremap to CPU, call mdt_load to
      load firmware segments into proper places and unmap
      reserved memory.
      
      Fixes: af2c3834 ("[media] media: venus: adding core part and helper functions")
      Signed-off-by: NStanimir Varbanov <stanimir.varbanov@linaro.org>
      Reviewed-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      a6e2d36b
    • R
      media: venus: hfi: fix error handling in hfi_sys_init_done() · 9883dc2c
      Rob Clark 提交于
      Not entirely sure what triggers it, but with venus build as kernel
      module and in initrd, we hit this crash:
      
        Unable to handle kernel paging request at virtual address ffff80003c039000
        pgd = ffff00000a14f000
        [ffff80003c039000] *pgd=00000000bd9f7003, *pud=00000000bd9f6003, *pmd=00000000bd9f0003, *pte=0000000000000000
        Internal error: Oops: 96000007 [#1] SMP
        Modules linked in: qcom_wcnss_pil(E+) crc32_ce(E) qcom_common(E) venus_core(E+) remoteproc(E) snd_soc_msm8916_digital(E) virtio_ring(E) cdc_ether(E) snd_soc_lpass_apq8016(E) snd_soc_lpass_cpu(E) snd_soc_apq8016_sbc(E) snd_soc_lpass_platform(E) v4l2_mem2mem(E) virtio(E) snd_soc_core(E) ac97_bus(E) snd_pcm_dmaengine(E) snd_seq(E) leds_gpio(E) videobuf2_v4l2(E) videobuf2_core(E) snd_seq_device(E) snd_pcm(E) videodev(E) media(E) nvmem_qfprom(E) msm(E) snd_timer(E) snd(E) soundcore(E) spi_qup(E) mdt_loader(E) qcom_tsens(E) qcom_spmi_temp_alarm(E) nvmem_core(E) msm_rng(E) uas(E) usb_storage(E) dm9601(E) usbnet(E) mii(E) mmc_block(E) adv7511(E) drm_kms_helper(E) syscopyarea(E) sysfillrect(E) sysimgblt(E) fb_sys_fops(E) qcom_spmi_vadc(E) qcom_vadc_common(PE) industrialio(E) pinctrl_spmi_mpp(E)
         pinctrl_spmi_gpio(E) rtc_pm8xxx(E) clk_smd_rpm(E) sdhci_msm(E) sdhci_pltfm(E) qcom_smd_regulator(E) drm(E) smd_rpm(E) qcom_spmi_pmic(E) regmap_spmi(E) ci_hdrc_msm(E) ci_hdrc(E) usb3503(E) extcon_usb_gpio(E) phy_msm_usb(E) udc_core(E) qcom_hwspinlock(E) extcon_core(E) ehci_msm(E) i2c_qup(E) sdhci(E) mmc_core(E) spmi_pmic_arb(E) spmi(E) qcom_smd(E) smsm(E) rpmsg_core(E) smp2p(E) smem(E) hwspinlock_core(E) gpio_keys(E)
        CPU: 2 PID: 551 Comm: irq/150-venus Tainted: P            E   4.12.0+ #1625
        Hardware name: qualcomm dragonboard410c/dragonboard410c, BIOS 2017.07-rc2-00144-ga97bdbdf72-dirty 07/08/2017
        task: ffff800037338000 task.stack: ffff800038e00000
        PC is at hfi_sys_init_done+0x64/0x140 [venus_core]
        LR is at hfi_process_msg_packet+0xcc/0x1e8 [venus_core]
        pc : [<ffff00000118b384>] lr : [<ffff00000118c11c>] pstate: 20400145
        sp : ffff800038e03c60
        x29: ffff800038e03c60 x28: 0000000000000000
        x27: 00000000000df018 x26: ffff00000118f4d0
        x25: 0000000000020003 x24: ffff80003a8d3010
        x23: ffff00000118f760 x22: ffff800037b40028
        x21: ffff8000382981f0 x20: ffff800037b40028
        x19: ffff80003c039000 x18: 0000000000000020
        x17: 0000000000000000 x16: ffff800037338000
        x15: ffffffffffffffff x14: 0000001000000014
        x13: 0000000100001007 x12: 0000000100000020
        x11: 0000100e00000000 x10: 0000000000000001
        x9 : 0000000200000000 x8 : 0000001400000001
        x7 : 0000000000001010 x6 : 0000000000000148
        x5 : 0000000000001009 x4 : ffff80003c039000
        x3 : 00000000cd770abb x2 : 0000000000000042
        x1 : 0000000000000788 x0 : 0000000000000002
        Process irq/150-venus (pid: 551, stack limit = 0xffff800038e00000)
        Call trace:
        [<ffff00000118b384>] hfi_sys_init_done+0x64/0x140 [venus_core]
        [<ffff00000118c11c>] hfi_process_msg_packet+0xcc/0x1e8 [venus_core]
        [<ffff00000118a2b4>] venus_isr_thread+0x1b4/0x208 [venus_core]
        [<ffff00000118e750>] hfi_isr_thread+0x28/0x38 [venus_core]
        [<ffff000008161550>] irq_thread_fn+0x30/0x70
        [<ffff0000081617fc>] irq_thread+0x14c/0x1c8
        [<ffff000008105e68>] kthread+0x138/0x140
        [<ffff000008083590>] ret_from_fork+0x10/0x40
        Code: 52820125 52820207 7a431820 54000249 (b9400263)
        ---[ end trace c963460f20a984b6 ]---
      
      The problem is that in the error case, we've incremented the data ptr
      but not decremented rem_bytes, and keep reading (presumably garbage)
      until eventually we go beyond the end of the buffer.
      
      Instead, on first error, we should probably just bail out.  Other
      option is to increment read_bytes by sizeof(u32) before the switch,
      rather than only accounting for the ptype header in the non-error
      case.  Note that in this case it is HFI_ERR_SYS_INVALID_PARAMETER,
      ie. an unrecognized/unsupported parameter, so interpreting the next
      word as a property type would be bogus.  The other error cases are
      due to truncated buffer, so there isn't likely to be anything valid
      to interpret in the remainder of the buffer.  So just bailing seems
      like a reasonable solution.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NStanimir Varbanov <stanimir.varbanov@linaro.org>
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      9883dc2c
    • A
      media: venus: fix compile-test build on non-qcom ARM platform · 0399b696
      Arnd Bergmann 提交于
      If QCOM_MDT_LOADER is enabled, but ARCH_QCOM is not, we run into
      a build error:
      
      ERROR: "qcom_mdt_load" [drivers/media/platform/qcom/venus/venus-core.ko] undefined!
      ERROR: "qcom_mdt_get_size" [drivers/media/platform/qcom/venus/venus-core.ko] undefined!
      
      This changes the 'select' statement again, so we only try to enable
      those symbols when the drivers will actually get built, and explicitly
      test for QCOM_MDT_LOADER to be enabled before calling into it.
      
      Fixes: 76724b30 ("[media] media: venus: enable building with COMPILE_TEST")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NStanimir Varbanov <stanimir.varbanov@linaro.org>
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      0399b696
    • A
      media: venus: mark PM functions as __maybe_unused · 06e49246
      Arnd Bergmann 提交于
      Without PM support, gcc warns about two unused functions:
      
      platform/qcom/venus/core.c:146:13: error: 'venus_clks_disable' defined but not used [-Werror=unused-function]
      platform/qcom/venus/core.c:126:12: error: 'venus_clks_enable' defined but not used [-Werror=unused-function]
      
      The problem as usual are incorrect #ifdefs, so the easiest fix
      is to do away with the #ifdef completely and mark the suspend/resume
      handlers as __maybe_unused, which they are.
      
      Fixes: af2c3834 ("[media] media: venus: adding core part and helper functions")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NStanimir Varbanov <stanimir.varbanov@linaro.org>
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      06e49246
    • G
      media: marvell-ccic: constify i2c_algorithm structure · 8e10fd85
      Gustavo A. R. Silva 提交于
      Check for i2c_algorithm structures that are only stored in
      the algo field of an i2c_adapter structure. This field is
      declared const, so i2c_algorithm structures that have this
      property can be declared as const also.
      
      This issue was identified using Coccinelle and the following
      semantic patch:
      
      @r disable optional_qualifier@
      identifier i;
      position p;
      @@
      static struct i2c_algorithm i@p = { ... };
      
      @ok@
      identifier r.i;
      struct i2c_adapter e;
      position p;
      @@
      e.algo = &i@p;
      
      @bad@
      position p != {r.p,ok.p};
      identifier r.i;
      @@
      i@p
      
      @depends on !bad disable optional_qualifier@
      identifier r.i;
      @@
      static
      +const
       struct i2c_algorithm i = { ... };
      Signed-off-by: NGustavo A. R. Silva <garsilva@embeddedor.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      8e10fd85