Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6487273rwd; Mon, 19 Jun 2023 08:00:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4qZHoUr8lNZjfL7aRxAbKjRNew5KSI9I+h7OTT0dqb5XYn7i/el8ZT09L5xGNcPNJX8QYP X-Received: by 2002:a05:6a00:9a3:b0:668:7143:50e3 with SMTP id u35-20020a056a0009a300b00668714350e3mr6644650pfg.1.1687186847393; Mon, 19 Jun 2023 08:00:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687186847; cv=none; d=google.com; s=arc-20160816; b=cYhDEnaHuW9/PSOB2jAXX4XfJ75NJ4CE4WKU63ku5xJgZmAj1WTlOYNEhEA/Si6SlL xG8DfKQIB0/1Z8vLf2mGbMeIqjPa4Wt72SHC+9V3XfYuUoD6g+wts0fHtgbAJHAhqSJY HqhtIEvlVZArWh1FGCrS7jQ5yo/A38McdK0+JnAk9Skyas+TT2U1TJBV+Z6Bc5cNrU16 vA+V/bnADbDzQ/pdXL0+fho9ARl/jlvlCrZ1ZiKXcjZdbSfembEyfEl/ZTB9MJ2Eq2uM 9pDuwH+0XP+glYVIM1BTYgWhOh6LherkarW4HqTPN3BbofFV2jEqe27ZgUhO/6kPy/ud JWBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:cc:to:from :date:references:in-reply-to:message-id:mime-version:user-agent :feedback-id:dkim-signature:dkim-signature; bh=Ox0mGgHLkp5N/Da4WUkUcZFzC5y5KCU3DdU4cU5s0Zw=; b=JuBml5DnbwFb2ikvJgkX4+8TRJ4g3GP9aQZ6mXdDpOjA0HPcYhZHvq70OfLnz5CZxT 3JPRiQfbeB34UKgwWnqXVPSD3sU/7sn4+ZE2vvTgwgEh/3KI79HQn9BmPaNu5lUG/5VY 6c++h0/k8x2x7kLpoxFbEKXj0KLfPumi9f7+5o+woWNPYWGoP3jJ70UnEYNZDokVFTB8 LbsRF+6hk+RLHK6JOY2s31YfFsvMdM6QCOVkKJpz9P3ItXOLYsL2SnzYSd03piu8DkJo MlOXFhm86PgJ9xY2lCaDNxzWC+F8WQAGNpzgEm23k4KNneVniFs1Ss5oORucLwMwqGoY UvdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=uBukndHQ; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=BlQIjlC4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z10-20020aa79e4a000000b006667a4ebfa8si10675526pfq.336.2023.06.19.08.00.20; Mon, 19 Jun 2023 08:00:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=uBukndHQ; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=BlQIjlC4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232217AbjFSOuK (ORCPT + 99 others); Mon, 19 Jun 2023 10:50:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232200AbjFSOuI (ORCPT ); Mon, 19 Jun 2023 10:50:08 -0400 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03385C1; Mon, 19 Jun 2023 07:50:06 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id ADE525C02DC; Mon, 19 Jun 2023 10:50:04 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Mon, 19 Jun 2023 10:50:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1687186204; x=1687272604; bh=Ox0mGgHLkp5N/Da4WUkUcZFzC5y5KCU3DdU 4cU5s0Zw=; b=uBukndHQGWLUkt5Elnl5NgRUP7VADlbyByjzxpYFPTCu6ZQkXkW EuO6nRksRTSITxAS041IgShdDE/C8nTnzCS7s+KZ4sgX6fv6hI2se4CxS3f76Cel P4ZqwZ2nOukWFZcSdwaDdraA+vnJ1lG0EYHRF7+UXlzs90o5yeMkfrs7nMAAZEK3 X3Pd/FoSMQ/gIs5V+CHZCfBNZdcNzQ5SwsRMhOJ9/JciE/N6W9hfB33m7yfbtupm 9H+jHbnWngZ6Rn/8sSIBLubLAbe59dNfS4uFYJ2GJnNy68mS1j7tEA7MtrS6Equz x1kQ67rUB17ZXrv0EkRvrnlrLXmZMNDbu8g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1687186204; x=1687272604; bh=Ox0mGgHLkp5N/Da4WUkUcZFzC5y5KCU3DdU 4cU5s0Zw=; b=BlQIjlC4NmqbmqO/N50HX0TO6aj3XPhHGD7M9YlMcqHrSp+rasA HsYFM3OHe592/b0g5KK9mszRBYFpelGzdavoUPRhfMLRRbYFj0QEc2vqC/OAicj6 k+vRxIuu6wlDRpXXi3opAdHsWh3CGny8wP/7moaXopic9tdQhKXtAmHJ8vVVZTAf VZ6Z8ss9uvYbSipcfWyx/j2V51PwTCM7ilQUkrjJnZKfqY6v3uR2+u1GwOTrlkOL FY5YX1ZFR0waug0Knym4rss67fjXHFFdn4ZAWHOpAb49Xxx//wdmeRtVp7BLueus 64bMxkkTpglzcGdQP7EnXj0ahq7qRiH8lMQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgeefvddgjeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtgfesthhqredtreerjeenucfhrhhomhepfdet rhhnugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrg htthgvrhhnpeegfeejhedvledvffeijeeijeeivddvhfeliedvleevheejleetgedukedt gfejveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grrhhnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 1B2F9B60086; Mon, 19 Jun 2023 10:50:03 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-496-g8c46984af0-fm-20230615.001-g8c46984a Mime-Version: 1.0 Message-Id: <063a8886-fd31-425f-901c-fc830512eca3@app.fastmail.com> In-Reply-To: References: <20230616144854.3818934-1-arnd@kernel.org> <20230616144854.3818934-2-arnd@kernel.org> Date: Mon, 19 Jun 2023 16:49:41 +0200 From: "Arnd Bergmann" To: "Nicolas Dufresne" , "Arnd Bergmann" , "Ezequiel Garcia" , "Philipp Zabel" , "Mauro Carvalho Chehab" Cc: "Hans Verkuil" , "Benjamin Gaignard" , "Jernej Skrabec" , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] media: verisilicon: change confusingly named relaxed register access Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 19, 2023, at 16:41, Nicolas Dufresne wrote: > Le vendredi 16 juin 2023 =C3=A0 16:48 +0200, Arnd Bergmann a =C3=A9cri= t=C2=A0: >> From: Arnd Bergmann >>=20 >> The register abstraction has wrappers around both the normal writel() >> and its writel_relaxed() counterpart, but this has led to a lot of us= ers >> ending up with the relaxed version. >>=20 >> There is sometimes a need to intentionally pick the relaxed accessor = for >> performance critical functions, but I noticed that each hantro_reg_wr= ite() >> call also contains a non-relaxed readl(), which is typically much more >> expensive than a writel, so there is little benefit here but an added >> risk of missing a serialization against DMA. >>=20 >> To make this behave like other interfaces, use the normal accessor by >> default and only provide the relaxed version as an alternative for >> performance critical code. hantro_postproc.c is the only place that >> used both the relaxed and normal writel, but this does not seem >> cricital either, so change it all to the normal ones. > > In this text you spoke about potential performance side effects of exi= sting code > and your changes, but its left all very vague and theoretical. Have yo= u done any > measurement ? Do you need help with the manner ? I don't have this hardware and have not done any measurements. Obviously the only point of using relaxed accessors is to improve performance in critical code paths, but from the way they are used here it seems that this was instead just an accident and nobody else did any comparisons either. My guess would be that if one wanted to speed up the register access, a better way would be to use a regmap cache to avoid reading registers when the contents are already known. Arnd