Skip to contentSkip to conversation

kgdb: fix kgdbeth compilation and make it init late enough

PATCH Pavel Machek 3 participants 7 messages Mar 2, 2004 – Mar 3, 2004 Network drivers

lore
Share & tools
lore
#0 lore raw

Hi!

CONFIG_NO_KGDB_CPUS can not be found anywhere in the patches => its probably not needd any more. init_kgdboe can't be module_initcall; in such cases it initializes after tg3 network card (and that's bad).

Okay to commit?
Pavel

drivers/net/kgdb_eth.c +1 -10
@@ -157,15 +157,6 @@
 
 static int init_kgdboe(void)
 {
-#ifdef CONFIG_SMP
-	if (num_online_cpus() > CONFIG_NO_KGDB_CPUS) {
-		printk
-		    ("kgdb: too manu cpus. Cannot enable debugger with more than %d cpus\n",
-		     CONFIG_NO_KGDB_CPUS);
-		return -1;
-	}
-#endif
-
 	if (!np.remote_ip || netpoll_setup(&np))
 		return 1;
 
@@ -176,4 +167,4 @@
 	return 0;
 }
 
-module_init(init_kgdboe);
+late_initcall(init_kgdboe);		/* This needs to be done after netcard is initialized */ 
Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#1 lore raw
Quoted 4 lines · Pavel Machek

Hi!

CONFIG_NO_KGDB_CPUS can not be found anywhere in the patches => its probably not needd any more.

I don't know if we can do that. There's some funky locking stuff done on SMP, which for some reason can't be done to NR_CPUS (or, no one has tried doing that).

Quoted 2 lines

init_kgdboe can't be module_initcall; in
such cases it initializes after tg3 network card (and that's bad).

Ah, that's an even better fix than trying to enforce link order.

Quoted 1 line

Okay to commit?

Second half, yes.

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/
#2 lore raw

Hi!

Quoted 6 lines
Quoted 2 lines

CONFIG_NO_KGDB_CPUS can not be found anywhere in the patches => its probably not needd any more.

I don't know if we can do that. There's some funky locking stuff done on SMP, which for some reason can't be done to NR_CPUS (or, no one has tried doing that).

There was no CONFIG_NO_KGDB_CPUS anywhere else in the CVS, that means that test could not have been right.

This could be related:

+#ifndef KGDB_MAX_NO_CPUS
+#if CONFIG_NR_CPUS > 8
+#error KGDB can handle max 8 CPUs
+#endif
+#define KGDB_MAX_NO_CPUS 8
+#endif

Quoted 8 lines
Quoted 2 lines

init_kgdboe can't be module_initcall; in
such cases it initializes after tg3 network card (and that's bad).

Ah, that's an even better fix than trying to enforce link order.

Quoted 1 line

Okay to commit?

Second half, yes.

I already commited both, sorry.

Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#3 lore raw
Quoted 11 lines · Pavel Machek

Hi!

Quoted 6 lines
Quoted 2 lines

CONFIG_NO_KGDB_CPUS can not be found anywhere in the patches => its probably not needd any more.

I don't know if we can do that. There's some funky locking stuff done on SMP, which for some reason can't be done to NR_CPUS (or, no one has tried doing that).

There was no CONFIG_NO_KGDB_CPUS anywhere else in the CVS, that means that test could not have been right.

That doesn't mean the right answer is to remove it. However, after talking with George (who might speak up now anyhow) for 2.6 we can just do the SMP locking stuff at NR_CPUS, since that's configurable.

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/
#4 lore raw
Quoted 13 lines · Tom Rini
Quoted 10 lines · Pavel Machek

Hi!

Quoted 6 lines
Quoted 2 lines

CONFIG_NO_KGDB_CPUS can not be found anywhere in the patches => its probably not needd any more.

I don't know if we can do that. There's some funky locking stuff done on SMP, which for some reason can't be done to NR_CPUS (or, no one has tried doing that).

Quoted 7 lines
Quoted 2 lines

There was no CONFIG_NO_KGDB_CPUS anywhere else in the CVS, that means that test could not have been right.

That doesn't mean the right answer is to remove it. However, after talking with George (who might speak up now anyhow) for 2.6 we can just do the SMP locking stuff at NR_CPUS, since that's configurable.

The old CONFIG_NO_KGDB_CPUS only affected the kgdb_info array. Its only purpose was to shorten the array as it I displayed it fairly often and having a bunch of unused stuff at the end was a bother. Now that 2.6 lets you define this, it is no longer needed.

Quoted 1 line
Signature · 3 lines
George Anzinger   [email protected]
High-res-timers:  http://sourceforge.net/projects/high-res-timers/
Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml
#5 lore raw
In reply to Tom Rini

Hi!

Quoted 6 lines
Quoted 2 lines

CONFIG_NO_KGDB_CPUS can not be found anywhere in the patches => its probably not needd any more.

I don't know if we can do that. There's some funky locking stuff done on SMP, which for some reason can't be done to NR_CPUS (or, no one has tried doing that).

There seems to be KGDB_MAX_NO_CPUS, but as 8250 patch does not check it, I believe that eth has no business checking it either.

Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#6 lore raw
Quoted 6 lines · Pavel Machek

Hi!

Quoted 3 lines
Quoted 2 lines

CONFIG_NO_KGDB_CPUS can not be found anywhere in the patches => its probably not needd any more.

Quoted 7 lines
Quoted 3 lines

I don't know if we can do that. There's some funky locking stuff done on SMP, which for some reason can't be done to NR_CPUS (or, no one has tried doing that).

There seems to be KGDB_MAX_NO_CPUS, but as 8250 patch does not check it, I believe that eth has no business checking it either.

I have not seen this one before. It must be from Amit's patch base.

Signature · 3 lines
George Anzinger   [email protected]
High-res-timers:  http://sourceforge.net/projects/high-res-timers/
Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml