From b3656914c80d5e0a091d59794add856fde318f79 Mon Sep 17 00:00:00 2001 From: leonidk Date: Sun, 29 Mar 2009 16:06:32 +0000 Subject: [PATCH] [MLX4_BUS] Bad order of operations in mlx4_ib teardown process. [mlnx: 4208] MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The bug is that the driver performs "CLOSE_PORT" command prior to closing all resources (such as QPs). In some cases it causes loss of completions. According to PRM: 18.2 ConnectX Driver Teardown and Re-initialization The HCA can be shut down (and re-initialized/restarted later on) by software. This operation is performed while the system shuts down gracefully or when PCI bus re-enumeration and memory re-allocation is required. In this case, software should perform the following steps: •Stop HCA operations (tear-down all QPs and flush WQEs if required). •Take down the network links by executing the CLOSE_PORT command. git-svn-id: svn://openib.tc.cornell.edu/gen1@2066 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- trunk/hw/mlx4/kernel/bus/ib/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/trunk/hw/mlx4/kernel/bus/ib/main.c b/trunk/hw/mlx4/kernel/bus/ib/main.c index 8910636a..a886302e 100644 --- a/trunk/hw/mlx4/kernel/bus/ib/main.c +++ b/trunk/hw/mlx4/kernel/bus/ib/main.c @@ -626,11 +626,12 @@ static void mlx4_ib_remove(struct mlx4_dev *dev, void *ibdev_ptr) ib_unregister_device(&ibdev->ib_dev); goto dealloc_dev; } + + ib_unregister_device(&ibdev->ib_dev); for (p = 1; p <= dev->caps.num_ports; ++p) mlx4_CLOSE_PORT(dev, p); - ib_unregister_device(&ibdev->ib_dev); iounmap(ibdev->uar_map,PAGE_SIZE); mlx4_uar_free(dev, &ibdev->priv_uar); mlx4_pd_free(dev, ibdev->priv_pdn); -- 2.41.0