From patchwork Wed Jul 3 20:24:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Bader X-Patchwork-Id: 256737 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 283872C00A6 for ; Thu, 4 Jul 2013 06:25:11 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1UuTbr-0002a3-G9; Wed, 03 Jul 2013 20:25:03 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1UuTbj-0002XB-8m for kernel-team@lists.ubuntu.com; Wed, 03 Jul 2013 20:24:55 +0000 Received: from p5b2e2ef3.dip0.t-ipconnect.de ([91.46.46.243] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1UuTbj-0008Fx-2v for kernel-team@lists.ubuntu.com; Wed, 03 Jul 2013 20:24:55 +0000 From: Stefan Bader To: kernel-team@lists.ubuntu.com Subject: [PATCH 4/5] tg3: Fix 5762 NVRAM sizing Date: Wed, 3 Jul 2013 22:24:47 +0200 Message-Id: <1372883088-8397-5-git-send-email-stefan.bader@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1372883088-8397-1-git-send-email-stefan.bader@canonical.com> References: <1372883088-8397-1-git-send-email-stefan.bader@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com From: Michael Chan Don't set the default size to 128K if it is 5762. Instead, rely on the size we obtain from NVRAM location 0xf0. Signed-off-by: Michael Chan Signed-off-by: David S. Miller BugLink: http://bugs.launchpad.net/bugs/1178899 (cherry-picked from commit c5d0b72e641340c5dc915cdfab5e2c55d81425c2 upstream) Signed-off-by: Stefan Bader --- drivers/net/ethernet/broadcom/tg3.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index dc4c7780..bbf2650 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -13813,7 +13813,8 @@ static void tg3_get_5720_nvram_info(struct tg3 *tp) tp->nvram_size = TG3_NVRAM_SIZE_1MB; break; default: - tp->nvram_size = TG3_NVRAM_SIZE_128KB; + if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5762) + tp->nvram_size = TG3_NVRAM_SIZE_128KB; break; } break; @@ -13859,7 +13860,8 @@ static void tg3_get_5720_nvram_info(struct tg3 *tp) tp->nvram_size = TG3_NVRAM_SIZE_1MB; break; default: - tp->nvram_size = TG3_NVRAM_SIZE_128KB; + if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5762) + tp->nvram_size = TG3_NVRAM_SIZE_128KB; break; } break;