linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Jon Hunter <jonathanh@nvidia.com>
Cc: Laxman Dewangan <ldewangan@nvidia.com>,
	Vinod Koul <vinod.koul@intel.com>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Alexandre Courbot <gnurou@gmail.com>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	dmaengine@vger.kernel.org, linux-tegra@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2 2/2] dmaengine: tegra-adma: Add support for Tegra210 ADMA
Date: Tue, 06 Oct 2015 11:32:35 +0200	[thread overview]
Message-ID: <16524792.BmEijCQ1oc@wuerfel> (raw)
In-Reply-To: <1444047007-30494-3-git-send-email-jonathanh@nvidia.com>

On Monday 05 October 2015 13:10:07 Jon Hunter wrote:
> Add support for the Tegra210 Audio DMA controller that is used for
> transferring data between system memory and the Audio sub-system.
> The driver only supports cyclic transfers because this is being solely
> used for audio.
> 
> This driver is based upon the work by Dara Ramesh <dramesh@nvidia.com>.
> 
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>

This version looks much better!

Just one small comment:

> +	slave_req = dma_spec->args[0];
> +	slave_dir = dma_spec->args[1];
> +
> +	if (slave_req == 0)
> +		return NULL;
> +
> +	switch (slave_dir) {
> +	case ADMA_AHUB_TO_MEM:
> +		if (slave_req > tdma->rx_requests)
> +			return NULL;
> +
> +		if (tdma->rx_requests_reserved & BIT(slave_req))
> +			return NULL;
> +
> +		tdma->rx_requests_reserved |= BIT(slave_req);
> +		break;

The rx_requests_reserved logic looks racy, if you have more than
one concurrent request or release. Better use atomic_test_and_set()
here and turn the variable into an atomic_t.

	Arbd

  reply	other threads:[~2015-10-06  9:32 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-05 12:10 [PATCH V2 0/2] Add support for Tegra210 ADMA Jon Hunter
2015-10-05 12:10 ` [PATCH V2 1/2] Documentation: DT: Add binding documentation for NVIDIA ADMA Jon Hunter
     [not found]   ` <1444047007-30494-2-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-10-05 13:12     ` Mark Rutland
2015-10-06  9:16       ` Jon Hunter
     [not found]         ` <56139181.4090706-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-10-06 22:57           ` Stephen Warren
     [not found]             ` <561451D3.2070605-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2015-10-07 15:26               ` Jon Hunter
     [not found]                 ` <56153991.3040409-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-10-07 16:05                   ` Stephen Warren
2015-10-07 16:33                     ` Mark Rutland
2015-10-06 23:04     ` Stephen Warren
     [not found]       ` <56145369.7040404-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2015-10-07  8:43         ` Jon Hunter
     [not found]           ` <5614DB41.5080907-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-10-07 16:09             ` Stephen Warren
     [not found]               ` <561543A2.2090402-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2015-10-07 16:19                 ` Jon Hunter
     [not found]                   ` <56154629.8080205-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-10-07 19:36                     ` Stephen Warren
2015-10-08  9:58                       ` Jon Hunter
2015-10-08 14:27                         ` Stephen Warren
2015-10-09 10:20                           ` Jon Hunter
     [not found]                             ` <56179505.7020301-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-10-09 15:26                               ` Stephen Warren
     [not found]                                 ` <5617DC89.7000505-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2015-10-12 13:55                                   ` Jon Hunter
     [not found]                                     ` <561BBBC8.5050107-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-10-12 17:51                                       ` Stephen Warren
     [not found]                                         ` <561BF33F.7090408-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2015-10-13 12:56                                           ` Jon Hunter
2015-10-07 16:38             ` Mark Rutland
2015-10-05 12:10 ` [PATCH V2 2/2] dmaengine: tegra-adma: Add support for Tegra210 ADMA Jon Hunter
2015-10-06  9:32   ` Arnd Bergmann [this message]
2015-10-06  9:45     ` Jon Hunter
     [not found]   ` <1444047007-30494-3-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-10-14 11:27     ` Vinod Koul
2015-10-14 13:34       ` Jon Hunter

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=16524792.BmEijCQ1oc@wuerfel \
    --to=arnd@arndb.de \
    --cc=dmaengine@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=gnurou@gmail.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jonathanh@nvidia.com \
    --cc=ldewangan@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=swarren@wwwdotorg.org \
    --cc=thierry.reding@gmail.com \
    --cc=vinod.koul@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).