<?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 Send SPI data in the tasklet in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Send-SPI-data-in-the-tasklet/m-p/874958#M132832</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone&lt;BR /&gt;I am using the 3.14.52 kernel on the IMX6 development board. I am using SPI to send data. Use the spi_sync function to send SPI data directly in the write function of file_operations, which can be sent and received normally. The SPI data is sent using the spi_async function, and the program reports an error. Then my goal is to send SPI data in the tasklet. But in the tasklet, whether it is spi_sync function or spi_async, it reports an error. Do you have any good solutions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Mar 2019 01:16:36 GMT</pubDate>
    <dc:creator>864535720</dc:creator>
    <dc:date>2019-03-07T01:16:36Z</dc:date>
    <item>
      <title>Send SPI data in the tasklet</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Send-SPI-data-in-the-tasklet/m-p/874958#M132832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone&lt;BR /&gt;I am using the 3.14.52 kernel on the IMX6 development board. I am using SPI to send data. Use the spi_sync function to send SPI data directly in the write function of file_operations, which can be sent and received normally. The SPI data is sent using the spi_async function, and the program reports an error. Then my goal is to send SPI data in the tasklet. But in the tasklet, whether it is spi_sync function or spi_async, it reports an error. Do you have any good solutions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2019 01:16:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Send-SPI-data-in-the-tasklet/m-p/874958#M132832</guid>
      <dc:creator>864535720</dc:creator>
      <dc:date>2019-03-07T01:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Send SPI data in the tasklet</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Send-SPI-data-in-the-tasklet/m-p/874959#M132833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi 其东 刘&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;nxp ecspi driver uses queues as described in sect.37.2.1 SPI Sub-System in Linux OS&lt;/P&gt;&lt;P&gt;attached Linux Manual. One can try to implement tasklets using tasklet apis described on&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developer.ibm.com/tutorials/l-tasklets/" title="https://developer.ibm.com/tutorials/l-tasklets/"&gt;Deferrable functions, kernel tasklets, and work queues – IBM Developer&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://www.cs.otago.ac.nz/cosc440/labs/lab08.pdf" title="http://www.cs.otago.ac.nz/cosc440/labs/lab08.pdf"&gt;http://www.cs.otago.ac.nz/cosc440/labs/lab08.pdf&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;igor&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2019 02:37:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Send-SPI-data-in-the-tasklet/m-p/874959#M132833</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2019-03-07T02:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Send SPI data in the tasklet</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Send-SPI-data-in-the-tasklet/m-p/874960#M132834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" data-avatarid="1034" data-externalid="" data-online="false" data-presence="null" data-userid="206296" data-username="igorpadykov" href="https://community.nxp.com/people/igorpadykov"&gt;igorpadykov&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I can now send SPI data using spi_async in the tasklet. At the same time, I encountered another problem. If I send data once in 1s, the data can be sent and received normally. If I send the data once in 1ms. The kernel will still crash. At the same time, I recorded the number of times the taskelt was called and the number of times the spi callback function was called. It is found that the number of calls to the taskelt is more than the number of calls to the spi callback function. Do you have any good suggestions for my situation?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Here is the information for my kernel crash prompt:&lt;/P&gt;&lt;P&gt;Sometimes prompted：&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unable to handle kernel NULL pointer dereference at virtual address 00000004&lt;BR /&gt;pgd = 80004000&lt;BR /&gt;[00000004] *pgd=00000000&lt;BR /&gt;Internal error: Oops: 817 [#1] PREEMPT SMP ARM&lt;BR /&gt;Modules linked in: spi_lqd(O)&lt;BR /&gt;CPU: 1 PID: 96 Comm: spi1 Tainted: G&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; O 3.14.52-1.1.1_ga #235&lt;BR /&gt;task: a8326d00 ti: a82f6000 task.ti: a82f6000&lt;BR /&gt;PC is at spi_pump_messages+0xdc/0x480&lt;BR /&gt;LR is at _raw_spin_lock_irqsave+0x18/0x5c&lt;BR /&gt;pc : [&amp;lt;8041c40c&amp;gt;]&amp;nbsp;&amp;nbsp;&amp;nbsp; lr : [&amp;lt;8075bdc8&amp;gt;]&amp;nbsp;&amp;nbsp;&amp;nbsp; psr: 60070093&lt;BR /&gt;sp : a82f7f08&amp;nbsp; ip : 00000000&amp;nbsp; fp : a837ddcc&lt;BR /&gt;r10: 80d0f504&amp;nbsp; r9 : 00000001&amp;nbsp; r8 : a82f6000&lt;BR /&gt;r7 : a837ddb4&amp;nbsp; r6 : a837dc00&amp;nbsp; r5 : 80d0f504&amp;nbsp; r4 : a837dde8&lt;BR /&gt;r3 : a87d5644&amp;nbsp; r2 : 00000000&amp;nbsp; r1 : a0070013&amp;nbsp; r0 : 00000000&lt;BR /&gt;Flags: nZCv&amp;nbsp; IRQs off&amp;nbsp; FIQs on&amp;nbsp; Mode SVC_32&amp;nbsp; ISA ARM&amp;nbsp; Segment kernel&lt;BR /&gt;Control: 10c53c7d&amp;nbsp; Table: 387a804a&amp;nbsp; DAC: 00000015&lt;BR /&gt;Process spi1 (pid: 96, stack limit = 0xa82f6238)&lt;BR /&gt;Stack: (0xa82f7f08 to 0xa82f8000)&lt;BR /&gt;7f00:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 00000000 a837ddb4 a82f6000 00000001 80d0f504 a837ddcc&lt;BR /&gt;7f20: 80d0f504 00000000 a837ddb4 a82f6000 00000001 80d0f504 a82f6000 80045408&lt;BR /&gt;7f40: a8326d00 00000000 a8194d00 a837ddb4 800453bc 00000000 00000000 00000000&lt;BR /&gt;7f60: 00000000 8004528c 36e5fded 00000000 dcd7bffd a837ddb4 00000000 00000000&lt;BR /&gt;7f80: a82f7f80 a82f7f80 00000000 00000000 a82f7f90 a82f7f90 a82f7fac a8194d00&lt;BR /&gt;7fa0: 800451c0 00000000 00000000 8000e500 00000000 00000000 00000000 00000000&lt;BR /&gt;7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000&lt;BR /&gt;7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 ff9df77d d5f5fedb&lt;BR /&gt;[&amp;lt;8041c40c&amp;gt;] (spi_pump_messages) from [&amp;lt;80045408&amp;gt;] (kthread_worker_fn+0x4c/0x164)&lt;BR /&gt;[&amp;lt;80045408&amp;gt;] (kthread_worker_fn) from [&amp;lt;8004528c&amp;gt;] (kthread+0xcc/0xe4)&lt;BR /&gt;[&amp;lt;8004528c&amp;gt;] (kthread) from [&amp;lt;8000e500&amp;gt;] (ret_from_fork+0x14/0x34)&lt;BR /&gt;Code: eafffff5 e2432024 e58b2028 e8930005 (e5802004) &lt;BR /&gt;---[ end trace 1c380d84298e318a ]---&lt;BR /&gt;note: spi1[96] exited with preempt_count 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sometimes prompted：&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unable to handle kernel NULL pointer dereference at virtual address 00000160&lt;BR /&gt;pgd = 80004000&lt;BR /&gt;[00000160] *pgd=00000000&lt;BR /&gt;Internal error: Oops: 17 [#1] PREEMPT SMP ARM&lt;BR /&gt;Modules linked in: spi_lqd(O)&lt;BR /&gt;CPU: 1 PID: 96 Comm: spi1 Tainted: G&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; O 3.14.52-1.1.1_ga #235&lt;BR /&gt;task: a8326d00 ti: a82f6000 task.ti: a82f6000&lt;BR /&gt;PC is at spi_imx_setupxfer+0xc/0x1bc&lt;BR /&gt;LR is at spi_bitbang_transfer_one+0x148/0x244&lt;BR /&gt;pc : [&amp;lt;8041fa94&amp;gt;]&amp;nbsp;&amp;nbsp;&amp;nbsp; lr : [&amp;lt;8041e258&amp;gt;]&amp;nbsp;&amp;nbsp;&amp;nbsp; psr: 20070013&lt;BR /&gt;sp : a82f7eb8&amp;nbsp; ip : 00000000&amp;nbsp; fp : a837ddcc&lt;BR /&gt;r10: 80c7b6f0&amp;nbsp; r9 : ffffffff&amp;nbsp; r8 : a837de48&lt;BR /&gt;r7 : 00000000&amp;nbsp; r6 : a876b020&amp;nbsp; r5 : 00000000&amp;nbsp; r4 : a876b050&lt;BR /&gt;r3 : 8041fa88&amp;nbsp; r2 : 00000000&amp;nbsp; r1 : a876b050&amp;nbsp; r0 : 00000000&lt;BR /&gt;Flags: nzCv&amp;nbsp; IRQs on&amp;nbsp; FIQs on&amp;nbsp; Mode SVC_32&amp;nbsp; ISA ARM&amp;nbsp; Segment kernel&lt;BR /&gt;Control: 10c53c7d&amp;nbsp; Table: 38ac804a&amp;nbsp; DAC: 00000015&lt;BR /&gt;Process spi1 (pid: 96, stack limit = 0xa82f6238)&lt;BR /&gt;Stack: (0xa82f7eb8 to 0xa82f8000)&lt;BR /&gt;7ea0:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a837ddcc 8075c43c&lt;BR /&gt;7ec0: 00000000 60070013 a876b050 00000001 a876b020 8041e258 a837ddcc a837dc00&lt;BR /&gt;7ee0: 00000000 a876afec a876b020 a837dc00 a837de10 a8121a10 a8121a10 00000001&lt;BR /&gt;7f00: a837ddcc 8041c638 a837ddcc 80d0f504 00000000 a837ddb4 a82f6000 a837ddcc&lt;BR /&gt;7f20: 80d0f504 00000000 a837ddb4 a82f6000 00000001 80d0f504 a82f6000 80045408&lt;BR /&gt;7f40: a8326d00 00000000 a8194d00 a837ddb4 800453bc 00000000 00000000 00000000&lt;BR /&gt;7f60: 00000000 8004528c 36e5fded 00000000 dcdfbffd a837ddb4 00000000 00000000&lt;BR /&gt;7f80: a82f7f80 a82f7f80 00000000 00000000 a82f7f90 a82f7f90 a82f7fac a8194d00&lt;BR /&gt;7fa0: 800451c0 00000000 00000000 8000e500 00000000 00000000 00000000 00000000&lt;BR /&gt;7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000&lt;BR /&gt;7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 ff9df7fd d5f5fedb&lt;BR /&gt;[&amp;lt;8041fa94&amp;gt;] (spi_imx_setupxfer) from [&amp;lt;8041e258&amp;gt;] (spi_bitbang_transfer_one+0x148/0x244)&lt;BR /&gt;[&amp;lt;8041e258&amp;gt;] (spi_bitbang_transfer_one) from [&amp;lt;8041c638&amp;gt;] (spi_pump_messages+0x308/0x480)&lt;BR /&gt;[ &amp;lt;1860:4018c:638&amp;gt;] (spi_pump_messages) from [&amp;lt;80045408&amp;gt;] (kthread_worker_fn+0x4c/0x164)&lt;BR /&gt;[&amp;lt;8004528c&amp;gt;] (kthread) from [&amp;lt;8000e500&amp;gt;] (ret_from_fork+0x14/0x34)&lt;BR /&gt;Code: e8bd8010 e92d4070 e1a05000 e24dd010 (e5900160) &lt;BR /&gt;---[ end trace ac4df25e44f27646 ]---&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Mar 2019 00:48:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Send-SPI-data-in-the-tasklet/m-p/874960#M132834</guid>
      <dc:creator>864535720</dc:creator>
      <dc:date>2019-03-08T00:48:51Z</dc:date>
    </item>
  </channel>
</rss>

