From: Vitaly Bordug <vbordug@ru.mvista.com>
To: "DI BACCO ANTONIO - technolabs" <Antonio.DiBacco@technolabs.it>
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: SPI controller hangs in 2.6 and not in 2.4 (on MPC875)
Date: Mon, 26 Feb 2007 10:41:23 +0300 [thread overview]
Message-ID: <20070226104123.46e18917@localhost.localdomain> (raw)
In-Reply-To: <F1F6EC0C8B75034F9E3A79FC85122E8E264927@aquib01a>
On Sun, 25 Feb 2007 20:51:12 +0100
DI BACCO ANTONIO - technolabs wrote:
> Hi Melinda,
>
> the problem in my case was caused by the following instructions to
> allocate the buffers for SPI controller tx and rx:
>
> rxbuffer = (u8*)m8xx_cpm_hostalloc(SPI_MAX_BUFFER_SIZE);
> txbuffer = (u8*)m8xx_cpm_hostalloc(SPI_MAX_BUFFER_SIZE);
> // Set the bd's rx and tx buffer address pointers
> rbdf->cbd_bufaddr = virt_to_bus((void
> *)rxbuffer); tbdf->cbd_bufaddr = virt_to_bus((void *)txbuffer);
>
> I don't know why (I'm asking an opinion to Vitaly Bordug), I replaced
> the allocation of rx and tx buffers with:
>
> ...->cbd_bufaddr = __pa(__get_free_page(GFP_KERNEL | GFP_DMA))
>
Well this is just evil... even if it works :)
> but it will better to use dma_alloc_coherent.
> In my case the use of m8xx_cpm_hostalloc led to an immediate kernel
> hang after giving the start command to the spi controller.
>
Heh, this case you'lll have to use dpram for the buffers I guess iiuc.
dma_* stuff might work too but I'm not sure. Moreover, it didn't work for
me in case of powerpc, where m8xx_cpm_hostalloc made as a placeholder for
dma_alloc_coherent...
next prev parent reply other threads:[~2007-02-26 7:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-25 19:51 SPI controller hangs in 2.6 and not in 2.4 (on MPC875) DI BACCO ANTONIO - technolabs
2007-02-26 7:41 ` Vitaly Bordug [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-02-25 14:52 melinda develey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070226104123.46e18917@localhost.localdomain \
--to=vbordug@ru.mvista.com \
--cc=Antonio.DiBacco@technolabs.it \
--cc=linuxppc-embedded@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).