Hi Pierre.
Thank you for your reply.

On Mon, 10 Mar 2008 13:54:25 +0100
"Pierre Sangouard" <[EMAIL PROTECTED]> wrote:

> Which sensors other that the hotswap ones move from carrier board to the

A voltage sensor and a current sensor also move to AMC.


> AMC? Could you send me the plugin log file for both runs described above?

Ok, I put two logs to my web site.

* http://www.homa.ne.jp/~ashie/linux/files/AMC_PRESENT.tar.gz
  - Lanuch the OpenHPI daemon after inserting an AMC module.
  - It includes also log of hpiel, hpitop and hpitree command

* http://www.homa.ne.jp/~ashie/linux/files/AMC_NOT_PRESENT.tar.gz
  - Lanuch the OpenHPI daemon before inserting an AMC module.
  - It includes also log of hpiel, hpitop and hpitree command

I may put one more log which records AMC hot-swap later.
Above two logs doesn't record it.


> Also, which version of OpenHPI are you using?

I'm now using openhpi-2.6.2 with some my customer's modifications.
(I'm sorry for using old version, but my customer needs to use it.)


> Please note that ipmidirect plugin does not implement HPI-to-AdvancedTCA
> Mapping.

Ok, I underdstand it.


> With the logs I asked for above I should be able to write a simple patch.

I already wrote a simple ad-hoc patch for this issue.
I attached a ported patch for openhpi r6710.
(But I tested it only on openhpi-2.6.2 with customer's modifications.)

It can recognize an AMC as a resource on inserting it, and can discard
it on removing it.
Because this work is a very quick hack and not complete yet, sometimes
it causes crash. Although I'll fix the problem and arrange the patch
soon, please point out the problem if you are noticed it.

BTW ipmidirect also can't recognize hot-swap of RTM.
This patch should fix this issue too.

Regards,

--
Takuro Ashie <[EMAIL PROTECTED]>
Index: plugins/ipmidirect/ipmi_mc_vendor.cpp
===================================================================
--- plugins/ipmidirect/ipmi_mc_vendor.cpp	(revision 6710)
+++ plugins/ipmidirect/ipmi_mc_vendor.cpp	(working copy)
@@ -627,16 +627,28 @@
 
        type     = (SaHpiEntityTypeT)sdr->m_data[8];
        instance = (SaHpiEntityLocationT)sdr->m_data[9];
+       bool exact_matched = true;
 
        parent_fru_id = sdrs->FindParentFru( type,
                                             instance,
                                             parent_type,
-                                            parent_instance
+                                            parent_instance,
+                                            exact_matched
                                           );
 
        cIpmiResource *res = FindResource( domain, sensor->Mc(),
                                           parent_fru_id, parent_type, parent_instance,
                                           sdrs );
+
+       // Don't register AMC sensors on an AMC carrier board when the carrier board doesn't exist.
+       // (Also for RTM)
+       if (!exact_matched && (type == 193 || type == 192) && parent_type == 160)
+       {
+	   // FIXME!: How should we treat such sensors?
+	   delete sensor;
+	   continue;
+       }
+
        if (!res )
        {
            delete sensor;
@@ -804,6 +816,7 @@
   SaHpiEntityTypeT     type, parent_type;
   SaHpiEntityLocationT instance, parent_instance;
   unsigned int parent_fru_id;
+  bool exact_matched = true;
 
   if ( sdr )
      {
@@ -819,7 +832,8 @@
   parent_fru_id = sdrs->FindParentFru( type,
                                        instance,
                                        parent_type,
-                                       parent_instance
+                                       parent_instance,
+                                       exact_matched
                                      );
 
   stdlog << "CreateSensorEntityPath mc " << source_mc->GetAddress() << " FRU " << parent_fru_id << " type " << type << " instance " << instance << "\n";
Index: plugins/ipmidirect/ipmi_discover.cpp
===================================================================
--- plugins/ipmidirect/ipmi_discover.cpp	(revision 6710)
+++ plugins/ipmidirect/ipmi_discover.cpp	(working copy)
@@ -247,6 +247,28 @@
 
 
 void
+cIpmiMcThread::DiscoverForSubboard()
+{
+  if ( !m_mc ) {
+    stdlog << "Discovery for a sub board with no parent carrier board.\n";
+    return;
+  }
+
+  SaErrorT rv = m_mc->HandleNew();
+  if ( rv != SA_OK ) {
+    stdlog << "Failed to HandleNew()." << m_addr << ".\n";
+    return;
+  }
+
+  WriteLock();
+  m_mc->Populate();
+  WriteUnlock();
+
+  stdlog << "Discovery for sub board done." << m_addr << ".\n";
+}
+
+
+void
 cIpmiMcThread::Discover( cIpmiMsg *get_device_id_rsp )
 {
   cIpmiAddr addr( eIpmiAddrTypeIpmb, 0, 0, m_addr );
@@ -487,6 +509,12 @@
 
   cIpmiSensor *sensor = m_mc->FindSensor( (event->m_data[5] & 0x3), event->m_data[8] );
 
+  if ( event->m_data[7] == eIpmiSensorTypeAtcaHotSwap && sensor == 0 )
+    {
+      DiscoverForSubboard();
+      sensor = m_mc->FindSensor( (event->m_data[5] & 0x3), event->m_data[8] );
+    }
+
   if ( sensor == 0 )
      {
        stdlog << "sensor of event not found !\n";
@@ -561,6 +589,12 @@
        WriteUnlock();
 
        m_mc = 0;
+    } else {
+      // remove the sensor
+       WriteLock();
+       cIpmiResource *res = sensor->Resource();
+       res->Destroy();
+       WriteUnlock();
     }
     break;
 
Index: plugins/ipmidirect/ipmi_sdr.cpp
===================================================================
--- plugins/ipmidirect/ipmi_sdr.cpp	(revision 6710)
+++ plugins/ipmidirect/ipmi_sdr.cpp	(working copy)
@@ -1174,7 +1174,8 @@
 cIpmiSdrs::FindParentFru( SaHpiEntityTypeT type,
                           SaHpiEntityLocationT instance,
                           SaHpiEntityTypeT & parent_type,
-                          SaHpiEntityLocationT & parent_instance
+                          SaHpiEntityLocationT & parent_instance,
+                          bool &exact_matched
                         )
 {
   SaHpiEntityTypeT mc_type = SAHPI_ENT_UNSPECIFIED;
@@ -1182,6 +1183,7 @@
 
   parent_type = SAHPI_ENT_UNSPECIFIED;
   parent_instance = 0;
+  exact_matched = true;
 
   // First look for FRUs themselves
   for( unsigned int i = 0; i < NumSdrs(); i++ )
@@ -1218,6 +1220,7 @@
        }
     }
 
+  exact_matched = false;
   stdlog << "Entity ID " << type << ", Instance " << instance << " is not a FRU\n";
 
   // SDR entity is not a FRU: look for association records
Index: plugins/ipmidirect/ipmi_discover.h
===================================================================
--- plugins/ipmidirect/ipmi_discover.h	(revision 6710)
+++ plugins/ipmidirect/ipmi_discover.h	(working copy)
@@ -82,6 +82,7 @@
 protected:
   // discover MC
   void Discover( cIpmiMsg *get_device_id_rsp = 0 );
+  void DiscoverForSubboard();
 
   // poll mc task
   void PollAddr( void *userdata );
Index: plugins/ipmidirect/ipmi_sdr.h
===================================================================
--- plugins/ipmidirect/ipmi_sdr.h	(revision 6710)
+++ plugins/ipmidirect/ipmi_sdr.h	(working copy)
@@ -173,7 +173,8 @@
   unsigned int FindParentFru( SaHpiEntityTypeT type,
                               SaHpiEntityLocationT instance,
                               SaHpiEntityTypeT & parent_type,
-                              SaHpiEntityLocationT & parent_instance
+                              SaHpiEntityLocationT & parent_instance,
+                              bool &exact_matched
                             );
 };
 
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Openhpi-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openhpi-devel

Reply via email to