Received: by 10.213.65.68 with SMTP id h4csp87235imn; Wed, 21 Mar 2018 13:04:32 -0700 (PDT) X-Google-Smtp-Source: AG47ELtB8ZFBiHhKOa+WBl0SMimAZ+NASJERg27++2wvWn3CLqfA/za1OTPgoHzwWanjWDQU7Kn+ X-Received: by 10.101.65.195 with SMTP id b3mr13995578pgq.118.1521662672662; Wed, 21 Mar 2018 13:04:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521662672; cv=none; d=google.com; s=arc-20160816; b=GiUJsOEkg8wEvRYt8AFfRaxluupfVVYksDDEnHn/OmS+qWMH27fuxltFvF60uDmLZT xFuviWBdSIalG4vqWV298VtwCrjbbR2iaH9xJHGcoHXUmCbUTNrITT5Zu/RNWl/CF8Gf B/BsnV3eLSWI04871qqi0KsWSH8+4xj+hAVr6fpnWhC0hwiR37016TzIuKGDjH1u44YL frrquP9RNG/O8sV/uHaJW9THgAe9zWsgMDkVAhBUlL/W6vfz2j3YdS1Wq+BqH12g8kdR +8+jzh5sLDONdYMIBvHkyu780SsARQ9jNjkwyzUmCwPQBPEWgXXu74jA39LPbqSFMiV7 2ivw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=KP1TQf7Ft9BL1Ph0T6ckk3WRmqoW2W8dGmGwU9hmS4k=; b=JAgVL7gNUxAfiFIuPmoTDVHAjyCRXdLu3SGkuXc5bxyk97vs52xzuw6EtRSKFuMe5f 5ncXke+tehVDajT8YlhyD/4SUt3zE2n6FNGHWwCWchE8yGSemzqBag6Ipp21ugKICnPC hbyGsBTrrFPy/PAL2aFoHHVmclF9qKww1kI1ArCyP2ZKH0xUutrutP2aCqcwtxWEJrb4 BopLe3PsTnIIrDEAvO4k3ixlXkvObKLcITH16JX99FvRvS3vrULTgtyaGGV0egjkQl1e +9Moc9F4ufI4J4uVu94leDGCfBYOGqH/eHLndF2bPgI56nwZRstjgKL9cH0GFqno66cI /kAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=HoxEbzfp; 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 g8-v6si4438571plt.235.2018.03.21.13.04.17; Wed, 21 Mar 2018 13:04:32 -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=@ziepe.ca header.s=google header.b=HoxEbzfp; 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 S1753229AbeCUUC5 (ORCPT + 99 others); Wed, 21 Mar 2018 16:02:57 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:45451 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753021AbeCUUCz (ORCPT ); Wed, 21 Mar 2018 16:02:55 -0400 Received: by mail-pl0-f65.google.com with SMTP id n15-v6so3797514plp.12 for ; Wed, 21 Mar 2018 13:02:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=KP1TQf7Ft9BL1Ph0T6ckk3WRmqoW2W8dGmGwU9hmS4k=; b=HoxEbzfpYKbib/I9cBVVgMjR+P8a5U7CQN6xjQJSjJrUp7+qCOf1WixlZSgNDd0WBv L4dO3xCyJb7koG2j1+HV2ZDMWBb7FKRAfNP1B3x005k9rR+CuV9iN0Z09bPz9fc+QdeS UVc2NmUL2jidm52YarcCqNyOQqReKRuwkjiApHhLSWUo77+XJPGyRx/1btnq3Y6X033y //Vt7CcyLz94Ol0GfL69tP2qIkqcDlXZ47Botp99hxvpo8WRgym5nIEO3ut+48CkjulA qkZaVcBb0IXJuSgJ07iWEduKkmIKRO4eYLd5ZW2N8tZby5955qn5u22OS8Grd6UuvWev 0HaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=KP1TQf7Ft9BL1Ph0T6ckk3WRmqoW2W8dGmGwU9hmS4k=; b=qD1dtWuzUy0FTPIFnvcgM0w3y3/sd7zctU+RN37Qadg9TJ0vqTCzPqlzxIIEtLiB/u 2yv1uGfUJNaPOFpeKYG/S8VrZzq8srJGWQiVsTu1jBlmJqr4ma/ED7ejj8HAtzm0cPeT +9s+7Z3U3tMGnpq6s3MbNJdDQSudlTYqA88raLMVBp0TvhyKqR92ZyyWp89CEwLy/akJ DnnzrMsBGby1NsCCnXMElkafd9m6ytSNT5DXSq4RDDjuiPa2vxSFBmlD0WXyNHYVjD7K CbhRVXOlfzmlzqaqE10NEbNE5uMzEbSNBmvlFF7mXN5KViBm0lu0U6KCM6Kd4GTGKvDk sutQ== X-Gm-Message-State: AElRT7GvnpHD0mJJknLzSvWEvmYMNUh/776SQBxeqKro03RlMsus1D8i yYhPapLawix7zToSsMa++ublR4oalAo= X-Received: by 2002:a17:902:7102:: with SMTP id a2-v6mr21805675pll.87.1521662575178; Wed, 21 Mar 2018 13:02:55 -0700 (PDT) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [174.3.196.123]) by smtp.gmail.com with ESMTPSA id t16sm10833983pfm.69.2018.03.21.13.02.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Mar 2018 13:02:54 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1eyjwj-0005bp-9l; Wed, 21 Mar 2018 14:02:53 -0600 Date: Wed, 21 Mar 2018 14:02:53 -0600 From: Jason Gunthorpe To: Sinan Kaya Cc: linux-rdma@vger.kernel.org, timur@codeaurora.org, sulrich@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Faisal Latif , Shiraz Saleem , Doug Ledford , linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 3/6] RDMA/i40iw: Eliminate duplicate barriers on weakly-ordered archs Message-ID: <20180321200253.GA21453@ziepe.ca> References: <1521514068-8856-1-git-send-email-okaya@codeaurora.org> <1521514068-8856-4-git-send-email-okaya@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1521514068-8856-4-git-send-email-okaya@codeaurora.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 19, 2018 at 10:47:45PM -0400, Sinan Kaya wrote: > diff --git a/drivers/infiniband/hw/i40iw/i40iw_uk.c b/drivers/infiniband/hw/i40iw/i40iw_uk.c > index 8afa5a6..7f0ebed 100644 > +++ b/drivers/infiniband/hw/i40iw/i40iw_uk.c > @@ -723,7 +723,7 @@ static void i40iw_cq_request_notification(struct i40iw_cq_uk *cq, > > wmb(); /* make sure WQE is populated before valid bit is set */ > > - writel(cq->cq_id, cq->cqe_alloc_reg); > + writel_relaxed(cq->cq_id, cq->cqe_alloc_reg); > } Ah, this one is probably not OK, i40iw_cq_request_notification is called here: spin_lock_irqsave(&iwcq->lock, flags); ukcq->ops.iw_cq_request_notification(ukcq, cq_notify); spin_unlock_irqrestore(&iwcq->lock, flags); So this needs to add mmmiomb(); to keep the same semantics. Generally I think you need to be very careful to ensure that any conversion to _relaxed isn't contained by a spinlock, or the mmiomb() is present. Maybe even do a first series with this obviously correct pattern: wmb(); writel() -> writel_relaxed() writel() -> writel_relaxed() [..] mmiowmb(); Jason