public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Mugunthan V N <mugunthanvnm-l0cyMroinI0@public•gmane.org>
To: Christian Riesch
	<christian.riesch-3mrvs1K0uXizZXS1Dc/lvw@public•gmane.org>,
	<netdev-u79uwXL29TY76Z2rM5mHXA@public•gmane.org>
Cc: <davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org>,
	Florian Fainelli
	<f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public•gmane.org>,
	Jon Ringle <jon-7zJyie9iPacdnm+yROfE0A@public•gmane.org>
Subject: Re: [PATCH RFC] net: davinci_emac: Fix rollback of emac_dev_open()
Date: Fri, 7 Mar 2014 20:15:00 +0530	[thread overview]
Message-ID: <5319DB6C.8080203@ti.com> (raw)
In-Reply-To: <130fa9cb-7e94-4698-ac3f-f987a03c0604-2Q1zT/7oKKveau+zUrS5eLNldLUNz+W/@public.gmane.org>

On Friday 07 March 2014 07:37 PM, Christian Riesch wrote:
> Signed-off-by: Christian Riesch <christian.riesch-3mrvs1K0uXizZXS1Dc/lvw@public•gmane.org>
> Cc: Prabhakar Lad <prabhakar.csengg-Re5JQEeQqe8AvxtiuMwx3w@public•gmane.org>
> Cc: Mugunthan V N <mugunthanvnm-l0cyMroinI0@public•gmane.org>
> Cc: Florian Fainelli <f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public•gmane.org>
> ---
>
> Hi again,
>
> How about this solution for fixing the rollback of emac_dev_open()?
> Especially the change in davinci_cpdma.c, would this break anything?
>
> The patch applies on top of 
> [PATCH] net: davinci_emac: Replace devm_request_irq with request_irq
>
> Regards,
> Christian
>
>  drivers/net/ethernet/ti/davinci_cpdma.c |    4 +--
>  drivers/net/ethernet/ti/davinci_emac.c  |   44 ++++++++++++++++++++-----------
>  2 files changed, 31 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/net/ethernet/ti/davinci_cpdma.c b/drivers/net/ethernet/ti/davinci_cpdma.c
> index 364d0c7..88ef270 100644
> --- a/drivers/net/ethernet/ti/davinci_cpdma.c
> +++ b/drivers/net/ethernet/ti/davinci_cpdma.c
> @@ -355,7 +355,7 @@ int cpdma_ctlr_stop(struct cpdma_ctlr *ctlr)
>  	int i;
>  
>  	spin_lock_irqsave(&ctlr->lock, flags);
> -	if (ctlr->state != CPDMA_STATE_ACTIVE) {
> +	if (ctlr->state == CPDMA_STATE_TEARDOWN) {
>  		spin_unlock_irqrestore(&ctlr->lock, flags);
>  		return -EINVAL;
>  	}
> @@ -891,7 +891,7 @@ int cpdma_chan_stop(struct cpdma_chan *chan)
>  	unsigned		timeout;
>  
>  	spin_lock_irqsave(&chan->lock, flags);
> -	if (chan->state != CPDMA_STATE_ACTIVE) {
> +	if (chan->state == CPDMA_STATE_TEARDOWN) {
>  		spin_unlock_irqrestore(&chan->lock, flags);
>  		return -EINVAL;
>  	}

Even when in idle mode chan stop should return error.

Regards
Mugunthan V N

  parent reply	other threads:[~2014-03-07 14:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-05 10:25 [PATCH] net: davinci_emac: Replace devm_request_irq with request_irq Christian Riesch
2014-03-06  5:38 ` Prabhakar Lad
2014-03-06  8:27 ` Mugunthan V N
2014-03-06  8:51   ` Christian Riesch
     [not found]   ` <A8464B1127B9570790254336@172.22.2.41>
2014-03-06 17:16     ` Florian Fainelli
2014-03-06 21:57 ` David Miller
     [not found]   ` <20140306.165736.154818699714315258.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2014-03-07  2:28     ` Christian Riesch
2014-03-07  6:44   ` Christian Riesch
2014-03-07 11:42   ` Christian Riesch
2014-03-07 14:07     ` [PATCH RFC] net: davinci_emac: Fix rollback of emac_dev_open() Christian Riesch
     [not found]       ` <130fa9cb-7e94-4698-ac3f-f987a03c0604-2Q1zT/7oKKveau+zUrS5eLNldLUNz+W/@public.gmane.org>
2014-03-07 14:45         ` Mugunthan V N [this message]
2014-03-10  7:16           ` Christian Riesch
     [not found]           ` <851BA4133600BADF3FBB6427@172.22.2.41>
2014-03-13 18:17             ` Prabhakar Lad

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=5319DB6C.8080203@ti.com \
    --to=mugunthanvnm-l0cymroini0@public$(echo .)gmane.org \
    --cc=christian.riesch-3mrvs1K0uXizZXS1Dc/lvw@public$(echo .)gmane.org \
    --cc=davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org \
    --cc=f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public$(echo .)gmane.org \
    --cc=jon-7zJyie9iPacdnm+yROfE0A@public$(echo .)gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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