blob: ac16f0947e091ccb54bde4bded80e76a628ec4df [file] [log] [blame]
Bill Hoffa41a142e2015-04-03 10:35:48 -05001From 5f06da05527c3ef2d9ee709e912c5840eb366e87 Mon Sep 17 00:00:00 2001
2From: Dan Crowell <dcrowell@us.ibm.com>
3Date: Thu, 2 Apr 2015 12:29:45 -0500
4Subject: [PATCH 04/10] Fix constant refresh of vpd cache
5
6Code was inadvertantly detecting mismatched pnor cache contents
7on every boot.
8
9Change-Id: I631dc758e03316a28d13f6d19032c1a76e3cffc1
10(cherry picked from commit 0d95414e03ff337404a3e20fd421fd8b4272ebc5)
11---
12 src/usr/vpd/ipvpd.C | 18 ++++++++++++------
13 src/usr/vpd/ipvpd.H | 5 ++++-
14 src/usr/vpd/vpd.C | 2 +-
15 3 files changed, 17 insertions(+), 8 deletions(-)
16
17diff --git a/src/usr/vpd/ipvpd.C b/src/usr/vpd/ipvpd.C
18index a0682d2..2cefb6e 100644
19--- a/src/usr/vpd/ipvpd.C
20+++ b/src/usr/vpd/ipvpd.C
21@@ -397,6 +397,9 @@ errlHndl_t IpVpdFacade::cmpPnorToSeeprom ( TARGETING::Target * i_target,
22 l_dataSeeprom,
23 l_sizePnor ) != 0 )
24 {
25+ TRACFCOMP( g_trac_vpd, "cmpPnorToSeeprom found mismatch for HUID %.8X 0x%X:0x%X", TARGETING::get_huid(i_target), i_record, i_keyword );
26+ TRACFBIN( g_trac_vpd, "EEPROM", l_dataSeeprom, l_sizeSeeprom );
27+ TRACFBIN( g_trac_vpd, "PNOR", l_dataPnor, l_sizePnor );
28 break;
29 }
30
31@@ -898,8 +901,9 @@ bool IpVpdFacade::hasVpdPresent( TARGETING::Target * i_target,
32 }
33
34 vpdPresent = recordPresent( recordName,
35- recordOffset,
36- i_target );
37+ recordOffset,
38+ i_target,
39+ VPD::AUTOSELECT );
40
41 }while( 0 );
42
43@@ -918,7 +922,8 @@ bool IpVpdFacade::hasVpdPresent( TARGETING::Target * i_target,
44 // ------------------------------------------------------------------
45 bool IpVpdFacade::recordPresent( const char * i_record,
46 uint16_t & o_offset,
47- TARGETING::Target * i_target )
48+ TARGETING::Target * i_target,
49+ VPD::vpdCmdTarget i_location )
50 {
51 errlHndl_t err = NULL;
52 uint64_t tmpOffset = 0x0;
53@@ -946,7 +951,7 @@ bool IpVpdFacade::recordPresent( const char * i_record,
54 RECORD_BYTE_SIZE,
55 record,
56 i_target,
57- VPD::AUTOSELECT );
58+ i_location );
59 tmpOffset += RECORD_BYTE_SIZE;
60
61 if( err )
62@@ -963,7 +968,7 @@ bool IpVpdFacade::recordPresent( const char * i_record,
63 RECORD_ADDR_BYTE_SIZE,
64 &o_offset,
65 i_target,
66- VPD::AUTOSELECT );
67+ i_location );
68 if( err )
69 {
70 break;
71@@ -1003,7 +1008,8 @@ errlHndl_t IpVpdFacade::findRecordOffsetPnor ( const char * i_record,
72
73 matchFound = recordPresent( i_record,
74 offset,
75- i_target );
76+ i_target,
77+ i_args.location );
78
79 if( !matchFound )
80 {
81diff --git a/src/usr/vpd/ipvpd.H b/src/usr/vpd/ipvpd.H
82index 2350bdd..7c2090c 100644
83--- a/src/usr/vpd/ipvpd.H
84+++ b/src/usr/vpd/ipvpd.H
85@@ -353,11 +353,14 @@ class IpVpdFacade
86 *
87 * @param[in] i_target - The target to retrieve the data for.
88 *
89+ * @param[in] i_location - VPD location to fetch data from (PNOR/SEEPROM)
90+ *
91 * @return bool - True if the record is found, False otherwise.
92 */
93 bool recordPresent( const char * i_record,
94 uint16_t & offset,
95- TARGETING::Target * i_target );
96+ TARGETING::Target * i_target,
97+ VPD::vpdCmdTarget i_location );
98
99 /**
100 * @brief This function will read the VPD TOC to find the offset where the
101diff --git a/src/usr/vpd/vpd.C b/src/usr/vpd/vpd.C
102index 3533af9..963025f 100755
103--- a/src/usr/vpd/vpd.C
104+++ b/src/usr/vpd/vpd.C
105@@ -533,7 +533,7 @@ errlHndl_t ensureCacheIsInSync ( TARGETING::Target * i_target )
106 // If we did not match, we need to load SEEPROM VPD data into PNOR
107 if( l_matchPN && l_matchSN )
108 {
109- TRACFCOMP(g_trac_vpd,"VPD::ensureCacheIsInSync: PNOR_PN/SN = SEEPROM_PN/SN for target %.8X",TARGETING::get_huid(i_target));
110+ TRACFCOMP(g_trac_vpd,"VPD::ensureCacheIsInSync: PNOR_PN/SN == SEEPROM_PN/SN for target %.8X",TARGETING::get_huid(i_target));
111 }
112 else
113 {
114--
1151.8.2.2
116