<?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>i.MX Processors中的主题 flexcan driver issue</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/flexcan-driver-issue/m-p/839660#M128805</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working with udoo quad (IMX6q). I've got the can bus up and running. However i have run into a similar issue referred to in this blog post&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/thread/330079?q=flexcan%20bug%20atomic" title="https://community.nxp.com/message/432806?q=flexcan%20bug%20atomic"&gt;https://community.nxp.com/message/432806?q=flexcan%20bug%20atomic&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="link-titled" href="https://community.nxp.com/thread/330079?q=flexcan%20bug%20atomic" title="https://community.nxp.com/message/432806?q=flexcan%20bug%20atomic"&gt;iMX6 FlexCAN generates 'BUG: scheduling while atomic' on every CAN send&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[ 187.633144] BUG: scheduling while atomic: swapper/0/0/0x00000102&lt;BR /&gt;[ 254.513103] INFO: rcu_preempt detected stalls on CPUs/tasks: { 0} (detected by 1, t=2439 jiffies, g=4294967258, c=4294967257, q=2)&lt;BR /&gt;[ 254.524955] Task dump for CPU 0:&lt;BR /&gt;[ 254.528201] swapper/0 D 804e8630 0 0 0 0x00000002&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i'm currently working with udooneo(imx6sx) and udooquad(imx6q). Applying the patch suggested in the post above&amp;nbsp; fixed the issue on imx6sx board. But on udooquad it has become intermittent. It happens sometimes on "ifconfig can0 up" or when the communication is started. Below is the patch i have applied to both imx6sx and imx6q. I'm using kernel 3.14.56-r0 (yocto poky distro).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;---&lt;BR /&gt; drivers/net/can/flexcan.c | 10 +++++-----&lt;BR /&gt; 1 file changed, 5 insertions(+), 5 deletions(-)&lt;/P&gt;&lt;P&gt;diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c&lt;BR /&gt;index 8de484b..42c8e63 100644&lt;BR /&gt;--- a/drivers/net/can/flexcan.c&lt;BR /&gt;+++ b/drivers/net/can/flexcan.c&lt;BR /&gt;@@ -340,7 +340,7 @@ static int flexcan_chip_enable(struct flexcan_priv *priv)&lt;BR /&gt; flexcan_write(reg, &amp;amp;regs-&amp;gt;mcr);&lt;BR /&gt; &lt;BR /&gt; while (timeout-- &amp;amp;&amp;amp; (flexcan_read(&amp;amp;regs-&amp;gt;mcr) &amp;amp; FLEXCAN_MCR_LPM_ACK))&lt;BR /&gt;- usleep_range(10, 20);&lt;BR /&gt;+ udelay(10);&lt;BR /&gt; &lt;BR /&gt; if (flexcan_read(&amp;amp;regs-&amp;gt;mcr) &amp;amp; FLEXCAN_MCR_LPM_ACK)&lt;BR /&gt; return -ETIMEDOUT;&lt;BR /&gt;@@ -359,7 +359,7 @@ static int flexcan_chip_disable(struct flexcan_priv *priv)&lt;BR /&gt; flexcan_write(reg, &amp;amp;regs-&amp;gt;mcr);&lt;BR /&gt; &lt;BR /&gt; while (timeout-- &amp;amp;&amp;amp; !(flexcan_read(&amp;amp;regs-&amp;gt;mcr) &amp;amp; FLEXCAN_MCR_LPM_ACK))&lt;BR /&gt;- usleep_range(10, 20);&lt;BR /&gt;+ udelay(10);&lt;BR /&gt; &lt;BR /&gt; if (!(flexcan_read(&amp;amp;regs-&amp;gt;mcr) &amp;amp; FLEXCAN_MCR_LPM_ACK))&lt;BR /&gt; return -ETIMEDOUT;&lt;BR /&gt;@@ -378,7 +378,7 @@ static int flexcan_chip_freeze(struct flexcan_priv *priv)&lt;BR /&gt; flexcan_write(reg, &amp;amp;regs-&amp;gt;mcr);&lt;BR /&gt; &lt;BR /&gt; while (timeout-- &amp;amp;&amp;amp; !(flexcan_read(&amp;amp;regs-&amp;gt;mcr) &amp;amp; FLEXCAN_MCR_FRZ_ACK))&lt;BR /&gt;- usleep_range(100, 200);&lt;BR /&gt;+ udelay(100);&lt;BR /&gt; &lt;BR /&gt; if (!(flexcan_read(&amp;amp;regs-&amp;gt;mcr) &amp;amp; FLEXCAN_MCR_FRZ_ACK))&lt;BR /&gt; return -ETIMEDOUT;&lt;BR /&gt;@@ -397,7 +397,7 @@ static int flexcan_chip_unfreeze(struct flexcan_priv *priv)&lt;BR /&gt; flexcan_write(reg, &amp;amp;regs-&amp;gt;mcr);&lt;BR /&gt; &lt;BR /&gt; while (timeout-- &amp;amp;&amp;amp; (flexcan_read(&amp;amp;regs-&amp;gt;mcr) &amp;amp; FLEXCAN_MCR_FRZ_ACK))&lt;BR /&gt;- usleep_range(10, 20);&lt;BR /&gt;+ udelay(10);&lt;BR /&gt; &lt;BR /&gt; if (flexcan_read(&amp;amp;regs-&amp;gt;mcr) &amp;amp; FLEXCAN_MCR_FRZ_ACK)&lt;BR /&gt; return -ETIMEDOUT;&lt;BR /&gt;@@ -412,7 +412,7 @@ static int flexcan_chip_softreset(struct flexcan_priv *priv)&lt;BR /&gt; &lt;BR /&gt; flexcan_write(FLEXCAN_MCR_SOFTRST, &amp;amp;regs-&amp;gt;mcr);&lt;BR /&gt; while (timeout-- &amp;amp;&amp;amp; (flexcan_read(&amp;amp;regs-&amp;gt;mcr) &amp;amp; FLEXCAN_MCR_SOFTRST))&lt;BR /&gt;- usleep_range(10, 20);&lt;BR /&gt;+ udelay(10);&lt;BR /&gt; &lt;BR /&gt; if (flexcan_read(&amp;amp;regs-&amp;gt;mcr) &amp;amp; FLEXCAN_MCR_SOFTRST)&lt;BR /&gt; return -ETIMEDOUT;&lt;BR /&gt;-- &lt;BR /&gt;2.7.4&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Jul 2018 14:50:15 GMT</pubDate>
    <dc:creator>mohammedtalha</dc:creator>
    <dc:date>2018-07-02T14:50:15Z</dc:date>
    <item>
      <title>flexcan driver issue</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/flexcan-driver-issue/m-p/839660#M128805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working with udoo quad (IMX6q). I've got the can bus up and running. However i have run into a similar issue referred to in this blog post&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/thread/330079?q=flexcan%20bug%20atomic" title="https://community.nxp.com/message/432806?q=flexcan%20bug%20atomic"&gt;https://community.nxp.com/message/432806?q=flexcan%20bug%20atomic&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="link-titled" href="https://community.nxp.com/thread/330079?q=flexcan%20bug%20atomic" title="https://community.nxp.com/message/432806?q=flexcan%20bug%20atomic"&gt;iMX6 FlexCAN generates 'BUG: scheduling while atomic' on every CAN send&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[ 187.633144] BUG: scheduling while atomic: swapper/0/0/0x00000102&lt;BR /&gt;[ 254.513103] INFO: rcu_preempt detected stalls on CPUs/tasks: { 0} (detected by 1, t=2439 jiffies, g=4294967258, c=4294967257, q=2)&lt;BR /&gt;[ 254.524955] Task dump for CPU 0:&lt;BR /&gt;[ 254.528201] swapper/0 D 804e8630 0 0 0 0x00000002&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i'm currently working with udooneo(imx6sx) and udooquad(imx6q). Applying the patch suggested in the post above&amp;nbsp; fixed the issue on imx6sx board. But on udooquad it has become intermittent. It happens sometimes on "ifconfig can0 up" or when the communication is started. Below is the patch i have applied to both imx6sx and imx6q. I'm using kernel 3.14.56-r0 (yocto poky distro).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;---&lt;BR /&gt; drivers/net/can/flexcan.c | 10 +++++-----&lt;BR /&gt; 1 file changed, 5 insertions(+), 5 deletions(-)&lt;/P&gt;&lt;P&gt;diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c&lt;BR /&gt;index 8de484b..42c8e63 100644&lt;BR /&gt;--- a/drivers/net/can/flexcan.c&lt;BR /&gt;+++ b/drivers/net/can/flexcan.c&lt;BR /&gt;@@ -340,7 +340,7 @@ static int flexcan_chip_enable(struct flexcan_priv *priv)&lt;BR /&gt; flexcan_write(reg, &amp;amp;regs-&amp;gt;mcr);&lt;BR /&gt; &lt;BR /&gt; while (timeout-- &amp;amp;&amp;amp; (flexcan_read(&amp;amp;regs-&amp;gt;mcr) &amp;amp; FLEXCAN_MCR_LPM_ACK))&lt;BR /&gt;- usleep_range(10, 20);&lt;BR /&gt;+ udelay(10);&lt;BR /&gt; &lt;BR /&gt; if (flexcan_read(&amp;amp;regs-&amp;gt;mcr) &amp;amp; FLEXCAN_MCR_LPM_ACK)&lt;BR /&gt; return -ETIMEDOUT;&lt;BR /&gt;@@ -359,7 +359,7 @@ static int flexcan_chip_disable(struct flexcan_priv *priv)&lt;BR /&gt; flexcan_write(reg, &amp;amp;regs-&amp;gt;mcr);&lt;BR /&gt; &lt;BR /&gt; while (timeout-- &amp;amp;&amp;amp; !(flexcan_read(&amp;amp;regs-&amp;gt;mcr) &amp;amp; FLEXCAN_MCR_LPM_ACK))&lt;BR /&gt;- usleep_range(10, 20);&lt;BR /&gt;+ udelay(10);&lt;BR /&gt; &lt;BR /&gt; if (!(flexcan_read(&amp;amp;regs-&amp;gt;mcr) &amp;amp; FLEXCAN_MCR_LPM_ACK))&lt;BR /&gt; return -ETIMEDOUT;&lt;BR /&gt;@@ -378,7 +378,7 @@ static int flexcan_chip_freeze(struct flexcan_priv *priv)&lt;BR /&gt; flexcan_write(reg, &amp;amp;regs-&amp;gt;mcr);&lt;BR /&gt; &lt;BR /&gt; while (timeout-- &amp;amp;&amp;amp; !(flexcan_read(&amp;amp;regs-&amp;gt;mcr) &amp;amp; FLEXCAN_MCR_FRZ_ACK))&lt;BR /&gt;- usleep_range(100, 200);&lt;BR /&gt;+ udelay(100);&lt;BR /&gt; &lt;BR /&gt; if (!(flexcan_read(&amp;amp;regs-&amp;gt;mcr) &amp;amp; FLEXCAN_MCR_FRZ_ACK))&lt;BR /&gt; return -ETIMEDOUT;&lt;BR /&gt;@@ -397,7 +397,7 @@ static int flexcan_chip_unfreeze(struct flexcan_priv *priv)&lt;BR /&gt; flexcan_write(reg, &amp;amp;regs-&amp;gt;mcr);&lt;BR /&gt; &lt;BR /&gt; while (timeout-- &amp;amp;&amp;amp; (flexcan_read(&amp;amp;regs-&amp;gt;mcr) &amp;amp; FLEXCAN_MCR_FRZ_ACK))&lt;BR /&gt;- usleep_range(10, 20);&lt;BR /&gt;+ udelay(10);&lt;BR /&gt; &lt;BR /&gt; if (flexcan_read(&amp;amp;regs-&amp;gt;mcr) &amp;amp; FLEXCAN_MCR_FRZ_ACK)&lt;BR /&gt; return -ETIMEDOUT;&lt;BR /&gt;@@ -412,7 +412,7 @@ static int flexcan_chip_softreset(struct flexcan_priv *priv)&lt;BR /&gt; &lt;BR /&gt; flexcan_write(FLEXCAN_MCR_SOFTRST, &amp;amp;regs-&amp;gt;mcr);&lt;BR /&gt; while (timeout-- &amp;amp;&amp;amp; (flexcan_read(&amp;amp;regs-&amp;gt;mcr) &amp;amp; FLEXCAN_MCR_SOFTRST))&lt;BR /&gt;- usleep_range(10, 20);&lt;BR /&gt;+ udelay(10);&lt;BR /&gt; &lt;BR /&gt; if (flexcan_read(&amp;amp;regs-&amp;gt;mcr) &amp;amp; FLEXCAN_MCR_SOFTRST)&lt;BR /&gt; return -ETIMEDOUT;&lt;BR /&gt;-- &lt;BR /&gt;2.7.4&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jul 2018 14:50:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/flexcan-driver-issue/m-p/839660#M128805</guid>
      <dc:creator>mohammedtalha</dc:creator>
      <dc:date>2018-07-02T14:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: flexcan driver issue</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/flexcan-driver-issue/m-p/839661#M128806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mohammed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.14.56 kernel not is maintained by nxp, recommended to try with official bsps&lt;/P&gt;&lt;P&gt;described on below link, for example L3.14.52&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://source.codeaurora.org/external/imx/linux-imx/tree/?h=imx_3.14.52_1.1.0_ga" title="https://source.codeaurora.org/external/imx/linux-imx/tree/?h=imx_3.14.52_1.1.0_ga"&gt;linux-imx - i.MX Linux kernel&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.nxp.com%2Fsupport%2Fdeveloper-resources%2Frun-time-software%2Fi.mx-developer-resources%2Fi.mx-6series-i.mx-7series-software-and-development-tool-resources%3AIMX_SW" rel="nofollow" target="_blank"&gt;https://www.nxp.com/support/developer-resources/run-time-software/i.mx-developer-resources/i.mx-6series-i.mx-7series-software-and-development-tool-resources:IMX_SW&lt;/A&gt;&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>Mon, 02 Jul 2018 23:13:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/flexcan-driver-issue/m-p/839661#M128806</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2018-07-02T23:13:44Z</dc:date>
    </item>
  </channel>
</rss>

