<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Is there a patch for v4l2/mt9p031 kernel panic in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Is-there-a-patch-for-v4l2-mt9p031-kernel-panic/m-p/699256#M108574</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I hope so. I found the problem because I'm inclined to stress test. Each&lt;/P&gt;&lt;P&gt;loop of my test captures images from two mt9p031 cameras using a gst-launch&lt;/P&gt;&lt;P&gt;script. Although I still see script hangs, I can time them out, kill the&lt;/P&gt;&lt;P&gt;scripts, and retry. That kind of fault-tolerant approach was NOT working&lt;/P&gt;&lt;P&gt;for the kernel panics.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On Thu, Aug 17, 2017 at 2:40 PM, gusarambula &amp;lt;admin@community.nxp.com&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Aug 2017 20:49:47 GMT</pubDate>
    <dc:creator>patsandt</dc:creator>
    <dc:date>2017-08-17T20:49:47Z</dc:date>
    <item>
      <title>Is there a patch for v4l2/mt9p031 kernel panic</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Is-there-a-patch-for-v4l2-mt9p031-kernel-panic/m-p/699250#M108568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;4.1.18 kernel, iMX6, custom board based on sabre-lite. I'm testing repeated image captures using gstreamer. Usually the code runs to completion without problem but occasionally (once every several hundred captures), I see a kernal panic from which the code never recovers:&lt;/P&gt;&lt;P&gt;[ 2201.806881] ------------[ cut here ]------------&lt;BR /&gt;[ 2201.811594] WARNING: CPU: 0 PID: 15311 at /home/pat/PepProjection/openembedded/build/tmp-glibc/work-shared/p2420-prodpcb1/kernel-source/drivers/media/i2c/mt9p031.c:1002 mt9p031_set_power+0x12c/0x17c [mt9p031]()&lt;BR /&gt;[ 2201.830329] Modules linked in: wl18xx wlcore imx_ipu_scaler imx_ipuv3_csi imx_ipu mt9p031 wlcore_sdio aptina_pll spidev coda videobuf2_vmalloc v4l2_mem2mem phytec_mediabus imx_media ipv6&lt;BR /&gt;[ 2201.847256] CPU: 0 PID: 15311 Comm: gst-launch-1.0 Not tainted 4.1.18-i.MX6-PD15.3.1 #1&lt;BR /&gt;[ 2201.855264] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)&lt;BR /&gt;[ 2201.861795] Backtrace:&lt;BR /&gt;[ 2201.864283] [&amp;lt;80013fbc&amp;gt;] (dump_backtrace) from [&amp;lt;800141d8&amp;gt;] (show_stack+0x18/0x1c)&lt;BR /&gt;[ 2201.871856]&amp;nbsp; r6:60000013 r5:00000000 r4:80b250f8 r3:00000000&lt;BR /&gt;[ 2201.877597] [&amp;lt;800141c0&amp;gt;] (show_stack) from [&amp;lt;807aa500&amp;gt;] (dump_stack+0xb4/0xe8)&lt;BR /&gt;[ 2201.884830] [&amp;lt;807aa44c&amp;gt;] (dump_stack) from [&amp;lt;8002dcc4&amp;gt;] (warn_slowpath_common+0x80/0xbc)&lt;BR /&gt;[ 2201.892922]&amp;nbsp; r10:00000008 r9:ebf9ccb8 r8:7f0c1c40 r7:000003ea r6:7f0c1464 r5:00000009&lt;BR /&gt;[ 2201.900832]&amp;nbsp; r4:00000000 r3:00000000&lt;BR /&gt;[ 2201.904445] [&amp;lt;8002dc44&amp;gt;] (warn_slowpath_common) from [&amp;lt;8002dda4&amp;gt;] (warn_slowpath_null+0x24/0x2c)&lt;BR /&gt;[ 2201.913232]&amp;nbsp; r8:eb50cac8 r7:ed7f9410 r6:eda04640 r5:ed7f9518 r4:00000000&lt;BR /&gt;[ 2201.920023] [&amp;lt;8002dd80&amp;gt;] (warn_slowpath_null) from [&amp;lt;7f0c1464&amp;gt;] (mt9p031_set_power+0x12c/0x17c [mt9p031])&lt;BR /&gt;[ 2201.929602] [&amp;lt;7f0c1338&amp;gt;] (mt9p031_set_power [mt9p031]) from [&amp;lt;7f0c14c8&amp;gt;] (mt9p031_close+0x14/0x18 [mt9p031])&lt;BR /&gt;[ 2201.939431]&amp;nbsp; r8:eb50cac8 r7:ed554410 r6:eda04640 r5:ed7f9410 r4:ebceb900 r3:7f0c14b4&lt;BR /&gt;[ 2201.947272] [&amp;lt;7f0c14b4&amp;gt;] (mt9p031_close [mt9p031]) from [&amp;lt;8054c144&amp;gt;] (subdev_close+0x40/0x8c)&lt;BR /&gt;[ 2201.955818] [&amp;lt;8054c104&amp;gt;] (subdev_close) from [&amp;lt;8053d8a0&amp;gt;] (v4l2_release+0x40/0x80)&lt;BR /&gt;[ 2201.963390]&amp;nbsp; r6:ebf9ccb8 r5:ebcfcc00 r4:eda04640 r3:8054c104&lt;BR /&gt;[ 2201.969126] [&amp;lt;8053d860&amp;gt;] (v4l2_release) from [&amp;lt;80104a18&amp;gt;] (__fput+0x90/0x1e8)&lt;BR /&gt;[ 2201.976264]&amp;nbsp; r5:00000000 r4:eda04640&lt;BR /&gt;[ 2201.979878] [&amp;lt;80104988&amp;gt;] (__fput) from [&amp;lt;80104bd0&amp;gt;] (____fput+0x10/0x14)&lt;BR /&gt;[ 2201.986582]&amp;nbsp; r10:00000000 r9:ebecc000 r8:00000000 r7:e9fc8a00 r6:00000000 r5:80b7bbf0&lt;BR /&gt;[ 2201.994491]&amp;nbsp; r4:e9fc8de0&lt;BR /&gt;[ 2201.997050] [&amp;lt;80104bc0&amp;gt;] (____fput) from [&amp;lt;80049c04&amp;gt;] (task_work_run+0xbc/0xf0)&lt;BR /&gt;[ 2202.004372] [&amp;lt;80049b48&amp;gt;] (task_work_run) from [&amp;lt;80013998&amp;gt;] (do_work_pending+0x90/0xb8)&lt;BR /&gt;[ 2202.012292]&amp;nbsp; r8:80010784 r7:80010784 r6:ebecdfb0 r5:ebecc000 r4:00000000 r3:eda04640&lt;BR /&gt;[ 2202.020122] [&amp;lt;80013908&amp;gt;] (do_work_pending) from [&amp;lt;80010604&amp;gt;] (work_pending+0xc/0x20)&lt;BR /&gt;[ 2202.027867]&amp;nbsp; r7:00000006 r6:016a20d0 r5:016a20d0 r4:016a20d4&lt;BR /&gt;[ 2202.033764] ---[ end trace 1dd9ab222c9b6c40 ]---&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found this (&lt;A class="link-titled" href="https://github.com/raspberrypi/linux/commit/f1e870c2c910d0620b1a48ac7165c8f9e9a75527" title="https://github.com/raspberrypi/linux/commit/f1e870c2c910d0620b1a48ac7165c8f9e9a75527"&gt;BCM2835-V4L2: Return buffers to videobuf2 on shutdown · raspberrypi/linux@f1e870c · GitHub&lt;/A&gt;&amp;nbsp;), which might be related. I'd be willing to test a related fix if someone can point me to the correct file and buffers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2017 15:18:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Is-there-a-patch-for-v4l2-mt9p031-kernel-panic/m-p/699250#M108568</guid>
      <dc:creator>patsandt</dc:creator>
      <dc:date>2017-08-15T15:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a patch for v4l2/mt9p031 kernel panic</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Is-there-a-patch-for-v4l2-mt9p031-kernel-panic/m-p/699251#M108569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;More info: I found this in v4l2_driver.c. That "sleep (1)" seems bad.&lt;/P&gt;&lt;P&gt;int v4l2_free_bufs(struct v4l2_driver *drv)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;unsigned int i;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (!drv-&amp;gt;n_bufs)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Requests the driver to free all buffers */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;drv-&amp;gt;reqbuf.count&amp;nbsp; = 0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;drv-&amp;gt;reqbuf.type&amp;nbsp;&amp;nbsp; = V4L2_BUF_TYPE_VIDEO_CAPTURE;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;drv-&amp;gt;reqbuf.memory = V4L2_MEMORY_MMAP;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* stop capture */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (xioctl(drv-&amp;gt;fd,VIDIOC_STREAMOFF,&amp;amp;drv-&amp;gt;reqbuf.type)&amp;lt;0)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return errno;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;EM&gt;sleep (1);&amp;nbsp;&amp;nbsp; &amp;nbsp;// FIXME: Should check if all buffers are stopped&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* V4L2 API says REQBUFS with count=0 should be used to release buffer.&lt;BR /&gt;&amp;nbsp;&amp;nbsp; However, video-buf.c doesn't implement it.&lt;BR /&gt;&amp;nbsp;*/&lt;BR /&gt;#if 0&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (xioctl(drv-&amp;gt;fd,VIDIOC_REQBUFS,&amp;amp;drv-&amp;gt;reqbuf)&amp;lt;0) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;perror("reqbufs while freeing buffers");&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return errno;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;#endif&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2017 15:49:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Is-there-a-patch-for-v4l2-mt9p031-kernel-panic/m-p/699251#M108569</guid>
      <dc:creator>patsandt</dc:creator>
      <dc:date>2017-08-15T15:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a patch for v4l2/mt9p031 kernel panic</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Is-there-a-patch-for-v4l2-mt9p031-kernel-panic/m-p/699252#M108570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Pat Sandt,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As of today, there is no support for kernel 4.1.18 on the BSPs for NXP boards. I’m not sure if Boundary Devices, manufacturers of the Sabre-Lite, might have support for this kernel, perhaps you can also ask this question on their forums.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The fix you pointed out may be the culprit but there is no patch available for the i.MX BSP so you would need to implement it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let us know of your findings and perhaps another Community user has some information on this.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Aug 2017 22:55:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Is-there-a-patch-for-v4l2-mt9p031-kernel-panic/m-p/699252#M108570</guid>
      <dc:creator>gusarambula</dc:creator>
      <dc:date>2017-08-16T22:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a patch for v4l2/mt9p031 kernel panic</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Is-there-a-patch-for-v4l2-mt9p031-kernel-panic/m-p/699253#M108571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using a Phytec module and they are using 4.1.18. However, I've been testing a fix and I'm working on a patch right now. Initial testing suggests that adding a call to v4l2_free_bufs to mt9p031_close might help. (I've run 2000 tests without a failure. I'm just building the patch now. Further testing once the patch is in the build.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Aug 2017 13:33:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Is-there-a-patch-for-v4l2-mt9p031-kernel-panic/m-p/699253#M108571</guid>
      <dc:creator>patsandt</dc:creator>
      <dc:date>2017-08-17T13:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a patch for v4l2/mt9p031 kernel panic</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Is-there-a-patch-for-v4l2-mt9p031-kernel-panic/m-p/699254#M108572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Answer: Adding a call to v4l2_free_bufs to mt9p031_close (in mt9p031.c) has apparently gotten rid of the kernel panics.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Aug 2017 20:06:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Is-there-a-patch-for-v4l2-mt9p031-kernel-panic/m-p/699254#M108572</guid>
      <dc:creator>patsandt</dc:creator>
      <dc:date>2017-08-17T20:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a patch for v4l2/mt9p031 kernel panic</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Is-there-a-patch-for-v4l2-mt9p031-kernel-panic/m-p/699255#M108573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for posting your findings! I'm sure it will help other community users.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Aug 2017 20:40:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Is-there-a-patch-for-v4l2-mt9p031-kernel-panic/m-p/699255#M108573</guid>
      <dc:creator>gusarambula</dc:creator>
      <dc:date>2017-08-17T20:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a patch for v4l2/mt9p031 kernel panic</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Is-there-a-patch-for-v4l2-mt9p031-kernel-panic/m-p/699256#M108574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I hope so. I found the problem because I'm inclined to stress test. Each&lt;/P&gt;&lt;P&gt;loop of my test captures images from two mt9p031 cameras using a gst-launch&lt;/P&gt;&lt;P&gt;script. Although I still see script hangs, I can time them out, kill the&lt;/P&gt;&lt;P&gt;scripts, and retry. That kind of fault-tolerant approach was NOT working&lt;/P&gt;&lt;P&gt;for the kernel panics.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On Thu, Aug 17, 2017 at 2:40 PM, gusarambula &amp;lt;admin@community.nxp.com&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Aug 2017 20:49:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Is-there-a-patch-for-v4l2-mt9p031-kernel-panic/m-p/699256#M108574</guid>
      <dc:creator>patsandt</dc:creator>
      <dc:date>2017-08-17T20:49:47Z</dc:date>
    </item>
  </channel>
</rss>

