public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Jonas Jensen <jonas.jensen@gmail.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"arm@kernel.org" <arm@kernel.org>,
	"Russell King - ARM Linux" <linux@arm.linux.org.uk>,
	Olof Johansson <olof@lixom.net>
Subject: Re: [PATCH v4 1/2] ARM: mach-moxart: add MOXA ART SoC platform files
Date: Sun, 15 Dec 2013 01:21:24 +0100	[thread overview]
Message-ID: <201312150121.24414.arnd@arndb.de> (raw)
In-Reply-To: <52ACBC18.6020301@roeck-us.net>

On Saturday 14 December 2013, Guenter Roeck wrote:
> Hmm ... not sure I agree. I don't see a problem with something like "arm,moxart-reboot".
> There are already vexpress-reboot and xgene-reboot properties which do pretty much
> the same.
> 
> Actually, you don't even need that; the reset driver could simply re-use the
> "moxa,moxart-watchdog" property. After all, all that specifies is that there
> is a compatible driver. Look for "samsung,s3c2410-wdt" for an example of another
> reset handler doing just that.
> 
> Attaching it to the watchdog device seems to be more problematic given the
> (currently) optional nature of the watchdog driver and its different scope.

As far as I'm concerned a watchdog driver is just as optional as a reboot
driver. The vexpress and xgene reset drivers are different because those
are actually dedicated devices that are there only to do rebooting.

The "samsung,s3c2410-wdt" device is exactly the same category as the moxart
one, but the code to use it performs the same hack by scanning the
device tree ad hoc from the platform initialization. I think it should
be integrated into watchdog the same way, and if we have more drivers
in that category, we'd probably want a generic watchdog reboot callback
function that wdt drivers can hook up to the architecture reset handler.

The main difference I see between plat-samsung and mach-moxart here is that
the samsung platforms still need a lot of code in arch/arm to get things
to work (this will have to change as soon as we get an arm64 exynos, which
would have everything in proper drivers), while for moxart this is the only
non-driver code.

Reusing the moxa,moxart-watchdog device from a separate reboot driver is
a violation of the driver model, since we can't really bind two platform
drivers to one platform device, unless you add another device in drivers/mfd
to create two children for wdt and reboot, but that would be really silly.
You could use the same code that samsung has at the moment in a loadable
module, which effectively implements a linux-2.4 style driver that probes
the device in the module_init function rather than registering a struct
device_driver with a probe callback.

	Arnd

  reply	other threads:[~2013-12-15  0:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-13 14:33 [PATCH v4 0/2] ARM: mach-moxart: add MOXA ART SoC support Jonas Jensen
2013-12-13 14:33 ` [PATCH v4 1/2] ARM: mach-moxart: add MOXA ART SoC platform files Jonas Jensen
2013-12-13 16:17   ` Arnd Bergmann
2013-12-13 17:23     ` Jonas Jensen
2013-12-13 19:07       ` Guenter Roeck
2013-12-14  4:01         ` Arnd Bergmann
2013-12-14  8:32         ` Jonas Jensen
2013-12-14 15:50           ` Guenter Roeck
2013-12-14 16:26             ` Jonas Jensen
2013-12-14 18:50               ` Arnd Bergmann
2013-12-14 20:14                 ` Guenter Roeck
2013-12-15  0:21                   ` Arnd Bergmann [this message]
2013-12-22 19:48   ` Olof Johansson
2013-12-13 14:33 ` [PATCH v4 2/2] ARM: mach-moxart: add MOXA ART SoC device tree files Jonas Jensen
2013-12-13 16:17   ` Arnd Bergmann
2013-12-15  4:27   ` Peter Crosthwaite
2013-12-16 20:05     ` Jonas Jensen
2013-12-16 23:53       ` Peter Crosthwaite
2013-12-17  0:09         ` Sören Brinkmann
2013-12-22 19:49   ` Olof Johansson

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=201312150121.24414.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=arm@kernel.org \
    --cc=jonas.jensen@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=linux@roeck-us.net \
    --cc=olof@lixom.net \
    /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