All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: alsa-devel@alsa-project.org, maruthi.bayyavarapu@amd.com,
	lgirdwood@gmail.com, dri-devel@lists.freedesktop.org,
	rajeevkumar.linux@gmail.com,
	Alex Deucher <alexander.deucher@amd.com>,
	perex@perex.cz
Subject: Re: [PATCH 11/13] ASoC: AMD: add AMD ASoC ACP 2.x DMA driver
Date: Fri, 18 Dec 2015 12:04:08 +0000	[thread overview]
Message-ID: <20151218120408.GA5727@sirena.org.uk> (raw)
In-Reply-To: <1449272440-8735-11-git-send-email-alexander.deucher@amd.com>


[-- Attachment #1.1: Type: text/plain, Size: 1374 bytes --]

On Fri, Dec 04, 2015 at 06:40:38PM -0500, Alex Deucher wrote:

> +static irqreturn_t dma_irq_handler(int irq, void *arg)
> +{
> +	u16 dscr_idx;
> +	u32 intr_flag;
> +
> +	int priority_level = 0;
> +	struct device *dev = arg;
> +
> +	struct audio_drv_data *irq_data;
> +	void __iomem *acp_mmio;
> +
> +	irq_data = dev_get_drvdata(dev);
> +	acp_mmio = irq_data->acp_mmio;
> +
> +	intr_flag = acp_get_intr_flag(acp_mmio);
> +
> +	if ((intr_flag & BIT(ACP_TO_I2S_DMA_CH_NUM)) != 0) {

> +	if ((intr_flag & BIT(I2S_TO_ACP_DMA_CH_NUM)) != 0) {

> +	if ((intr_flag & BIT(ACP_TO_SYSRAM_CH_NUM)) != 0) {
> +		snd_pcm_period_elapsed(irq_data->capture_stream);
> +		acp_ext_stat_clear_dmaioc(acp_mmio, ACP_TO_SYSRAM_CH_NUM);
> +	}
> +
> +	return IRQ_HANDLED;

What if none of those flags were set?

> +		mul = (dscr == PLAYBACK_START_DMA_DESCR_CH13) ? 0 : 1;
> +		pos =  (mul * period_bytes);

Please just write normal if statements, they're a lot more legible than
the ternery operator.

> +	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
> +	case SNDRV_PCM_TRIGGER_RESUME:
> +		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
> +			acp_dma_start(rtd->acp_mmio,
> +						SYSRAM_TO_ACP_CH_NUM, false);
> +			while (acp_reg_read(rtd->acp_mmio, mmACP_DMA_CH_STS) &
> +						BIT(SYSRAM_TO_ACP_CH_NUM))
> +				cpu_relax();

This needs a timeout in case things go wrong, otherwise we lock up.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2015-12-18 12:04 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-04 23:40 [PATCH 00/13] Add ASoC support for AMD APUs [v5] Alex Deucher
2015-12-04 23:40 ` [PATCH 01/13] drm/amdgpu/cgs: add an interface to access PCI resources Alex Deucher
2015-12-04 23:40 ` [PATCH 02/13] drm/amdgpu: add irq domain support Alex Deucher
2015-12-04 23:40 ` [PATCH 03/13] ASoC: dwc: add runtime suspend/resume functionality Alex Deucher
2015-12-07 19:54   ` Applied "ASoC: dwc: add runtime suspend/resume functionality" to the asoc tree Mark Brown
2015-12-04 23:40 ` [PATCH 04/13] ASoC: dwc: add quirk for different register offset Alex Deucher
2015-12-07 19:54   ` Applied "ASoC: dwc: add quirk for different register offset" to the asoc tree Mark Brown
2015-12-04 23:40 ` [PATCH 05/13] ASoC: dwc: reconfigure dwc in 'resume' from 'suspend' Alex Deucher
2015-12-07 19:54   ` Applied "ASoC: dwc: reconfigure dwc in 'resume' from 'suspend'" to the asoc tree Mark Brown
2015-12-04 23:40 ` [PATCH 06/13] PM / Domains: export symbols to add/remove devices from genpd Alex Deucher
2015-12-18 11:25   ` Mark Brown
2015-12-04 23:40 ` [PATCH 07/13] drm/amd: add ACP driver support Alex Deucher
2015-12-04 23:40 ` [PATCH 08/13] drm/amd: add pm domain for ACP IP sub blocks Alex Deucher
2015-12-04 23:40 ` [PATCH 10/13] ASoC: AMD: add ACP 2.x IP DMA abstraction layer Alex Deucher
2015-12-18 11:22   ` Mark Brown
2015-12-04 23:40 ` [PATCH 11/13] ASoC: AMD: add AMD ASoC ACP 2.x DMA driver Alex Deucher
2015-12-18 12:04   ` Mark Brown [this message]
2015-12-04 23:40 ` [PATCH 12/13] ASoC: AMD: add pm ops Alex Deucher
2015-12-04 23:40 ` [PATCH 13/13] ASoC: AMD: Manage ACP 2.x SRAM banks power Alex Deucher
2015-12-18 12:08   ` Mark Brown
2015-12-18 12:09 ` [PATCH 00/13] Add ASoC support for AMD APUs [v5] Mark Brown
2015-12-21 19:08 ` Christian König

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=20151218120408.GA5727@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alexander.deucher@amd.com \
    --cc=alexdeucher@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lgirdwood@gmail.com \
    --cc=maruthi.bayyavarapu@amd.com \
    --cc=perex@perex.cz \
    --cc=rajeevkumar.linux@gmail.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.