Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp546371ybi; Fri, 21 Jun 2019 04:10:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzODUTn8BbCozzsaTbgz5hUKIO8qqmXuGjxuBudfxeL+OxnlTMbAVDK8+N85UAp0xFkBJv0 X-Received: by 2002:a63:5c16:: with SMTP id q22mr16379493pgb.200.1561115408594; Fri, 21 Jun 2019 04:10:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561115408; cv=none; d=google.com; s=arc-20160816; b=lUGiE/fnj0I5DYBYW7Js8p2kYKPcxFU+9gfZK03TaZMm1TrezFG1qbnxkIXjIOhQEW UG/TeN9A+CjteuAv2h9KOH+uvSq6GDqhQz/GQFPegEdpBB288695vAjNUCz87uijRZ09 28b0SEgsTDz0xxR8IkFUonwHyyq7JWBDvuzUMbKSjWpoSEwz1JEzcnGh8T2siIjTe183 Rqbg7jI+gJUzfWMOeSysL+9s8H4s05EOiqoSxOde47/Gdzmt4pCZ6CsjMCDoupi48pj9 uO5Zob4QSM1Kd11rlBNtNGw3Sg1Gw1y+Y5muY8F1pxy0vLZLpk6R9zxXtA8HlD6wylwa 4HiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=Xo3SvTstxc7h8VJt3dWmJBpJuemSVAPyqkyjpLinJ9Q=; b=K2SKrPvggKhud5Kow7KiiUMi/c7i22hAM2ct7g0qNyA3fkCgApmiw4LiSiL8s11SPF CCuOfr6JblemaERx9/aNWIpm9XtnjNkW92NHWEapjx2cUWGjNuA77IkgnAOKqU22rn8G GFE/OmNNlL1+foCZt0+3ZfcQxjUUQiA7V0rdp0rKoJcY7LBFF31gYVuyd9Wim1Gf8nyH HhBc5LGBPgzxZqrR3YkZVU81ITIym1k7QbSc39Xgu9mXMw6V63lihF1TA9x4XO5/SOGj +tQ7GQYyaDKDCcMuZDdmN9iq2BmMQUC7r/6h9x5N9qE/KnUxmhMlcoNdTQuxUhL/eMog elWA== ARC-Authentication-Results: i=1; mx.google.com; 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 u11si2318923plz.219.2019.06.21.04.09.52; Fri, 21 Jun 2019 04:10:08 -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; 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 S1726622AbfFULJm (ORCPT + 99 others); Fri, 21 Jun 2019 07:09:42 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:35465 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726218AbfFULJl (ORCPT ); Fri, 21 Jun 2019 07:09:41 -0400 Received: by mail-qt1-f193.google.com with SMTP id d23so6484951qto.2; Fri, 21 Jun 2019 04:09:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Xo3SvTstxc7h8VJt3dWmJBpJuemSVAPyqkyjpLinJ9Q=; b=rPMjz6Jvy0o8zHF5mV55OCnizlza5oUVh1Wymk2CnmUzUkayjYT/0cHs/UAKNN7ON5 FUkvGHDJoL/mnL4K8bekFYu9xsd40DCGycDxUwm1n3VAipvtC7P1U3w9ZS0zQoRha9j/ Yx3TDCvdfEn8Eu2OzpVfqJL/PBxM++CeRw6XQop9oOqTeSbazE4+eqv0oPCYuzM5/Gob YdNAFvOakgfo87XT8/T5iu9KB2ubyqLvcECfTH2zrzWbG+rzHHarjkGl3xNL7pUIksz0 +eahEaZUIaNW4IYp/8YWVT87BHouU5vLrLNgzMjmASoccSdE5n2md5Wo8GWdne2dOchm 61iQ== X-Gm-Message-State: APjAAAXxk3pICnI/rhOAkWHrmSlEapOypjudbea7QYpSXrWQ/y4kyYhn BltiUbXFo1CzHNeHlkm0/cG0WG4+8fSnQynCfw8= X-Received: by 2002:a0c:91dd:: with SMTP id r29mr171346qvr.93.1561115380817; Fri, 21 Jun 2019 04:09:40 -0700 (PDT) MIME-Version: 1.0 References: <20190614063341.1672-1-fancer.lancer@gmail.com> <20190620174002.tgayzon7dc5d57fh@pburton-laptop> In-Reply-To: From: Arnd Bergmann Date: Fri, 21 Jun 2019 13:09:24 +0200 Message-ID: Subject: Re: [PATCH] mips: Remove q-accessors from non-64bit platforms To: "Maciej W. Rozycki" Cc: Paul Burton , Serge Semin , Ralf Baechle , James Hogan , Serge Semin , "Vadim V . Vlasov" , "linux-mips@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 21, 2019 at 12:09 PM Maciej W. Rozycki wrote: > > On Fri, 21 Jun 2019, Arnd Bergmann wrote: > > > > The use of 64-bit operations to access option's packet memory, which is > > > true SRAM, i.e. no side effects, is to improve throughput only and there's > > > no need for atomicity here nor also any kind of barriers, except at the > > > conclusion. Splitting 64-bit accesses into 32-bit halves in software > > > would not be a functional error here. > > > > The other property of packet memory and similar things is that you > > basically want memcpy()-behavior with no byteswaps. This is one > > of the few cases in which __raw_readq() is actually the right accessor > > in (mostly) portable code. > > Correct, but we're missing an `__raw_readq_relaxed', etc. interface and > having additional barriers applied on every access would hit performance > very badly; How so? __raw_readq() by definition has the least barriers of all, you can't make it more relaxed than it already is. > in fact even the barriers `*_relaxed' accessors imply would > best be removed in this use (which is why defza.c uses `readw_o' vs > `readw_u', etc. internally), but after all the struggles over the years > for weakly ordered internal APIs x86 people are so averse to I'm not sure > if I want to start another one. We can get away with `readq_relaxed' in > this use though as all the systems this device can be used with are > little-endian as is TURBOchannel, so no byte-swapping will ever actually > occur. I still don't see any downside of using __raw_readq() here, while the upsides are: - makes the driver portable to big-endian kernels (even though we don't care) - avoids all barriers - fixes the build regression. Arnd