* [PATCH] [POWERPC] Add the PC speaker only when requested so
@ 2008-05-22 22:40 Emil Medve
2008-05-22 23:27 ` Grant Likely
0 siblings, 1 reply; 5+ messages in thread
From: Emil Medve @ 2008-05-22 22:40 UTC (permalink / raw)
To: paulus, galak, linuxppc-dev, linuxppc-embedded; +Cc: Emil Medve
This will cause this minor boot-time debugging error message to go away:
[ 1.316451] calling add_pcspkr+0x0/0x84
[ 1.316478] initcall add_pcspkr+0x0/0x84 returned -19 after 0 msecs
Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
---
> scripts/checkpatch.pl 0001--POWERPC-Add-the-PC-speaker-only-when-requested-so.patch
total: 0 errors, 0 warnings, 14 lines checked
0001--POWERPC-Add-the-PC-speaker-only-when-requested-so.patch has no obvious style problems and is ready for submission.
arch/powerpc/kernel/setup-common.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index db540ea..61a3f41 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -500,6 +500,7 @@ void __init smp_setup_cpu_sibling_map(void)
}
#endif /* CONFIG_SMP */
+#ifdef CONFIG_PCSPKR_PLATFORM
static __init int add_pcspkr(void)
{
struct device_node *np;
@@ -522,6 +523,7 @@ static __init int add_pcspkr(void)
return ret;
}
device_initcall(add_pcspkr);
+#endif /* CONFIG_PCSPKR_PLATFORM */
void probe_machine(void)
{
--
1.5.5.GIT
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] [POWERPC] Add the PC speaker only when requested so
2008-05-22 22:40 [PATCH] [POWERPC] Add the PC speaker only when requested so Emil Medve
@ 2008-05-22 23:27 ` Grant Likely
2008-05-23 3:34 ` Kumar Gala
2008-05-23 12:59 ` Medve Emilian
0 siblings, 2 replies; 5+ messages in thread
From: Grant Likely @ 2008-05-22 23:27 UTC (permalink / raw)
To: Emil Medve; +Cc: linuxppc-dev, paulus, linuxppc-embedded
On Thu, May 22, 2008 at 4:40 PM, Emil Medve <Emilian.Medve@freescale.com> wrote:
> This will cause this minor boot-time debugging error message to go away:
>
> [ 1.316451] calling add_pcspkr+0x0/0x84
> [ 1.316478] initcall add_pcspkr+0x0/0x84 returned -19 after 0 msecs
What situation are you hitting this in? The code should only run if
there is a "pnpPNP,100" compatible node in the device tree.
Also, where is CONFIG_PCSPKR_PLATFORM defined? I don't see it
anywhere in powerpc code and only a reference to it in an x86
Makefile. As it stands, it looks like this patch unconditionally
disables the pcspkr code.
Cheers,
g.
>
> Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
> ---
>
>> scripts/checkpatch.pl 0001--POWERPC-Add-the-PC-speaker-only-when-requested-so.patch
> total: 0 errors, 0 warnings, 14 lines checked
>
> 0001--POWERPC-Add-the-PC-speaker-only-when-requested-so.patch has no obvious style problems and is ready for submission.
>
> arch/powerpc/kernel/setup-common.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
> index db540ea..61a3f41 100644
> --- a/arch/powerpc/kernel/setup-common.c
> +++ b/arch/powerpc/kernel/setup-common.c
> @@ -500,6 +500,7 @@ void __init smp_setup_cpu_sibling_map(void)
> }
> #endif /* CONFIG_SMP */
>
> +#ifdef CONFIG_PCSPKR_PLATFORM
> static __init int add_pcspkr(void)
> {
> struct device_node *np;
> @@ -522,6 +523,7 @@ static __init int add_pcspkr(void)
> return ret;
> }
> device_initcall(add_pcspkr);
> +#endif /* CONFIG_PCSPKR_PLATFORM */
>
> void probe_machine(void)
> {
> --
> 1.5.5.GIT
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] [POWERPC] Add the PC speaker only when requested so
2008-05-22 23:27 ` Grant Likely
@ 2008-05-23 3:34 ` Kumar Gala
2008-05-23 4:44 ` Grant Likely
2008-05-23 12:59 ` Medve Emilian
1 sibling, 1 reply; 5+ messages in thread
From: Kumar Gala @ 2008-05-23 3:34 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev, paulus, linuxppc-embedded
On May 22, 2008, at 6:27 PM, Grant Likely wrote:
> On Thu, May 22, 2008 at 4:40 PM, Emil Medve <Emilian.Medve@freescale.com
> > wrote:
>> This will cause this minor boot-time debugging error message to go
>> away:
>>
>> [ 1.316451] calling add_pcspkr+0x0/0x84
>> [ 1.316478] initcall add_pcspkr+0x0/0x84 returned -19 after 0
>> msecs
>
> What situation are you hitting this in? The code should only run if
> there is a "pnpPNP,100" compatible node in the device tree.
The code always runs, the -19 is from the fact that the code returns -
ENODEV when it doesn't find the device in the tree.
I don't see any reason we should be ALWAYS be probing for a PC
speaker. Seems like a reasonable patch.
> Also, where is CONFIG_PCSPKR_PLATFORM defined? I don't see it
> anywhere in powerpc code and only a reference to it in an x86
> Makefile. As it stands, it looks like this patch unconditionally
> disables the pcspkr code.
Its defined in init/Kconfig.
>
- k
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] [POWERPC] Add the PC speaker only when requested so
2008-05-23 3:34 ` Kumar Gala
@ 2008-05-23 4:44 ` Grant Likely
0 siblings, 0 replies; 5+ messages in thread
From: Grant Likely @ 2008-05-23 4:44 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, paulus, linuxppc-embedded
On Thu, May 22, 2008 at 9:34 PM, Kumar Gala <galak@kernel.crashing.org> wrote:
>
> On May 22, 2008, at 6:27 PM, Grant Likely wrote:
>
>> On Thu, May 22, 2008 at 4:40 PM, Emil Medve <Emilian.Medve@freescale.com>
>> wrote:
>>>
>>> This will cause this minor boot-time debugging error message to go away:
>>>
>>> [ 1.316451] calling add_pcspkr+0x0/0x84
>>> [ 1.316478] initcall add_pcspkr+0x0/0x84 returned -19 after 0 msecs
>>
>> What situation are you hitting this in? The code should only run if
>> there is a "pnpPNP,100" compatible node in the device tree.
>
> The code always runs, the -19 is from the fact that the code returns -ENODEV
> when it doesn't find the device in the tree.
>
> I don't see any reason we should be ALWAYS be probing for a PC speaker.
> Seems like a reasonable patch.
Fair enough; I was just wondering if it was a complete fix. But now
that I dig into the code I see that the calling...initcall returned...
messages are just debug stuff that isn't always turned on.
I have no problem with the patch.
>
>> Also, where is CONFIG_PCSPKR_PLATFORM defined? I don't see it
>> anywhere in powerpc code and only a reference to it in an x86
>> Makefile. As it stands, it looks like this patch unconditionally
>> disables the pcspkr code.
>
> Its defined in init/Kconfig.
Apparently my grep-foo isn't what it used to be...
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] [POWERPC] Add the PC speaker only when requested so
2008-05-22 23:27 ` Grant Likely
2008-05-23 3:34 ` Kumar Gala
@ 2008-05-23 12:59 ` Medve Emilian
1 sibling, 0 replies; 5+ messages in thread
From: Medve Emilian @ 2008-05-23 12:59 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev, paulus, linuxppc-embedded
Hello Grant,
You can reproduce this by adding initcall_debug to your kernel
parameters. I'm encountering this situation on an MPC85xx board, but
from looking at the code that seems irrelevant as add_pcspkr() will get
executed anyway. True, "pnpPNP,100" is looked after before the platform
code runs and it will fail if it can't find "pnpPNP,100", but the error
message will show up. As mentioned below, this saves some memory and a
few boot-up CPU cycles...
PCSPKR_PLATFORM is an option in init/Kconfig:
...
config PCSPKR_PLATFORM
bool "Enable PC-Speaker support" if EMBEDDED
depends on ALPHA || X86 || MIPS || PPC_PREP || PPC_CHRP ||
PPC_PSERIES
default y
help
This option allows to disable the internal PC-Speaker
support, saving some memory.
...
Cheers,
Emil.
> -----Original Message-----
> From: glikely@secretlab.ca [mailto:glikely@secretlab.ca] On=20
> Behalf Of Grant Likely
> Sent: Thursday, May 22, 2008 6:28 PM
> To: Medve Emilian
> Cc: paulus@samba.org; galak@kernel.crashing.org;=20
> linuxppc-dev@ozlabs.org; linuxppc-embedded@ozlabs.org
> Subject: Re: [PATCH] [POWERPC] Add the PC speaker only when=20
> requested so
>=20
> On Thu, May 22, 2008 at 4:40 PM, Emil Medve=20
> <Emilian.Medve@freescale.com> wrote:
> > This will cause this minor boot-time debugging error=20
> message to go away:
> >
> > [ 1.316451] calling add_pcspkr+0x0/0x84
> > [ 1.316478] initcall add_pcspkr+0x0/0x84 returned -19=20
> after 0 msecs
>=20
> What situation are you hitting this in? The code should only run if
> there is a "pnpPNP,100" compatible node in the device tree.
>=20
> Also, where is CONFIG_PCSPKR_PLATFORM defined? I don't see it
> anywhere in powerpc code and only a reference to it in an x86
> Makefile. As it stands, it looks like this patch unconditionally
> disables the pcspkr code.
>=20
> Cheers,
> g.
>=20
> >
> > Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
> > ---
> >
> >> scripts/checkpatch.pl=20
> 0001--POWERPC-Add-the-PC-speaker-only-when-requested-so.patch
> > total: 0 errors, 0 warnings, 14 lines checked
> >
> >=20
> 0001--POWERPC-Add-the-PC-speaker-only-when-requested-so.patch=20
> has no obvious style problems and is ready for submission.
> >
> > arch/powerpc/kernel/setup-common.c | 2 ++
> > 1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/powerpc/kernel/setup-common.c=20
> b/arch/powerpc/kernel/setup-common.c
> > index db540ea..61a3f41 100644
> > --- a/arch/powerpc/kernel/setup-common.c
> > +++ b/arch/powerpc/kernel/setup-common.c
> > @@ -500,6 +500,7 @@ void __init smp_setup_cpu_sibling_map(void)
> > }
> > #endif /* CONFIG_SMP */
> >
> > +#ifdef CONFIG_PCSPKR_PLATFORM
> > static __init int add_pcspkr(void)
> > {
> > struct device_node *np;
> > @@ -522,6 +523,7 @@ static __init int add_pcspkr(void)
> > return ret;
> > }
> > device_initcall(add_pcspkr);
> > +#endif /* CONFIG_PCSPKR_PLATFORM */
> >
> > void probe_machine(void)
> > {
> > --
> > 1.5.5.GIT
> >
> > _______________________________________________
> > Linuxppc-dev mailing list
> > Linuxppc-dev@ozlabs.org
> > https://ozlabs.org/mailman/listinfo/linuxppc-dev
> >
>=20
>=20
>=20
> --=20
> Grant Likely, B.Sc., P.Eng.
> Secret Lab Technologies Ltd.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-05-23 12:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-22 22:40 [PATCH] [POWERPC] Add the PC speaker only when requested so Emil Medve
2008-05-22 23:27 ` Grant Likely
2008-05-23 3:34 ` Kumar Gala
2008-05-23 4:44 ` Grant Likely
2008-05-23 12:59 ` Medve Emilian
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).