Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1391107pxy; Fri, 23 Apr 2021 07:06:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz++HMpxD8otftLqnXzG/zsLnrIkNO4soBqIjCfy/4NEWXYPibau479k60HRznhZBFJJtMt X-Received: by 2002:a65:4c89:: with SMTP id m9mr3888807pgt.330.1619186766268; Fri, 23 Apr 2021 07:06:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619186766; cv=none; d=google.com; s=arc-20160816; b=muDFLkP1kNq9/6so4nxZ7BZk6GB4RTnBBBlM072HuUceT0GUNzCi6qC8MsYRuzyc3Y uy6zSSEYqZz/azvxUG9wXR6MfQJgq3/o2pElmME5MBIuHdIpQycn+FpCwpEI+Z4lhpac JAx4ULiHOEywDfPrd+p+7yQhfwmQJSVQNqV/25X/e7Y6UP9sLIAxiv5fZhMvyuQER2nR 8+hBFy9ER59jwW9uNXJSdcEuH7zN+559zOuWuQoxwj7geExd8XURniIBF37+9/KdvuXy rnzjYEL+j2SY9GLOP5pdWNBi86hwKMyJ/qsgtqowMQW5Dl+xA/72Facp/+4RRf4X27fH FskA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=yVfMqSBfK2/PqYx0vrefAbZn8CuJJPRDt4Z7FHHTIMk=; b=ihUCfb2DpKD1JjMmWNMJeUQpn2FTqBlL78vnod83egEmFktSkbm5FS6Yafl/FCfF0r gx8J5c9JUbIFIgVh+0hOVmHnvnV5yAQPc0y2suK3K6RnXahV7eP1ojVr0+NLezcpd/Tp k0Qj9Isw9bbrRBhMsZtZcflnZhmOSbRK5bQSTjAmjB5NUPHLzuZxMWuZez1KQjxY6afe yRLWfztVgtwPBcSiH7QMbTrNzgU13YlIQd2Djk9XuH+u8g3hMomJtY5khIoKY+ru8sm1 lWGzb5GCPFBtwTux2TaUteYifEMVlV7rN46FYFHSTtWAfWOOtZaB61KQm8sR035laYjD rN9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@0x0f.com header.s=google header.b=lNZsy6ZR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a1si10391801pjo.167.2021.04.23.07.05.48; Fri, 23 Apr 2021 07:06:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@0x0f.com header.s=google header.b=lNZsy6ZR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235511AbhDWODc (ORCPT + 99 others); Fri, 23 Apr 2021 10:03:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231305AbhDWODb (ORCPT ); Fri, 23 Apr 2021 10:03:31 -0400 Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50DEFC061574 for ; Fri, 23 Apr 2021 07:02:55 -0700 (PDT) Received: by mail-qt1-x833.google.com with SMTP id o2so23003611qtr.4 for ; Fri, 23 Apr 2021 07:02:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=0x0f.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yVfMqSBfK2/PqYx0vrefAbZn8CuJJPRDt4Z7FHHTIMk=; b=lNZsy6ZRl8T3jl9miUiy1DG8huWs8AoSpr2G+6tVSViQrqjFn1zJE0a/n1Ij0dEqz9 shw148LUXm7t2bu+AdCZdr5bWS0c/6C6PuRa2vpBH2/C7PU2h9B0JnGTp9oNGByMmKU3 NBUhdOExu3xpn1y9aPQogQcIbF2SQO+oVLwhI= 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=yVfMqSBfK2/PqYx0vrefAbZn8CuJJPRDt4Z7FHHTIMk=; b=bAJ35mUlzXxWnk30F+8gn4hzkUw1yglGuBShBZ+LLDiU5GIlQc7HnPwCL50Vs1GAe6 lQDS8qd0Do+vWytQTRPGIU6uUgei5JdMMtpbdDkjrzMv26fd/sqQ2upaN+LgcSnMcGee 9tOg57LnnNn7QN4SfBHTslSg0VZ8C7/2/ME8beAf94WxrBrda65xe7KLcb5565hZHmWO 8+IdO2bevd410OZ/3edigDfAyBO8giBZSXacrPCMeD0Q5m9sVLU6W0Zo7e8alFShkiNn 5Ie0aUxKpVOhjCbVantBbg479d1OL3JAoYC30PySdAahOPhMich+rWeU7ssnETTKBXGK 5Ktg== X-Gm-Message-State: AOAM530jYj8hZFoB1xPbS+YiMS4YOQiManzXlm5Twa74Y4zRTKzauFuf DAySS2uqLlXOQBTMlSv8ikCxmGf5NPxxyJv6yWlQXg== X-Received: by 2002:a05:622a:14b:: with SMTP id v11mr3909827qtw.33.1619186573440; Fri, 23 Apr 2021 07:02:53 -0700 (PDT) MIME-Version: 1.0 References: <20210422140945.4131092-1-daniel@0x0f.com> <20210422140945.4131092-2-daniel@0x0f.com> In-Reply-To: From: Daniel Palmer Date: Fri, 23 Apr 2021 23:02:42 +0900 Message-ID: Subject: Re: [RFC PATCH 1/2] ARM: mstar: Add header with macros for RIU register access To: Arnd Bergmann Cc: SoC Team , Linux ARM , Linux Kernel Mailing List , Olof Johansson , Willy Tarreau Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, On Fri, 23 Apr 2021 at 22:48, Arnd Bergmann wrote: > > The __iomem token comes after the type, so this should be 'void __iomem *'. > Bit of copy/paste fail. Fixed. > > + return readw_relaxed(reg + 4) << 16 | readw_relaxed(reg); > > This should probably be using 'readw' instead of 'readw_relaxed'. If you > absolutely need to use one of the relaxed accessors somewhere, > better add both sets and make sure drivers use the non-relaxed version > by default. I'll add a relaxed/non-relaxed version of each. Because of the heavy memory barrier to access one 32 bit register we'll hit the barrier twice in the non-relaxed version. And we don't need to hit the barrier at all because it doesn't actually matter for IO. Is there something better I can do there? > Maybe both types of accessors can be in a single header. That makes sense. I'll merge them. Would this header be something that could go in alone without anything that uses them in mainline right now? Thanks, Daniel