All of lore.kernel.org
 help / color / mirror / Atom feed
From: Troy Kisky <troy.kisky@boundarydevices.com>
To: "Mani, Arun" <avm@ti.com>
Cc: "davinci-linux-open-source@linux.davincidsp.com"
	<davinci-linux-open-source@linux.davincidsp.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: [PATCH] To avoid the divide by zero error during the first	execution, initialize the data type.
Date: Wed, 09 Sep 2009 17:39:43 -0700	[thread overview]
Message-ID: <4AA84ACF.508@boundarydevices.com> (raw)
In-Reply-To: <7A436F7769CA33409C6B44B358BFFF0C0129E88EA5@dlee02.ent.ti.com>

Mani, Arun wrote:
> It indeed gets initialized in the hw_params. But the runtime dma parameters are not populated with the substream private data information that is gets in hw_params for the first time. I am not sure why. Any ideas?
> 
> 
> 
> Thanks,
> Arun.
> 

The real bug is in the routine davinci_i2s_startup.

The line

	cpu_dai->dma_data = dev->dma_params[substream->stream];


This works, as long as both streams aren't open.

playback stream
davinci_i2s_startup: P0 dma_params=c03a7680
davinci_pcm_dma_request: P0 dma_data=c03a7680
^^ saves pointer

capture stream
davinci_i2s_startup: C1 dma_params=c03a769c
^^ changes cpu_dai pointer
davinci_pcm_dma_request: C1 dma_data=c03a769c
^^ saves pointer
davinci_i2s_hw_params: data_type=2 C1 dma_params=c03a769c
^^ capture data_type=2

davinci_pcm_enqueue_dma: data_type=2 C1 c03a769c
davinci_pcm_enqueue_dma: data_type=2 C1 c03a769c

playback stream
davinci_i2s_hw_params: data_type=2 P0 dma_params=c03a769c
^^ playback dma_params is WRONG should be c03a7680

davinci_pcm_enqueue_dma: data_type=0 P0 c03a7680
^^ This uses the save dma_params value, hence data_type is still 0

Division by zero in kernel.


It seems like a lot of drivers may have this bug.

Troy

      reply	other threads:[~2009-09-10  0:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1252527563-15074-1-git-send-email-avm@ti.com>
2009-09-09 20:47 ` [PATCH] To avoid the divide by zero error during the first execution, initialize the data type Troy Kisky
     [not found]   ` <4AA8144A.10105-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2009-09-09 21:07     ` Mani, Arun
2009-09-10  0:39       ` Troy Kisky [this message]

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=4AA84ACF.508@boundarydevices.com \
    --to=troy.kisky@boundarydevices.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=avm@ti.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=davinci-linux-open-source@linux.davincidsp.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.