From: Ralf Baechle <ralf@linux-mips.org>
To: Daniel Laird <daniel.j.laird@nxp.com>
Cc: Florian Fainelli <florian.fainelli@telecomint.eu>,
linux-mips@linux-mips.org
Subject: Re: [PATCH] : Add support for NXP PNX833x (STB222/5) into linux kernel
Date: Wed, 11 Jun 2008 11:43:27 +0100 [thread overview]
Message-ID: <20080611104327.GA777@linux-mips.org> (raw)
In-Reply-To: <64660ef00806060132j1aab8d9fh968cbf3f2fc56bc2@mail.gmail.com>
On Fri, Jun 06, 2008 at 09:32:15AM +0100, Daniel Laird wrote:
> > > +#if defined(CONFIG_SATA_PNX833X) || defined(CONFIG_SATA_PNX833X_MODULE)
> > > +static struct resource pnx833x_sata_resources[] = {
> > > + [0] = {
> > > + .start = PNX8335_SATA_PORTS_START,
> > > + .end = PNX8335_SATA_PORTS_END,
> > > + .flags = IORESOURCE_MEM,
> > > + },
> > > + [1] = {
> > > + .start = PNX8335_PIC_SATA_INT,
> > > + .end = PNX8335_PIC_SATA_INT,
> > > + .flags = IORESOURCE_IRQ,
> > > + },
> > > +};
> > > +
> > > +static struct platform_device pnx833x_sata_device = {
> > > + .name = "pnx833x-sata",
> > > + .id = -1,
> > > + .num_resources = ARRAY_SIZE(pnx833x_sata_resources),
> > > + .resource = pnx833x_sata_resources,
> > > +};
> > > +#endif
> >
> > What about defining those resources anyway ?
> > > +
> > > +#if defined(CONFIG_MTD_NAND_PLATFORM) ||
> > > defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
> >
> > Same here and others below too.
> >
> Is there any harm in having them always defined even if not
> implemented? I was playing safe.
You normally should register all platform devices based on their presence
on the platform without consideration of the drivers actually being enabled.
The Linux driver philosophy is that a driver can be enabled, compiled as
a module and loaded separately from the kernel build and the driver should
still be working. That will only work if the driver and its resources are
always in - even at the (low!) price of being unused on a particular
platform. It also helps tools that use sysfs to query hardware
configuration.
> > > +{
> > > + printk(KERN_ALERT "\n\nSystem halted.\n\n");
> > > +
> > > + while (1)
> > > + __asm__ __volatile__ ("wait");
> > > +}
> >
> > You might want to use cpu_relax(); instead of the assembly wait instruction.
> >
> Sounds good.
Almost. cpu_relax() is defined to just barrier() on MIPS since there
isn't really very much we could or need to do in tight loop - unlike the
infamous Pentium 4 netburst architecture which burns serious amounts of
power in such a loop.
So best keep it as it is for now. The issue deserves a better solution
though but that's beyond the scope of your patch.
> > > +void pnx833x_machine_power_off(void)
> > > +{
> > > + printk(KERN_ALERT "\n\nPower off not implemented.");
> > > + pnx833x_machine_halt();
> > > +}
> >
> > And put some less alarming message here, like "*** You can safely turn off the
> > board".
No message at all. It's userspace which is supposed to communicate with the
user not the kernel.
Ralf
next prev parent reply other threads:[~2008-06-11 10:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-06 8:32 [PATCH] : Add support for NXP PNX833x (STB222/5) into linux kernel Daniel Laird
2008-06-11 10:43 ` Ralf Baechle [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-06-11 10:53 Daniel Laird
2008-06-11 11:01 ` Ralf Baechle
2008-06-05 19:45 Daniel Laird
2008-06-05 20:43 ` Florian Fainelli
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=20080611104327.GA777@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=daniel.j.laird@nxp.com \
--cc=florian.fainelli@telecomint.eu \
--cc=linux-mips@linux-mips.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