From patchwork Thu Oct 27 13:21:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Menzel X-Patchwork-Id: 79669 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp645627qge; Thu, 27 Oct 2016 07:11:41 -0700 (PDT) X-Received: by 10.99.184.25 with SMTP id p25mr12367751pge.120.1477577501418; Thu, 27 Oct 2016 07:11:41 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a66si8217847pgc.33.2016.10.27.07.11.40; Thu, 27 Oct 2016 07:11:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965967AbcJ0OKN (ORCPT + 4 others); Thu, 27 Oct 2016 10:10:13 -0400 Received: from mx1.molgen.mpg.de ([141.14.17.9]:42229 "EHLO mx1.molgen.mpg.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964996AbcJ0OKK (ORCPT ); Thu, 27 Oct 2016 10:10:10 -0400 Received: from keineahnung.molgen.mpg.de (keineahnung.molgen.mpg.de [141.14.17.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 76798201282472; Thu, 27 Oct 2016 15:21:08 +0200 (CEST) Subject: Re: [bnx2] [Regression 4.8] Driver loading fails without firmware To: Baoquan He References: <244cb42b-0fce-fe41-7b7c-babb51411e8c@molgen.mpg.de> <20161026120021.GA4402@x1> Cc: Sony Chacko , Dept-HSGLinuxNICDev@qlogic.com, netdev@vger.kernel.org, "David S. Miller" , dvteam@molgen.mpg.de From: Paul Menzel Message-ID: Date: Thu, 27 Oct 2016 15:21:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161026120021.GA4402@x1> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Dear Baoquan, On 10/26/16 14:00, Baoquan He wrote: > On 10/26/16 at 12:31pm, Paul Menzel wrote: >>>> dev->hw_features = NETIF_F_IP_CSUM | NETIF_F_SG | >>>> @@ -8607,6 +8608,7 @@ 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); >> >> Baoquan, could you please fix this regression. My suggestion is, that you >> add the old code back, but check if the firmware has been loaded. If it >> hasn’t, load it again. >> >> That way, people can update their Linux kernel, and it continues working >> without changing the initramfs, or anything else. > > I saw your mail but I am also not familiar with bnx2 driver. As the > commit log says I just tried to make bnx2 driver reset itself earlier. > > So you did a git bisect and found this commit caused the regression, > right? If yes, and network developers have no action, I will look into > the code and see if I have idea to fix it. Well, I looked through the commits and found that one, which would explain the changed behavior. To be sure, and to follow your request, I took Linux 4.8.4 and reverted your commit (attached). Then I deleted the firmware again from the initramfs, and rebooted. The devices showed up just fine as before. So to summarize, the commit is indeed the culprit. Thank you for looking into this. Kind regards, Paul Acked-by: Rasesh Mody >From 61b8dac8796343a797858b4a2eb0a59a0cfcd735 Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Thu, 27 Oct 2016 11:34:52 +0200 Subject: [PATCH] Revert "bnx2: Reset device during driver initialization" This reverts commit 3e1be7ad2d38c6bd6aeef96df9bd0a7822f4e51c. --- 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 27f11a5..ecd357d 100644 --- a/drivers/net/ethernet/broadcom/bnx2.c +++ b/drivers/net/ethernet/broadcom/bnx2.c @@ -6356,6 +6356,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); @@ -6424,6 +6428,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; } @@ -8570,12 +8575,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 | @@ -8608,7 +8607,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.4.1