netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Dept-GELinuxNICDev@cavium.com,
	rasesh.mody@cavium.com, harish.patil@cavium.com,
	frank@undermydesk.org, jsr@dex.edzone.net, pmenzel@molgen.mpg.de,
	jroedel@suse.de, dyoung@redhat.com, Baoquan He <bhe@redhat.com>
Subject: [PATCH 1/2] Revert "bnx2: Reset device during driver initialization"
Date: Fri, 11 Nov 2016 21:46:34 +0800	[thread overview]
Message-ID: <1478871995-29652-2-git-send-email-bhe@redhat.com> (raw)
In-Reply-To: <1478871995-29652-1-git-send-email-bhe@redhat.com>

This reverts commit 3e1be7ad2d38c6bd6aeef96df9bd0a7822f4e51c.

When people build bnx2 driver into kernel, it will fail to detect
and load firmware because firmware is contained in initramfs and
initramfs has not been uncompressed yet during do_initcalls. So
revert commit 3e1be7a and work out a new way in the later patch.

Signed-off-by: Baoquan He <bhe@redhat.com>
---
 drivers/net/ethernet/broadcom/bnx2.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c
index b3791b3..c557972 100644
--- a/drivers/net/ethernet/broadcom/bnx2.c
+++ b/drivers/net/ethernet/broadcom/bnx2.c
@@ -6361,6 +6361,10 @@ bnx2_open(struct net_device *dev)
 	struct bnx2 *bp = netdev_priv(dev);
 	int rc;
 
+	rc = bnx2_request_firmware(bp);
+	if (rc < 0)
+		goto out;
+
 	netif_carrier_off(dev);
 
 	bnx2_disable_int(bp);
@@ -6429,6 +6433,7 @@ bnx2_open(struct net_device *dev)
 	bnx2_free_irq(bp);
 	bnx2_free_mem(bp);
 	bnx2_del_napi(bp);
+	bnx2_release_firmware(bp);
 	goto out;
 }
 
@@ -8575,12 +8580,6 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	pci_set_drvdata(pdev, dev);
 
-	rc = bnx2_request_firmware(bp);
-	if (rc < 0)
-		goto error;
-
-
-	bnx2_reset_chip(bp, BNX2_DRV_MSG_CODE_RESET);
 	memcpy(dev->dev_addr, bp->mac_addr, ETH_ALEN);
 
 	dev->hw_features = NETIF_F_IP_CSUM | NETIF_F_SG |
@@ -8613,7 +8612,6 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	return 0;
 
 error:
-	bnx2_release_firmware(bp);
 	pci_iounmap(pdev, bp->regview);
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
-- 
2.5.5

  reply	other threads:[~2016-11-11 13:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-11 13:46 [PATCH 0/2] bnx2: Hard reset bnx2 chip at probe stage Baoquan He
2016-11-11 13:46 ` Baoquan He [this message]
2016-11-11 13:51   ` [PATCH 1/2] Revert "bnx2: Reset device during driver initialization" Paul Menzel
2016-11-11 13:46 ` [PATCH 2/2] bnx2: Hard reset bnx2 chip at probe stage Baoquan He
2016-11-13  4:15   ` [PATCH v2 2/2] bnx2: Wait for in-flight DMA to complete " Baoquan He
2016-11-13  4:40     ` David Miller
2016-11-13  4:54       ` Baoquan He
2016-11-11 14:02 ` [PATCH 0/2] bnx2: Hard reset bnx2 chip " Baoquan He
2016-11-11 17:37   ` Michael Chan
2016-11-13  4:10     ` Baoquan He

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=1478871995-29652-2-git-send-email-bhe@redhat.com \
    --to=bhe@redhat.com \
    --cc=Dept-GELinuxNICDev@cavium.com \
    --cc=dyoung@redhat.com \
    --cc=frank@undermydesk.org \
    --cc=harish.patil@cavium.com \
    --cc=jroedel@suse.de \
    --cc=jsr@dex.edzone.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pmenzel@molgen.mpg.de \
    --cc=rasesh.mody@cavium.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 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).