Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932685AbbERUJk (ORCPT ); Mon, 18 May 2015 16:09:40 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:59746 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932302AbbERUJf (ORCPT ); Mon, 18 May 2015 16:09:35 -0400 Date: Mon, 18 May 2015 16:09:31 -0400 (EDT) Message-Id: <20150518.160931.2235555994068443513.davem@davemloft.net> To: aleksey.makarov@auriga.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, david.daney@cavium.com, sgoutham@cavium.com, mjc@semihalf.com, ganapatrao.kulkarni@caviumnetworks.com, tomasz.nowicki@linaro.org, rrichter@cavium.com, kamil@semihalf.com, tsrinivasulu@caviumnetworks.com, svangala@cavium.com, rric@kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH net-next v3 2/2] net: Adding support for Cavium ThunderX network controller From: David Miller In-Reply-To: <1431747401-20847-3-git-send-email-aleksey.makarov@auriga.com> References: <1431747401-20847-1-git-send-email-aleksey.makarov@auriga.com> <1431747401-20847-3-git-send-email-aleksey.makarov@auriga.com> X-Mailer: Mew version 6.6 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Mon, 18 May 2015 13:09:34 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1005 Lines: 29 From: Aleksey Makarov Date: Fri, 15 May 2015 20:36:39 -0700 > +/* Register read/write APIs */ > +static void nic_reg_write(struct nicpf *nic, u64 offset, u64 val) > +{ > + writeq_relaxed(val, nic->reg_base + offset); > +} > + > +static u64 nic_reg_read(struct nicpf *nic, u64 offset) > +{ > + return readq_relaxed(nic->reg_base + offset); > +} Are you really sure it's OK to used relaxed ordering for all register accesses like this? Personally, I think it's asking for trouble. Maybe in _extremely_ specific situations in the packet processing fast path where you can clearly define the ordering needs when programming the mailbox registers, I'd say it's OK. But universally across the entire driver? No way, no way at all. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/