From 5d8a86ca5f0e07bb69fbed6920a481da123270df Mon Sep 17 00:00:00 2001 From: tzachid Date: Sun, 12 Oct 2008 07:38:53 +0000 Subject: [PATCH] [ibbus]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) git-svn-id: svn://openib.tc.cornell.edu/gen1@1645 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- trunk/core/bus/kernel/bus_iou_mgr.c | 1 + trunk/core/bus/kernel/bus_port_mgr.c | 10 +++++++--- trunk/hw/mlx4/kernel/hca/drv.c | 3 +++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/trunk/core/bus/kernel/bus_iou_mgr.c b/trunk/core/bus/kernel/bus_iou_mgr.c index 5811dec8..de51e1d1 100644 --- a/trunk/core/bus/kernel/bus_iou_mgr.c +++ b/trunk/core/bus/kernel/bus_iou_mgr.c @@ -1583,6 +1583,7 @@ iou_query_interface( 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; diff --git a/trunk/core/bus/kernel/bus_port_mgr.c b/trunk/core/bus/kernel/bus_port_mgr.c index 11cf6aee..337a7821 100644 --- a/trunk/core/bus/kernel/bus_port_mgr.c +++ b/trunk/core/bus/kernel/bus_port_mgr.c @@ -1197,7 +1197,6 @@ port_mgr_port_remove( */ 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 @@ -1211,7 +1210,8 @@ port_mgr_port_remove( ("%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 ); @@ -1837,7 +1837,10 @@ port_query_ipoib_ifc( 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 ) ); @@ -1939,6 +1942,7 @@ port_query_interface( 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; diff --git a/trunk/hw/mlx4/kernel/hca/drv.c b/trunk/hw/mlx4/kernel/hca/drv.c index 485576ba..7e6cba43 100644 --- a/trunk/hw/mlx4/kernel/hca/drv.c +++ b/trunk/hw/mlx4/kernel/hca/drv.c @@ -295,6 +295,7 @@ __alloc_hca_ifc( 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 @@ __alloc_hca_ifc( 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 @@ __query_ci_ifc( 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; -- 2.46.0