All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: John Allen <jallen@linux.vnet.ibm.com>
Cc: netdev@vger.kernel.org,
	Thomas Falcon <tlfalcon@linux.vnet.ibm.com>,
	Nathan Fontenot <nfont@linux.vnet.ibm.com>
Subject: Re: [PATCH net-next v2] ibmvnic: Bail from ibmvnic_open if driver is already open
Date: Mon, 12 Mar 2018 20:33:51 +0100	[thread overview]
Message-ID: <20180312193351.GA31588@lunn.ch> (raw)
In-Reply-To: <36666f4d-6207-ab97-e7f6-4d7d0c6a1155@linux.vnet.ibm.com>

On Mon, Mar 12, 2018 at 02:19:52PM -0500, John Allen wrote:
> If the driver is already in the "open" state, don't attempt the procedure
> for opening the driver.
> 
> Signed-off-by: John Allen <jallen@linux.vnet.ibm.com>
> ---
> v2: Unlock reset_lock mutex before returning.
> 
> diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
> index 7be4b06..9a5e8ac 100644
> --- a/drivers/net/ethernet/ibm/ibmvnic.c
> +++ b/drivers/net/ethernet/ibm/ibmvnic.c
> @@ -1057,6 +1057,11 @@ static int ibmvnic_open(struct net_device *netdev)
> 
>  	mutex_lock(&adapter->reset_lock);
> 
> +	if (adapter->state == VNIC_OPEN) {
> +		mutex_unlock(&adapter->reset_lock);
> +		return 0;
> +	}

Hi John

This looks better.

But how did you get ibmvnic_open() to be called twice? Is the actual
issue that __ibmvnic_close() does not kill off the
adapter->ibmvnic_reset workqueue, so that a reset can happen after
close() has been called?

	   Andrew

  reply	other threads:[~2018-03-12 19:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-12 19:19 [PATCH net-next v2] ibmvnic: Bail from ibmvnic_open if driver is already open John Allen
2018-03-12 19:33 ` Andrew Lunn [this message]
2018-03-12 19:56   ` John Allen
2018-03-12 20:10     ` Andrew Lunn
2018-03-12 20:12       ` John Allen

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=20180312193351.GA31588@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=jallen@linux.vnet.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=nfont@linux.vnet.ibm.com \
    --cc=tlfalcon@linux.vnet.ibm.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.