From patchwork Fri Jul 31 19:13:48 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dean Nelson X-Patchwork-Id: 30440 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 9F4ACB7BA0 for ; Sat, 1 Aug 2009 05:15:01 +1000 (EST) Received: by ozlabs.org (Postfix) id 911CDDDDA2; Sat, 1 Aug 2009 05:15:01 +1000 (EST) 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 123A7DDD1B for ; Sat, 1 Aug 2009 05:15:01 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752809AbZGaTOv (ORCPT ); Fri, 31 Jul 2009 15:14:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752829AbZGaTOv (ORCPT ); Fri, 31 Jul 2009 15:14:51 -0400 Received: from mx2.redhat.com ([66.187.237.31]:40850 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752783AbZGaTOv (ORCPT ); Fri, 31 Jul 2009 15:14:51 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n6VJE1wD030333; Fri, 31 Jul 2009 15:14:11 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6VJDoq7000694; Fri, 31 Jul 2009 15:13:56 -0400 Received: from [127.0.0.1] (vpn-225-175.phx2.redhat.com [10.3.225.175]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6VJDmut023743; Fri, 31 Jul 2009 15:13:49 -0400 Date: Fri, 31 Jul 2009 15:13:48 -0400 From: Dean Nelson To: netdev@vger.kernel.org Cc: linux-driver@qlogic.com, Ron Mercer Message-Id: <20090731191348.5470.55591.send-patch@aqua> In-Reply-To: <20090731191254.5470.99642.send-patch@aqua> References: <20090731191254.5470.99642.send-patch@aqua> Subject: [net-next-2.6 PATCH 7/9] qlge: return PCI_ERS_RESULT_DISCONNECT on permanent failure X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org PCI drivers that implement the struct pci_error_handlers' error_detected callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is pci_channel_io_perm_failure. This patch fixes the issue for qlge. Signed-off-by: Dean Nelson --- This patch has not been tested, since I don't have the hardware to test it. It is based on a few recent patches. See the following commits: http://git.kernel.org/linus/c93b5a76d58656158d195a7df507ebc660010969 http://git.kernel.org/linus/eab633021c26025b34f36f79f0311d3d99f40ceb http://git.kernel.org/linus/ef681ce1e8b3e63317cd724c200b2fd39286c005 http://git.kernel.org/linus/59ed6eecff4aa00c5c5d18ffd180acac108d596e http://git.kernel.org/linus/3044b8d1ff8c05237652a692fb572a34e4d70146 drivers/net/qlge/qlge_main.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index 5768af1..3a271af 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c @@ -4076,6 +4076,11 @@ static pci_ers_result_t qlge_io_error_detected(struct pci_dev *pdev, struct net_device *ndev = pci_get_drvdata(pdev); struct ql_adapter *qdev = netdev_priv(ndev); + netif_device_detach(ndev); + + if (state == pci_channel_io_perm_failure) + return PCI_ERS_RESULT_DISCONNECT; + if (netif_running(ndev)) ql_adapter_down(qdev);