All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: Xiang Wang <wangxfdu@gmail.com>
Cc: Dan Williams <djbw@fb.com>,
	linux-kernel@vger.kernel.org, cxie4@marvell.com,
	Xiang Wang <wangx@marvell.com>
Subject: Re: [PATCH 1/2] dma: mmp_pdma: add protect when alloc/free phy channels
Date: Mon, 17 Jun 2013 18:56:07 +0530	[thread overview]
Message-ID: <20130617132607.GA10671@intel.com> (raw)
In-Reply-To: <1370246529-17155-2-git-send-email-wangxfdu@gmail.com>

On Mon, Jun 03, 2013 at 04:02:08PM +0800, Xiang Wang wrote:
> From: Xiang Wang <wangx@marvell.com>
> 
> In mmp pdma, phy channels are allocated/freed dynamically
> and frequently. But no proper protection is added.
> Conflict will happen when multi-users are requesting phy
> channels at the same time. Use spinlock to protect.
> 
> Signed-off-by: Xiang Wang <wangx@marvell.com>
> ---
>  drivers/dma/mmp_pdma.c |   41 +++++++++++++++++++++++++----------------
>  1 files changed, 25 insertions(+), 16 deletions(-)
> 

> +static void free_phy(struct mmp_pdma_chan *pchan)
pls namespace this
> +{
> +	struct mmp_pdma_device *pdev = to_mmp_pdma_dev(pchan->chan.device);
> +	unsigned long flags;
empty line pls

> +	if (!pchan->phy)
> +		return;
> +
> +	spin_lock_irqsave(&pdev->phy_lock, flags);
> +	pchan->phy->vchan = NULL;
> +	pchan->phy = NULL;
> +	spin_unlock_irqrestore(&pdev->phy_lock, flags);
> +}
> +
rest looks okay

--
~Vinod

  reply	other threads:[~2013-06-17 14:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-03  8:02 [PATCH 0/2] dma: mmp_pdma: Fix phy channels not protected issue Xiang Wang
2013-06-03  8:02 ` [PATCH 1/2] dma: mmp_pdma: add protect when alloc/free phy channels Xiang Wang
2013-06-17 13:26   ` Vinod Koul [this message]
2013-06-18  8:47     ` Xiang Wang
2013-06-03  8:02 ` [PATCH 2/2] dma: mmp_pdma: clear DRCMR when free a phy channel Xiang Wang
2013-06-03 10:07   ` Andy Shevchenko

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=20130617132607.GA10671@intel.com \
    --to=vinod.koul@intel.com \
    --cc=cxie4@marvell.com \
    --cc=djbw@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wangx@marvell.com \
    --cc=wangxfdu@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.