[ofw] patch: Release hca interface when loading of ibal fails

Tzachi Dar tzachid at mellanox.co.il
Sun Jan 24 05:42:23 PST 2010


While debugging another failure I have found out that if ib_register_ca
fails it is not possibale to try again until the computer is rebooted.
 
This patch solves this problem.
 
Index: bus/kernel/bus_pnp.c
===================================================================
--- bus/kernel/bus_pnp.c (revision 5503)
+++ bus/kernel/bus_pnp.c (working copy)
@@ -428,6 +428,10 @@
  {
   BUS_TRACE_EXIT( BUS_DBG_ERROR, ("ib_register_ca returned %s.\n",
    ib_get_err_str(ib_status)) );
+  p_ext->hca_ifc.InterfaceHeader.InterfaceDereference(
+   p_ext->hca_ifc.InterfaceHeader.Context);
+  p_ext->hca_ifc_taken = FALSE;
+  
   return STATUS_UNSUCCESSFUL;
  }
  BUS_TRACE_EXIT(BUS_DBG_PNP, ("%s bound to CA guid %I64x\n",
Index: complib/kernel/cl_pnp_po.c
===================================================================
--- complib/kernel/cl_pnp_po.c (revision 5503)
+++ complib/kernel/cl_pnp_po.c (working copy)
@@ -429,8 +429,15 @@
  CL_ENTER( CL_DBG_PNP, p_ext->dbg_lvl );
 
  status = p_ext->vfptr_pnp_po->pfn_start( p_dev_obj, p_irp, p_action );
- if( NT_SUCCESS( status ) )
+ if( NT_SUCCESS( status ) ) 
+ {
   cl_set_pnp_state( p_ext, Started );
+ } 
+ else
+ {
+  CL_TRACE( CL_DBG_ERROR, p_ext->dbg_lvl, 
+   ("p_ext->vfptr_pnp_po->pfn_start returned %08x. \n", status) );
+ }
 
  CL_EXIT( CL_DBG_PNP, p_ext->dbg_lvl );
  return status;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100124/cb4ef5bd/attachment.html>


More information about the ofw mailing list