From patchwork Mon Nov 3 16:11:13 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eilon Greenstein X-Patchwork-Id: 6919 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 76C9FDDFAD for ; Tue, 4 Nov 2008 03:11:35 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755741AbYKCQLb (ORCPT ); Mon, 3 Nov 2008 11:11:31 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755722AbYKCQLb (ORCPT ); Mon, 3 Nov 2008 11:11:31 -0500 Received: from mms3.broadcom.com ([216.31.210.19]:4756 "EHLO MMS3.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755718AbYKCQLa (ORCPT ); Mon, 3 Nov 2008 11:11:30 -0500 Received: from [10.11.16.99] by MMS3.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.2)); Mon, 03 Nov 2008 08:11:18 -0800 X-Server-Uuid: B55A25B1-5D7D-41F8-BC53-C57E7AD3C201 Received: by mail-irva-10.broadcom.com (Postfix, from userid 47) id D42832B1; Mon, 3 Nov 2008 08:11:17 -0800 (PST) Received: from mail-irva-8.broadcom.com (mail-irva-8 [10.11.18.52]) by mail-irva-10.broadcom.com (Postfix) with ESMTP id B3CBD2B0; Mon, 3 Nov 2008 08:11:17 -0800 (PST) Received: from mail-irva-13.broadcom.com (mail-irva-13.broadcom.com [10.11.16.103]) by mail-irva-8.broadcom.com (MOS 3.7.5a-GA) with ESMTP id HGO45655; Mon, 3 Nov 2008 08:11:16 -0800 (PST) Received: from mail-tlva-1.il.broadcom.com (mail-tlva-1.il.broadcom.com [10.187.128.17]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 7B35574CFE; Mon, 3 Nov 2008 08:11:16 -0800 (PST) Received: from [10.185.6.119] (lb-tlvb-eliezer [10.185.6.119]) by mail-tlva-1.il.broadcom.com (Postfix) with ESMTP id 9175D75326; Mon, 3 Nov 2008 18:11:14 +0200 (IST) Subject: [PATCH 1/4]bnx2x: Removing the PMF indication when unloading From: "Eilon Greenstein" To: "David Miller" , netdev Organization: Broadcom Date: Mon, 03 Nov 2008 18:11:13 +0200 Message-ID: <1225728673.14568.10.camel@lb-tlvb-eliezer> MIME-Version: 1.0 X-Mailer: Evolution 2.22.3.1 X-WSS-ID: 6511FD2C37G7608331-01-01 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When the PMF flag is set, the driver can access the HW freely. When the driver is unloaded, it should not access the HW. The problem caused fatal errors when "ethtool -i" was called after the calling instance was unloaded and another instance was already loaded Signed-off-by: Eilon Greenstein Tested-by: Alex Chiang --- drivers/net/bnx2x_main.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index fce7451..61152e1 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c @@ -6481,6 +6481,7 @@ load_int_disable: bnx2x_free_irq(bp); load_error: bnx2x_free_mem(bp); + bp->port.pmf = 0; /* TBD we really need to reset the chip if we want to recover from this */ @@ -6791,6 +6792,7 @@ unload_error: /* Report UNLOAD_DONE to MCP */ if (!BP_NOMCP(bp)) bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_DONE); + bp->port.pmf = 0; /* Free SKBs, SGEs, TPA pool and driver internals */ bnx2x_free_skbs(bp);