From: Tony Lindgren <tony@atomide.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: David Brownell <david-b@pacbell.net>,
"Woodruff, Richard" <r-woodruff2@ti.com>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
Eduardo Valentin <edubezval@gmail.com>
Subject: Re: FOR COMMENT: void __iomem * and similar casts are Bad News
Date: Wed, 3 Sep 2008 17:28:45 -0700 [thread overview]
Message-ID: <20080904002844.GL23085@atomide.com> (raw)
In-Reply-To: <20080903225654.GO19980@flint.arm.linux.org.uk>
* Russell King - ARM Linux <linux@arm.linux.org.uk> [080903 15:57]:
> On Wed, Sep 03, 2008 at 03:05:59PM -0700, David Brownell wrote:
> > According to Mr. Grep, there are at least 10 ARMs that work
> > like that in mainline. Maybe Russell can recommend one of
> > them as a preferred model.
>
> As I've been trying to say, I see this as a separate issue for the near
> future. At the moment, I'm trying to concentrate on one aspect only.
>
> That is, getting OMAP to the point that we're using the compiler to
> warn us when we do something silly, like passing a virtual address
> to a function which takes a physical address, and fixing the places
> which are currently wrong.
>
> Anything else like changing the ioremap behaviour is actually
> completely orthogonal to that, and *is* a distraction. Rather than
> actually fixing the mcbsp.c issue, I've spent the last hour or so
> composing various replies to Richard's emails, and then postponing
> them, reading more of this thread, creating more replies, postponing
> those as well, etc.
>
> Anyway, what I've done now is committed the minimal set of fixes so
> far to go into mainline for the current -rc so we can at least improve
> the situation there. That's not to say that the other patch won't be
> going in - it will in some form or other.
>
> It can also be applied to the omap tree by saving this message as
> "whateverpatchfile", running:
>
> sed -i 's,\[id\]\.,->,' whateverpatchfile
>
> and then applying "whateverpatchfile". Expect some offsets.
>
> Arun - can you please test this patch on your 5912 OSK board to see if
> it resolves your problem please?
Audio still works with n810 after this patch, so I'll apply it also
to l-o tree.
Can anybody from TI confirm that the DMA is using only 28 bits of the
src/dest address? At least that's the best explanation so far why it
was working earlier even without this patch.
Acked-by: Tony Lindgren <tony@atomide.com>
> diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c
> index 826010d..b6ffbab 100644
> --- a/arch/arm/mach-omap1/mcbsp.c
> +++ b/arch/arm/mach-omap1/mcbsp.c
> @@ -184,7 +184,7 @@ static struct omap_mcbsp_platform_data omap730_mcbsp_pdata[] = {
> #ifdef CONFIG_ARCH_OMAP15XX
> static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = {
> {
> - .virt_base = OMAP1510_MCBSP1_BASE,
> + .virt_base = io_p2v(OMAP1510_MCBSP1_BASE),
> .dma_rx_sync = OMAP_DMA_MCBSP1_RX,
> .dma_tx_sync = OMAP_DMA_MCBSP1_TX,
> .rx_irq = INT_McBSP1RX,
> @@ -201,7 +201,7 @@ static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = {
> .ops = &omap1_mcbsp_ops,
> },
> {
> - .virt_base = OMAP1510_MCBSP3_BASE,
> + .virt_base = io_p2v(OMAP1510_MCBSP3_BASE),
> .dma_rx_sync = OMAP_DMA_MCBSP3_RX,
> .dma_tx_sync = OMAP_DMA_MCBSP3_TX,
> .rx_irq = INT_McBSP3RX,
> @@ -219,7 +219,7 @@ static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = {
> #ifdef CONFIG_ARCH_OMAP16XX
> static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = {
> {
> - .virt_base = OMAP1610_MCBSP1_BASE,
> + .virt_base = io_p2v(OMAP1610_MCBSP1_BASE),
> .dma_rx_sync = OMAP_DMA_MCBSP1_RX,
> .dma_tx_sync = OMAP_DMA_MCBSP1_TX,
> .rx_irq = INT_McBSP1RX,
> @@ -236,7 +236,7 @@ static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = {
> .ops = &omap1_mcbsp_ops,
> },
> {
> - .virt_base = OMAP1610_MCBSP3_BASE,
> + .virt_base = io_p2v(OMAP1610_MCBSP3_BASE),
> .dma_rx_sync = OMAP_DMA_MCBSP3_RX,
> .dma_tx_sync = OMAP_DMA_MCBSP3_TX,
> .rx_irq = INT_McBSP3RX,
> diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
> index d084405..5245a2a 100644
> --- a/arch/arm/plat-omap/mcbsp.c
> +++ b/arch/arm/plat-omap/mcbsp.c
> @@ -651,7 +651,7 @@ int omap_mcbsp_xmit_buffer(unsigned int id, dma_addr_t buffer,
> omap_set_dma_dest_params(mcbsp[id].dma_tx_lch,
> src_port,
> OMAP_DMA_AMODE_CONSTANT,
> - mcbsp[id].io_base + OMAP_MCBSP_REG_DXR1,
> + io_v2p(mcbsp[id].io_base + OMAP_MCBSP_REG_DXR1),
> 0, 0);
>
> omap_set_dma_src_params(mcbsp[id].dma_tx_lch,
> @@ -712,7 +712,7 @@ int omap_mcbsp_recv_buffer(unsigned int id, dma_addr_t buffer,
> omap_set_dma_src_params(mcbsp[id].dma_rx_lch,
> src_port,
> OMAP_DMA_AMODE_CONSTANT,
> - mcbsp[id].io_base + OMAP_MCBSP_REG_DRR1,
> + io_v2p(mcbsp[id].io_base + OMAP_MCBSP_REG_DRR1),
> 0, 0);
>
> omap_set_dma_dest_params(mcbsp[id].dma_rx_lch,
>
>
next prev parent reply other threads:[~2008-09-04 0:28 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-27 22:08 FOR COMMENT: void __iomem * and similar casts are Bad News Russell King
2008-08-31 21:47 ` David Brownell
2008-09-02 22:15 ` Tony Lindgren
2008-09-03 7:55 ` Russell King - ARM Linux
2008-09-03 16:40 ` Tony Lindgren
2008-09-03 19:34 ` Russell King - ARM Linux
2008-09-03 19:48 ` Tony Lindgren
2008-09-03 21:09 ` David Brownell
2008-09-03 23:02 ` Russell King - ARM Linux
2008-09-03 19:58 ` Woodruff, Richard
2008-09-03 20:30 ` Russell King - ARM Linux
2008-09-03 21:19 ` Woodruff, Richard
2008-09-03 20:32 ` Tony Lindgren
2008-09-03 21:32 ` Woodruff, Richard
2008-09-03 21:35 ` Tony Lindgren
2008-09-03 21:38 ` Russell King - ARM Linux
2008-09-03 21:46 ` Multi-Boot: Was " Woodruff, Richard
2008-09-03 21:18 ` David Brownell
2008-09-03 21:40 ` Woodruff, Richard
2008-09-03 22:05 ` David Brownell
2008-09-03 22:56 ` Russell King - ARM Linux
2008-09-04 0:28 ` Tony Lindgren [this message]
2008-09-04 1:06 ` David Brownell
2008-09-04 7:25 ` Arun KS
2008-09-03 15:07 ` Eduardo Valentin
2008-09-03 18:01 ` Tony Lindgren
2008-09-04 0:16 ` David Brownell
2008-09-03 15:33 ` Eduardo Valentin
2008-09-03 18:48 ` Russell King
2008-09-03 19:33 ` Eduardo Valentin
2008-09-03 19:48 ` Russell King - ARM Linux
2008-09-03 20:04 ` Eduardo Valentin
2008-09-03 20:45 ` Russell King - ARM Linux
2008-09-03 20:50 ` Tony Lindgren
2008-09-03 20:56 ` Tony Lindgren
2008-09-03 21:07 ` Russell King - ARM Linux
2008-09-03 21:13 ` Tony Lindgren
2008-09-03 21:00 ` Koen Kooi
2008-09-03 20:37 ` Tony Lindgren
2008-09-03 21:04 ` Russell King - ARM Linux
2008-09-03 21:26 ` Eduardo Valentin
2008-09-03 21:48 ` Tony Lindgren
2008-09-03 21:35 ` David Brownell
2008-09-03 23:16 ` Russell King - ARM Linux
2008-09-04 9:46 ` Russell King - ARM Linux
2008-09-04 16:10 ` Tony Lindgren
2008-09-04 16:12 ` Russell King - ARM Linux
2008-09-04 16:29 ` Tony Lindgren
2008-09-04 17:07 ` Russell King - ARM Linux
2008-09-04 17:58 ` Tony Lindgren
2008-09-04 21:01 ` Russell King - ARM Linux
2008-09-04 21:20 ` Tony Lindgren
2008-09-05 1:07 ` Tony Lindgren
2008-09-05 5:17 ` Paul Walmsley
2008-09-05 5:58 ` Paul Walmsley
2008-09-29 5:16 ` Arun KS
2008-09-29 7:44 ` Jarkko Nikula
2008-09-29 9:24 ` Arun KS
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=20080904002844.GL23085@atomide.com \
--to=tony@atomide.com \
--cc=david-b@pacbell.net \
--cc=edubezval@gmail.com \
--cc=linux-omap@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=r-woodruff2@ti.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.