From: Vinod Koul <vinod.koul@intel.com>
To: Mark Brown <broonie@kernel.org>
Cc: liam.r.girdwood@linux.intel.com, tiwai@suse.de,
alsa-devel@alsa-project.org,
"Subhransu S. Prusty" <subhransu.s.prusty@intel.com>,
patches.audio@intel.com
Subject: Re: [RFC 4/9] ASoC: hda: Add DSP init and boot up functionality
Date: Sun, 26 Apr 2015 19:51:15 +0530 [thread overview]
Message-ID: <20150426142115.GT2738@intel.com> (raw)
In-Reply-To: <20150424171140.GU22845@sirena.org.uk>
[-- Attachment #1.1: Type: text/plain, Size: 1775 bytes --]
On Fri, Apr 24, 2015 at 06:11:40PM +0100, Mark Brown wrote:
> On Fri, Apr 17, 2015 at 06:46:02PM +0530, Vinod Koul wrote:
>
> > +static int ssth_acquire_irq(struct ssth_lib *ctx)
> > +{
> > + if (request_threaded_irq(ctx->irq, ssth_interrupt,
> > + NULL, IRQF_SHARED, KBUILD_MODNAME, ctx)) {
> > + dev_err(ctx->dev, "unable to grab threaded IRQ %d, disabling device\n", ctx->irq);
> > + return -1;
>
> Don't discard the return code, pass it back. I'm pretty sure the error
> wasn't -EPERM anyway. Though...
yes, we will fix it
>
> > +
> > + /* initialize IPC */
> > + ctx->ipc = ssth_ipc_init(ctx->dev, ctx);
> > + if (ctx->ipc == NULL)
> > + ret = -ENODEV;
> > +
> > + /* Now let's request the IRQ */
> > + ssth_acquire_irq(ctx);
>
> ..of course we ignore errors anyway. Why not just inline this?
thats not right, we should do that...
>
> > +int ssth_dsp_free0(struct ssth_lib *dsp)
> > +{
> > + int ret = 0;
> > +
> > + dev_dbg(dsp->dev, "In %s\n", __func__);
> > +
> > + ssth_ipc_int_disable(dsp);
> > +
> > + free_irq(dsp->irq, dsp);
> > + ssth_ipc_free(dsp->ipc);
> > + ssth_disable_dsp_core(dsp);
> > + kfree(dsp);
> > + return ret;
> > +}
> > +EXPORT_SYMBOL_GPL(ssth_dsp_free0);
>
> free0?
crap, will fix
>
> > +bool ssth_dsp_is_running(struct ssth_lib *ctx)
> > +{
> > + bool ret = 0;
> > +
> > + mutex_lock(&ctx->sst_lock);
> > + ret = (ctx->sst_state == SST_DSP_RUNNING) ? 1 : 0;
> > + mutex_unlock(&ctx->sst_lock);
>
> How does this get used? The state could change immediately after
> returning. Also no need for the ternery operator there, logic
> operations generate logic results anyway.
yes you are right, we should hold the lock and check, will fix this
Thanks
--
~Vinod
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2015-04-26 14:24 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-17 13:15 [RFC 0/9] Add SKL ipc handling code Vinod Koul
2015-04-17 13:15 ` [RFC 1/9] ASoC: hda: Add helper to read/write to dsp mmio space Vinod Koul
2015-04-20 21:46 ` Mark Brown
2015-04-22 3:50 ` Vinod Koul
2015-04-24 17:33 ` Mark Brown
2015-04-26 14:34 ` Vinod Koul
2015-04-27 21:02 ` Mark Brown
2015-04-29 11:03 ` Vinod Koul
2015-04-17 13:16 ` [RFC 2/9] ASoC: hda: Add IPC library for SKL platform Vinod Koul
2015-04-20 21:56 ` Mark Brown
2015-04-22 3:54 ` Vinod Koul
2015-04-24 17:34 ` Mark Brown
2015-04-26 14:36 ` Vinod Koul
2015-04-17 13:16 ` [RFC 3/9] ASoC: hda: Add config option for SKL ipc library Vinod Koul
2015-04-17 13:16 ` [RFC 4/9] ASoC: hda: Add DSP init and boot up functionality Vinod Koul
2015-04-24 17:11 ` Mark Brown
2015-04-26 14:21 ` Vinod Koul [this message]
2015-04-17 13:16 ` [RFC 5/9] ASoC: hda: Add dsp loader ops Vinod Koul
2015-04-17 13:16 ` [RFC 6/9] ASoC: hda: Add Code Loader DMA support Vinod Koul
2015-04-24 17:18 ` Mark Brown
2015-04-26 14:28 ` Vinod Koul
2015-04-27 14:17 ` Mark Brown
2015-04-29 11:08 ` Vinod Koul
2015-04-17 13:16 ` [RFC 7/9] ASoC: hda: Add DSP library functions for SKL platform Vinod Koul
2015-04-17 13:16 ` [RFC 8/9] ASoC: hda: Add for CL DMA interrupt handling Vinod Koul
2015-04-24 17:30 ` Mark Brown
2015-04-26 14:28 ` Vinod Koul
2015-04-17 13:16 ` [RFC 9/9] ASoC: hda: Export API to change DSP power state Vinod Koul
2015-04-24 17:33 ` Mark Brown
2015-04-20 21:44 ` [RFC 0/9] Add SKL ipc handling code Mark Brown
2015-04-22 4:00 ` Vinod Koul
2015-04-22 11:19 ` Liam Girdwood
2015-04-22 15:53 ` Vinod Koul
2015-04-22 19:06 ` Mark Brown
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=20150426142115.GT2738@intel.com \
--to=vinod.koul@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=liam.r.girdwood@linux.intel.com \
--cc=patches.audio@intel.com \
--cc=subhransu.s.prusty@intel.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox