]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.25/patches.drivers/cxgb3-eeprom-read-fixes.patch
Revert "Move xen patchset to new version's subdir."
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.drivers / cxgb3-eeprom-read-fixes.patch
CommitLineData
00e5a55c
BS
1Subject: [1/2,2.6.28] cxgb3 - eeprom read fixes
2Date: Sat, 08 Nov 2008 22:55:28 -0000
3From: Divy Le Ray <divy@chelsio.com>
4Acked-by: Karsten Keil <kkeil@novell.com>
5Reference: bnc#446739
6
7From: Divy Le Ray <divy@chelsio.com>
8
9Protect against invalid phy entries in the eeprom.
10Extend eeprom access timeout.
11
12Signed-off-by: Divy Le Ray <divy@chelsio.com>
13---
14
15 drivers/net/cxgb3/t3_hw.c | 8 +++++++-
16 1 files changed, 7 insertions(+), 1 deletions(-)
17
18
19--
20To unsubscribe from this list: send the line "unsubscribe netdev" in
21the body of a message to majordomo@vger.kernel.org
22More majordomo info at http://vger.kernel.org/majordomo-info.html
23
24diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
25index 968f64b..9a0898b 100644
26--- a/drivers/net/cxgb3/t3_hw.c
27+++ b/drivers/net/cxgb3/t3_hw.c
28@@ -572,7 +572,7 @@ struct t3_vpd {
29 u32 pad; /* for multiple-of-4 sizing and alignment */
30 };
31
32-#define EEPROM_MAX_POLL 4
33+#define EEPROM_MAX_POLL 40
34 #define EEPROM_STAT_ADDR 0x4000
35 #define VPD_BASE 0xc00
36
37@@ -3690,6 +3690,12 @@ int t3_prep_adapter(struct adapter *adapter, const struct adapter_info *ai,
38 ;
39
40 pti = &port_types[adapter->params.vpd.port_type[j]];
41+ if (!pti->phy_prep) {
42+ CH_ALERT(adapter, "Invalid port type index %d\n",
43+ adapter->params.vpd.port_type[j]);
44+ return -EINVAL;
45+ }
46+
47 ret = pti->phy_prep(&p->phy, adapter, ai->phy_base_addr + j,
48 ai->mdio_ops);
49 if (ret)