Skip to contentSkip to conversation

CONFIG_USB_UHCI=y not possible?

Linux-ia64 John Hesterberg 4 participants 7 messages Feb 20, 2002 USB

lore
Share & tools
lore
#0 lore raw

When I try to change CONFIG_USB_UHCI from a module to static (=m to =y), I get:

drivers/usb/usbdrv.o: In function `alloc_uhci':
drivers/usb/usbdrv.o(.text.init+0x7e2): relocation truncated to fit: PCREL21B uhci_pci_remove

I don't see anything obvious (to me) with the disassembly:

     7e0:   11 60 01 40 00 21       [MIB]       mov r44=r32
     7e6:   00 00 00 02 00 00                   nop.i 0x0
     7ec:   08 00 00 50                         br.call.sptk.many b0~0 <alloc_uhci

It's see the same problem in a different kernel, with the same code at a different offset (0x672).

Anyone have any idea what's going on with this?

Also, I have some recollection seeing something that said that USB support has to be a module, maybe because it doesn't see the devices otherwise? Any truth to this?

Thanks,

John

#1 lore raw

John,

Quoted 8 lines · John Hesterberg

When I try to change CONFIG_USB_UHCI from a module to static (=m to =y), I get:

drivers/usb/usbdrv.o: In function `alloc_uhci':
drivers/usb/usbdrv.o(.text.init+0x7e2): relocation truncated to fit: PCREL21B uhci_pci_remove

I don't see anything obvious (to me) with the disassembly:

Quoted 9 lines
     7e0:   11 60 01 40 00 21       [MIB]       mov r44=r32
     7e6:   00 00 00 02 00 00                   nop.i 0x0
     7ec:   08 00 00 50                         br.call.sptk.many b0~0 <alloc_uhci

It's see the same problem in a different kernel, with the same code at a different offset (0x672).

Anyone have any idea what's going on with this?

Your kernel is too big (exceed range for relocation). You have to compile some subsystems as modules.

Signature · 1 line
-Stephane
#2 lore raw
In reply to John Hesterberg
Quoted 15 lines · Stephane Eranian

John,

Quoted 12 lines · John Hesterberg

When I try to change CONFIG_USB_UHCI from a module to static (=m to =y), I get:

drivers/usb/usbdrv.o: In function `alloc_uhci':
drivers/usb/usbdrv.o(.text.init+0x7e2): relocation truncated to fit: PCREL21B uhci_pci_remove

I don't see anything obvious (to me) with the disassembly:

     7e0:   11 60 01 40 00 21       [MIB]       mov r44=r32
     7e6:   00 00 00 02 00 00                   nop.i 0x0
     7ec:   08 00 00 50                         br.call.sptk.many b0~0 <alloc_uhci
Quoted 10 lines
Quoted 5 lines

It's see the same problem in a different kernel, with the same code at a different offset (0x672).

Anyone have any idea what's going on with this?

Your kernel is too big (exceed range for relocation). You have to compile some subsystems as modules.

Signature · 1 line
-Stephane

I don't think that's it. I've hit this problem with very different configurations, with other stuff turned on and off. It fails at this exact spot.

As Bill Nottingham noted, I think it's because the USB UHCI code is calling a init function from an exit function, or maybe vice versa. I'm guessing that some of the err handling code in alloc_uhci is somehow ending up calling uhci_pci_remove, which is defined as __devexit, which gets discarded by arch/ia64/vmlinux.lds.S. So I think I've almost connected the dots. :-)

John

#3 lore raw
In reply to John Hesterberg

John Hesterberg <[email protected]> writes:

|> As Bill Nottingham noted, I think it's because the USB UHCI code is
|> calling a init function from an exit function, or maybe vice versa.
|> I'm guessing that some of the err handling code in alloc_uhci is
|> somehow ending up calling uhci_pci_remove, which is defined as
|> __devexit, which gets discarded by arch/ia64/vmlinux.lds.S.  So I
|> think I've almost connected the dots. :-)

Yes, that has already been fixed in 2.4.18-rc1.

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#4 lore raw
In reply to John Hesterberg
Quoted 5 lines · John Hesterberg

When I try to change CONFIG_USB_UHCI from a module to static (=m to =y), I get:

drivers/usb/usbdrv.o: In function `alloc_uhci':
drivers/usb/usbdrv.o(.text.init+0x7e2): relocation truncated to fit: PCREL21B uhci_pci_remove

OK, I think this is because alloc_uhci() calls uhci_pci_remove(), which is defined as __devexit. This gets dropped when it's not a module.

Below is a quick patch if anyone is interested. I don't know if this is right or not, but it links.

I'll take this up with the USB maintainer(s).
Seems like if they allow CONFIG_USB_UHCI=y,
then this should be fixed.

John

drivers/usb/usb-uhci.c +2 -0
diff -Naur 2.4.17-sn2/drivers/usb/usb-uhci.c linux/drivers/usb/usb-uhci.c
@@ -3001,7 +3001,9 @@
 	s->irq = irq;
 
 	if(uhci_start_usb (s) < 0) {
+#if defined(MODULE) || defined(CONFIG_HOTPLUG)
 		uhci_pci_remove(dev);
+#endif
 		return -1;
 	}
 
#5 lore raw
In reply to John Hesterberg
Quoted 5 lines · John Hesterberg

OK, I think this is because alloc_uhci() calls uhci_pci_remove(), which is defined as __devexit. This gets dropped when it's not a module.

Below is a quick patch if anyone is interested. I don't know if this is right or not, but it links.

It's not the correct thing to do.

Quoted 1 line

I'll take this up with the USB maintainer(s).

I already know about it :)

Quoted 2 lines

Seems like if they allow CONFIG_USB_UHCI=y,
then this should be fixed.

It's been fixed for quite some time now in the 2.4.18-pre series. Grab 2.4.18-rc2 and let me know if you still have this problem.

thanks,

greg k-h

#6 lore raw
In reply to John Hesterberg

This is fixed in 2.4.18-pre2 (or earlier) by removing the __devexit on uhci_pci_remove. I wish I'd noticed that sooner. :-)

I'm done replying to my own mails now.

John

Quoted 37 lines · John Hesterberg
Quoted 5 lines · John Hesterberg

When I try to change CONFIG_USB_UHCI from a module to static (=m to =y), I get:

drivers/usb/usbdrv.o: In function `alloc_uhci':
drivers/usb/usbdrv.o(.text.init+0x7e2): relocation truncated to fit: PCREL21B uhci_pci_remove

OK, I think this is because alloc_uhci() calls uhci_pci_remove(), which is defined as __devexit. This gets dropped when it's not a module.

Below is a quick patch if anyone is interested. I don't know if this is right or not, but it links.

I'll take this up with the USB maintainer(s).
Seems like if they allow CONFIG_USB_UHCI=y,
then this should be fixed.

John

diff -Naur 2.4.17-sn2/drivers/usb/usb-uhci.c linux/drivers/usb/usb-uhci.c

drivers/usb/usb-uhci.c +2 -0
@@ -3001,7 +3001,9 @@
 	s->irq = irq;
 
 	if(uhci_start_usb (s) < 0) {
+#if defined(MODULE) || defined(CONFIG_HOTPLUG)
 		uhci_pci_remove(dev);
+#endif
 		return -1;
 	}
 

_______________________________________________
Linux-IA64 mailing list
[email protected]
http://lists.linuxia64.org/lists/listinfo/linux-ia64