<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7234.20">
<TITLE>SPI controller hangs in 2.6 and not in 2.4 (on MPC875)</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Hi Melinda,<BR>
<BR>
the problem in my case was caused by the following instructions to allocate the buffers for SPI controller tx and rx:<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rxbuffer = (u8*)m8xx_cpm_hostalloc(SPI_MAX_BUFFER_SIZE);&nbsp;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; txbuffer = (u8*)m8xx_cpm_hostalloc(SPI_MAX_BUFFER_SIZE);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Set the bd's rx and tx buffer address pointers<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rbdf-&gt;cbd_bufaddr = virt_to_bus((void *)rxbuffer);&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tbdf-&gt;cbd_bufaddr = virt_to_bus((void *)txbuffer);&nbsp;&nbsp;<BR>
<BR>
I don't know why (I'm asking an opinion to Vitaly Bordug), I replaced the allocation of rx and tx buffers with:<BR>
<BR>
...-&gt;cbd_bufaddr = __pa(__get_free_page(GFP_KERNEL | GFP_DMA))<BR>
<BR>
but it will better to use dma_alloc_coherent.<BR>
In my case the use of m8xx_cpm_hostalloc led to an immediate kernel hang after giving the start command to the spi controller.<BR>
<BR>
Bye,<BR>
Antonio.<BR>
<BR>
<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;&nbsp;<BR>
</FONT>
</P>

</BODY>
</HTML>