All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "Wang, Haiyue" <haiyue.wang@linux.intel.com>,
	openbmc@lists.ozlabs.org, openbmc-request@lists.ozlabs.org,
	Andrew Jeffery <andrew@aj.id.au>, Joel Stanley <joel@jms.id.au>
Subject: Re: openbmc Digest, Vol 32, Issue 32
Date: Fri, 13 Apr 2018 15:41:38 +1000	[thread overview]
Message-ID: <1523598098.11062.202.camel@kernel.crashing.org> (raw)
In-Reply-To: <94260b45-7adc-a9ff-6300-e5bd3bd359bb@linux.intel.com>

On Fri, 2018-04-13 at 13:11 +0800, Wang, Haiyue wrote:
> 
> On 2018-04-13 12:43, Benjamin Herrenschmidt wrote:
> > On Thu, 2018-04-12 at 16:42 +0800, Wang, Haiyue wrote:
> > > I means the device tree merge time, putting things in kernel need long time
> > > to be passed code review. And people may want to export different range of
> > > registers, then they need to change the device tree, the development cycle
> > > may be long.
> > 
> > But that's not a big issue in practice though, you don't*need*  all
> > your device-trees to be upstream and up to date especially if it's
> > stored separately from the kernel.
> > 
> > Keep in mind this should be strictly limited to a few registers that
> > need that sort of manipulation, maybe a handful or two, that's it.
> > 
> > Most things need proper kernel drivers.
> > 
> 
> Understood, NOT exposing like /dev/mem makes sense for security

Not just security. It's also plain gross ;-)

It also means it's hard to locate which pieces of your userspace may
contain chip revision specific stuff.

If something changes, you get a nice error bcs the named file is absent
rather than whacking the wrong register with underterminate results.

The naming also makes the code more comprehensible & grep'able

You also have an atomicity problem is the same register contains
multiple things that several fields (kernel, userspace) try to modify
at the same time, etc etc etc...

It's never great to have userspace bang at the registers so directly.

etc etc etc..

A minimum of abastraction is much more preferable in these cases.

Cheers,
Ben.

  reply	other threads:[~2018-04-13  5:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.355.1523511154.2391.openbmc@lists.ozlabs.org>
2018-04-12  7:55 ` openbmc Digest, Vol 32, Issue 32 Wang, Haiyue
2018-04-12  8:20   ` Benjamin Herrenschmidt
2018-04-12  8:42     ` Wang, Haiyue
2018-04-13  4:43       ` Benjamin Herrenschmidt
2018-04-13  5:11         ` Wang, Haiyue
2018-04-13  5:41           ` Benjamin Herrenschmidt [this message]
2018-04-13  5:55             ` Wang, Haiyue
2018-04-13  0:30   ` Andrew Jeffery
2018-04-13  0:37     ` Wang, Haiyue

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=1523598098.11062.202.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=andrew@aj.id.au \
    --cc=haiyue.wang@linux.intel.com \
    --cc=joel@jms.id.au \
    --cc=openbmc-request@lists.ozlabs.org \
    --cc=openbmc@lists.ozlabs.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.