Bug 6711

Summary: via velocity reports incorrect cable in/out status
Product: Drivers Reporter: Roy Marples (uberlord)
Component: NetworkAssignee: Francois Romieu (romieu)
Status: CLOSED CODE_FIX    
Severity: normal    
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.17 Subsystem:
Regression: --- Bisected commit-id:
Attachments: syslog as requested
minimal link detection
almost working syslog
fix link detection at start-up. Try #2
Working link detection
Working link dection

Description Roy Marples 2006-06-18 15:51:02 UTC
Most recent kernel where this bug did not occur: n/a - occured since 2.6.13, 
first kernel on machine
Distribution: Gentoo
Hardware Environment: amd64
Software Environment: Gentoo/Linux
Problem Description: via velocity always thinks cable is plugged in according 
to netplug and/or ifplugd

Steps to reproduce:
Install Gentoo
emerge baselayout-1.12.1
emerge netplug
remove network cable
/etc/init.d/net.eth0 restart
examine log to see netplug claiming eth0 has a cable inserted
Comment 1 Francois Romieu 2006-06-20 14:56:41 UTC
Can you send a complete dmesg wherein a mark would be added after each of the
relevant command ?

Thanks in advance.

-- 
Ueimor
Comment 2 Roy Marples 2006-06-21 00:27:17 UTC
Created attachment 8359 [details]
syslog as requested

I've marked *** PROBLEM HERE *** when the device thinks there's a cable in.
Comment 3 Francois Romieu 2006-06-21 14:14:57 UTC
Created attachment 8369 [details]
minimal link detection

Can you give the patch above a try and report if the behavior
is changed (with/withou cable) ?

Don't hold your breath, it's just a try. Please send updated dmesg.

-- 
Ueimor
Comment 4 Roy Marples 2006-06-22 01:14:48 UTC
Created attachment 8376 [details]
almost working syslog

Well, the patch nearly fixes it :) Pull cable out, ifplugd and netplug respond.
Put cable in, ifplugd and netplug respond.

However, the last error remaining is that both ifplugd and netplug think that
the interface has a link when the module is first loaded.
Maybe a call to check link status when the module loads is needed?
Comment 5 Francois Romieu 2006-06-22 13:33:04 UTC
Created attachment 8380 [details]
fix link detection at start-up. Try #2

Quick feedback. Cool.

Is this patch better ?

-- 
Ueimor
Comment 6 Roy Marples 2006-06-22 14:12:49 UTC
Created attachment 8381 [details]
Working link detection

OK, I was wrong with my initial report. The link detection *was* working - it
just wasn't informing the system about it!

This patch is much simpler and more importantly it works 100% on my box now.

Thanks :)
Comment 7 Francois Romieu 2006-06-22 14:51:04 UTC
@@ -799,9 +798,6 @@
 	if (ret < 0)
 		goto err_iounmap;
 
-	if (velocity_get_link(dev))
-		netif_carrier_off(dev);
-
 	velocity_print_info(vptr);
 	pci_set_drvdata(pdev, dev);

This part does not seem to match 2.6.17:
http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;h=2eb6b5f9ba0df647bd760b43abcec48216241df6;hb=0dad31d2da706ef114bc5c21123123be2f405d5b;f=drivers/net/via-velocity.c
Comment 8 Roy Marples 2006-06-22 14:59:44 UTC
Created attachment 8382 [details]
Working link dection

OK, my bad. Patch was reversed by mistake.
This should apply clean.
Comment 9 Francois Romieu 2006-06-23 09:56:17 UTC
Patch has been merged into mainline.

-- 
Ueimor