From owner-svn-src-head@freebsd.org Fri Nov 10 08:58:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7239E68A3D; Fri, 10 Nov 2017 08:58:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 935996BD23; Fri, 10 Nov 2017 08:58:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAA8wgmO087449; Fri, 10 Nov 2017 08:58:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAA8wgbm087448; Fri, 10 Nov 2017 08:58:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711100858.vAA8wgbm087448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 10 Nov 2017 08:58:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325637 - head/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Commit-Revision: 325637 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 08:58:43 -0000 Author: hselasky Date: Fri Nov 10 08:58:42 2017 New Revision: 325637 URL: https://svnweb.freebsd.org/changeset/base/325637 Log: Mark ipoib device as initialized on device open. Set the IPOIB_FLAG_INITIALIZED on dev_open and clear it on dev_stop to avoid a race between ipoib load and the underlying device driver. The device module must dispatch the IB_EVENT_PORT_ACTIVE event before ipoib module is loaded. Otherwise, the flush will fail since no one set the IPOIB_FLAG_INITIALIZED. Submitted by: Slava Shwartsman Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Fri Nov 10 08:42:37 2017 (r325636) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Fri Nov 10 08:58:42 2017 (r325637) @@ -638,6 +638,8 @@ int ipoib_ib_dev_open(struct ipoib_dev_priv *priv) clear_bit(IPOIB_STOP_REAPER, &priv->flags); queue_delayed_work(ipoib_workqueue, &priv->ah_reap_task, HZ); + set_bit(IPOIB_FLAG_INITIALIZED, &priv->flags); + return 0; } @@ -744,6 +746,8 @@ int ipoib_ib_dev_stop(struct ipoib_dev_priv *priv, int unsigned long begin; struct ipoib_tx_buf *tx_req; int i; + + clear_bit(IPOIB_FLAG_INITIALIZED, &priv->flags); ipoib_cm_dev_stop(priv);