linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomasz Figa <tomasz.figa@gmail.com>
To: Rob Herring <robherring2@gmail.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>,
	Mark Rutland <mark.rutland@arm.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-samsung-soc@vger.kernel.org"
	<linux-samsung-soc@vger.kernel.org>,
	Russell King <linux@arm.linux.org.uk>,
	Ian Campbell <ian.campbell@citrix.com>,
	Pawel Moll <pawel.moll@arm.com>,
	Marc Zyngier <marc.zyngier@arm.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Rob Herring <rob.herring@calxeda.com>,
	linux-gpio@vger.kernel.org, Kukjin Kim <kgene.kim@samsung.com>,
	Arnd Bergmann <arnd@arndb.de>, Mark Brown <broonie@kernel.org>,
	Olof Johansson <olof@lixom.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v8 1/7] irqchip: vic: Parse interrupt and resume masks from device tree
Date: Sat, 24 Aug 2013 18:57:13 +0200	[thread overview]
Message-ID: <2823496.bR7bMWMK3l@flatron> (raw)
In-Reply-To: <5218E0B7.4020701@gmail.com>

On Saturday 24 of August 2013 11:35:03 Rob Herring wrote:
> On 08/24/2013 10:31 AM, Tomasz Figa wrote:
> > On Saturday 24 of August 2013 10:25:26 Rob Herring wrote:
> >> On Fri, Aug 23, 2013 at 6:04 PM, Tomasz Figa <tomasz.figa@gmail.com>
> > 
> > wrote:
> >>> On Friday 23 of August 2013 16:11:18 Stephen Warren wrote:
> >>>> On 08/22/2013 05:22 PM, Tomasz Figa wrote:
> >>>>> This patch extends vic_of_init to parse valid interrupt sources
> >>>>> and resume sources masks from device tree.
> >>>>> 
> >>>>> If mask values are not specified in device tree, all sources
> >>>>> are assumed to be valid, as before this patch.
> >>>> 
> >>>> Can you explain further why the VIC needs this information
> >>>> up-front?
> >>>> Presumably it can accumulate it as devices request interrupts.
> >>> 
> >>> It does not need this information just for operation, but this makes
> >>> the hardware description more detailed and allows better sanity
> >>> checking of interrupts being requested.
> >>> 
> >>> To clarify, this is a mask of valid interrupt sources of the VIC,
> >>> where
> >>> set bit indicates that given signal is wired and clear bit that it
> >>> is
> >>> not.
> >> 
> >> I agree with Stephen here. The valid interrupts are the ones in the
> >> DT. The reserved ones are the ones not present. If it is not needed
> >> for the operation of the VIC, then remove it. The argument of sanity
> >> checking could apply to all interrupt controllers.
> > 
> > Sorry, but I don't get what's wrong in having a more detailed
> > description than required just for operation of the hardware.
> > 
> > The feature of sanity checks based on interrupt_mask (here now called
> > valid-mask) has been present in the VIC driver since a long time
> > already (if not from the beginning of existence of this driver) and
> > before we started using DT, the mask was being passed from platform
> > code as VIC init function argument.
> 
> So we should base the binding on the Linux software design?

I would put it different way: The binding should provide information 
detailed enough to allow any features allowed by Linux software design.

Well, anyway, I don't believe that existing, pre-ARM, bindings wasn't 
influenced by how things worked on PowerPC platforms and software running 
on them (including OpenFirmware and OS'es like Linux).

> > I'd prefer this feature to be available when using DT as well, unless
> > we really want to move things backwards, just because we want to use
> > DT...
> As I mentioned all these arguments apply to ALL interrupt controllers
> except ones which a mask does not work. So IF this makes sense, then
> this should be a generic property and generic code to support.

Isn't a binding of particular device free to define a private property? 
Anyway, I wouldn't be opposed to making it generic.

> You simply have the same information twice. One is distributed

Assuming you have it specified correctly under client nodes.

> and one
> is centralized. While it adds a way to validate things it also adds a
> way to introduce errors. Suppose someone writes a dts such that
> valid-mask matches the irq lines present in that dts (simply because
> they were lazy or don't have documentation of all interrupt lines).

That's why this property is optional. If you don't know how this is set up 
on your hardware then you don't fill it with a random value, but just skip 
it instead.

> Then
> you go add a node with a new interrupt (because the initial dts was not
> complete). Updating the valid-mask could very easily be forgotten. Yes,
> this should all be found by testing, but people don't always have
> access to all the h/w.

Adding a node with a new interrupt usually means adding support for new 
hardware. This is something I wouldn't really want to see submitted 
untested...

Anyway, since I'd like this series to be merged ASAP and this patch is not 
strictly necessary, especially this optional sanity check, let me just 
drop this property and move on with other things...

Best regards,
Tomasz

  reply	other threads:[~2013-08-24 16:57 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-21 21:21 [PATCH v7 0/7] Initial Device Tree support for S3C64xx Tomasz Figa
2013-08-21 21:21 ` [PATCH v7 1/7] ARM: common: vic: Parse interrupt and resume masks from device tree Tomasz Figa
2013-08-21 23:19   ` Linus Walleij
2013-08-22  7:57     ` Tomasz Figa
2013-08-22 23:22   ` [PATCH v8 1/7] irqchip: " Tomasz Figa
2013-08-23 18:12     ` Linus Walleij
2013-08-23 22:11     ` Stephen Warren
2013-08-23 23:04       ` Tomasz Figa
2013-08-23 23:19         ` Stephen Warren
2013-08-23 23:33           ` Tomasz Figa
2013-08-24 15:25         ` Rob Herring
2013-08-24 15:31           ` Tomasz Figa
2013-08-24 16:35             ` Rob Herring
2013-08-24 16:57               ` Tomasz Figa [this message]
2013-08-23 23:54     ` [PATCH v9 " Tomasz Figa
2013-08-21 21:21 ` [PATCH v7 2/7] ARM: s3c64xx: Bypass legacy initialization when booting with DT Tomasz Figa
2013-08-21 21:21 ` [PATCH v7 3/7] gpio: samsung: Skip initialization if device tree is present Tomasz Figa
2013-08-21 23:21   ` Linus Walleij
2013-08-22  8:06     ` Tomasz Figa
2013-08-22  9:48       ` Mark Brown
2013-08-22  9:59       ` Kukjin Kim
2013-08-22 23:19         ` Tomasz Figa
2013-08-23 18:11         ` Linus Walleij
2013-08-25 17:21           ` Kukjin Kim
2013-08-22  9:45     ` Kukjin Kim
2013-08-21 21:21 ` [PATCH v7 4/7] ARM: s3c64xx: Add board file for boot using Device Tree Tomasz Figa
2013-08-21 21:21 ` [PATCH v7 5/7] ARM: dts: Add basic dts include files for Samsung S3C64xx SoCs Tomasz Figa
2013-08-22 23:24   ` [PATCH v8 " Tomasz Figa
2013-08-23 23:56     ` [PATCH v9 " Tomasz Figa
2013-08-21 21:21 ` [PATCH v7 6/7] ARM: dts: Add dts file for S3C6410-based Mini6410 board Tomasz Figa
2013-08-21 21:21 ` [PATCH v7 7/7] ARM: dts: Add dts file for S3C6410-based SMDK6410 board Tomasz Figa
2013-08-25 17:31 ` [PATCH v7 0/7] Initial Device Tree support for S3C64xx Kukjin Kim

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=2823496.bR7bMWMK3l@flatron \
    --to=tomasz.figa@gmail.com \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=ian.campbell@citrix.com \
    --cc=kgene.kim@samsung.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=marc.zyngier@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=olof@lixom.net \
    --cc=pawel.moll@arm.com \
    --cc=rob.herring@calxeda.com \
    --cc=robherring2@gmail.com \
    --cc=swarren@wwwdotorg.org \
    --cc=tglx@linutronix.de \
    /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).