1. 08 6月, 2016 3 次提交
  2. 07 6月, 2016 3 次提交
    • A
      [media] s5p-mfc: don't close instance after free OUTPUT buffers · 9bd5d869
      ayaka 提交于
      User-space applications can use the VIDIOC_REQBUFS ioctl to determine if a
      memory mapped, user pointer or DMABUF based I/O is supported by the driver.
      
      So a set of VIDIOC_REQBUFS ioctl calls will be made with count 0 and then
      the real VIDIOC_REQBUFS call with count == n. But for count 0, the driver
      not only frees the buffer but also closes the MFC instance and s5p_mfc_ctx
      state is set to MFCINST_FREE.
      
      The VIDIOC_REQBUFS handler for the output device checks if the s5p_mfc_ctx
      state is set to MFCINST_INIT (which happens on an VIDIOC_S_FMT) and fails
      otherwise. So after a VIDIOC_REQBUFS(n), future VIDIOC_REQBUFS(n) calls
      will fails unless a VIDIOC_S_FMT ioctl calls happens before the reqbufs.
      
      But applications may first set the format and then attempt to determine
      the I/O methods supported by the driver (for example Gstramer does it) so
      the state won't be set to MFCINST_INIT again and VIDIOC_REQBUFS will fail.
      
      To avoid this issue, only free the buffers on VIDIOC_REQBUFS(0) but don't
      close the MFC instance to allow future VIDIOC_REQBUFS(n) calls to succeed.
      
      [javier: Rewrote changelog to explain the problem more detailed]
      Signed-off-by: Nayaka <ayaka@soulik.info>
      Signed-off-by: NJavier Martinez Canillas <javier@osg.samsung.com>
      Acked-by: NNicolas Dufresne <nicolas@collabora.com>
      Tested-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Acked-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      9bd5d869
    • J
      [media] s5p-mfc: Don't try to put pm->clock if lookup failed · 8b120e73
      Javier Martinez Canillas 提交于
      Failing to get the struct s5p_mfc_pm .clock is a non-fatal error so the
      clock field can have a errno pointer value. But s5p_mfc_final_pm() only
      checks if .clock is not NULL before attempting to unprepare and put it.
      
      This leads to the following warning in clk_put() due s5p_mfc_final_pm():
      
      WARNING: CPU: 3 PID: 1023 at drivers/clk/clk.c:2814 s5p_mfc_final_pm+0x48/0x74 [s5p_mfc]
      CPU: 3 PID: 1023 Comm: rmmod Tainted: G        W       4.6.0-rc6-next-20160502-00005-g5a15a49106bc #9
      Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
      [<c010e1bc>] (unwind_backtrace) from [<c010af28>] (show_stack+0x10/0x14)
      [<c010af28>] (show_stack) from [<c032485c>] (dump_stack+0x88/0x9c)
      [<c032485c>] (dump_stack) from [<c011b8e8>] (__warn+0xe8/0x100)
      [<c011b8e8>] (__warn) from [<c011b9b0>] (warn_slowpath_null+0x20/0x28)
      [<c011b9b0>] (warn_slowpath_null) from [<bf16004c>] (s5p_mfc_final_pm+0x48/0x74 [s5p_mfc])
      [<bf16004c>] (s5p_mfc_final_pm [s5p_mfc]) from [<bf157414>] (s5p_mfc_remove+0x8c/0x94 [s5p_mfc])
      [<bf157414>] (s5p_mfc_remove [s5p_mfc]) from [<c03fe1f8>] (platform_drv_remove+0x24/0x3c)
      [<c03fe1f8>] (platform_drv_remove) from [<c03fcc70>] (__device_release_driver+0x84/0x110)
      [<c03fcc70>] (__device_release_driver) from [<c03fcdd8>] (driver_detach+0xac/0xb0)
      [<c03fcdd8>] (driver_detach) from [<c03fbff8>] (bus_remove_driver+0x4c/0xa0)
      [<c03fbff8>] (bus_remove_driver) from [<c01886a8>] (SyS_delete_module+0x174/0x1b8)
      [<c01886a8>] (SyS_delete_module) from [<c01078c0>] (ret_fast_syscall+0x0/0x3c)
      
      Assign the pointer to NULL in case of a lookup failure to fix the issue.
      Signed-off-by: NJavier Martinez Canillas <javier@osg.samsung.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Acked-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      8b120e73
    • M
      [media] media: s5p-mfc: fix compilation issue on archs other than ARM (32bit) · 675f9bc7
      Marek Szyprowski 提交于
      This patch fixes build break caused by lack of dma-iommu API on ARM64
      (this API is specific to ARM 32bit architecture).
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      675f9bc7
  3. 03 6月, 2016 6 次提交
  4. 28 5月, 2016 1 次提交
    • A
      remove lots of IS_ERR_VALUE abuses · 287980e4
      Arnd Bergmann 提交于
      Most users of IS_ERR_VALUE() in the kernel are wrong, as they
      pass an 'int' into a function that takes an 'unsigned long'
      argument. This happens to work because the type is sign-extended
      on 64-bit architectures before it gets converted into an
      unsigned type.
      
      However, anything that passes an 'unsigned short' or 'unsigned int'
      argument into IS_ERR_VALUE() is guaranteed to be broken, as are
      8-bit integers and types that are wider than 'unsigned long'.
      
      Andrzej Hajda has already fixed a lot of the worst abusers that
      were causing actual bugs, but it would be nice to prevent any
      users that are not passing 'unsigned long' arguments.
      
      This patch changes all users of IS_ERR_VALUE() that I could find
      on 32-bit ARM randconfig builds and x86 allmodconfig. For the
      moment, this doesn't change the definition of IS_ERR_VALUE()
      because there are probably still architecture specific users
      elsewhere.
      
      Almost all the warnings I got are for files that are better off
      using 'if (err)' or 'if (err < 0)'.
      The only legitimate user I could find that we get a warning for
      is the (32-bit only) freescale fman driver, so I did not remove
      the IS_ERR_VALUE() there but changed the type to 'unsigned long'.
      For 9pfs, I just worked around one user whose calling conventions
      are so obscure that I did not dare change the behavior.
      
      I was using this definition for testing:
      
       #define IS_ERR_VALUE(x) ((unsigned long*)NULL == (typeof (x)*)NULL && \
             unlikely((unsigned long long)(x) >= (unsigned long long)(typeof(x))-MAX_ERRNO))
      
      which ends up making all 16-bit or wider types work correctly with
      the most plausible interpretation of what IS_ERR_VALUE() was supposed
      to return according to its users, but also causes a compile-time
      warning for any users that do not pass an 'unsigned long' argument.
      
      I suggested this approach earlier this year, but back then we ended
      up deciding to just fix the users that are obviously broken. After
      the initial warning that caused me to get involved in the discussion
      (fs/gfs2/dir.c) showed up again in the mainline kernel, Linus
      asked me to send the whole thing again.
      
      [ Updated the 9p parts as per Al Viro  - Linus ]
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Andrzej Hajda <a.hajda@samsung.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Link: https://lkml.org/lkml/2016/1/7/363
      Link: https://lkml.org/lkml/2016/5/27/486
      Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> # For nvmem part
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      287980e4
  5. 10 5月, 2016 1 次提交
    • A
      [media] exynos-gsc: avoid build warning without CONFIG_OF · aff093d4
      Arnd Bergmann 提交于
      When building the exynos-gsc driver with CONFIG_OF disabled, we get
      a warning about an out-of-bounds access:
      
      drivers/media/platform/exynos-gsc/gsc-core.c: In function 'gsc_probe':
      drivers/media/platform/exynos-gsc/gsc-core.c:1078:34: error: array subscript is above array bounds [-Werror=array-bounds]
      
      This is harmless because the driver will never be used without CONFIG_OF,
      but it's better to avoid the warning anyway. Checking the return value
      of of_alias_get_id() for an error condition is probably a good idea
      anyway, and it makes sure the compiler can verify that we don't get
      into that situation.
      
      Fixes: 26a7ed9c ("[media] exynos-gsc: remove an always false condition")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      aff093d4
  6. 09 5月, 2016 3 次提交
  7. 07 5月, 2016 1 次提交
  8. 02 5月, 2016 2 次提交
  9. 21 4月, 2016 3 次提交
  10. 14 4月, 2016 17 次提交