Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp32395pxb; Wed, 24 Feb 2021 17:18:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJwgyMjD5oTAqU2b+7hYoeoOLaCr6dLkPOVtSJdahZok7NI1S1MCiIHMA1cHjkFBw+LQXzvU X-Received: by 2002:aa7:dacc:: with SMTP id x12mr581845eds.98.1614215915863; Wed, 24 Feb 2021 17:18:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614215915; cv=none; d=google.com; s=arc-20160816; b=Ff+9VLZiwbhaq6LY+QPj2S65u8mUb285Fo9+vc+r3SrJ4xZpdMoARU868jpdyFuvtq 9nwsg6NuTR6uv0rXtNN2oFkoomw29OKPIbkut1IktsPhgKCfUSEce3fI5piLO9qjHtBq B5w5BCGtKFhfSlAKnFcejJI7petRfjbhWLjIqheSUgpqcblcOOubHzPEoHPWKbRxHSSC o3BUSRHOx8uDAaSReOealy0cGJjF+7CaS18OkPP8iI7yh6l2l73ZAsZJL1NsKyzxeOrw ZsvI0GHXpWTBvSj+pE/KvsnW5xBjwoGLPKuJOAGCU3X5IosmMrWDCFdx800bBnBZ0oDA CmUg== 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=G6sIzKMsw4B4xVqIuYUP+Cu6qAUU1qkMRQwEBscFhaw=; b=JITLIDZfJmeBW3sB5lc+MZM0FlpyddKvtz2Z5GeRXDsMN/rC2Dh9df5Wds84JpgkiQ ElMpmJOSXc1OheNW2pLLiO9lS1Szi3q7NXsCkLA+kQfBmhnlOYtYYMwr6uxj+icTQNK4 1NNQwm4+skbQ2I2l+6YUyichdeKimAUFuK6cF4dZGY8zemj9s5kFKFsDA7BSKldSDMh9 ZicuudvXZ/37eNF4FRcRgUAw10nU0phJhxbSLQzV6MBn247appq7vIjydzqve6rY37+0 msv1lFyDpyhTev+OkG/dlI7st6cRzGUKQ9amkiPQGDAKLVbYUmuG8HokaVfVbBSs1QgS olZg== 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 o8si1547149edv.2.2021.02.24.17.18.12; Wed, 24 Feb 2021 17:18:35 -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 S232372AbhBXRhe (ORCPT + 99 others); Wed, 24 Feb 2021 12:37:34 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:53088 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbhBXRhd (ORCPT ); Wed, 24 Feb 2021 12:37:33 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 7F0181C0B80; Wed, 24 Feb 2021 18:36:50 +0100 (CET) Date: Wed, 24 Feb 2021 18:36:50 +0100 From: Pavel Machek To: Florian Fainelli Cc: =?iso-8859-1?Q?=C1lvaro_Fern=E1ndez?= Rojas , Dan Murphy , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] leds: bcm6328: improve write and read functions Message-ID: <20210224173649.GA10809@amd> 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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AhhlLboLdkugWU4S" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --AhhlLboLdkugWU4S Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > >> Yeah, but ideally you should not be copying comments; there should be > >> one central place which does it and does it right. > >=20 > > I=E2=80=99m open to suggestions :). > > Which central place would be a good place for you? >=20 > I did consider creating an include/linux/brcm/brcm_io.h header or > something like that but I am really not sure what the benefit would > be. Less code duplication? It is immediately clear that driver including this is specific for brcm SoCs and would not try to work somewhere else? > 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. 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...? > We need the swapping for ARM because when running in ARM BE32, the data > is going to be in the host CPU endian, but the register bus is hard > wired to little endian. Yeah I see you need to do some byteswapping. But I'm pretty sure not all MIPS BE boxes do the magic swapping, right? And drivers/leds is not a place where you encode knowledge about SoC byte swapping. Best regards, Pavel --=20 http://www.livejournal.com/~pavelmachek --AhhlLboLdkugWU4S Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAmA2jrEACgkQMOfwapXb+vL/AgCeOS4GOKBqZCUt/Csj+W5FZdyH n1wAoKcDfUQrzWKWv+1GP8aXoI/EPBbD =pLCR -----END PGP SIGNATURE----- --AhhlLboLdkugWU4S--