From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH v5 3/5] bnx2x: Eliminate duplicate barriers on weakly-ordered archs Date: Fri, 23 Mar 2018 13:04:18 -0400 (EDT) Message-ID: <20180323.130418.2223623186761161723.davem@davemloft.net> References: <20180323.124326.2170503491903886041.davem@davemloft.net> <4bd9ccd2-df8f-acad-2513-eefe065dc852@codeaurora.org> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4bd9ccd2-df8f-acad-2513-eefe065dc852@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org To: okaya@codeaurora.org Cc: netdev@vger.kernel.org, timur@codeaurora.org, sulrich@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, ariel.elior@cavium.com, everest-linux-l2@cavium.com, linux-kernel@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org From: Sinan Kaya Date: Fri, 23 Mar 2018 12:51:47 -0400 > It could if txdata->tx_db was not a union. There is a data dependency > between txdata->tx_db.data.prod and txdata->tx_db.raw. > > So, no reordering. I don't see it that way, the code requires that: txdata->tx_db.data.prod += nbd; is visible before the doorbell update. barrier() doesn't provide that. Neither does writel_relaxed(). However plain writel() does. Therefore the code is only correct as-is, and your change potentially adds a reordering problem.