Skip to contentSkip to conversation

2.6.9-rc1-mm4 badness in rtl8150.c ethernet driver

DISCUSSION Applied Eric Valette 4 participants 12 messages Sep 7, 2004 – Sep 14, 2004 USB

lore
Share & tools
lore
#0 lore raw

Andrew,

I tried your new test kernel and it broke my USB/Ethernet adapter. Adapter is detected, ifup works but no ping using IP adress on a point to point ethernet network. I saw the file change in the diff and probably something broke (either bogus endianness fixes or changed reset code data or ...). Bitkeeper being unreachable I can hardly follow what incremental broke it but, for sure, it is broken (FYI 2.6.9-rc1-mm2 works).

I also have oops trace when rebooting but cannot read as machines reboots. Will try network console when the rest is fixed :-)

Signature · 7 lines
   __
  /  `                   	Eric Valette
 /--   __  o _.          	6 rue Paul Le Flem
(___, / (_(_(__         	35740 Pace

Tel: +33 (0)2 99 85 26 76	Fax: +33 (0)2 99 85 26 76
E-mail: [email protected]
#1 lore raw
Quoted 5 lines · Eric Valette

Andrew,

I tried your new test kernel and it broke my USB/Ethernet adapter. Adapter is detected, ifup works but no ping using IP adress on a point to point ethernet network. I saw the file change in the diff and probably something broke (either bogus endianness fixes or changed reset code data or ...). Bitkeeper being unreachable I can hardly follow what incremental broke it but, for sure, it is broken (FYI 2.6.9-rc1-mm2 works).

I also have oops trace when rebooting but cannot read as machines reboots. Will try network console when the rest is fixed :-)

Just to confirm : reverting the rtl8150.c diff makes the card functionnal again.

Signature · 7 lines
   __
  /  `                   	Eric Valette
 /--   __  o _.          	6 rue Paul Le Flem
(___, / (_(_(__         	35740 Pace

Tel: +33 (0)2 99 85 26 76	Fax: +33 (0)2 99 85 26 76
E-mail: [email protected]
#2 lore raw

Re: 2.6.9-rc1-mm4 badness in rtl8150.c ethernet driver : fixed

In reply to Eric Valette
Quoted 1 line · Eric Valette

I tried your new test kernel and it broke my USB/Ethernet adapter. Adapter is detected, ifup works but no ping using IP adress on a point to point ethernet network. I saw the file change in the diff and probably something broke (either bogus endianness fixes or changed reset code data or ...). Bitkeeper being unreachable I can hardly follow what incremental broke it but, for sure, it is broken (FYI 2.6.9-rc1-mm2 works).

Andrew,

Here is a small patch that makes the card functionnal again. I've forwarded the patch to driver author also.

Signed off by <[email protected]>

Move value used to reset the card back to its previous definition.

Signature · 7 lines
   __
  /  `                   	Eric Valette
 /--   __  o _.          	6 rue Paul Le Flem
(___, / (_(_(__         	35740 Pace

Tel: +33 (0)2 99 85 26 76	Fax: +33 (0)2 99 85 26 76
E-mail: [email protected]
drivers/usb/net/rtl8150.c renamed from drivers/usb/net/rtl8150.c-2.6.9-rc1-mm4.orig +1 -1
@@ -341,7 +341,7 @@
 
 static int rtl8150_reset(rtl8150_t * dev)
 {
-	u8 data = 0x11;
+	u8 data = 0x10;
 	int i = HZ;
 
 	set_registers(dev, CR, 1, &data);
#3 lore raw

Re: 2.6.9-rc1-mm4 badness in rtl8150.c ethernet driver : fixed

drivers/usb/net/rtl8150.c line 344

Quoted 12 lines · Eric Valette

Here is a small patch that makes the card functionnal again. I've forwarded the patch to driver author also.

drivers/usb/net/rtl8150.c renamed from drivers/usb/net/rtl8150.c-2.6.9-rc1-mm4.orig +1 -1
@@ -341,7 +341,7 @@
 
 static int rtl8150_reset(rtl8150_t * dev)
 {
-	u8 data = 0x11;
+	u8 data = 0x10;

hm, OK. Presumably the change (which comes in via the bk-usb tree) was made for a reason. So I suspect both versions are wrong ;)

But it might be risky for Greg to merge this patch up at present.

#4 lore raw

Re: 2.6.9-rc1-mm4 badness in rtl8150.c ethernet driver : fixed

Quoted 17 lines · Andrew Morton

drivers/usb/net/rtl8150.c line 344

Quoted 12 lines · Eric Valette

Here is a small patch that makes the card functionnal again. I've forwarded the patch to driver author also.

drivers/usb/net/rtl8150.c renamed from drivers/usb/net/rtl8150.c-2.6.9-rc1-mm4.orig +1 -1
@@ -341,7 +341,7 @@
 
 static int rtl8150_reset(rtl8150_t * dev)
 {
-	u8 data = 0x11;
+	u8 data = 0x10;

hm, OK. Presumably the change (which comes in via the bk-usb tree) was made for a reason. So I suspect both versions are wrong ;)

Quoted 1 line

But it might be risky for Greg to merge this patch up at present.

As all your patch does is revert the patch in my tree (it was a one line change), mainline should work just fine for you, right?

I'll defer to Petkan as to what to do about this, as he sent me that patch for a good reason I imagine :)

thanks,

greg k-h

#5 lore raw

Re: 2.6.9-rc1-mm4 badness in rtl8150.c ethernet driver : fixed

Quoted 18 lines · Greg KH
Quoted 16 lines · Andrew Morton

drivers/usb/net/rtl8150.c line 344

Quoted 10 lines · Eric Valette

Here is a small patch that makes the card functionnal again. I've forwarded the patch to driver author also.

drivers/usb/net/rtl8150.c renamed from drivers/usb/net/rtl8150.c-2.6.9-rc1-mm4.orig +1 -1
@@ -341,7 +341,7 @@
 
 static int rtl8150_reset(rtl8150_t * dev)
 {
-	u8 data = 0x11;
+	u8 data = 0x10;

hm, OK. Presumably the change (which comes in via the bk-usb tree) was made for a reason. So I suspect both versions are wrong ;)

Quoted 8 lines
Quoted 1 line

But it might be risky for Greg to merge this patch up at present.

As all your patch does is revert the patch in my tree (it was a one line change), mainline should work just fine for you, right?

I'll defer to Petkan as to what to do about this, as he sent me that patch for a good reason I imagine :)

FYI : I already forwarded the patch to the author. Just copied LKML so that other can get the fix easily.

NB : I just reverted one small change, the rest of the changes (mainly access to driver private data, and IOCTL ops) are OK...

Signature · 7 lines
   __
  /  `                   	Eric Valette
 /--   __  o _.          	6 rue Paul Le Flem
(___, / (_(_(__         	35740 Pace

Tel: +33 (0)2 99 85 26 76	Fax: +33 (0)2 99 85 26 76
E-mail: [email protected]
#6 lore raw

Re: 2.6.9-rc1-mm4 badness in rtl8150.c ethernet driver : fixed

In reply to Greg KH
Quoted 18 lines · Greg KH
Quoted 17 lines · Andrew Morton

drivers/usb/net/rtl8150.c line 344

Quoted 12 lines · Eric Valette

Here is a small patch that makes the card functionnal again. I've forwarded the patch to driver author also.

drivers/usb/net/rtl8150.c renamed from drivers/usb/net/rtl8150.c-2.6.9-rc1-mm4.orig +1 -1
@@ -341,7 +341,7 @@
 
 static int rtl8150_reset(rtl8150_t * dev)
 {
-	u8 data = 0x11;
+	u8 data = 0x10;

hm, OK. Presumably the change (which comes in via the bk-usb tree) was made for a reason. So I suspect both versions are wrong ;)

Quoted 7 lines
Quoted 1 line

But it might be risky for Greg to merge this patch up at present.

As all your patch does is revert the patch in my tree (it was a one line change), mainline should work just fine for you, right?

I'll defer to Petkan as to what to do about this, as he sent me that patch for a good reason I imagine :)

Steven Hein <[email protected]> sent me a patch that supposedly fix device registers misinitialization when it is being frequently reseted.

RTL8150 is quite flaky piece of HW so i first tested the new value and it did work for me. That's why i decided to send it to Greg.

I would say lets wait for some time and see if we'll break someone else's
heart and then reverse the patch. Another solution is to restore the original value and add new module parameter, so whoever thinks anything != 0x10 work better for him will be free to change it.

Petko

#7 lore raw

Re: 2.6.9-rc1-mm4 badness in rtl8150.c ethernet driver : fixed

Quoted 1 line · Petko Manolov

Steven Hein <[email protected]> sent me a patch that supposedly fix device registers misinitialization when it is being frequently reseted.

I never saw traces showing the card should be resetted. It hung occasionnaly in the past but did not know who to really blame (USB vs drivers). It is now working well for quite a long time now allthough I periodically transfers more than 100mb via ftp...

Quoted 3 lines

I would say lets wait for some time and see if we'll break someone else's
heart and then reverse the patch. Another solution is to restore the original value and add new module parameter, so whoever thinks anything != 0x10 work better for him will be free to change it.

I'm not sure 2.6.9-rcx-mmx will provide valuable data, we will probably have to wait until distro incoporates this code to get some reasonnable hints... Do you have some well known driver users you could ping to get feedback more quickly?

Anyway, you are aware of the problem and I know how to fix my problem so all is fine.

Have a nice day,

Signature · 7 lines
   __
  /  `                   	Eric Valette
 /--   __  o _.          	6 rue Paul Le Flem
(___, / (_(_(__         	35740 Pace

Tel: +33 (0)2 99 85 26 76	Fax: +33 (0)2 99 85 26 76
E-mail: [email protected]
#8 lore raw

Re: 2.6.9-rc1-mm4 badness in rtl8150.c ethernet driver : fixed

Quoted 3 lines · Eric Valette

Petko Manolov wrote:

I never saw traces showing the card should be resetted. It hung occasionnaly in the past but did not know who to really blame (USB vs drivers). It is now

Well, i haven't touched anything major in many many months. :-)

Quoted 1 line

working well for quite a long time now allthough I periodically transfers more than 100mb via ftp...

That is good news, although many other people have made worse reports in the past.

Quoted 1 line

I'm not sure 2.6.9-rcx-mmx will provide valuable data, we will probably have to wait until distro incoporates this code to get some reasonnable hints... Do you have some well known driver users you could ping to get feedback more quickly?

None that i am aware of.

Quoted 1 line

Anyway, you are aware of the problem and I know how to fix my problem so all is fine.

All right - lets wait for a little while and see what sort info we'll get. Then we'll decide accordingly.

Petko

#9 lore raw

rtl8150.c ethernet driver : usb_unlink_urb ->usb_kill_urb

In reply to Greg KH
Quoted 3 lines

I'll defer to Petkan as to what to do about this, as he sent me that patch for a good reason I imagine :)

While we are looking at this driver, here is a way to avoid one full page of annoying messages at shutdown/module unload.

Signature · 7 lines
   __
  /  `                   	Eric Valette
 /--   __  o _.          	6 rue Paul Le Flem
(___, / (_(_(__         	35740 Pace

Tel: +33 (0)2 99 85 26 76	Fax: +33 (0)2 99 85 26 76
E-mail: [email protected]
drivers/usb/net/rtl8150.c renamed from drivers/usb/net/rtl8150.c-2.6.9-rc1-mm4.orig +1 -1
@@ -341,7 +341,7 @@
 
 static int rtl8150_reset(rtl8150_t * dev)
 {
-	u8 data = 0x11;
+	u8 data = 0x10;
 	int i = HZ;
 
 	set_registers(dev, CR, 1, &data);
#10 lore raw

Re: rtl8150.c ethernet driver : usb_unlink_urb ->usb_kill_urb

Quoted 8 lines · Eric Valette
Quoted 3 lines

I'll defer to Petkan as to what to do about this, as he sent me that patch for a good reason I imagine :)

While we are looking at this driver, here is a way to avoid one full page of annoying messages at shutdown/module unload.

Wrong patch, sorry...

Signature · 7 lines
   __
  /  `                   	Eric Valette
 /--   __  o _.          	6 rue Paul Le Flem
(___, / (_(_(__         	35740 Pace

Tel: +33 (0)2 99 85 26 76	Fax: +33 (0)2 99 85 26 76
E-mail: [email protected]
drivers/usb/net/rtl8150.c renamed from drivers/usb/net/rtl8150.c-2.6.9-rc1-mm4.orig +6 -6
@@ -341,7 +341,7 @@
 
 static int rtl8150_reset(rtl8150_t * dev)
 {
-	u8 data = 0x11;
+	u8 data = 0x10;
 	int i = HZ;
 
 	set_registers(dev, CR, 1, &data);
@@ -389,10 +389,10 @@
 
 static void unlink_all_urbs(rtl8150_t * dev)
 {
-	usb_unlink_urb(dev->rx_urb);
-	usb_unlink_urb(dev->tx_urb);
-	usb_unlink_urb(dev->intr_urb);
-	usb_unlink_urb(dev->ctrl_urb);
+	usb_kill_urb(dev->rx_urb);
+	usb_kill_urb(dev->tx_urb);
+	usb_kill_urb(dev->intr_urb);
+	usb_kill_urb(dev->ctrl_urb);
 }
 
 static inline struct sk_buff *pull_skb(rtl8150_t *dev)
@@ -656,7 +656,7 @@
 	rtl8150_t *dev = netdev_priv(netdev);
 	warn("%s: Tx timeout.", netdev->name);
 	dev->tx_urb->transfer_flags |= URB_ASYNC_UNLINK;
-	usb_unlink_urb(dev->tx_urb);
+	usb_kill_urb(dev->tx_urb);
 	dev->stats.tx_errors++;
 }
 
Applied
#11 lore raw

Re: rtl8150.c ethernet driver : usb_unlink_urb ->usb_kill_urb

Quoted 6 lines · Eric Valette
Quoted 5 lines · Eric Valette
Quoted 3 lines

I'll defer to Petkan as to what to do about this, as he sent me that patch for a good reason I imagine :)

Quoted 6 lines
Quoted 4 lines

While we are looking at this driver, here is a way to avoid one full page of annoying messages at shutdown/module unload.

Wrong patch, sorry...

Applied, thanks.

greg k-h