devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Scott Wood <oss@buserror.net>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linuxppc-dev@lists.ozlabs.org,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Yangbo Lu <yangbo.lu@nxp.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Xiaobo Xie <xiaobo.xie@nxp.com>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
	Qiang Zhao <qiang.zhao@nxp.com>,
	Russell King <linux@arm.linux.org.uk>,
	Bhupesh Sharma <bhupesh.sharma@freescale.com>,
	Joerg Roedel <joro@8bytes.org>,
	Claudiu Manoil <claudiu.manoil@freescale.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Santosh Shilimkar <ssantosh@kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Yang-Leo
Subject: Re: [PATCH 4/4] Revert "powerpc/fsl: Move fsl_guts.h out of arch/powerpc"
Date: Fri, 10 Jun 2016 21:13:07 -0500	[thread overview]
Message-ID: <1465611186.22191.169.camel@buserror.net> (raw)
In-Reply-To: <3225846.9EJ0sHv0XK@wuerfel>

On Thu, 2016-06-02 at 11:01 +0200, Arnd Bergmann wrote:
> On Wednesday, June 1, 2016 8:24:20 PM CEST Scott Wood wrote:
> > On Mon, 2016-05-30 at 15:18 +0200, Arnd Bergmann wrote:
> > > All users of this driver are PowerPC specific and the header file
> > > has no business in the global include/linux/ hierarchy, so move
> > > it back before anyone starts using it on ARM.
> > > 
> > > This reverts commit 948486544713492f00ac8a9572909101ea892cb0.
> > > 
> > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > > ---
> > > This part of the series is not required for the eSDHC quirk,
> > > but it restores the asm/fsl_guts.h header so it doesn't accidentally
> > > get abused for this in the future. I found two drivers outside of
> > > arch/powerpc that already accessed the registers directly, but the
> > > functions look fairly contained, and can be easily hidden in an
> > > #ifdef CONFIG_PPC
> > 
> > NACK
> > 
> > Besides adding ifdef pollution for no good reason, this register block is
> > used
> > on some ARM chips as well.  Why is it a problem if "anyone starts using it
> > on
> > ARM"?
> 
> It's just not a good interface when it's defined as "this is the layout of
> a register area that any driver can ioremap() if they can figure out the
> device node".

That's why I want to move accesses into one guts driver.

>  It's not uncommon to have register areas like that, but
> normally you have at the minimum a 'syscon' device to handle locking
> between drivers accessing the same registers and to avoid having to map
> the same area multiple times.

syscon requires device tree changes.

I don't see read-modify-write operations in regmap -- how does locking around
an individual, inherently-atomic load or store help?

> If we need to use 'guts' registers on ARM, we can find a way to abstract
> them properly for the given use cases, using a syscon or a driver with
> exported functions, but just making a PowerPC platform specific header
> global to all Linux drivers by putting it into include/linux doesn't seem
> right.

Again, it's not PowerPC-specific!  It started that way but then the same
register block got put onto some ARM chips.

It's not global to "all Linux drivers", just the ones that choose to include
an fsl-specific header.

If and when all uses of guts are moved into the guts driver, the header can be
moved into drivers/soc/fsl.

> Note that the header file uses a structure definition rather than the more
> common macros with register offsets, which is fine for a driver that has
> its own registers and abstracts them, but it doesn't really work with
> the regmap interface, so if we want to use it with syscon, it also needs to
> be rewritten.

We don't want to use it with syscon.  If we did, the solution wouldn't be to
move the header back to arch/powerpc, but to convert the struct into offsets.

-Scott

  reply	other threads:[~2016-06-11  2:13 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-05  3:12 [v10, 0/7] Fix eSDHC host version register bug Yangbo Lu
     [not found] ` <1462417950-46796-1-git-send-email-yangbo.lu-3arQi8VN3Tc@public.gmane.org>
2016-05-05  3:12   ` [v10, 1/7] Documentation: DT: update Freescale DCFG compatible Yangbo Lu
2016-05-05 22:25     ` Rob Herring
2016-05-05  3:12   ` [v10, 2/7] ARM64: dts: ls2080a: add device configuration node Yangbo Lu
2016-05-05  3:12   ` [v10, 3/7] soc: fsl: add GUTS driver for QorIQ platforms Yangbo Lu
2016-07-15 16:43     ` Paul Gortmaker
2016-07-15 19:12       ` Scott Wood
2016-07-15 22:39         ` Paul Gortmaker
2016-05-05  3:12   ` [v10, 4/7] dt: move guts devicetree doc out of powerpc directory Yangbo Lu
2016-05-05  3:12   ` [v10, 5/7] powerpc/fsl: move mpc85xx.h to include/linux/fsl Yangbo Lu
2016-05-05  3:12   ` [v10, 6/7] MAINTAINERS: add entry for Freescale SoC drivers Yangbo Lu
2016-05-05  3:12   ` [v10, 7/7] mmc: sdhci-of-esdhc: fix host version for T4240-R1.0-R2.0 Yangbo Lu
     [not found]     ` <1462417950-46796-8-git-send-email-yangbo.lu-3arQi8VN3Tc@public.gmane.org>
2016-05-05  8:31       ` Arnd Bergmann
2016-05-05  9:41         ` Yangbo Lu
     [not found]           ` <HE1PR04MB0889B52134A43C0E7A452B7BF87C0-6LN7OEpIatX1kPMWxTxe+c9NdZoXdze2vxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2016-05-05 11:10             ` Arnd Bergmann
2016-05-11  3:26               ` Scott Wood
     [not found]                 ` <1462937186.16584.77.camel-fOR+EgIDQEHk1uMJSBkQmQ@public.gmane.org>
2016-05-20  6:05                   ` Yangbo Lu
2016-05-26  4:05                 ` Yangbo Lu
2016-05-26  7:44                   ` Ulf Hansson
2016-05-30 13:13                     ` Arnd Bergmann
2016-05-30 13:14                     ` [PATCH 1/4] base: soc: introduce soc_device_match() interface Arnd Bergmann
2016-05-30 14:57                       ` Arnd Bergmann
2016-05-30 13:15                     ` [PATCH 2/4] soc: fsl: add GUTS driver for QorIQ platforms Arnd Bergmann
2016-06-02  1:47                       ` Scott Wood
2016-06-02  8:43                         ` Arnd Bergmann
2016-06-11  1:50                           ` Scott Wood
     [not found]                             ` <1465609853.22191.151.camel-fOR+EgIDQEHk1uMJSBkQmQ@public.gmane.org>
2016-06-23  2:46                               ` Yangbo Lu
2016-07-07  2:35                             ` Yangbo Lu
     [not found]                               ` <HE1PR04MB0889646206BFAD68046F3473F83B0-6LN7OEpIatX1kPMWxTxe+c9NdZoXdze2vxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2016-07-07  8:30                                 ` Arnd Bergmann
2016-07-07 20:42                                   ` Scott Wood
2016-07-08  3:05                                   ` Yangbo Lu
2016-05-30 13:16                     ` [PATCH 3/4] mmc: sdhci-of-esdhc: fix host version for T4240-R1.0-R2.0 Arnd Bergmann
2016-06-02  1:11                       ` Scott Wood
2016-06-02  8:52                         ` Arnd Bergmann
2016-06-11  2:00                           ` Scott Wood
2016-05-30 13:18                     ` [PATCH 4/4] Revert "powerpc/fsl: Move fsl_guts.h out of arch/powerpc" Arnd Bergmann
2016-06-02  1:24                       ` Scott Wood
     [not found]                         ` <1464830660.22191.6.camel-fOR+EgIDQEHk1uMJSBkQmQ@public.gmane.org>
2016-06-02  9:01                           ` Arnd Bergmann
2016-06-11  2:13                             ` Scott Wood [this message]
2017-04-03 14:16               ` [v10, 7/7] mmc: sdhci-of-esdhc: fix host version for T4240-R1.0-R2.0 Kiran Kumar

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=1465611186.22191.169.camel@buserror.net \
    --to=oss@buserror.net \
    --cc=arnd@arndb.de \
    --cc=bhupesh.sharma@freescale.com \
    --cc=claudiu.manoil@freescale.com \
    --cc=devicetree@vger.kernel.org \
    --cc=joro@8bytes.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mark.rutland@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=qiang.zhao@nxp.com \
    --cc=robh+dt@kernel.org \
    --cc=ssantosh@kernel.org \
    --cc=ulf.hansson@linaro.org \
    --cc=xiaobo.xie@nxp.com \
    --cc=yangbo.lu@nxp.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;
as well as URLs for NNTP newsgroup(s).