linux/drivers/media/platform
Lad, Prabhakar c1d1e40b8b [media] media: davinci: vpfe: make sure all the buffers unmapped and released
this patch makes sure that it terminates if any IO in
progress and also makes sure that all the buffers are unmapped.
It was observed that with several runs of application the application
sometimes failed to allocate memory, This patch makes sure it
all the buffers are released.

Using kmemleak it was found that buffer were not released, this patch
fixes following issue,

 echo scan > /sys/kernel/debug/kmemleak
  Kernel message reads:
      memleak: 3 new suspected memory leaks (see /sys/kernel/debug/kmemleak)

Then,
     cat /sys/kernel/debug/kmemleak

  unreferenced object 0xc564a480 (size 192):
  comm "mttest", pid 764, jiffies 4294945878 (age 487.160s)
  hex dump (first 32 bytes):
    00 00 00 00 28 07 07 20 d0 02 00 00 e0 01 00 00  ....(.. ........
    00 00 00 00 00 64 05 00 01 00 00 00 01 00 00 00  .....d..........
  backtrace:
    [<c00a98dc>] create_object+0x10c/0x28c
    [<c03ba8ec>] kmemleak_alloc+0x3c/0x70
    [<c00a67c0>] __kmalloc+0x11c/0x1d4
    [<c02b6f48>] __videobuf_alloc+0x1c/0x3c
    [<c02b6194>] videobuf_alloc_vb+0x38/0x80
    [<c02b6638>] __videobuf_mmap_setup+0x9c/0x108
    [<c02b6da0>] videobuf_reqbufs.part.10+0x12c/0x1bc
    [<c02b6e9c>] videobuf_reqbufs+0x6c/0x8c
    [<c02be2c4>] vpfe_reqbufs+0xcc/0x130
    [<c02aae90>] v4l_reqbufs+0x50/0x54
    [<c02aab54>] __video_do_ioctl+0x260/0x2c4
    [<c02a9dd4>] video_usercopy+0xf0/0x310
    [<c02aa008>] video_ioctl2+0x14/0x1c
    [<c02a562c>] v4l2_ioctl+0x104/0x14c
    [<c00bd320>] do_vfs_ioctl+0x80/0x2d0
    [<c00bd5b4>] SyS_ioctl+0x44/0x64
unreferenced object 0xc564ac00 (size 192):
  comm "mttest", pid 764, jiffies 4294945878 (age 487.160s)
  hex dump (first 32 bytes):
    01 00 00 00 28 07 07 20 d0 02 00 00 e0 01 00 00  ....(.. ........
    00 00 00 00 00 64 05 00 01 00 00 00 01 00 00 00  .....d..........
  backtrace:
    [<c00a98dc>] create_object+0x10c/0x28c
    [<c03ba8ec>] kmemleak_alloc+0x3c/0x70
    [<c00a67c0>] __kmalloc+0x11c/0x1d4
    [<c02b6f48>] __videobuf_alloc+0x1c/0x3c
    [<c02b6194>] videobuf_alloc_vb+0x38/0x80
    [<c02b6638>] __videobuf_mmap_setup+0x9c/0x108
    [<c02b6da0>] videobuf_reqbufs.part.10+0x12c/0x1bc
    [<c02b6e9c>] videobuf_reqbufs+0x6c/0x8c
    [<c02be2c4>] vpfe_reqbufs+0xcc/0x130
    [<c02aae90>] v4l_reqbufs+0x50/0x54
    [<c02aab54>] __video_do_ioctl+0x260/0x2c4
    [<c02a9dd4>] video_usercopy+0xf0/0x310
    [<c02aa008>] video_ioctl2+0x14/0x1c
    [<c02a562c>] v4l2_ioctl+0x104/0x14c
    [<c00bd320>] do_vfs_ioctl+0x80/0x2d0
    [<c00bd5b4>] SyS_ioctl+0x44/0x64
unreferenced object 0xc564a180 (size 192):
  comm "mttest", pid 764, jiffies 4294945880 (age 487.140s)
  hex dump (first 32 bytes):
    02 00 00 00 28 07 07 20 d0 02 00 00 e0 01 00 00  ....(.. ........
    00 00 00 00 00 64 05 00 01 00 00 00 01 00 00 00  .....d..........
  backtrace:
    [<c00a98dc>] create_object+0x10c/0x28c
    [<c03ba8ec>] kmemleak_alloc+0x3c/0x70
    [<c00a67c0>] __kmalloc+0x11c/0x1d4
    [<c02b6f48>] __videobuf_alloc+0x1c/0x3c
    [<c02b6194>] videobuf_alloc_vb+0x38/0x80
    [<c02b6638>] __videobuf_mmap_setup+0x9c/0x108
    [<c02b6da0>] videobuf_reqbufs.part.10+0x12c/0x1bc
    [<c02b6e9c>] videobuf_reqbufs+0x6c/0x8c
    [<c02be2c4>] vpfe_reqbufs+0xcc/0x130
    [<c02aae90>] v4l_reqbufs+0x50/0x54
    [<c02aab54>] __video_do_ioctl+0x260/0x2c4
    [<c02a9dd4>] video_usercopy+0xf0/0x310
    [<c02aa008>] video_ioctl2+0x14/0x1c
    [<c02a562c>] v4l2_ioctl+0x104/0x14c
    [<c00bd320>] do_vfs_ioctl+0x80/0x2d0
    [<c00bd5b4>] SyS_ioctl+0x44/0x64

Reported-by: Jimmy Ho <jimmygge@gmail.com>
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-15 09:54:38 -03:00
..
blackfin [media] v4l: Rename vb2_queue.timestamp_type as timestamp_flags 2014-03-05 16:34:14 -03:00
davinci [media] media: davinci: vpfe: make sure all the buffers unmapped and released 2014-04-15 09:54:38 -03:00
exynos4-is [media] s5p-fimc: Fix YUV422P depth 2014-04-15 09:50:06 -03:00
exynos-gsc [media] v4l: Copy timestamp source flags to destination on m2m devices 2014-03-05 16:47:15 -03:00
marvell-ccic [media] vb2: change result code of buf_finish to void 2014-03-11 06:56:38 -03:00
omap [media] omap_vout: Add DVI display type support 2014-03-11 12:10:06 -03:00
omap3isp [media] omap3isp: Fix kerneldoc for _module_sync_is_stopping and isp_isr() 2014-03-05 17:02:07 -03:00
s3c-camif [media] v4l: Rename vb2_queue.timestamp_type as timestamp_flags 2014-03-05 16:34:14 -03:00
s5p-g2d [media] v4l: Copy timestamp source flags to destination on m2m devices 2014-03-05 16:47:15 -03:00
s5p-jpeg [media] s5p-jpeg: Fix broken indentation in jpeg-regs.h 2014-03-14 10:37:24 -03:00
s5p-mfc [media] s5p-mfc: remove meaningless memory bank assignment 2014-03-11 10:29:09 -03:00
s5p-tv [media] vb2: only call start_streaming if sufficient buffers are queued 2014-03-11 06:56:41 -03:00
soc_camera [media] media: soc_camera: rcar_vin: Add support for 10-bit YUV cameras 2014-03-11 09:32:26 -03:00
ti-vpe [media] v4l: ti-vpe: retain v4l2_buffer flags for captured buffers 2014-04-07 09:44:25 -03:00
vsp1 [media] v4l: vsp1: Update copyright notice 2014-03-12 10:41:51 -03:00
arv.c [media] arv: fix sleep_on race 2014-03-11 09:23:10 -03:00
coda.c [media] v4l: Copy timestamp source flags to destination on m2m devices 2014-03-05 16:47:15 -03:00
coda.h [media] coda: add CODA7541 decoding support 2013-07-31 15:56:44 -03:00
fsl-viu.c fsl-viu: adjust for OF based clock lookup 2014-01-12 18:53:05 +01:00
indycam.c [media] indycam: remove g_chip_ident op 2013-06-17 08:49:47 -03:00
indycam.h
Kconfig [media] v4l: VIDEO_SH_VOU should depend on HAS_DMA 2014-03-11 09:22:48 -03:00
m2m-deinterlace.c [media] v4l: Copy timestamp source flags to destination on m2m devices 2014-03-05 16:47:15 -03:00
Makefile [media] omap24xx/tcm825x: move to staging for future removal 2013-12-20 13:45:22 -02:00
mem2mem_testdev.c [media] mem2mem_testdev: improve field handling 2014-03-11 10:34:56 -03:00
mx2_emmaprp.c [media] v4l: Copy timestamp source flags to destination on m2m devices 2014-03-05 16:47:15 -03:00
sh_veu.c sh_veu: Replace PTR_RET with PTR_ERR_OR_ZERO 2013-07-16 16:06:01 +09:30
sh_vou.c [media] sh_vou: comment unused vars 2014-01-13 11:30:26 -02:00
timblogiw.c Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2013-11-20 13:20:24 -08:00
via-camera.c [media] via-camera: replace current_norm by g_std 2013-06-17 09:33:49 -03:00
via-camera.h
vino.c [media] v4l2: pass std by value to the write-only s_std ioctl 2013-03-24 06:47:00 -03:00
vino.h
vivi.c [media] vivi: fix ENUM_FRAMEINTERVALS implementation 2014-03-11 06:56:45 -03:00