From: Pavel Machek <pavel@ucw.cz>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: "Álvaro Fernández Rojas" <noltari@gmail.com>,
linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] leds: bcm6328: improve write and read functions
Date: Wed, 24 Feb 2021 22:45:28 +0100 [thread overview]
Message-ID: <20210224214528.GA511@duo.ucw.cz> (raw)
In-Reply-To: <b43f49c1-8fb6-bedf-b560-9bd8c5ce872a@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1636 bytes --]
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?
>
> 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?
> >
> >> 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...?
>
> 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
--
http://www.livejournal.com/~pavelmachek
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next prev parent reply other threads:[~2021-02-24 21:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-23 8:17 [PATCH 0/2] leds: bcm63x8: improve read and write functions Álvaro Fernández Rojas
2021-02-23 8:17 ` [PATCH 1/2] leds: bcm6328: improve write and read functions Álvaro Fernández Rojas
2021-02-23 8:34 ` Pavel Machek
2021-02-23 8:42 ` Álvaro Fernández Rojas
2021-02-23 8:58 ` Pavel Machek
2021-02-23 9:05 ` Álvaro Fernández Rojas
2021-02-23 17:00 ` Florian Fainelli
2021-02-24 17:36 ` Pavel Machek
2021-02-24 17:45 ` Florian Fainelli
2021-02-24 21:45 ` Pavel Machek [this message]
2021-02-23 8:17 ` [PATCH 2/2] leds: bcm6358: " Álvaro Fernández Rojas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210224214528.GA511@duo.ucw.cz \
--to=pavel@ucw.cz \
--cc=f.fainelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=noltari@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®