netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dimitris Michailidis <dm@chelsio.com>
To: netdev@vger.kernel.org
Cc: Dimitris Michailidis <dm@chelsio.com>
Subject: [PATCH net-next 1/5] cxgb4: move the choice of interrupt type before net_device registration
Date: Sun, 11 Jul 2010 15:01:15 -0700	[thread overview]
Message-ID: <1278885679-3738-2-git-send-email-dm@chelsio.com> (raw)
In-Reply-To: <1278885679-3738-1-git-send-email-dm@chelsio.com>

We need to settle on the kind of interrupts we'll be using, a choice that
also impacts the number of queues, before registering and making visible
the net_devices.  Move the relevant code up a bit.

Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
---
 drivers/net/cxgb4/cxgb4_main.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c
index 2619997..743dc6f 100644
--- a/drivers/net/cxgb4/cxgb4_main.c
+++ b/drivers/net/cxgb4/cxgb4_main.c
@@ -3507,6 +3507,12 @@ static int __devinit init_one(struct pci_dev *pdev,
 		adapter->params.offload = 0;
 	}
 
+	/* See what interrupts we'll be using */
+	if (msi > 1 && enable_msix(adapter) == 0)
+		adapter->flags |= USING_MSIX;
+	else if (msi > 0 && pci_enable_msi(pdev) == 0)
+		adapter->flags |= USING_MSI;
+
 	/*
 	 * The card is now ready to go.  If any errors occur during device
 	 * registration we do not fail the whole card but rather proceed only
@@ -3542,12 +3548,6 @@ static int __devinit init_one(struct pci_dev *pdev,
 		setup_debugfs(adapter);
 	}
 
-	/* See what interrupts we'll be using */
-	if (msi > 1 && enable_msix(adapter) == 0)
-		adapter->flags |= USING_MSIX;
-	else if (msi > 0 && pci_enable_msi(pdev) == 0)
-		adapter->flags |= USING_MSI;
-
 	if (is_offload(adapter))
 		attach_ulds(adapter);
 
@@ -3571,6 +3571,7 @@ sriov:
 			free_netdev(adapter->port[i]);
 	if (adapter->flags & FW_OK)
 		t4_fw_bye(adapter, 0);
+	disable_msi(adapter);
  out_unmap_bar:
 	iounmap(adapter->regs);
  out_free_adapter:
-- 
1.5.4


  reply	other threads:[~2010-07-11 22:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-11 22:01 [PATCH net-next 0/5] cxgb4 updates Dimitris Michailidis
2010-07-11 22:01 ` Dimitris Michailidis [this message]
2010-07-11 22:01   ` [PATCH net-next 2/5] cxgb4: avoid duplicating some resource freeing code Dimitris Michailidis
2010-07-11 22:01     ` [PATCH net-next 3/5] cxgb4: add user manipulation of the RSS table Dimitris Michailidis
2010-07-11 22:01       ` [PATCH net-next 4/5] cxgb4: implement the ETHTOOL_GRXFH command Dimitris Michailidis
2010-07-11 22:01         ` [PATCH net-next 5/5] cxgb4: exclude registers with read side effects from register dumps Dimitris Michailidis
2010-07-11 22:17           ` Ben Hutchings
2010-07-12  0:03             ` David Miller
2010-07-12  0:08 ` [PATCH net-next 0/5] cxgb4 updates David Miller

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=1278885679-3738-2-git-send-email-dm@chelsio.com \
    --to=dm@chelsio.com \
    --cc=netdev@vger.kernel.org \
    /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).