diff mbox

[3/3] FIXUP: FROMLIST: ASoC: amd: Report accurate hw_ptr during dma

Message ID 20171108172404.19118-4-alexander.deucher@amd.com (mailing list archive)
State Accepted
Commit 7db08b2cb36cbfbcb06c44dc8e48ccb6a119466f
Headers show

Commit Message

Alex Deucher Nov. 8, 2017, 5:24 p.m. UTC
From: Guenter Roeck <groeck@chromium.org>

ERROR: "__aeabi_uldivmod" [sound/soc/amd/snd-soc-acp-pcm.ko] undefined!

64-bit divides require special operations to avoid build errors on 32-bit
systems.

BUG=b:63121716
TEST="Build i386:allmodconfig"

Signed-off-by: Guenter Roeck <groeck@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/678919
Reviewed-by: Jason Clinton <jclinton@chromium.org>
(cherry picked from commit 7ca726e80f21abdbaed9a5a70def1c33a26f8533)
Reviewed-on: https://chromium-review.googlesource.com/681618
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 sound/soc/amd/acp-pcm-dma.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Alex Deucher Nov. 8, 2017, 5:42 p.m. UTC | #1
On Wed, Nov 8, 2017 at 12:29 PM, Guenter Roeck <groeck@google.com> wrote:
> On Wed, Nov 8, 2017 at 9:24 AM, Alex Deucher <alexdeucher@gmail.com> wrote:
>>
>> From: Guenter Roeck <groeck@chromium.org>
>>
>> ERROR: "__aeabi_uldivmod" [sound/soc/amd/snd-soc-acp-pcm.ko] undefined!
>>
>> 64-bit divides require special operations to avoid build errors on 32-bit
>> systems.
>>
>> BUG=b:63121716
>> TEST="Build i386:allmodconfig"
>>
>
> Is this an upstream submission ? Fine with me, but it should not include any
> chromium specific tags, neither in the subject not in the description.

I'm not familiar with which are chromium specific (TEST, BUG, FIXUP,
FROMLIST I guess?). The info seems useful to have in the bug, but I
can respin if it's a big deal.

Alex

>
> Guenter
>
>>
>> Signed-off-by: Guenter Roeck <groeck@chromium.org>
>> Reviewed-on: https://chromium-review.googlesource.com/678919
>> Reviewed-by: Jason Clinton <jclinton@chromium.org>
>> (cherry picked from commit 7ca726e80f21abdbaed9a5a70def1c33a26f8533)
>> Reviewed-on: https://chromium-review.googlesource.com/681618
>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>> ---
>>  sound/soc/amd/acp-pcm-dma.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c
>> index 13d040a4d26f..ef7e98ad960c 100644
>> --- a/sound/soc/amd/acp-pcm-dma.c
>> +++ b/sound/soc/amd/acp-pcm-dma.c
>> @@ -856,12 +856,11 @@ static snd_pcm_uframes_t acp_dma_pointer(struct
>> snd_pcm_substream *substream)
>>         if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
>>                 if (bytescount > rtd->renderbytescount)
>>                         bytescount = bytescount - rtd->renderbytescount;
>> -               pos =  bytescount % buffersize;
>>         } else {
>>                 if (bytescount > rtd->capturebytescount)
>>                         bytescount = bytescount - rtd->capturebytescount;
>> -               pos = bytescount % buffersize;
>>         }
>> +       pos = do_div(bytescount, buffersize);
>>         return bytes_to_frames(runtime, pos);
>>  }
>>
>> --
>> 2.13.6
>>
>
Alex Deucher Nov. 8, 2017, 5:45 p.m. UTC | #2
On Wed, Nov 8, 2017 at 12:42 PM, Alex Deucher <alexdeucher@gmail.com> wrote:
> On Wed, Nov 8, 2017 at 12:29 PM, Guenter Roeck <groeck@google.com> wrote:
>> On Wed, Nov 8, 2017 at 9:24 AM, Alex Deucher <alexdeucher@gmail.com> wrote:
>>>
>>> From: Guenter Roeck <groeck@chromium.org>
>>>
>>> ERROR: "__aeabi_uldivmod" [sound/soc/amd/snd-soc-acp-pcm.ko] undefined!
>>>
>>> 64-bit divides require special operations to avoid build errors on 32-bit
>>> systems.
>>>
>>> BUG=b:63121716
>>> TEST="Build i386:allmodconfig"
>>>
>>
>> Is this an upstream submission ? Fine with me, but it should not include any
>> chromium specific tags, neither in the subject not in the description.
>
> I'm not familiar with which are chromium specific (TEST, BUG, FIXUP,
> FROMLIST I guess?). The info seems useful to have in the bug, but I
> can respin if it's a big deal.

s/bug/commit message/

Alex

>
> Alex
>
>>
>> Guenter
>>
>>>
>>> Signed-off-by: Guenter Roeck <groeck@chromium.org>
>>> Reviewed-on: https://chromium-review.googlesource.com/678919
>>> Reviewed-by: Jason Clinton <jclinton@chromium.org>
>>> (cherry picked from commit 7ca726e80f21abdbaed9a5a70def1c33a26f8533)
>>> Reviewed-on: https://chromium-review.googlesource.com/681618
>>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>>> ---
>>>  sound/soc/amd/acp-pcm-dma.c | 3 +--
>>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>>
>>> diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c
>>> index 13d040a4d26f..ef7e98ad960c 100644
>>> --- a/sound/soc/amd/acp-pcm-dma.c
>>> +++ b/sound/soc/amd/acp-pcm-dma.c
>>> @@ -856,12 +856,11 @@ static snd_pcm_uframes_t acp_dma_pointer(struct
>>> snd_pcm_substream *substream)
>>>         if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
>>>                 if (bytescount > rtd->renderbytescount)
>>>                         bytescount = bytescount - rtd->renderbytescount;
>>> -               pos =  bytescount % buffersize;
>>>         } else {
>>>                 if (bytescount > rtd->capturebytescount)
>>>                         bytescount = bytescount - rtd->capturebytescount;
>>> -               pos = bytescount % buffersize;
>>>         }
>>> +       pos = do_div(bytescount, buffersize);
>>>         return bytes_to_frames(runtime, pos);
>>>  }
>>>
>>> --
>>> 2.13.6
>>>
>>
Mark Brown Nov. 8, 2017, 6 p.m. UTC | #3
On Wed, Nov 08, 2017 at 12:45:16PM -0500, Alex Deucher wrote:
> On Wed, Nov 8, 2017 at 12:42 PM, Alex Deucher <alexdeucher@gmail.com> wrote:

> > I'm not familiar with which are chromium specific (TEST, BUG, FIXUP,
> > FROMLIST I guess?). The info seems useful to have in the bug, but I
> > can respin if it's a big deal.

> s/bug/commit message/

All of those are Chrome specific.  If in doubt look at what other people
are using.
diff mbox

Patch

diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c
index 13d040a4d26f..ef7e98ad960c 100644
--- a/sound/soc/amd/acp-pcm-dma.c
+++ b/sound/soc/amd/acp-pcm-dma.c
@@ -856,12 +856,11 @@  static snd_pcm_uframes_t acp_dma_pointer(struct snd_pcm_substream *substream)
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
 		if (bytescount > rtd->renderbytescount)
 			bytescount = bytescount - rtd->renderbytescount;
-		pos =  bytescount % buffersize;
 	} else {
 		if (bytescount > rtd->capturebytescount)
 			bytescount = bytescount - rtd->capturebytescount;
-		pos = bytescount % buffersize;
 	}
+	pos = do_div(bytescount, buffersize);
 	return bytes_to_frames(runtime, pos);
 }