From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: tiwai@suse.de, alsa-devel@alsa-project.org,
Mark Brown <broonie@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Jarkko Nikula <jarkko.nikula@bitmer.com>
Subject: Re: [PATCH] ASoC: omap-pcm: Lower the dma coherent mask to 32bits
Date: Thu, 5 Dec 2013 17:33:46 +0200 [thread overview]
Message-ID: <52A09CDA.6010700@ti.com> (raw)
In-Reply-To: <20131205095619.GC4360@n2100.arm.linux.org.uk>
On 12/05/2013 11:56 AM, Russell King - ARM Linux wrote:
> On Thu, Dec 05, 2013 at 10:06:42AM +0200, Peter Ujfalusi wrote:
>> The underlying API dma_coerce_mask_and_coherent() checks the requested bits
>> mask against the size of dma_addr_t which is 32bits on OMAP.
>> Because of the previously used 64bits mask audio was not probing after
>> commit c9bd5e6 (and 4dcfa6007).
>> 32bits for the DMA_BIT_MASK looks to be the correct one to use.
>>
>> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
>> ---
>> Hi Mark,
>>
>> This is the fix for OMAP audio for 3.13-rc2+. The dma coherent changes went in
>> between -rc1 and -rc2 which broke things because omap-pcm was using 64bits for
>> dma coherent mask.
>
> Can you please try to understand _why_ it broke and post an explanation.
> This breakage wasn't expected and shouldn't have happened.
I'm not that familiar with this part of the code (mm, dma-mapping) but so far
this is what I found:
ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(64));
is successful, no failure to set the mask to 64.
later on when requesting the dma channel however:
arm_dma_alloc() -> get_coherent_dma_mask() fails.
As far I can see we have different checks in case of
dma_coerce_mask_and_coherent() and arm_dma_alloc():
[1] dma_coerce_mask_and_coherent() -> dma_supported()
if (sizeof(mask) != sizeof(dma_addr_t) &&
mask > (dma_addr_t)~0 &&
dma_to_pfn(dev, ~0) > arm_dma_pfn_limit) /* !!! */
return 0;
[2] arm_dma_alloc() -> get_coherent_dma_mask()
if (sizeof(mask) != sizeof(dma_addr_t) &&
mask > (dma_addr_t)~0 &&
dma_to_pfn(dev, ~0) > min(max_pfn, arm_dma_pfn_limit)) /* !!! */
return 0;
On omap4:
max_pfn: 0xc0000, arm_dma_pfn_limit: 0xfffff
Not sure which check is the correct one but I think in both cases we should
have the same check in this way we can catch the issue at
dma_coerce_mask_and_coherent() time and try to figure out what to do.
In case of omap-pcm we request for 64 bit because of future SoCs, but I think
it would be fine to try first 64 and in case it is not supported fall back to 32.
--
Péter
next prev parent reply other threads:[~2013-12-05 15:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-05 8:06 [PATCH] ASoC: omap-pcm: Lower the dma coherent mask to 32bits Peter Ujfalusi
2013-12-05 9:56 ` Russell King - ARM Linux
2013-12-05 15:33 ` Peter Ujfalusi [this message]
2013-12-05 19:28 ` Russell King - ARM Linux
2013-12-05 20:11 ` Takashi Iwai
2013-12-05 21:07 ` Russell King - ARM Linux
2013-12-06 8:12 ` Takashi Iwai
2013-12-06 12:25 ` Russell King - ARM Linux
2013-12-06 13:04 ` Takashi Iwai
2013-12-09 9:56 ` Peter Ujfalusi
2013-12-09 17:03 ` Russell King - ARM Linux
2013-12-10 9:37 ` Peter Ujfalusi
2013-12-10 10:00 ` Peter Ujfalusi
2013-12-13 11:46 ` Peter Ujfalusi
2013-12-13 11:49 ` Russell King - ARM Linux
2013-12-13 11:50 ` Peter Ujfalusi
2013-12-06 9:31 ` Peter Ujfalusi
2013-12-06 12:33 ` Russell King - ARM Linux
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=52A09CDA.6010700@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=jarkko.nikula@bitmer.com \
--cc=lgirdwood@gmail.com \
--cc=linux@arm.linux.org.uk \
--cc=tiwai@suse.de \
/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.