From patchwork Tue Nov 23 13:08:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: amit salecha X-Patchwork-Id: 72651 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.180.67]) by ozlabs.org (Postfix) with ESMTP id 41915B70DF for ; Wed, 24 Nov 2010 00:08:34 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753612Ab0KWNIa (ORCPT ); Tue, 23 Nov 2010 08:08:30 -0500 Received: from mvnat01.qlogic.com ([198.186.3.73]:48285 "EHLO unm84.unminc.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751829Ab0KWNI3 (ORCPT ); Tue, 23 Nov 2010 08:08:29 -0500 Received: from unm84.unminc.com (localhost.localdomain [127.0.0.1]) by unm84.unminc.com (8.13.8/8.13.8) with ESMTP id oAND8SRP008584; Tue, 23 Nov 2010 05:08:28 -0800 Received: (from amit@localhost) by unm84.unminc.com (8.13.8/8.13.8/Submit) id oAND8RZK008583; Tue, 23 Nov 2010 05:08:27 -0800 X-Authentication-Warning: unm84.unminc.com: amit set sender to amit.salecha@qlogic.com using -f From: Amit Kumar Salecha To: davem@davemloft.net Cc: netdev@vger.kernel.org, ameen.rahman@qlogic.com, anirban.chakraborty@qlogic.com, Rajesh Borundia Subject: [PATCH] netxen: avoid using reset_devices as it may become obsolete Date: Tue, 23 Nov 2010 05:08:27 -0800 Message-Id: <1290517707-8554-1-git-send-email-amit.salecha@qlogic.com> X-Mailer: git-send-email 1.7.3.2 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Rajesh Borundia In kdump environment do not depend on reset_devices parameter to reset the device as the parameter may become obsolete. Instead use an adapter specific mechanism to determine if the device needs a reset. Driver maintains a count of number of pci functions probed and decrements the count when remove handler of that pci function is called. If the first probe, probe of function 0, detects the count as non zero then reset the device. Signed-off-by: Rajesh Borundia Signed-off-by: Amit Kumar Salecha --- drivers/net/netxen/netxen_nic_main.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index e1d30d7..ceeaac9 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c @@ -1277,6 +1277,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) int i = 0, err; int pci_func_id = PCI_FUNC(pdev->devfn); uint8_t revision_id; + u32 val; if (pdev->revision >= NX_P3_A0 && pdev->revision <= NX_P3_B1) { pr_warning("%s: chip revisions between 0x%x-0x%x " @@ -1352,8 +1353,9 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) break; } - if (reset_devices) { - if (adapter->portnum == 0) { + if (adapter->portnum == 0) { + val = NXRD32(adapter, NX_CRB_DEV_REF_COUNT); + if (val != 0xffffffff && val != 0) { NXWR32(adapter, NX_CRB_DEV_REF_COUNT, 0); adapter->need_fw_reset = 1; }