From patchwork Fri Apr 16 13:15:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Detsch X-Patchwork-Id: 50329 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 SMTP id 1DF3EB7D53 for ; Fri, 16 Apr 2010 23:20:27 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932163Ab0DPNPR (ORCPT ); Fri, 16 Apr 2010 09:15:17 -0400 Received: from e4.ny.us.ibm.com ([32.97.182.144]:59146 "EHLO e4.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932148Ab0DPNPP (ORCPT ); Fri, 16 Apr 2010 09:15:15 -0400 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by e4.ny.us.ibm.com (8.14.3/8.13.1) with ESMTP id o3GD3L3F032329 for ; Fri, 16 Apr 2010 09:03:21 -0400 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o3GDFEom140516 for ; Fri, 16 Apr 2010 09:15:14 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o3GDFDwi002377 for ; Fri, 16 Apr 2010 09:15:13 -0400 Received: from t400.localnet ([9.8.3.93]) by d01av01.pok.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id o3GDFCHw002360; Fri, 16 Apr 2010 09:15:13 -0400 From: Andre Detsch Organization: IBM To: netdev@vger.kernel.org, Matt Carlson Subject: [PATCH] tg3: Fix INTx fallback when MSI fails Date: Fri, 16 Apr 2010 10:15:11 -0300 User-Agent: KMail/1.12.2 (Linux/2.6.31-20-generic; KDE/4.3.2; i686; ; ) MIME-Version: 1.0 Message-Id: <201004161015.12089.adetsch@br.ibm.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org tg3: Fix INTx fallback when MSI fails MSI setup changes the value of some key attributes of struct tg3 *tp. These attributes must be taken into account and restored before we try to do a new request_irq for INTx fallback. In powerpc, the original code was leading to an EINVAL return within request_irq, because the driver was trying to use the disabled MSI virtual irq number instead of tp->pdev->irq. Signed-off-by: Andre Detsch --- Tested on powerpc, but should be safe for other architectures as well. -- 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 Index: linux-2.6.34-rc4/drivers/net/tg3.c =================================================================== --- linux-2.6.34-rc4.orig/drivers/net/tg3.c 2010-04-12 21:41:35.000000000 -0400 +++ linux-2.6.34-rc4/drivers/net/tg3.c 2010-04-15 20:37:41.000000000 -0400 @@ -8633,6 +8633,9 @@ static int tg3_test_msi(struct tg3 *tp) pci_disable_msi(tp->pdev); tp->tg3_flags2 &= ~TG3_FLG2_USING_MSI; + tp->irq_cnt = 1; + tp->napi[0].irq_vec = tp->pdev->irq; + tp->dev->real_num_tx_queues = 1; err = tg3_request_irq(tp, 0); if (err)