From patchwork Fri Apr 8 13:34:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Assmann X-Patchwork-Id: 90342 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 377B8B6F7A for ; Fri, 8 Apr 2011 23:35:18 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756770Ab1DHNfL (ORCPT ); Fri, 8 Apr 2011 09:35:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62013 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752538Ab1DHNfK (ORCPT ); Fri, 8 Apr 2011 09:35:10 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p38DZ0bQ022735 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 8 Apr 2011 09:35:00 -0400 Received: from T500.redhat.com (vpn2-11-48.ams2.redhat.com [10.36.11.48]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p38DYwgY011058; Fri, 8 Apr 2011 09:34:59 -0400 From: Stefan Assmann To: netdev@vger.kernel.org Cc: e1000-devel@lists.sourceforge.net, jeffrey.t.kirsher@intel.com, jeffrey.e.pieper@intel.com, carolyn.wyborny@intel.com, john.ronciak@intel.com Subject: [PATCH] igb: restore EEPROM 16kB access limit Date: Fri, 8 Apr 2011 15:34:55 +0200 Message-Id: <1302269695-27188-1-git-send-email-sassmann@kpanic.de> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The check limiting the EEPROM access up to 16kB was removed by commit 4322e561a93ec7ee034b603a6c610e7be90d4e8a. Without this check the kernel will try to checksum the EEPROM up to 2MB (observed with a 8086:10c9 NIC) and fail. igb 0000:03:00.0: 0 vfs allocated igb 0000:03:00.0: The NVM Checksum Is Not Valid ACPI: PCI interrupt for device 0000:03:00.0 disabled igb: probe of 0000:03:00.0 failed with error -5 Reason for that being an overflow in u16 e1000_nvm_info->nvm while doing "nvm->word_size = 1 << size;" with size == 21. Putting the check back in place. Signed-off-by: Stefan Assmann --- drivers/net/igb/e1000_82575.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c index 6b256c2..5cfa37f 100644 --- a/drivers/net/igb/e1000_82575.c +++ b/drivers/net/igb/e1000_82575.c @@ -244,6 +244,10 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw) */ size += NVM_WORD_SIZE_BASE_SHIFT; + /* EEPROM access above 16k is unsupported */ + if (size > 14) + size = 14; + nvm->word_size = 1 << size; if (nvm->word_size == (1 << 15)) nvm->page_size = 128;