Skip to contentSkip to conversation

2.6.6: smc-ultra: eth%d message

Kernel-janitors Roger Luethi 2 participants 2 messages May 29, 2004 – May 31, 2004 Kernel janitors

lore
Share & tools
lore
#0 lore raw
Quoted 8 lines · Németh Márton

When I'm loading smc-ultra module with 'modprobe -k smc_ultra' using Linux 2.6.6 I get the following message in 'dmesg':

smc-ultra.c: Presently autoprobing (not recommended) for a single card. smc-ultra.c: No ISAPnP cards found, trying standard ones... smc-ultra.c:v2.02 2/3/98 Donald Becker ([email protected]) eth%d: SMC Ultra at 0x280, 00 00 C0 78 C5 B6, IRQ 3 memory 0xd0000-0xd3fff.

Quoted 5 lines

Using Linux kernel 2.4.25 the last line was correct, like this:
eth0: SMC Ultra at 0x280, 00 00 C0 78 C5 B6, IRQ 3 memory 0xd0000-0xd3fff.

I think the printk() in linux-2.6.6/drivers/net/smc-ultra.c:243 is buggy, but I do not have the knowledge how to correct this.

There are several drivers in 2.6 that use dev->name before calling register_netdev(), which results in the "eth%d" messages you are seeing. I've noticed this with mace.c as well (2.6.5 IIRC).

Maybe some KJ would like to pick that up?

Roger
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#1 lore raw

Hi!

I tried to write a 'Smatch' ( http://smatch.sourceforge.net/ ) script to help searching for the problem below.

The question that the script would check is that is any 'struct net_device'.'name' accessed by any read-out expression before calling register_netdev().

It seems to me that 'Smatch' does not provide enough information for this:

----------------------------------------------------------------
linux-2.6.6/drivers/net/smc-ultra.c:243 is:

    printk("%s: %s at %#3x,", dev->name, model_name, ioaddr);

smc-ultra.c.sm contains:
SM drivers/net/smc-ultra.c 243 expr_stmt call_expr((addr_expr function_decl(printk))(tree_list: addr_expr string_cst(""%s: %s at %#3x,""), non_lvalue_expr parm_decl(dev), var_decl(model_name), parm_decl(ioaddr)))
----------------------------------------------------------------

and the pointer type of 'dev' is also not known:

----------------------------------------------------------------
linux-2.6.6/drivers/net/smc-ultra.c:206 is:
static int __init ultra_probe1(struct net_device *dev, int ioaddr)

smc-ultra.c.sm:
SM drivers/net/smc-ultra.c 207 function_decl integer_type function_decl(ultra_probe1)(pointer_type(parm_decl(dev)), integer_type(parm_decl(ioaddr)))
----------------------------------------------------------------

Is it possible to update 'Smatch' to let the check possible?

NMarci

Quoted 12 lines · Roger Luethi
Quoted 11 lines · Németh Márton

When I'm loading smc-ultra module with 'modprobe -k smc_ultra' using Linux 2.6.6 I get the following message in 'dmesg':

smc-ultra.c: Presently autoprobing (not recommended) for a single card. smc-ultra.c: No ISAPnP cards found, trying standard ones... smc-ultra.c:v2.02 2/3/98 Donald Becker ([email protected]) eth%d: SMC Ultra at 0x280, 00 00 C0 78 C5 B6, IRQ 3 memory 0xd0000-0xd3fff.

Using Linux kernel 2.4.25 the last line was correct, like this:
eth0: SMC Ultra at 0x280, 00 00 C0 78 C5 B6, IRQ 3 memory 0xd0000-0xd3fff.

Quoted 6 lines
Quoted 2 lines

I think the printk() in linux-2.6.6/drivers/net/smc-ultra.c:243 is buggy, but I do not have the knowledge how to correct this.

There are several drivers in 2.6 that use dev->name before calling register_netdev(), which results in the "eth%d" messages you are seeing. I've noticed this with mace.c as well (2.6.5 IIRC).

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors