All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: Joel Fernandes <joelf@ti.com>
Cc: dan.j.williams@intel.com, nsekhar@ti.com,
	dmaengine@vger.kernel.org,
	davinci-linux-open-source@linux.davincidsp.com,
	Linux OMAP List <linux-omap@vger.kernel.org>,
	Linux ARM Kernel List <linux-arm-kernel@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] dmaengine: edma: No need save/restore interrupt flags during spin_lock in IRQ
Date: Wed, 23 Apr 2014 11:21:41 +0530	[thread overview]
Message-ID: <20140423055141.GA32284@intel.com> (raw)
In-Reply-To: <1397714313-26561-1-git-send-email-joelf@ti.com>

On Thu, Apr 17, 2014 at 12:58:33AM -0500, Joel Fernandes wrote:
> The vchan lock in edma_callback is acquired in hard interrupt context. As
> interrupts are already disabled, there's no point in save/restoring interrupt
> mask bit or cpsr flags.
> 
> Get rid of flags local variable and use spin_lock instead of spin_lock_irqsave.

Applied, thanks

-- 
~Vinod

> 
> Signed-off-by: Joel Fernandes <joelf@ti.com>
> ---
>  drivers/dma/edma.c |    9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
> index 91849aa..25a75e2 100644
> --- a/drivers/dma/edma.c
> +++ b/drivers/dma/edma.c
> @@ -638,7 +638,6 @@ static void edma_callback(unsigned ch_num, u16 ch_status, void *data)
>  	struct edma_chan *echan = data;
>  	struct device *dev = echan->vchan.chan.device->dev;
>  	struct edma_desc *edesc;
> -	unsigned long flags;
>  	struct edmacc_param p;
>  
>  	edesc = echan->edesc;
> @@ -649,7 +648,7 @@ static void edma_callback(unsigned ch_num, u16 ch_status, void *data)
>  
>  	switch (ch_status) {
>  	case EDMA_DMA_COMPLETE:
> -		spin_lock_irqsave(&echan->vchan.lock, flags);
> +		spin_lock(&echan->vchan.lock);
>  
>  		if (edesc) {
>  			if (edesc->cyclic) {
> @@ -665,11 +664,11 @@ static void edma_callback(unsigned ch_num, u16 ch_status, void *data)
>  			}
>  		}
>  
> -		spin_unlock_irqrestore(&echan->vchan.lock, flags);
> +		spin_unlock(&echan->vchan.lock);
>  
>  		break;
>  	case EDMA_DMA_CC_ERROR:
> -		spin_lock_irqsave(&echan->vchan.lock, flags);
> +		spin_lock(&echan->vchan.lock);
>  
>  		edma_read_slot(EDMA_CHAN_SLOT(echan->slot[0]), &p);
>  
> @@ -700,7 +699,7 @@ static void edma_callback(unsigned ch_num, u16 ch_status, void *data)
>  			edma_trigger_channel(echan->ch_num);
>  		}
>  
> -		spin_unlock_irqrestore(&echan->vchan.lock, flags);
> +		spin_unlock(&echan->vchan.lock);
>  
>  		break;
>  	default:
> -- 
> 1.7.9.5
> 

-- 

WARNING: multiple messages have this Message-ID (diff)
From: vinod.koul@intel.com (Vinod Koul)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] dmaengine: edma: No need save/restore interrupt flags during spin_lock in IRQ
Date: Wed, 23 Apr 2014 11:21:41 +0530	[thread overview]
Message-ID: <20140423055141.GA32284@intel.com> (raw)
In-Reply-To: <1397714313-26561-1-git-send-email-joelf@ti.com>

On Thu, Apr 17, 2014 at 12:58:33AM -0500, Joel Fernandes wrote:
> The vchan lock in edma_callback is acquired in hard interrupt context. As
> interrupts are already disabled, there's no point in save/restoring interrupt
> mask bit or cpsr flags.
> 
> Get rid of flags local variable and use spin_lock instead of spin_lock_irqsave.

Applied, thanks

-- 
~Vinod

> 
> Signed-off-by: Joel Fernandes <joelf@ti.com>
> ---
>  drivers/dma/edma.c |    9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
> index 91849aa..25a75e2 100644
> --- a/drivers/dma/edma.c
> +++ b/drivers/dma/edma.c
> @@ -638,7 +638,6 @@ static void edma_callback(unsigned ch_num, u16 ch_status, void *data)
>  	struct edma_chan *echan = data;
>  	struct device *dev = echan->vchan.chan.device->dev;
>  	struct edma_desc *edesc;
> -	unsigned long flags;
>  	struct edmacc_param p;
>  
>  	edesc = echan->edesc;
> @@ -649,7 +648,7 @@ static void edma_callback(unsigned ch_num, u16 ch_status, void *data)
>  
>  	switch (ch_status) {
>  	case EDMA_DMA_COMPLETE:
> -		spin_lock_irqsave(&echan->vchan.lock, flags);
> +		spin_lock(&echan->vchan.lock);
>  
>  		if (edesc) {
>  			if (edesc->cyclic) {
> @@ -665,11 +664,11 @@ static void edma_callback(unsigned ch_num, u16 ch_status, void *data)
>  			}
>  		}
>  
> -		spin_unlock_irqrestore(&echan->vchan.lock, flags);
> +		spin_unlock(&echan->vchan.lock);
>  
>  		break;
>  	case EDMA_DMA_CC_ERROR:
> -		spin_lock_irqsave(&echan->vchan.lock, flags);
> +		spin_lock(&echan->vchan.lock);
>  
>  		edma_read_slot(EDMA_CHAN_SLOT(echan->slot[0]), &p);
>  
> @@ -700,7 +699,7 @@ static void edma_callback(unsigned ch_num, u16 ch_status, void *data)
>  			edma_trigger_channel(echan->ch_num);
>  		}
>  
> -		spin_unlock_irqrestore(&echan->vchan.lock, flags);
> +		spin_unlock(&echan->vchan.lock);
>  
>  		break;
>  	default:
> -- 
> 1.7.9.5
> 

-- 

  reply	other threads:[~2014-04-23  6:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-17  5:58 [PATCH] dmaengine: edma: No need save/restore interrupt flags during spin_lock in IRQ Joel Fernandes
2014-04-17  5:58 ` Joel Fernandes
2014-04-17  5:58 ` Joel Fernandes
2014-04-23  5:51 ` Vinod Koul [this message]
2014-04-23  5:51   ` Vinod Koul

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=20140423055141.GA32284@intel.com \
    --to=vinod.koul@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=joelf@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=nsekhar@ti.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.