<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi to the community.<br>
<br>
I'm the man who has posted numerous questions about this problem of
fcc_enet timeout in ppc8260.<br>
I just want to say that the 2.6 kernel doesn't solve the problem if you
have it on your board (I tried it,&nbsp; normally I have a 2.4-20 linux too).<br>
I have search for this bug during a long time, and fortunatly, I 'm
happy to say you that finally, it is corrected since few days. <br>
Special thanks to "Hunter, David" for having take in consideration my
problem, and proposing me some way of invastigations in this thread:<br>
<br>
<a class="moz-txt-link-freetext" href="http://ozlabs.org/pipermail/linuxppc-embedded/2006-January/021842.html">http://ozlabs.org/pipermail/linuxppc-embedded/2006-January/021842.html</a><br>
<br>
In fact the solution comes from the new "MPC8260 PowerQUICC II Family
Reference Manual" &nbsp; fresescale has delivered 01/19/2006.<br>
<a class="moz-txt-link-freetext" href="http://www.freescale.com/files/product/doc/MPC8260UM.pdf">http://www.freescale.com/files/product/doc/MPC8260UM.pdf</a><br>
<br>
They have added a very interesting paragraph about error handling in
ethernet mode:<br>
<br>
<i>29.10.1.3 Adjusting Transmitter BD Handling<br>
When a TXE event occurs, the TBPTR may already point beyond BDs still
marked as ready due to internal<br>
pipelining. If the TBPTR is not adjusted, these BDs would be skipped
while still being marked as ready.<br>
Software must determine if these BDs should be retransmitted or if they
should be skipped, depending on<br>
the protocol and application needs. This requires the following steps:<br>
1. From the current TBPTR value, search backwards over all (if any) BDs
still marked as ready to<br>
find the first BD that has not been closed by the CPM. The search
process should stop if the BD to<br>
be checked next is not ready or if it is the most recent BD marked as
ready by the CPU transmit<br>
software. This is to avoid an endless loop in case the CPU software
fills the BD ring completely.<br>
2. A) For skipping BDs, manually close all BDs from the BD just found
up to and including the BD<br>
just before TBPTR. Leave the TBPTR value untouched.<br>
B) For retransmitting BDs, change the TBPTR value to point to the BD
just found.<br>
</i><br>
So, here is the correction&nbsp; I have done to the fcc-enet.c driver, and
wich I'am very satsify<br>
I have tested it on my platform which was always entering in this
infernal timeout loop when there was successive plug/unplug during
important data transfert.<br>
Thanks to some trace, I have seen that, as it is said in the new
manual, the error comes from the pipelining and a bad restart procedure
in the driver.<br>
(I think it is the same restart procedure in the 2.6 kernel ??? to
verify ...)<br>
With this correction, I have no more infernal timeout&nbsp; loop. <br>
In fact, I replace the restart procedure in the fcc_enet_interrupt
method by this one, which respect the MPC8260 manual restart procedure:<br>
<br>
<font face="Times New Roman, Times, serif"><small>if (must_restart) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; volatile cpm8260_t *cp;<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /* Some transmit errors cause the transmitter to shut<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;* down.&nbsp; We now issue a restart transmit.&nbsp; Since the<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;* errors close the BD and update the pointers, the restart<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;* _should_ pick up without having to reset any of our<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;* pointers either.&nbsp; Also, To workaround 8260 device erratum <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;* CPM37, we must disable and then re-enable the transmitter<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;* following a Late Collision, Underrun, or Retry Limit error.<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;*/<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;// disable Transmitter <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cep-&gt;fccp-&gt;fcc_gfmr &amp;= ~FCC_GFMR_ENT;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; udelay(10); /* wait a few microseconds just on principle */<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #ifdef THALES_DEBUG_TRACE <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; printk("Thales restart debug trace :\n");<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; printk("first dirty tx %d, final dirty_tx %d, tbptr
%d\n",cbt_ptr2index(dev,first_bdp_dirty_tx),cbt_ptr2index(dev,cep-&gt;dirty_tx),tbptr_ptr2index(dev,ep-&gt;fen_genfcc.fcc_tbptr));<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #endif<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // RESTART TX command to the cpm<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cp = cpmp;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cp-&gt;cp_cpcr = mk_cr_cmd(cep-&gt;fip-&gt;fc_cpmpage,
cep-&gt;fip-&gt;fc_cpmblock,0x0c, CPM_CR_RESTART_TX) | CPM_CR_FLG;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; while (cp-&gt;cp_cpcr &amp; CPM_CR_FLG);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Adjusting Transmitter BD Handling<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /* HLO : I do not search backwards from the current TBPTR value
to found skip BDs, but I directly <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;* adjust the tbptr value to the dirty_tx current value.<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;* In case of problemes occuring, change it and do like
indicated in 29.10.3 of MPC8260 manual<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;*/<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ep-&gt;fen_genfcc.fcc_tbptr = __pa(cep-&gt;dirty_tx);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #ifdef THALES_DEBUG_TRACE <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; printk(" Thales workaround tbptr value adjusted :
%d\n",tbptr_ptr2index(dev,ep-&gt;fen_genfcc.fcc_tbptr));<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #endif<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // re-enable Transmitter&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cep-&gt;fccp-&gt;fcc_gfmr |=&nbsp; FCC_GFMR_ENT;<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
</small></font><br>
I hope this correction will help you and the community.<br>
<br>
Best regards<br>
<br>
<br>
Siju Viswanath K E a &eacute;crit&nbsp;:
<blockquote cite="mid1143193658.22246.20.camel@Blaze" type="cite">
  <pre wrap="">Hi Denk,
        Thanks for the suggestion. I had a look at the source repository
at projects/linuxppc_2_4_devel.git site. Outdated code doesnt seem to be
the issue. My repository is patched upto 
"Patch by Wojciech Kromer, 06 Jan 2004" and later changes are only
adding extra board support. 

regards,
Siju Viswanath

On Fri, 2006-03-24 at 13:21, Wolfgang Denk wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">In message &lt;1143177651.22246.3.camel@Blaze&gt; you wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap="">        I am using denk's linuxppc-2.4.20 . I am getting this problem of
      </pre>
    </blockquote>
    <pre wrap="">Why don't you try using a more current version of the code? 2.4.20 is
*very* old, and *lots* of bugs and problems have been fixed since.

It really does not make sense to spend effort on such old code.

Best regards,

Wolfgang Denk
    </pre>
  </blockquote>
  <pre wrap=""><!---->
_______________________________________________
Linuxppc-embedded mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Linuxppc-embedded@ozlabs.org">Linuxppc-embedded@ozlabs.org</a>
<a class="moz-txt-link-freetext" href="https://ozlabs.org/mailman/listinfo/linuxppc-embedded">https://ozlabs.org/mailman/listinfo/linuxppc-embedded</a>

  </pre>
</blockquote>
</body>
</html>