<?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のトピックUDEV trigger for SD card insert and remove in iMX28 Linux 2.6.35</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/UDEV-trigger-for-SD-card-insert-and-remove-in-iMX28-Linux-2-6-35/m-p/222885#M15114</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;I have my bord based on iMX28 + LTIB + Linux 2.6.35 (design based on iMX28 EVK).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;I use internal FLASH and sometimes I need to plug external mass storage like USB pendrive o SD card. I wrote my custom udev rules for manage my external devices. When I insert/remove pendrive all works fine: udev receives trigger on connect (ADD) and on disconnect (REMOVE). When I try to do the same actions with SD card (mmc0) sometimes I don't receive any plug notification: if I see DUART terminal, there are no messages and no udev rules triggered (if all works fine, for example, when I remove sd card I see a message like "mmc0: card removed" in duart console). If I look for mmc0 (all partitions) object in my sysfs, in effect I don't see any entry to sd card.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;&lt;/SPAN&gt;May be this a problem in sd driver? Is there a patch?&lt;/P&gt;&lt;P&gt;Please note: if I plug sd card and after I turn on my device, the rule "ADD" is always triggered and also REMOVE rule is correctly triggered.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;Emanuele&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 May 2013 19:23:37 GMT</pubDate>
    <dc:creator>emanuelec</dc:creator>
    <dc:date>2013-05-02T19:23:37Z</dc:date>
    <item>
      <title>UDEV trigger for SD card insert and remove in iMX28 Linux 2.6.35</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/UDEV-trigger-for-SD-card-insert-and-remove-in-iMX28-Linux-2-6-35/m-p/222885#M15114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;I have my bord based on iMX28 + LTIB + Linux 2.6.35 (design based on iMX28 EVK).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;I use internal FLASH and sometimes I need to plug external mass storage like USB pendrive o SD card. I wrote my custom udev rules for manage my external devices. When I insert/remove pendrive all works fine: udev receives trigger on connect (ADD) and on disconnect (REMOVE). When I try to do the same actions with SD card (mmc0) sometimes I don't receive any plug notification: if I see DUART terminal, there are no messages and no udev rules triggered (if all works fine, for example, when I remove sd card I see a message like "mmc0: card removed" in duart console). If I look for mmc0 (all partitions) object in my sysfs, in effect I don't see any entry to sd card.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;&lt;/SPAN&gt;May be this a problem in sd driver? Is there a patch?&lt;/P&gt;&lt;P&gt;Please note: if I plug sd card and after I turn on my device, the rule "ADD" is always triggered and also REMOVE rule is correctly triggered.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;Emanuele&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 May 2013 19:23:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/UDEV-trigger-for-SD-card-insert-and-remove-in-iMX28-Linux-2-6-35/m-p/222885#M15114</guid>
      <dc:creator>emanuelec</dc:creator>
      <dc:date>2013-05-02T19:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: UDEV trigger for SD card insert and remove in iMX28 Linux 2.6.35</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/UDEV-trigger-for-SD-card-insert-and-remove-in-iMX28-Linux-2-6-35/m-p/222886#M15115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SOLVED!&lt;/P&gt;&lt;P&gt;I found a workaround.&lt;/P&gt;&lt;P&gt;The problem is:&lt;/P&gt;&lt;P&gt;when I plug SD card inside SD card connector, mmc driver detects the card via mxs_mmc_is_plugged function (file: mxs-mmc.c). But tested flag is not correctly set (I think) because it doesn't reflect the status of SSP_DETECT pin. This because the flag is set when sd card is not completely inserted inside sd connector: this flag is set just when gold connectors of sd card connect the pins of the sd slot. SSPx_DETECT pin is moved only when SD card is completely inserted in sd slot because there is a switch inside the sd connector that &lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;electrically put SSPx_DETECT to ground (or VCC when released)&lt;/SPAN&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;Workaround I use is simple (function: mxs_mmc_detect_poll, file: mxs-mmc.c):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[..]&lt;/P&gt;&lt;P&gt;card_status = mxs_mmc_is_plugged(host);&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(card_status != host-&amp;gt;present &amp;amp;&amp;amp; card_status == 1 &amp;amp;&amp;amp; numTry &amp;lt; 5) {&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;STRONG&gt;numTry&lt;/STRONG&gt;&lt;STRONG&gt;++;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; card_status = host-&amp;gt;present;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;} else {&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;STRONG&gt;numTry&lt;/STRONG&gt;&lt;STRONG&gt; = 0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (card_status != host-&amp;gt;present)&lt;/P&gt;&lt;P&gt;[..]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I simply wait few seconds after plug detection. In this time I suppose the sd card is correctly inserted inside sd connector...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 May 2013 16:44:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/UDEV-trigger-for-SD-card-insert-and-remove-in-iMX28-Linux-2-6-35/m-p/222886#M15115</guid>
      <dc:creator>emanuelec</dc:creator>
      <dc:date>2013-05-19T16:44:05Z</dc:date>
    </item>
  </channel>
</rss>

