[ofw][patch] Prevent ibbus driver from crash

Alex Naslednikov xalex at mellanox.co.il
Tue Oct 7 09:43:57 PDT 2008


This patch prevents BSOD caused by WHQL reliability tests
signed-off by: Alexander Naslednikov (xalex at mellanox.co.il)
                    Tzachi Dar (tzachid at mellanox.co.il)
Index: core/bus/kernel/bus_iou_mgr.c
===================================================================
--- core/bus/kernel/bus_iou_mgr.c (revision 3218)
+++ core/bus/kernel/bus_iou_mgr.c (working copy)
@@ -1583,6 +1583,7 @@
   p_ext = p_dev_obj->DeviceExtension;
   if( !p_ext->h_ca ||
    !p_ext->b_present ||
+   !p_ext->h_ca->obj.p_ci_ca->verbs.p_hca_dev ||
    p_ext->b_reported_missing )
   {
    return STATUS_NO_SUCH_DEVICE;
Index: core/bus/kernel/bus_port_mgr.c
===================================================================
--- core/bus/kernel/bus_port_mgr.c (revision 3218)
+++ core/bus/kernel/bus_port_mgr.c (working copy)
@@ -1206,7 +1206,6 @@
   */
  p_ext = p_ctx->p_pdo_ext;
  CL_ASSERT( p_ext );
- CL_ASSERT(p_bfi == p_ext->p_parent_ext->bus_filter);
 
  /*
   * Flag the port PDO as no longer being present.  We have to wait
until
@@ -1220,7 +1219,8 @@
       ("%s NULL h_ca? p_ext %p\n", p_bfi->whoami, p_ext ) );
   return;
  }
-
+ CL_ASSERT(p_bfi == p_ext->p_parent_ext->bus_filter);
+ 
  cl_mutex_acquire( &gp_port_mgr->pdo_mutex );
  CL_ASSERT( p_ext->h_ca );
 
@@ -1846,7 +1846,10 @@
  CL_ASSERT( KeGetCurrentIrql() < DISPATCH_LEVEL );
 
  p_ext = p_dev_obj->DeviceExtension;
-
+ if  (p_ext->pdo.b_hibernating) {
+  // Can't continue within hibernation stage
+  return STATUS_UNSUCCESSFUL;
+ }
  BUS_TRACE( BUS_DBG_PNP, ("Query i/f for %s: PDO %p (=%p),ext %p,
present %d, missing %d .\n",
   p_ext->pdo.cl_ext.vfptr_pnp_po->identity,
p_ext->pdo.cl_ext.p_self_do, 
   p_dev_obj, p_ext, p_ext->pdo.b_present, p_ext->pdo.b_reported_missing
) );
@@ -1948,6 +1951,7 @@
   p_ext = p_dev_obj->DeviceExtension;
   if( !p_ext->h_ca ||
    !p_ext->b_present ||
+   !p_ext->h_ca->obj.p_ci_ca->verbs.p_hca_dev ||
    p_ext->b_reported_missing )
   {
    return STATUS_NO_SUCH_DEVICE;
Index: hw/mlx4/kernel/hca/drv.c
===================================================================
--- hw/mlx4/kernel/hca/drv.c (revision 3218)
+++ hw/mlx4/kernel/hca/drv.c (working copy)
@@ -295,6 +295,7 @@
  setup_ci_interface( p_fdo->hca.guid, !!hca_is_livefish(p_fdo), pIfc );
 
  pIfc->p_hca_dev = WdfDeviceWdmGetPhysicalDevice(p_fdo->FdoDevice);
+ ASSERT(pIfc->p_hca_dev);
  pIfc->vend_id = (uint32_t)p_fdo->bus_ib_ifc.pdev->ven_id;
  pIfc->dev_id = (uint16_t)p_fdo->bus_ib_ifc.pdev->dev_id;
  pIfc->dev_revision = (uint16_t)p_fdo->hca.hw_ver;
@@ -1443,6 +1444,7 @@
  setup_ci_interface( p_fdo->hca.guid, !!hca_is_livefish(p_fdo), pIfc );
 
  pIfc->p_hca_dev = p_fdo->cl_ext.p_pdo;
+ ASSERT(pIfc->p_hca_dev);    
  pIfc->vend_id = (uint32_t)p_fdo->bus_ib_ifc.pdev->ven_id;
  pIfc->dev_id = (uint16_t)p_fdo->bus_ib_ifc.pdev->dev_id;
  pIfc->dev_revision = (uint16_t)p_fdo->hca.hw_ver;
@@ -2111,6 +2113,7 @@
  p_ifc->InterfaceHeader.InterfaceDereference = __hca_noop;
  p_ifc->Verbs = *p_hca_ifc;
  p_ifc->Verbs.p_hca_dev = &p_fdo->hca;
+ ASSERT(p_ifc->Verbs.p_hca_dev);    
 
  ExFreePool( p_hca_ifc );
  status = STATUS_SUCCESS;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20081007/4fb184d2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: whql_bsod_patches.patch
Type: application/octet-stream
Size: 3021 bytes
Desc: whql_bsod_patches.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20081007/4fb184d2/attachment.obj>


More information about the ofw mailing list