LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Mike Frysinger" <vapier.adi@gmail.com>
To: "Alan Cox" <alan@lxorguk.ukuu.org.uk>
Cc: "Marc Pignat" <marc.pignat@hevs.ch>,
wim@iguana.be, linux-kernel@vger.kernel.org
Subject: Re: [RFC, PATCH] watchdog on gpio
Date: Mon, 14 Jan 2008 04:28:11 -0500 [thread overview]
Message-ID: <8bd0f97a0801140128i2ebf9236uabe0e0b8cf15fbe@mail.gmail.com> (raw)
In-Reply-To: <20080114090329.6efa2921@lxorguk.ukuu.org.uk>
On Jan 14, 2008 4:03 AM, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> > > +static char banner[] __initdata = KERN_INFO PFX "fixed %d.%03d seconds timeout (nowayout= %d)\n";
> >
> > this only gets used once in the init function ... having it be broken
> > out like this is kind of silly
>
> Saves memory - you can't make inlined strings __initdata without breaking
> some compilers. So it is correct.
you could make the same argument about all strings used in all __init
functions. making a special case for this one string is just
confusing. this is also used from the *platfrom driver probe*
function, not the *module init* function, which means it should be
__devinitdata (see below) ... which quickly adds to the
confusion/craziness.
> > > +static int __init gpio_wdt_probe(struct platform_device *pdev)
> >
> > shouldnt this be __devinit ?
>
> IFF the device can be found/removed dynamically.
wont __init get freed once the module has finished loading ? he's
writing a platform driver which means the resources are usually
static, but there's no hard requirement that would prevent loading a
small module that merely contains additional platform resources. if
those resources declared a gpio watchdog, then i imagine things would
fall apart since the probe function for the registered platform driver
no longer exists. i also dont think there's a hard logical guarantee
that the the probing step will happen after the call to the platform
device register and before the kernel finishes loading the module (and
thus frees __init resources). so logically, using __init/__exit for
platform probe/remove drivers is plain wrong and it works here "by
accident".
> > > + if (watchdog) {
> > > + printk(KERN_ERR PFX "only one device supported\n");
> > > + return -ENODEV;
> > > + }
> >
> > why ? it'd be trivial to abstract this driver away from a global
> > "watchdog" state into a proper arbitrary # of gpio watchdogs.
>
> The core watchdog code only supports one watchdog currently. This again
> is correct.
today you're of course correct. but if we're looking to unify
watchdogs, keeping the 1 watchdog limit seems silly. and considering
the trivial amount of effort to move these resources to the private
data pointers ... might as well get the work done now while it's fresh
in his mind. his call of course though.
-mike
next prev parent reply other threads:[~2008-01-14 9:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-10 15:11 Marc Pignat
2008-01-10 17:14 ` Ben Dooks
2008-01-11 16:40 ` Florian Fainelli
2008-01-14 7:34 ` Marc Pignat
2008-01-14 8:08 ` Mike Frysinger
2008-01-14 8:04 ` Mike Frysinger
2008-01-14 9:03 ` Alan Cox
2008-01-14 9:28 ` Mike Frysinger [this message]
2008-01-14 9:29 ` Alan Cox
2008-01-14 9:45 ` Mike Frysinger
2008-01-14 12:14 ` Haavard Skinnemoen
2008-01-14 12:22 ` Mike Frysinger
2008-01-14 13:30 ` Haavard Skinnemoen
2008-01-14 12:49 ` Johannes Weiner
2008-01-14 13:03 ` Mike Frysinger
2008-01-14 13:56 ` printk-wrapper with sectionized string constants [was: Re: [RFC, PATCH] watchdog on gpio] Johannes Weiner
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=8bd0f97a0801140128i2ebf9236uabe0e0b8cf15fbe@mail.gmail.com \
--to=vapier.adi@gmail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.pignat@hevs.ch \
--cc=wim@iguana.be \
--subject='Re: [RFC, PATCH] watchdog on gpio' \
/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
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).