Patchwork [4/5] tg3: Fix 5762 NVRAM sizing

login
register
mail settings
Submitter Stefan Bader
Date July 3, 2013, 8:24 p.m.
Message ID <1372883088-8397-5-git-send-email-stefan.bader@canonical.com>
Download mbox | patch
Permalink /patch/256737/
State New
Headers show

Comments

Stefan Bader - July 3, 2013, 8:24 p.m.
From: Michael Chan <mchan@broadcom.com>

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 <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

BugLink: http://bugs.launchpad.net/bugs/1178899

(cherry-picked from commit c5d0b72e641340c5dc915cdfab5e2c55d81425c2 upstream)
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
---
 drivers/net/ethernet/broadcom/tg3.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch

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;