Received: by 10.213.65.68 with SMTP id h4csp639038imn; Fri, 23 Mar 2018 12:14:59 -0700 (PDT) X-Google-Smtp-Source: AG47ELu7J7WnlAVyYP2i4smBjoAAp12RmzJ75FvOiENPUWb4MLmM/zuOlGQWNgJhn+WQqIueKm6I X-Received: by 2002:a17:902:209:: with SMTP id 9-v6mr30076022plc.403.1521832499640; Fri, 23 Mar 2018 12:14:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521832499; cv=none; d=google.com; s=arc-20160816; b=CZWq8pmUL1aLsy+YYgzS5mx/ulCrr74npa7EP2Fs7a+hdgno0t9vmf24qBN7O/2hV+ DXEN/QEK7z54C0a5vpqwJEEWaXL5gMFx/KTvRsZlznmgmggp6URJHMUpBwMfHM/FPUvu 7lZksCTcjIon9NtOMufFU7yMAhkTfLADxrSp/YBpeS97w7Ivi/cffYNHxwJD6XvqNuTt tb+Ry7MMl7Kqyy2zANet1+7gc/3OLVLbu4n/aAVEYxLltsZM43UkyDP4U86npglbAVy1 HviJ+euB3lzOflMtgPnWa54rRTRK4KQbrkw7YOZT0VaVxGUzh8JpKH1AtgTttNl/6/f9 BW+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=Rcw3GBP84eFNkFph6hmq9aBBrb29DqIQ1viNh8wACrk=; b=i7JA1vySU4AYOn6mrpysRxOzgjmn+Ol0Cu7X3EwT4shMNjcI/YhzlWzoCjmPQFlamX ENAcvnqGezbQGOxofyOb7QZHqhdZ/pBh5un274aLznE2gGIjxiz5MfmdMSsWDXj9Q4r3 65QJWXpCGiDrI/v4cLK3SZAwNJ4PqNzaRiBh9U3phq/kYXmNYrJ5bJ/3ZEf8qebmXgYD JG0Ibe2NnUSpsOLQNUJ6gn9AA7MfWLkTH551Cx5700eDTtHbqj/2m8TEk4mEOm3S+3rA Rk3WYCghsSIZdC/z1IsfyoqJPrcnAp4V51+qVOOjbn4Ds22DyBhsmHp6gT6WxI43HRFb G1FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=IG5FRhEy; dkim=pass header.i=@codeaurora.org header.s=default header.b=h7u24Unq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b14si6412764pge.252.2018.03.23.12.14.45; Fri, 23 Mar 2018 12:14:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=IG5FRhEy; dkim=pass header.i=@codeaurora.org header.s=default header.b=h7u24Unq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752481AbeCWTNV (ORCPT + 99 others); Fri, 23 Mar 2018 15:13:21 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:42376 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752425AbeCWTNT (ORCPT ); Fri, 23 Mar 2018 15:13:19 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id BEAE360C54; Fri, 23 Mar 2018 19:13:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521832398; bh=Xfs7twrS0QypmOvaARdYHD2gassIWBCwKI5hOPeF3Is=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=IG5FRhEyclMUEP2USWT3W/k4lkrppvdFkv9Xk1bK9lTvsqR64iU25DoDXgDoRBm1R JVlTJPx6AgNv9iEwwHQCirf7YnLORb9xN3DV+F3DhAL8F49spnz/BZo7wVVeyaT7wY g3uFkpbVmEMQshy/xNWv5OjYH9QIKv+yiGVw+fCk= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.0.105] (cpe-174-109-247-98.nc.res.rr.com [174.109.247.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id BFE0F60246; Fri, 23 Mar 2018 19:13:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521832397; bh=Xfs7twrS0QypmOvaARdYHD2gassIWBCwKI5hOPeF3Is=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=h7u24UnqJPsWiJadEAsUIAMh5XR3gHL+98x9n5PzKrYWUlpeOEMyX05CTg1y4mgHU K2VTg65T+95lSoIsPEK2GmdaZhVB401T/KFcrIhXdTUinFqXZsl2A1W/aFHLV9dWtK b+seQ//BdX0P3ib/IUcm2IKckRLekPJS+7dwnJ6U= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org BFE0F60246 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org Subject: Re: [PATCH v6] RDMA/qedr: eliminate duplicate barriers on weakly-ordered archs #2 To: linux-rdma@vger.kernel.org, timur@codeaurora.org, sulrich@codeaurora.org Cc: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michal Kalderon , Ariel Elior , Doug Ledford , Jason Gunthorpe , linux-kernel@vger.kernel.org References: <1521736245-23662-1-git-send-email-okaya@codeaurora.org> From: Sinan Kaya Message-ID: Date: Fri, 23 Mar 2018 15:13:15 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1521736245-23662-1-git-send-email-okaya@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/22/2018 12:30 PM, Sinan Kaya wrote: > Code includes wmb() followed by writel() in multiple places. writel() > already has a barrier on some architectures like arm64. > > This ends up CPU observing two barriers back to back before executing the > register write. > > Since code already has an explicit barrier call, changing writel() to > writel_relaxed(). > > Signed-off-by: Sinan Kaya > --- > drivers/infiniband/hw/qedr/verbs.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c > index 53f00db..d1cf9a0 100644 > --- a/drivers/infiniband/hw/qedr/verbs.c > +++ b/drivers/infiniband/hw/qedr/verbs.c > @@ -35,6 +35,7 @@ > #include > #include > #include > +#include what should we do here? change include? drop writeq_relaxed? > > #include > #include > @@ -860,7 +861,7 @@ static void doorbell_cq(struct qedr_cq *cq, u32 cons, u8 flags) > wmb(); > cq->db.data.agg_flags = flags; > cq->db.data.value = cpu_to_le32(cons); > - writeq(cq->db.raw, cq->db_addr); > + writeq_relaxed(cq->db.raw, cq->db_addr); > > /* Make sure write would stick */ > mmiowb(); > @@ -3338,7 +3339,7 @@ int qedr_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr, > > qp->rq.db_data.data.value++; > > - writel(qp->rq.db_data.raw, qp->rq.db); > + writel_relaxed(qp->rq.db_data.raw, qp->rq.db); > > /* Make sure write sticks */ > mmiowb(); > -- Sinan Kaya Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.