mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Alexander Stein <alexander.stein@systec-electronic.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] regmap: regcache-rbtree: Use GFP_ATOMIC when using spinlocks
Date: Tue, 21 Jul 2015 11:43:14 +0100	[thread overview]
Message-ID: <20150721104314.GO11162@sirena.org.uk> (raw)
In-Reply-To: <8537578.XGSGY4If3j@ws-stein>

[-- Attachment #1: Type: text/plain, Size: 1666 bytes --]

On Tue, Jul 21, 2015 at 08:14:32AM +0200, Alexander Stein wrote:
> On Monday 20 July 2015 18:26:27, Mark Brown wrote:

> > Well, it's *better* to provide defaults since otherwise everything
> > defaults to 0 but it does avoid the whole allocation during fast path
> > issue since it allocates the cache on init and perhaps that's OK.

> There is another reason for using REGCACHE_FLAT: Using regcache_cache_only 
> (e.g. during suspend) which is not possible with REGCACHE_NONE.

Sure, if you want a cache you need to use a cache.

> > > So how to handle this properly? Bail out, if fast_io is available and
> > > cache_type != (REGCACHE_NONE || REGCACHE_FLAT)?

> > Or perhaps just if we have to do an allocation?  I can see that someone
> > might want to use an rbtree and would be careful enough to do the init,
> > though I *am* a bit dubious about it.

> I'm feeling uncomfortable this warning occured only when (at least) 
> CONFIG_LOCKDEP is enabled. It warns right ahead but only if you begged for 
> it...

OTOH it'll splat with lockdep enabled just as soon as someone tries to
access a register that they didn't provide a default for.  An explicitly
added error and bomb out like I suggested above would do the same thing.

> Even if defaults are provided an extension to the register set (e.g. a more 
> recent IP revision with more features) might not be synchronized with the 
> defaults. Nobody might noticed until CONFIG_LOCKDEP is enabled and the 
> register without defaults gets written.

Sure, it's got sharp edges but the whole point with my suggestion above
is that detection wouldn't depend on CONFIG_LOCKDEP.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

      reply	other threads:[~2015-07-21 10:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-16 15:48 Alexander Stein
2015-07-16 19:06 ` Mark Brown
2015-07-20  7:04   ` Alexander Stein
2015-07-20 17:26     ` Mark Brown
2015-07-21  6:14       ` Alexander Stein
2015-07-21 10:43         ` Mark Brown [this message]

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=20150721104314.GO11162@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alexander.stein@systec-electronic.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.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 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®