lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 28 Oct 2014 20:16:33 +0300
From:	Max Filippov <jcmvbkbc@...il.com>
To:	Lars-Peter Clausen <lars@...afoo.de>
Cc:	alsa-devel@...a-project.org, Mark Rutland <mark.rutland@....com>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	Pawel Moll <pawel.moll@....com>,
	"linux-xtensa@...ux-xtensa.org" <linux-xtensa@...ux-xtensa.org>,
	Takashi Iwai <tiwai@...e.de>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Liam Girdwood <lgirdwood@...il.com>,
	Rob Herring <robh+dt@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Mark Brown <broonie@...nel.org>,
	Kumar Gala <galak@...eaurora.org>,
	Grant Likely <grant.likely@...aro.org>
Subject: Re: [alsa-devel] [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

Hi Lars-Peter,

On Tue, Oct 28, 2014 at 6:58 PM, Lars-Peter Clausen <lars@...afoo.de> wrote:
> On 10/27/2014 08:07 PM, Max Filippov wrote:
>
> A few minor things.
>
> [...]
>
>> +static irqreturn_t xtfpga_i2s_interrupt(int irq, void *dev_id)
>> +       if (tx_active) {
>> +               if (i2s->tx_fifo_high < 256)
>> +                       xtfpga_i2s_refill_fifo(i2s);
>> +               else
>> +                       tasklet_hi_schedule(&i2s->refill_fifo);
>
> Maybe use threaded IRQs instead of IRQ + tasklet.

Ok, I'll look at it.

>> +static int xtfpga_pcm_trigger(struct snd_pcm_substream *substream, int

> If you don't do anything you don't need the handler. The core will handle
> things if it is NULL.

Ok.

>> +static struct snd_pcm_ops xtfpga_pcm_ops = {
>
> const

Ok.

>> +static int xtfpga_i2s_probe(struct platform_device *pdev)
>> +       dev_set_drvdata(&pdev->dev, i2s);
>
> platform_set_drvdata(...)

Ok.

>> +       i2s->dev = &pdev->dev;
>> +       dev_dbg(&pdev->dev, "dev: %p, i2s: %p\n", &pdev->dev, i2s);
>> +
>> +       mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> +       if (!mem) {
>> +               dev_err(&pdev->dev, "No memory resource\n");
>> +               err = -ENODEV;
>> +               goto err;
>> +       }
>
> devm_ioremap_resource will check if mem is NULL and print a error message,
> so the check above can be removed.

Ok.

>> +       irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
>
> platform_get_irq(...)

Ok.

>> +       err = devm_request_irq(&pdev->dev, irq->start,
>> xtfpga_i2s_interrupt,
>> +                              IRQF_SHARED, pdev->name, i2s);
>> +       if (err < 0) {
>> +               dev_err(&pdev->dev, "request_irq failed\n");
>> +               goto err;
>> +       }
>> +       tasklet_init(&i2s->refill_fifo, xtfpga_i2s_refill_fifo_tasklet,
>> +                    (unsigned long)i2s);
>> +
>
>
> Since the tasklet is is used in the interrupt handler it should initialized
> before the IRQ is requested.

Ok.

>> +static int xtfpga_i2s_remove(struct platform_device *pdev)
>> +{
>> +       struct xtfpga_i2s *i2s = dev_get_drvdata(&pdev->dev);
>> +
>> +       if (i2s) {
>
>
> This will always be non NULL.

Ok.

-- 
Thanks.
-- Max
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ