diff options
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/pnor/pnorrp.C | 8 | ||||
-rw-r--r-- | src/usr/pnor/pnorrp.H | 6 | ||||
-rw-r--r-- | src/usr/pnor/test/pnorrptest.H | 43 |
3 files changed, 43 insertions, 14 deletions
diff --git a/src/usr/pnor/pnorrp.C b/src/usr/pnor/pnorrp.C index cfb7fbd07..0f212bce5 100644 --- a/src/usr/pnor/pnorrp.C +++ b/src/usr/pnor/pnorrp.C @@ -152,7 +152,6 @@ void* wait_for_message( void* unused ) PnorRP::PnorRP() : iv_msgQ(NULL) ,iv_startupRC(0) -,iv_shutdownUE(false) { TRACFCOMP(g_trac_pnor, "PnorRP::PnorRP> " ); @@ -580,12 +579,6 @@ void PnorRP::waitForMessage() switch(message->type) { case( MSG_MM_RP_READ ): - // do not allow reads in the shutdown path, only writes - if( iv_shutdownUE ) - { - status_rc = -EIO; - break; - } l_errhdl = readFromDevice( dev_offset, chip_select, needs_ecc, @@ -729,7 +722,6 @@ errlHndl_t PnorRP::readFromDevice( uint64_t i_offset, // Also need to spawn a separate task to do the shutdown // so that the regular PNOR task can service the writes // that happen during shutdown. - iv_shutdownUE = true; o_fatalError = true; INITSERVICE::doShutdown( PNOR::RC_ECC_UE, true ); } diff --git a/src/usr/pnor/pnorrp.H b/src/usr/pnor/pnorrp.H index d246360b0..8c2fb2abc 100644 --- a/src/usr/pnor/pnorrp.H +++ b/src/usr/pnor/pnorrp.H @@ -149,12 +149,6 @@ class PnorRP std::map<uint64_t,FlashStats_t> iv_stats; /** - * Remember that we got a UE and we are shutting down - */ - bool iv_shutdownUE; - - - /** * @brief Initialize the daemon, called by constructor */ void initDaemon(); diff --git a/src/usr/pnor/test/pnorrptest.H b/src/usr/pnor/test/pnorrptest.H index d48ec491c..71766fea0 100644 --- a/src/usr/pnor/test/pnorrptest.H +++ b/src/usr/pnor/test/pnorrptest.H @@ -248,6 +248,49 @@ class PnorRpTest : public CxxTest::TestSuite } } + //Enable this to test the UE handling, not turning on by default + // because it causes a shutdown +#if 0 + TRACFCOMP(g_trac_pnor, "PnorRpTest::test_ECC: Attempting UE" ); + // flush the page to make sure it gets out to the device + totals++; + rc = mm_remove_pages( RELEASE, dataptr, PAGESIZE ); + if( rc ) + { + TRACFCOMP( g_trac_pnor, "PnorRpTest::test_ECC> ERROR : error on RELEASE 2: rc=%X", rc ); + TS_FAIL( "PnorRpTest::test_ECC> ERROR : error on RELEASE 2" ); + fails++; + } + // generate data with CEs + chip_data_ptr = chip_data; + for (int i = 0; i < 9; i++) + { + memcpy( &data_ecc, chip_data_ptr, sizeof(uint64_t) ); + uint64_t bad_data = data_ecc ^ (1ul << i) ^ (1ul << 9); + memcpy( chip_data_ptr, &bad_data, sizeof(uint64_t) ); + chip_data_ptr += 9; + } + // write the bad data to the chip directly + totals++; + errhdl = deviceWrite(TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL, + chip_data, + l_size, + DEVICE_PNOR_ADDRESS(0, TEST_PHYS_OFFSET)); + if( errhdl ) + { + TS_FAIL("PnorRpTest::test_ECC: PNORDD deviceWrite() 2 failed! Error committed."); + ERRORLOG::errlCommit(errhdl,PNOR_COMP_ID); + fails++; + } + uint32_t tmp2 = 0; + totals++; + memcpy( &tmp2, dataptr, sizeof(uint32_t) ); + TRACFCOMP(g_trac_pnor, "PnorRpTest::test_ECC: UE all done - should never see this!!" ); + fails++; + TS_FAIL("PnorRpTest::test_ECC: UE did not kill the task!."); +#endif + + TRACFCOMP(g_trac_pnor, "PnorRpTest::test_ECC> %d/%d fails", fails, total ); }; |