* idebus setup problem (2.6.7-rc1)
@ 2004-05-27 11:57 Auzanneau Gregory
2004-05-27 14:37 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 22+ messages in thread
From: Auzanneau Gregory @ 2004-05-27 11:57 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 745 bytes --]
Hello,
It seems there is a problem with idebus parameter with 2.6.7-rc1.
Indeed, it doesn't take into account lilo append.
With 2.6.7-rc1-mm1, i've got:
Kernel command line: BOOT_IMAGE=LinuxNEW ro root=304 idebus=66
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
With 2.6.6-mm3, i've got:
May 24 11:37:43 greg-port kernel: Kernel command line:
BOOT_IMAGE=LinuxNEW ro root=304 idebus=66
May 24 11:37:43 greg-port kernel: ide_setup: idebus=66
May 24 11:37:43 greg-port kernel: ide: Assuming 66MHz system bus speed
for PIO modes
I tried to seek in the code, but my level is not as good as I would like
it. :)
Thank you all for the good work with linux, keep up with it ! :)
--
Auzanneau Grégory
GPG 0x99137BEE
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: idebus setup problem (2.6.7-rc1)
2004-05-27 11:57 Auzanneau Gregory
@ 2004-05-27 14:37 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 22+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2004-05-27 14:37 UTC (permalink / raw)
To: Auzanneau Gregory; +Cc: linux-kernel, Andrew Morton
On Thursday 27 of May 2004 13:57, Auzanneau Gregory wrote:
> Hello,
>
> It seems there is a problem with idebus parameter with 2.6.7-rc1.
> Indeed, it doesn't take into account lilo append.
Why are you using it in the first place?
Let me guess... you've nForce2 chipset and lspci shows you 66MHz.
You don't need and really shouldn't be using 'idebus=66'.
> With 2.6.7-rc1-mm1, i've got:
> Kernel command line: BOOT_IMAGE=LinuxNEW ro root=304 idebus=66
> ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
This needs fixing.
I remember seeing patch related to handling '=' in kernel params,
maybe it's related (or maybe not).
> With 2.6.6-mm3, i've got:
> May 24 11:37:43 greg-port kernel: Kernel command line:
> BOOT_IMAGE=LinuxNEW ro root=304 idebus=66
> May 24 11:37:43 greg-port kernel: ide_setup: idebus=66
> May 24 11:37:43 greg-port kernel: ide: Assuming 66MHz system bus speed
> for PIO modes
>
> I tried to seek in the code, but my level is not as good as I would like
> it. :)
>
>
> Thank you all for the good work with linux, keep up with it ! :)
^ permalink raw reply [flat|nested] 22+ messages in thread
* RE: idebus setup problem (2.6.7-rc1)
@ 2004-05-27 15:21 Zhu, Yi
2004-05-27 15:51 ` Bartlomiej Zolnierkiewicz
2004-05-27 16:09 ` Jeff Garzik
0 siblings, 2 replies; 22+ messages in thread
From: Zhu, Yi @ 2004-05-27 15:21 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz, Auzanneau Gregory; +Cc: linux-kernel, Andrew Morton
Bartlomiej Zolnierkiewicz [B.Zolnierkiewicz@elka.pw.edu.pl] wrote:
>
> I remember seeing patch related to handling '=' in kernel
> params, maybe it's related (or maybe not).
Yes, this is caused by my kernel-parameter-parsing-fix.patch.
But I think below code in ide.c is a hack.
__setup("", ide_setup);
How about below change?
--- linux-2.6.7-rc1-mm1.orig/drivers/ide/ide.c 2004-05-27
23:07:59.405138992 +0800
+++ linux-2.6.7-rc1-mm1/drivers/ide/ide.c 2004-05-27
23:09:47.529701560 +0800
@@ -2459,7 +2459,8 @@ void cleanup_module (void)
#else /* !MODULE */
-__setup("", ide_setup);
+__setup("hd", ide_setup);
+__setup("ide", ide_setup);
module_init(ide_init);
-yi
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: idebus setup problem (2.6.7-rc1)
2004-05-27 15:21 Zhu, Yi
@ 2004-05-27 15:51 ` Bartlomiej Zolnierkiewicz
2004-05-27 16:09 ` Jeff Garzik
1 sibling, 0 replies; 22+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2004-05-27 15:51 UTC (permalink / raw)
To: Zhu, Yi, Auzanneau Gregory; +Cc: linux-kernel, Andrew Morton
On Thursday 27 of May 2004 17:21, Zhu, Yi wrote:
> Bartlomiej Zolnierkiewicz [B.Zolnierkiewicz@elka.pw.edu.pl] wrote:
> > I remember seeing patch related to handling '=' in kernel
> > params, maybe it's related (or maybe not).
>
> Yes, this is caused by my kernel-parameter-parsing-fix.patch.
>
> But I think below code in ide.c is a hack.
> __setup("", ide_setup);
It is a really bad hack but unfortunately it is not easy to fix.
We can only do it by introducing new kernel parameters and obsoleting
current braindamage (+ halting boot if obsolete parameter is detected).
Please note that in (very) rare corner cases current breakage can cause
data corruption.
> How about below change?
It breaks all "idex=" and "hdx=" options.
Please take a look at how ide_setup().
> --- linux-2.6.7-rc1-mm1.orig/drivers/ide/ide.c 2004-05-27
> 23:07:59.405138992 +0800
> +++ linux-2.6.7-rc1-mm1/drivers/ide/ide.c 2004-05-27
> 23:09:47.529701560 +0800
> @@ -2459,7 +2459,8 @@ void cleanup_module (void)
>
> #else /* !MODULE */
>
> -__setup("", ide_setup);
> +__setup("hd", ide_setup);
> +__setup("ide", ide_setup);
>
> module_init(ide_init);
>
>
> -yi
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: idebus setup problem (2.6.7-rc1)
2004-05-27 15:21 Zhu, Yi
2004-05-27 15:51 ` Bartlomiej Zolnierkiewicz
@ 2004-05-27 16:09 ` Jeff Garzik
1 sibling, 0 replies; 22+ messages in thread
From: Jeff Garzik @ 2004-05-27 16:09 UTC (permalink / raw)
To: Zhu, Yi
Cc: Bartlomiej Zolnierkiewicz, Auzanneau Gregory, linux-kernel,
Andrew Morton
Zhu, Yi wrote:
> --- linux-2.6.7-rc1-mm1.orig/drivers/ide/ide.c 2004-05-27
> 23:07:59.405138992 +0800
> +++ linux-2.6.7-rc1-mm1/drivers/ide/ide.c 2004-05-27
> 23:09:47.529701560 +0800
> @@ -2459,7 +2459,8 @@ void cleanup_module (void)
>
> #else /* !MODULE */
>
> -__setup("", ide_setup);
> +__setup("hd", ide_setup);
> +__setup("ide", ide_setup);
>
> module_init(ide_init);
module_param() works for both the built-in case (where __setup is used),
and also the modular case. If this is getting changed, might as well do
the right change...
Jeff
^ permalink raw reply [flat|nested] 22+ messages in thread
* RE: idebus setup problem (2.6.7-rc1)
@ 2004-05-27 16:16 Zhu, Yi
0 siblings, 0 replies; 22+ messages in thread
From: Zhu, Yi @ 2004-05-27 16:16 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz, Auzanneau Gregory, Jeff Garzik
Cc: linux-kernel, Andrew Morton
Bartlomiej Zolnierkiewicz wrote:
>
> It breaks all "idex=" and "hdx=" options.
> Please take a look at how ide_setup().
Yes, thanks for pointing out. Maybe we need some
wildcard support. If module_param() can do this, that's
great.
-yi
^ permalink raw reply [flat|nested] 22+ messages in thread
* RE: idebus setup problem (2.6.7-rc1)
@ 2004-05-27 16:38 Zhu, Yi
2004-06-03 6:53 ` Rusty Russell
0 siblings, 1 reply; 22+ messages in thread
From: Zhu, Yi @ 2004-05-27 16:38 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz, Auzanneau Gregory, Jeff Garzik
Cc: linux-kernel, Andrew Morton, Rusty Russell
linux-kernel-owner@vger.kernel.org wrote:
> Bartlomiej Zolnierkiewicz wrote:
>>
>> It breaks all "idex=" and "hdx=" options.
>> Please take a look at how ide_setup().
>
> Yes, thanks for pointing out. Maybe we need some wildcard
> support. If module_param() can do this, that's great.
Does below change acceptable to make module_param support
wildcard '?' ?
--- linux-2.6.6.orig/kernel/params.c 2004-05-28
00:13:24.931368296 +0800
+++ linux-2.6.6/kernel/params.c 2004-05-28 00:16:04.406124448 +0800
@@ -37,7 +37,8 @@ static inline int dash2underscore(char c
static inline int parameq(const char *input, const char *paramname)
{
unsigned int i;
- for (i = 0; dash2underscore(input[i]) == paramname[i]; i++)
+ for (i = 0; paramname[i] == '?' ||
+ dash2underscore(input[i]) == paramname[i]; i++)
if (input[i] == '\0')
return 1;
return 0;
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: idebus setup problem (2.6.7-rc1)
[not found] <3ACA40606221794F80A5670F0AF15F84047998B0@PDSMSX403.ccr.corp.intel.com>
@ 2004-05-28 4:50 ` Zhu, Yi
2004-05-28 9:11 ` Auzanneau Gregory
0 siblings, 1 reply; 22+ messages in thread
From: Zhu, Yi @ 2004-05-28 4:50 UTC (permalink / raw)
To: Auzanneau Gregory, Andrew Morton, Bartlomiej Zolnierkiewicz
Cc: Linux Kernel Mailing List
On Thu, 27 May 2004, Auzanneau Gregory wrote:
>
> Hello,
>
> It seems there is a problem with idebus parameter with 2.6.7-rc1.
> Indeed, it doesn't take into account lilo append.
>
> With 2.6.7-rc1-mm1, i've got:
> Kernel command line: BOOT_IMAGE=LinuxNEW ro root=304 idebus=66
> ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
>
> With 2.6.6-mm3, i've got:
> May 24 11:37:43 greg-port kernel: Kernel command line:
> BOOT_IMAGE=LinuxNEW ro root=304 idebus=66
> May 24 11:37:43 greg-port kernel: ide_setup: idebus=66
> May 24 11:37:43 greg-port kernel: ide: Assuming 66MHz system bus speed
> for PIO modes
My bad. I missed ide_setup(), please try below patch.
--- linux-2.6.7-rc1-mm1.orig/init/main.c 2004-05-28 12:39:15.549314064 +0800
+++ linux-2.6.7-rc1-mm1/init/main.c 2004-05-28 12:40:29.399087192 +0800
@@ -162,7 +162,7 @@ static int __init obsolete_checksetup(ch
p = &__setup_start;
do {
int n = strlen(p->str);
- if (len <= n && !strncmp(line, p->str, n)) {
+ if (n == 0 || (len <= n && !strncmp(line, p->str, n))) {
/* Already done in parse_early_param? */
if (p->early)
return 1;
Andrew, could you apply?
Thanks,
-yi
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: idebus setup problem (2.6.7-rc1)
2004-05-28 4:50 ` Zhu, Yi
@ 2004-05-28 9:11 ` Auzanneau Gregory
2004-05-28 12:50 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 22+ messages in thread
From: Auzanneau Gregory @ 2004-05-28 9:11 UTC (permalink / raw)
To: Zhu, Yi; +Cc: Andrew Morton, Bartlomiej Zolnierkiewicz,
Linux Kernel Mailing List
Zhu, Yi a écrit :
> My bad. I missed ide_setup(), please try below patch.
Patch works fine for me:
Kernel command line: BOOT_IMAGE=LinuxNEW ro root=304 idebus=66
ide_setup: idebus=66
ide: Assuming 66MHz system bus speed for PIO modes
Thanks a lot,
--
Auzanneau Grégory
GPG 0x99137BEE
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: idebus setup problem (2.6.7-rc1)
2004-05-28 9:11 ` Auzanneau Gregory
@ 2004-05-28 12:50 ` Bartlomiej Zolnierkiewicz
2004-05-28 12:52 ` Auzanneau Gregory
0 siblings, 1 reply; 22+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2004-05-28 12:50 UTC (permalink / raw)
To: Auzanneau Gregory, Zhu, Yi; +Cc: Andrew Morton, Linux Kernel Mailing List
On Friday 28 of May 2004 11:11, Auzanneau Gregory wrote:
> Zhu, Yi a écrit :
> > My bad. I missed ide_setup(), please try below patch.
Thanks.
> Patch works fine for me:
> Kernel command line: BOOT_IMAGE=LinuxNEW ro root=304 idebus=66
> ide_setup: idebus=66
> ide: Assuming 66MHz system bus speed for PIO modes
OK, now please explain why do you use 'idebus=66'. :-)
> Thanks a lot,
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: idebus setup problem (2.6.7-rc1)
2004-05-28 12:50 ` Bartlomiej Zolnierkiewicz
@ 2004-05-28 12:52 ` Auzanneau Gregory
2004-05-28 13:10 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 22+ messages in thread
From: Auzanneau Gregory @ 2004-05-28 12:52 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: Linux Kernel Mailing List
Bartlomiej Zolnierkiewicz a écrit :
> OK, now please explain why do you use 'idebus=66'. :-)
Because my SIS 5513 southbridge seems to run by default to 33Mhz.
--
Auzanneau Grégory
GPG 0x99137BEE
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: idebus setup problem (2.6.7-rc1)
2004-05-28 12:52 ` Auzanneau Gregory
@ 2004-05-28 13:10 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 22+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2004-05-28 13:10 UTC (permalink / raw)
To: Auzanneau Gregory; +Cc: Linux Kernel Mailing List
On Friday 28 of May 2004 14:52, Auzanneau Gregory wrote:
> Bartlomiej Zolnierkiewicz a écrit :
> > OK, now please explain why do you use 'idebus=66'. :-)
>
> Because my SIS 5513 southbridge seems to run by default to 33Mhz.
and you run PCI bus at 66MHz?
SiS IDE driver completely ignores 'idebus' parameter.
^ permalink raw reply [flat|nested] 22+ messages in thread
* RE: idebus setup problem (2.6.7-rc1)
2004-05-27 16:38 idebus setup problem (2.6.7-rc1) Zhu, Yi
@ 2004-06-03 6:53 ` Rusty Russell
0 siblings, 0 replies; 22+ messages in thread
From: Rusty Russell @ 2004-06-03 6:53 UTC (permalink / raw)
To: Zhu, Yi
Cc: Bartlomiej Zolnierkiewicz, Auzanneau Gregory, Jeff Garzik,
lkml - Kernel Mailing List, Andrew Morton
On Fri, 2004-05-28 at 02:38, Zhu, Yi wrote:
> linux-kernel-owner@vger.kernel.org wrote:
> > Bartlomiej Zolnierkiewicz wrote:
> >>
> >> It breaks all "idex=" and "hdx=" options.
> >> Please take a look at how ide_setup().
> >
> > Yes, thanks for pointing out. Maybe we need some wildcard
> > support. If module_param() can do this, that's great.
>
> Does below change acceptable to make module_param support
> wildcard '?' ?
Dislike this idea. If you have hundreds of parameters, maybe it's
supposed to be a PITA?
Rusty,
--
Anyone who quotes me in their signature is an idiot -- Rusty Russell
^ permalink raw reply [flat|nested] 22+ messages in thread
* RE: idebus setup problem (2.6.7-rc1)
@ 2004-06-03 14:05 Zhu, Yi
2004-06-03 21:31 ` Herbert Poetzl
0 siblings, 1 reply; 22+ messages in thread
From: Zhu, Yi @ 2004-06-03 14:05 UTC (permalink / raw)
To: Rusty Russell
Cc: Bartlomiej Zolnierkiewicz, Auzanneau Gregory, Jeff Garzik,
lkml - Kernel Mailing List, Andrew Morton
Rusty Russell wrote:
>
> Dislike this idea. If you have hundreds of parameters, maybe it's
> supposed to be a PITA?
What's your idea to make module_param support alterable param
names like ide3=xxx ?
Thanks,
-yi
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: idebus setup problem (2.6.7-rc1)
2004-06-03 14:05 Zhu, Yi
@ 2004-06-03 21:31 ` Herbert Poetzl
2004-06-03 21:44 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 22+ messages in thread
From: Herbert Poetzl @ 2004-06-03 21:31 UTC (permalink / raw)
To: Zhu, Yi
Cc: Rusty Russell, Bartlomiej Zolnierkiewicz, Auzanneau Gregory,
Jeff Garzik, lkml - Kernel Mailing List, Andrew Morton
On Thu, Jun 03, 2004 at 10:05:08PM +0800, Zhu, Yi wrote:
> Rusty Russell wrote:
> >
> > Dislike this idea. If you have hundreds of parameters, maybe it's
> > supposed to be a PITA?
>
> What's your idea to make module_param support alterable param
> names like ide3=xxx ?
hmm, what about making all those something like:
ide=3:foo,bar;4:wossname
where ':' and ';' are arbitrarily chosen atm ...
or, if it should be handled at the 'argument' level
maybe the 'notion' of arrays would help, something
like
ide[3]=foo,bar
where ide is defined as array of strings, size 16
best,
Herbert
> Thanks,
> -yi
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: idebus setup problem (2.6.7-rc1)
2004-06-03 21:31 ` Herbert Poetzl
@ 2004-06-03 21:44 ` Bartlomiej Zolnierkiewicz
2004-06-04 4:32 ` Rusty Russell
0 siblings, 1 reply; 22+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2004-06-03 21:44 UTC (permalink / raw)
To: Herbert Poetzl, Zhu, Yi
Cc: Rusty Russell, Auzanneau Gregory, Jeff Garzik,
lkml - Kernel Mailing List, Andrew Morton
On Thursday 03 of June 2004 23:31, Herbert Poetzl wrote:
> On Thu, Jun 03, 2004 at 10:05:08PM +0800, Zhu, Yi wrote:
> > Rusty Russell wrote:
> > > Dislike this idea. If you have hundreds of parameters, maybe it's
> > > supposed to be a PITA?
> >
> > What's your idea to make module_param support alterable param
> > names like ide3=xxx ?
>
> hmm, what about making all those something like:
>
> ide=3:foo,bar;4:wossname
We are in stable kernel and in 2.7 'idex=' and 'hdx=' will die.
> where ':' and ';' are arbitrarily chosen atm ...
> or, if it should be handled at the 'argument' level
> maybe the 'notion' of arrays would help, something
> like
>
> ide[3]=foo,bar
>
> where ide is defined as array of strings, size 16
Sounds awful.
Cheers,
Bartlomiej
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: idebus setup problem (2.6.7-rc1)
2004-06-03 21:44 ` Bartlomiej Zolnierkiewicz
@ 2004-06-04 4:32 ` Rusty Russell
2004-06-04 22:58 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 22+ messages in thread
From: Rusty Russell @ 2004-06-04 4:32 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz
Cc: Herbert Poetzl, Zhu, Yi, Auzanneau Gregory, Jeff Garzik,
lkml - Kernel Mailing List, Andrew Morton
On Fri, 2004-06-04 at 07:44, Bartlomiej Zolnierkiewicz wrote:
> On Thursday 03 of June 2004 23:31, Herbert Poetzl wrote:
> > On Thu, Jun 03, 2004 at 10:05:08PM +0800, Zhu, Yi wrote:
> > > Rusty Russell wrote:
> > > > Dislike this idea. If you have hundreds of parameters, maybe it's
> > > > supposed to be a PITA?
> > >
> > > What's your idea to make module_param support alterable param
> > > names like ide3=xxx ?
> >
> > hmm, what about making all those something like:
> >
> > ide=3:foo,bar;4:wossname
>
> We are in stable kernel and in 2.7 'idex=' and 'hdx=' will die.
Yes, and if you want to clean this up for 2.6, I'd recommend simply
putting twenty module_param_call() lines.
It's ugly, but that's because it's doing ugly things, IMHO, and I don't
think Bart would disagree?
Rusty.
--
Anyone who quotes me in their signature is an idiot -- Rusty Russell
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: idebus setup problem (2.6.7-rc1)
2004-06-04 4:32 ` Rusty Russell
@ 2004-06-04 22:58 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 22+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2004-06-04 22:58 UTC (permalink / raw)
To: Rusty Russell
Cc: Herbert Poetzl, Zhu, Yi, Auzanneau Gregory, Jeff Garzik,
lkml - Kernel Mailing List, Andrew Morton
On Friday 04 of June 2004 06:32, Rusty Russell wrote:
> On Fri, 2004-06-04 at 07:44, Bartlomiej Zolnierkiewicz wrote:
> > On Thursday 03 of June 2004 23:31, Herbert Poetzl wrote:
> > > On Thu, Jun 03, 2004 at 10:05:08PM +0800, Zhu, Yi wrote:
> > > > Rusty Russell wrote:
> > > > > Dislike this idea. If you have hundreds of parameters, maybe it's
> > > > > supposed to be a PITA?
> > > >
> > > > What's your idea to make module_param support alterable param
> > > > names like ide3=xxx ?
> > >
> > > hmm, what about making all those something like:
> > >
> > > ide=3:foo,bar;4:wossname
> >
> > We are in stable kernel and in 2.7 'idex=' and 'hdx=' will die.
>
> Yes, and if you want to clean this up for 2.6, I'd recommend simply
> putting twenty module_param_call() lines.
10 for "idex="
20 for "hdx="
1 for "idebus="
1 for "ide="
I tried it once and result was uglier than the current behavior
(part of the problem is that MAX_HWIFS is arch/config dependent).
Why can't we apply this minimal fix from Yi for now?
--- linux-2.6.7-rc1-mm1.orig/init/main.c 2004-05-28 12:39:15.549314064 +0800
+++ linux-2.6.7-rc1-mm1/init/main.c 2004-05-28 12:40:29.399087192 +0800
@@ -162,7 +162,7 @@ static int __init obsolete_checksetup(ch
p = &__setup_start;
do {
int n = strlen(p->str);
- if (len <= n && !strncmp(line, p->str, n)) {
+ if (n == 0 || (len <= n && !strncmp(line, p->str, n))) {
/* Already done in parse_early_param? */
if (p->early)
return 1;
> It's ugly, but that's because it's doing ugly things, IMHO, and I don't
> think Bart would disagree?
>
> Rusty.
^ permalink raw reply [flat|nested] 22+ messages in thread
* RE: idebus setup problem (2.6.7-rc1)
@ 2004-06-06 13:11 Zhu, Yi
2004-06-07 0:07 ` Rusty Russell
0 siblings, 1 reply; 22+ messages in thread
From: Zhu, Yi @ 2004-06-06 13:11 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz, Rusty Russell
Cc: Herbert Poetzl, Auzanneau Gregory, Jeff Garzik,
lkml - Kernel Mailing List, Andrew Morton
Bartlomiej Zolnierkiewicz wrote:
>
> Why can't we apply this minimal fix from Yi for now?
Thanks, this is in 2.6.7-rc2-mm2.
>
> --- linux-2.6.7-rc1-mm1.orig/init/main.c 2004-05-28
> 12:39:15.549314064 +0800 +++ linux-2.6.7-rc1-mm1/init/main.c
> 2004-05-28 12:40:29.399087192 +0800
> @@ -162,7 +162,7 @@ static int __init obsolete_checksetup(ch
> p = &__setup_start; do {
> int n = strlen(p->str);
> - if (len <= n && !strncmp(line, p->str, n)) {
> + if (n == 0 || (len <= n && !strncmp(line, p->str,
> n))) { /* Already done in parse_early_param?
> */ if (p->early)
> return 1;
>
Thanks,
-yi
^ permalink raw reply [flat|nested] 22+ messages in thread
* RE: idebus setup problem (2.6.7-rc1)
2004-06-06 13:11 Zhu, Yi
@ 2004-06-07 0:07 ` Rusty Russell
0 siblings, 0 replies; 22+ messages in thread
From: Rusty Russell @ 2004-06-07 0:07 UTC (permalink / raw)
To: Zhu, Yi
Cc: Bartlomiej Zolnierkiewicz, Herbert Poetzl, Auzanneau Gregory,
Jeff Garzik, lkml - Kernel Mailing List, Andrew Morton
On Sun, 2004-06-06 at 23:11, Zhu, Yi wrote:
> Bartlomiej Zolnierkiewicz wrote:
> >
> > Why can't we apply this minimal fix from Yi for now?
>
> Thanks, this is in 2.6.7-rc2-mm2.
OK, I've revisited this problem, with my thinking cap ON this time.
Sorry for the delay.
Andrew, please revert kernel-parameter-parsing-fix.patch and
kernel-parameter-parsing-fix-fix.patch in favor of this one-liner.
Yi, does this fix your ACPI problem?
Rusty.
Name: Handle __early_param and __setup Collision
Status: Trivial
Depends: EarlyParam/early_param.patch.gz
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Yi Zhu (yi.zhu@intel.com) points out the following problem:
In arch/i386/kernel/setup.c:
__early_param("acpi", early_acpi);
In drivers/acpi/osl.c:
__setup("acpi_os_name=", acpi_os_name_setup);
The problem command line looks like:
"acpi=force acpi_os_name=my_override_name"
For simplicity, we overload the __setup section to contain both
__early_param and __setup, so we can check that all options on the
command line are taken by at least one of them. However,
__early_param have different semantics the __setup: in particular,
__early_param("acpi"), must not match anything but "acpi" and "acpi=",
which mirrors module_param(), whereas __setup("acpi") would match
anything which starts with "acpi".
Fix the obsolete_checksetup code to take this difference into account
correctly.
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .22424-linux-2.6.7-rc2-bk7/init/main.c .22424-linux-2.6.7-rc2-bk7.updated/init/main.c
--- .22424-linux-2.6.7-rc2-bk7/init/main.c 2004-06-07 09:51:11.000000000 +1000
+++ .22424-linux-2.6.7-rc2-bk7.updated/init/main.c 2004-06-07 09:53:06.000000000 +1000
@@ -159,8 +159,9 @@ static int __init obsolete_checksetup(ch
do {
int n = strlen(p->str);
if (!strncmp(line, p->str, n)) {
- /* Already done in parse_early_param? */
- if (p->early)
+ /* Already done in parse_early_param? (Needs
+ * exact match on param part) */
+ if (p->early && (line[n] == '\0' || line[n] == '='))
return 1;
if (!p->setup_func) {
printk(KERN_WARNING "Parameter %s is obsolete, ignored\n", p->str);
--
Anyone who quotes me in their signature is an idiot -- Rusty Russell
^ permalink raw reply [flat|nested] 22+ messages in thread
* RE: idebus setup problem (2.6.7-rc1)
@ 2004-06-07 11:04 Zhu, Yi
2004-06-07 23:00 ` Rusty Russell
0 siblings, 1 reply; 22+ messages in thread
From: Zhu, Yi @ 2004-06-07 11:04 UTC (permalink / raw)
To: Rusty Russell
Cc: Bartlomiej Zolnierkiewicz, Herbert Poetzl, Auzanneau Gregory,
Jeff Garzik, lkml - Kernel Mailing List, Andrew Morton
Rusty Russell wrote:
>
> OK, I've revisited this problem, with my thinking cap ON this time.
> Sorry for the delay.
>
> Andrew, please revert kernel-parameter-parsing-fix.patch and
> kernel-parameter-parsing-fix-fix.patch in favor of this one-liner.
>
> Yi, does this fix your ACPI problem?
>
> Rusty.
>
> Name: Handle __early_param and __setup Collision
> Status: Trivial
> Depends: EarlyParam/early_param.patch.gz
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
>
> Yi Zhu (yi.zhu@intel.com) points out the following problem:
>
> In arch/i386/kernel/setup.c:
> __early_param("acpi", early_acpi);
>
> In drivers/acpi/osl.c:
> __setup("acpi_os_name=", acpi_os_name_setup);
>
> The problem command line looks like:
>
> "acpi=force acpi_os_name=my_override_name"
>
> For simplicity, we overload the __setup section to contain
> both __early_param and __setup, so we can check that all
> options on the command line are taken by at least one of
> them. However, __early_param have different semantics the
> __setup: in particular, __early_param("acpi"), must not match
> anything but "acpi" and "acpi=", which mirrors
> module_param(), whereas __setup("acpi") would match anything
> which starts with "acpi".
Really? I think currently only ide_setup is an exception for __setup(),
which will match all params given in command line.
>
> Fix the obsolete_checksetup code to take this difference into account
> correctly.
>
> diff -urpN --exclude TAGS -X
> /home/rusty/devel/kernel/kernel-patches/current-dontdiff
> --minimal .22424-linux-2.6.7-rc2-bk7/init/main.c
> .22424-linux-2.6.7-rc2-bk7.updated/init/main.c
> --- .22424-linux-2.6.7-rc2-bk7/init/main.c 2004-06-07
> 09:51:11.000000000 +1000 +++
> .22424-linux-2.6.7-rc2-bk7.updated/init/main.c 2004-06-07
> 09:53:06.000000000 +1000 @@ -159,8 +159,9 @@ static int __init
> obsolete_checksetup(ch do { int n =
strlen(p->str);
> if (!strncmp(line, p->str, n)) {
> - /* Already done in parse_early_param? */
> - if (p->early)
> + /* Already done in parse_early_param? (Needs
> + * exact match on param part) */
> + if (p->early && (line[n] == '\0' ||
> line[n] == '='))
> return 1;
> if (!p->setup_func) {
> printk(KERN_WARNING "Parameter
> %s is obsolete, ignored\n", p->str);
This doesn't work. The p->setup_func for "acpi" will still be called on
behalf of "acpi_os_name".
Below change should work.
Thanks,
-yi
--- linux-2.6.7-rc2-mm2.orig/init/main.c 2004-06-07
16:01:25.000000000 +0800
+++ linux-2.6.7-rc2-mm2/init/main.c 2004-06-07 18:50:22.256204536
+0800
@@ -154,18 +154,22 @@ static int __init obsolete_checksetup(ch
{
struct obs_kernel_param *p;
extern struct obs_kernel_param __setup_start, __setup_end;
- char *ptr;
- int len = strlen(line);
- if ((ptr = strchr(line, '=')))
- len = ptr - line;
p = &__setup_start;
do {
int n = strlen(p->str);
- if (n == 0 || (len <= n && !strncmp(line, p->str, n))) {
- /* Already done in parse_early_param? */
- if (p->early)
- return 1;
+ if (!strncmp(line, p->str, n)) {
+ if (p->early) {
+ /* Already done in parse_early_param?
(Needs
+ * exact match on param part) */
+ if (p->early && (line[n] == '\0' ||
+ line[n] == '='))
+ return 1;
+ else {
+ p++;
+ continue;
+ }
+ }
if (!p->setup_func) {
printk(KERN_WARNING "Parameter %s is
obsolete,"
" ignored\n", p->str);
^ permalink raw reply [flat|nested] 22+ messages in thread
* RE: idebus setup problem (2.6.7-rc1)
2004-06-07 11:04 Zhu, Yi
@ 2004-06-07 23:00 ` Rusty Russell
0 siblings, 0 replies; 22+ messages in thread
From: Rusty Russell @ 2004-06-07 23:00 UTC (permalink / raw)
To: Zhu, Yi
Cc: Bartlomiej Zolnierkiewicz, Herbert Poetzl, Auzanneau Gregory,
Jeff Garzik, lkml - Kernel Mailing List, Andrew Morton
On Mon, 2004-06-07 at 21:04, Zhu, Yi wrote:
> > For simplicity, we overload the __setup section to contain
> > both __early_param and __setup, so we can check that all
> > options on the command line are taken by at least one of
> > them. However, __early_param have different semantics the
> > __setup: in particular, __early_param("acpi"), must not match
> > anything but "acpi" and "acpi=", which mirrors
> > module_param(), whereas __setup("acpi") would match anything
> > which starts with "acpi".
>
> Really? I think currently only ide_setup is an exception for __setup(),
> which will match all params given in command line.
No, there is at least one other place which relies on this feature last
I searched. They're all supposed to be stem matches, so __setup("foo")
matches "foobar=100" for example.
> > - /* Already done in parse_early_param? */
> > - if (p->early)
> > + /* Already done in parse_early_param? (Needs
> > + * exact match on param part) */
> > + if (p->early && (line[n] == '\0' ||
> > line[n] == '='))
> > return 1;
> > if (!p->setup_func) {
> > printk(KERN_WARNING "Parameter
> > %s is obsolete, ignored\n", p->str);
>
> This doesn't work. The p->setup_func for "acpi" will still be called on
> behalf of "acpi_os_name".
>
> Below change should work.
Good point, but I think this is clearer:
Name: Handle __early_param and __setup Collision
Status: Booted on 2.6.7-rc2-bk7
Depends: EarlyParam/early_param.patch.gz
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Yi Zhu (yi.zhu@intel.com) points out the following problem:
In arch/i386/kernel/setup.c:
__early_param("acpi", early_acpi);
In drivers/acpi/osl.c:
__setup("acpi_os_name=", acpi_os_name_setup);
The problem command line looks like:
"acpi=force acpi_os_name=my_override_name"
For simplicity, we overload the __setup section to contain both
__early_param and __setup, so we can check that all options on the
command line are taken by at least one of them. However,
__early_param have different semantics the __setup: in particular,
__early_param("acpi"), must not match anything but "acpi" and "acpi=",
which mirrors module_param(), whereas __setup("acpi") would match
anything which starts with "acpi".
Fix the obsolete_checksetup code to take this difference into account
correctly.
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .9590-linux-2.6.7-rc2-bk7/init/main.c .9590-linux-2.6.7-rc2-bk7.updated/init/main.c
--- .9590-linux-2.6.7-rc2-bk7/init/main.c 2004-06-08 08:44:23.000000000 +1000
+++ .9590-linux-2.6.7-rc2-bk7.updated/init/main.c 2004-06-08 08:48:15.000000000 +1000
@@ -159,10 +159,12 @@ static int __init obsolete_checksetup(ch
do {
int n = strlen(p->str);
if (!strncmp(line, p->str, n)) {
- /* Already done in parse_early_param? */
- if (p->early)
- return 1;
- if (!p->setup_func) {
+ if (p->early) {
+ /* Already done in parse_early_param? (Needs
+ * exact match on param part) */
+ if (line[n] == '\0' || line[n] == '=')
+ return 1;
+ } else if (!p->setup_func) {
printk(KERN_WARNING "Parameter %s is obsolete, ignored\n", p->str);
return 1;
} else if (p->setup_func(line + n))
--
Anyone who quotes me in their signature is an idiot -- Rusty Russell
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2004-06-07 23:01 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-27 16:38 idebus setup problem (2.6.7-rc1) Zhu, Yi
2004-06-03 6:53 ` Rusty Russell
-- strict thread matches above, loose matches on Subject: below --
2004-06-07 11:04 Zhu, Yi
2004-06-07 23:00 ` Rusty Russell
2004-06-06 13:11 Zhu, Yi
2004-06-07 0:07 ` Rusty Russell
2004-06-03 14:05 Zhu, Yi
2004-06-03 21:31 ` Herbert Poetzl
2004-06-03 21:44 ` Bartlomiej Zolnierkiewicz
2004-06-04 4:32 ` Rusty Russell
2004-06-04 22:58 ` Bartlomiej Zolnierkiewicz
[not found] <3ACA40606221794F80A5670F0AF15F84047998B0@PDSMSX403.ccr.corp.intel.com>
2004-05-28 4:50 ` Zhu, Yi
2004-05-28 9:11 ` Auzanneau Gregory
2004-05-28 12:50 ` Bartlomiej Zolnierkiewicz
2004-05-28 12:52 ` Auzanneau Gregory
2004-05-28 13:10 ` Bartlomiej Zolnierkiewicz
2004-05-27 16:16 Zhu, Yi
2004-05-27 15:21 Zhu, Yi
2004-05-27 15:51 ` Bartlomiej Zolnierkiewicz
2004-05-27 16:09 ` Jeff Garzik
2004-05-27 11:57 Auzanneau Gregory
2004-05-27 14:37 ` Bartlomiej Zolnierkiewicz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox