From patchwork Tue Jan 14 15:45:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 3486351 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0E7819F381 for ; Tue, 14 Jan 2014 15:46:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0FEFA2022F for ; Tue, 14 Jan 2014 15:46:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7B8F92021B for ; Tue, 14 Jan 2014 15:46:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751678AbaANPpw (ORCPT ); Tue, 14 Jan 2014 10:45:52 -0500 Received: from mail-ea0-f176.google.com ([209.85.215.176]:57148 "EHLO mail-ea0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751735AbaANPpv (ORCPT ); Tue, 14 Jan 2014 10:45:51 -0500 Received: by mail-ea0-f176.google.com with SMTP id h14so3975701eaj.21 for ; Tue, 14 Jan 2014 07:45:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4fTuGPKARTxEC9+dSwsYXizgpkkeFQYIMuw4zI+x3Ns=; b=fFLUs3xec60yCfFZTTHHPtM7P6SSEk6LIfa5fah8VdntuuA67Z1soqcWVyy06B9zev yKREOa5TRNyEHllWxMHINMBXN8EKgrM9B7iBNuJth7IhifraG0C9u1FGtK2USWQb24p8 NNCbgbq4gNGcqN68VmmhvkdXerUY3rATq/gtswD5XaKccezmVsBiSDTpkAHm8YJ7MimG fXCyBq4/bOyJeVJaZHOF4c+CuCvRjcVFb8Pb+3bXlXfufdAxHE2PwJxR2PnWTDyi8zGB x4UFojiBGhLK+ZkLG9cJf1Y05mnyjD4dByyvFtp6IuBJ/Crs6LtUbTwREnuRwy+VPFr8 1ktw== X-Gm-Message-State: ALoCoQkCtW8r7VM/2O4Z+Y26mC0tNpP2itXgEF/voGGlxbO2y5x82+Cxi7GGxQSGpY3dFfnkMFEo X-Received: by 10.14.107.3 with SMTP id n3mr2899537eeg.67.1389714349997; Tue, 14 Jan 2014 07:45:49 -0800 (PST) Received: from localhost (out.voltaire.com. [193.47.165.251]) by mx.google.com with ESMTPSA id o47sm2607907eem.21.2014.01.14.07.45.49 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 14 Jan 2014 07:45:49 -0800 (PST) From: Eli Cohen To: roland@kernel.org Cc: linux-rdma@vger.kernel.org, davem@davemloft.net, ogerlitz@mellanox.com, Eli Cohen Subject: [PATCH for-next 07/14] IB/mlx5: Make sure doorbell record is visible before doorbell Date: Tue, 14 Jan 2014 17:45:16 +0200 Message-Id: <1389714323-20130-8-git-send-email-eli@mellanox.com> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1389714323-20130-1-git-send-email-eli@mellanox.com> References: <1389714323-20130-1-git-send-email-eli@mellanox.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Put a wmb() to make sure the doorbell record is visible to the HCA before we hit doorbell. Signed-off-by: Eli Cohen --- drivers/infiniband/hw/mlx5/qp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index a056c24..87b7fb1 100644 --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c @@ -2251,6 +2251,10 @@ out: qp->db.db[MLX5_SND_DBR] = cpu_to_be32(qp->sq.cur_post); + /* Make sure doorbell record is visible to the HCA before + * we hit doorbell */ + wmb(); + if (bf->need_lock) spin_lock(&bf->lock);