Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp212618pxb; Wed, 24 Feb 2021 23:57:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJy0TRT7Tc+yobfgA6M2wvb9Fml89ivYM1dPHvwKt4bUPxoXboqlmruXEuiwvEhKQU1KvWg2 X-Received: by 2002:a17:907:7252:: with SMTP id ds18mr1513636ejc.239.1614239829765; Wed, 24 Feb 2021 23:57:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614239829; cv=none; d=google.com; s=arc-20160816; b=zEIJqAYfKiKgcvy461B8O95mE7iPG0Lkhayj1BajNx/GkS++KIZjLxo8Md4e5aKClm KImtAevwkrq4CeMibmoMbj1/7zgTSf39dLPvuuNRjHaN3ZOPI1yJgPAtlnc0afsY4mFD Uq0VKHDvIaDy+vz96mKuuYQQlXO85adNH9jkFRqAylns0LKjf9ZGj6uMbnk/LE5nTyyM QSR+ai7GBb07ZA3f/bD7M9UI+uTDdf+uPOdQRQQOVMtHoSKoqiO5J+bXAc098HWL6VrH H5J4wmj5Ixu8C19BtgyR30dZH9YundfkXXWc0EUx33q1J9YdODyZ1vRXj0HaD+m0IaWG FWkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=2wrIZUhe2zFnnfMErAEKNJB/byCqHiKP21AGevB0DBw=; b=Pn4naldG6jQ3/+74hcKETVlEhfnOvnL8IVfc0tiZZF6xjj5otOED+Dmngl7M+ruksw GyCAT/p89jbQKPNjgdn6x3HXHeMxPLcI9k8xIGKI2VVgKLCZ4BZTkli8D+qPRHkL8kQ0 L/qsQpuzZo4XykTEiKU19RUchO/RchgOu8rADlc0invGeOrAdyiA5nlNTYy9uQOnUrJo 5hkGsh/cnbl+LyFWYfUTVyB8OYrM3zzPC+dczr/GfmcNYZYSsuyr3U5AUOqQV8Meum5r 8SOG2ixofZ5wWFW0OTR95w5xoNdNIXfq6gN4vXgzyy5gfGh//rxS1MvRgj8s1Ov1gkxn vEOw== ARC-Authentication-Results: i=1; mx.google.com; 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 qw19si2975449ejb.607.2021.02.24.23.56.46; Wed, 24 Feb 2021 23:57:09 -0800 (PST) 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; 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 S236067AbhBXVqQ (ORCPT + 99 others); Wed, 24 Feb 2021 16:46:16 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:48056 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230330AbhBXVqO (ORCPT ); Wed, 24 Feb 2021 16:46:14 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 437ED1C0B80; Wed, 24 Feb 2021 22:45:29 +0100 (CET) Date: Wed, 24 Feb 2021 22:45:28 +0100 From: Pavel Machek To: Florian Fainelli Cc: =?iso-8859-1?Q?=C1lvaro_Fern=E1ndez?= Rojas , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] leds: bcm6328: improve write and read functions Message-ID: <20210224214528.GA511@duo.ucw.cz> References: <20210223081732.9362-1-noltari@gmail.com> <20210223081732.9362-2-noltari@gmail.com> <20210223083449.GA9750@amd> <3826ACDE-EFF2-4CC5-82EE-2DBC991CF996@gmail.com> <20210223085819.GB9750@amd> <20210224173649.GA10809@amd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IS0zKkzwUGydFO0o" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --IS0zKkzwUGydFO0o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > Less code duplication? It is immediately clear that driver including > > this is specific for brcm SoCs and would not try to work somewhere else? >=20 > Yes maybe, there still does not feel like this deserves a shared header, > but as long as the generated code is the same, why not. Ok, it seems patch is not needed at all, after all? > >=20 > >> As far as using _relaxed() this is absolutely correct because the bus > >> logic that connects the CPU to its on-chip registers is non re-ordering > >> non posted. That is true on the MIPS BE/LE and ARM when configured in = LE > >> or BE. > >=20 > > If that's right on particular SoC, then _relaxed and normal versions > > should be same; drivers still need to use normal versions, because > > they may be running on different SoC...? >=20 > readl() includes barriers and read_relaxed() does not, hence the > difference in the name. There is no need to pay the price of a barrier > when a) the bus architecture guarantees non re-ordering and posting and > that statement is true on all the SoCs where these peripherals are used, > and b) you have worked on fine tuning your drivers to get the most > performance out of them. Exactly. When bus architecture guarantees ... readl and read_relaxed can be the same. That knowledge should be in architecture code, not in drivers. (But it does not matter much when the drivers are architecture-specific). > Given these peripherals can only be used on CPUs/SoCs made by Broadcom, > any argument about portability to other SoCs is moot. Ok. Pavel --=20 http://www.livejournal.com/~pavelmachek --IS0zKkzwUGydFO0o Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCYDbI+AAKCRAw5/Bqldv6 8jvKAKDAMeVhVr1yspG9mMfPYO/0EFpXRgCgnu7pOAKu4FSk7HnYa6MrHsW7uQ8= =kaHi -----END PGP SIGNATURE----- --IS0zKkzwUGydFO0o--