[IBAL] fix to 2226. cause an asynchronic event to be handled immediately (and not...
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sun, 16 Aug 2009 14:06:23 +0000 (14:06 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sun, 16 Aug 2009 14:06:23 +0000 (14:06 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2355 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

core/al/al_ci_ca_shared.c
core/al/kernel/al_pnp.c

index ae992d7..da86759 100644 (file)
@@ -314,6 +314,7 @@ ci_ca_process_event_cb(
                if (AL_BASE_TYPE( p_obj->type) == AL_OBJ_TYPE_CI_CA) {\r
                                pnp_force_event( (struct _al_ci_ca *) p_obj, IB_PNP_LID_CHANGE,\r
                                        p_event_item->event_rec.port_number );\r
+                               force_smi_poll();\r
                }\r
                break;\r
 #endif //CL_KERNEL\r
index c3026f2..7fe8c36 100644 (file)
@@ -1332,6 +1332,44 @@ __pnp_process_port_backward(
 }\r
 \r
 \r
+/* \r
+ *send asynchronous events\r
+ */\r
+static void\r
+__pnp_send_ae(\r
+       IN                              al_ci_ca_t* const                       p_ci_ca )\r
+{\r
+       int ci, cnt, i;\r
+       al_pnp_ca_event_t               event_rec;\r
+       al_ae_info_t ae[MAX_AE]; /* pending Asynchronic Events */               \r
+\r
+       if (!p_ci_ca->cnt)\r
+               return;\r
+       \r
+       /* copy events in temp array */\r
+       ci_ca_lock_attr( p_ci_ca );\r
+       cnt = p_ci_ca->cnt;\r
+       ci = p_ci_ca->ci;\r
+       for (i=0; i<cnt; ++i)\r
+       {\r
+               ae[i] = p_ci_ca->ae[ci];\r
+               if ( ++ci >= MAX_AE )\r
+                       ci = 0;\r
+       }\r
+       cnt = p_ci_ca->cnt;\r
+       p_ci_ca->cnt = 0;\r
+       p_ci_ca->ci = ci;\r
+       ci_ca_unlock_attr( p_ci_ca );\r
+\r
+       event_rec.p_ci_ca = p_ci_ca;\r
+       for (i=0; i<cnt; ++i)\r
+       {\r
+               event_rec.pnp_event = ae[i].pnp_event;\r
+               event_rec.port_index = ae[i].port_index;\r
+               __pnp_process_port_forward( &event_rec );\r
+       }\r
+} \r
+\r
 \r
 /*\r
  * Check for port attribute changes.\r
@@ -1492,37 +1530,6 @@ __pnp_check_ports(
                }\r
        }\r
 \r
-       /* send asynchronous events */\r
-       {\r
-               int ci, cnt, i;\r
-               al_ae_info_t ae[MAX_AE]; /* pending Asynchronic Events */               \r
-\r
-               if (!p_ci_ca->cnt)\r
-                       return;\r
-               \r
-               /* copy events in temp array */\r
-               ci_ca_lock_attr( p_ci_ca );\r
-               cnt = p_ci_ca->cnt;\r
-               ci = p_ci_ca->ci;\r
-               for (i=0; i<cnt; ++i)\r
-               {\r
-                       ae[i] = p_ci_ca->ae[ci];\r
-                       if ( ++ci >= MAX_AE )\r
-                               ci = 0;\r
-               }\r
-               cnt = p_ci_ca->cnt;\r
-               p_ci_ca->cnt = 0;\r
-               p_ci_ca->ci = ci;\r
-               ci_ca_unlock_attr( p_ci_ca );\r
-\r
-               for (i=0; i<cnt; ++i)\r
-               {\r
-                       event_rec.pnp_event = ae[i].pnp_event;\r
-                       event_rec.port_index = ae[i].port_index;\r
-                       __pnp_process_port_forward( &event_rec );\r
-               }\r
-       } \r
-\r
 }\r
 \r
 \r
@@ -1616,6 +1623,10 @@ __pnp_check_events(
                                continue;\r
                        }\r
                }\r
+\r
+               /* send asynchronous events */\r
+               __pnp_send_ae( p_ci_ca );\r
+               \r
        }\r
 \r
        /* Dereference the PnP Manager. */\r