public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] CONFIG_USB_UHCI=y not possible?
@ 2002-02-20 15:50 John Hesterberg
  2002-02-20 16:09 ` Stephane Eranian
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: John Hesterberg @ 2002-02-20 15:50 UTC (permalink / raw)
  To: linux-ia64

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Linux-ia64] CONFIG_USB_UHCI=y not possible?
  2002-02-20 15:50 [Linux-ia64] CONFIG_USB_UHCI=y not possible? John Hesterberg
@ 2002-02-20 16:09 ` Stephane Eranian
  2002-02-20 16:48 ` John Hesterberg
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Stephane Eranian @ 2002-02-20 16:09 UTC (permalink / raw)
  To: linux-ia64

John,

On Wed, Feb 20, 2002 at 09:50:38AM -0600, John Hesterberg wrote:
> 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?
> 
Your kernel is too big (exceed range for relocation). You have to compile some subsystems as modules.

-- 

-Stephane


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Linux-ia64] CONFIG_USB_UHCI=y not possible?
  2002-02-20 15:50 [Linux-ia64] CONFIG_USB_UHCI=y not possible? John Hesterberg
  2002-02-20 16:09 ` Stephane Eranian
@ 2002-02-20 16:48 ` John Hesterberg
  2002-02-20 17:02 ` Andreas Schwab
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: John Hesterberg @ 2002-02-20 16:48 UTC (permalink / raw)
  To: linux-ia64

On Wed, Feb 20, 2002 at 08:09:55AM -0800, Stephane Eranian wrote:
> John,
> 
> On Wed, Feb 20, 2002 at 09:50:38AM -0600, John Hesterberg wrote:
> > 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?
> > 
> Your kernel is too big (exceed range for relocation). You have to compile some subsystems as modules.
> 
> -- 
> 
> -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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Linux-ia64] CONFIG_USB_UHCI=y not possible?
  2002-02-20 15:50 [Linux-ia64] CONFIG_USB_UHCI=y not possible? John Hesterberg
  2002-02-20 16:09 ` Stephane Eranian
  2002-02-20 16:48 ` John Hesterberg
@ 2002-02-20 17:02 ` Andreas Schwab
  2002-02-20 17:14 ` John Hesterberg
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Andreas Schwab @ 2002-02-20 17:02 UTC (permalink / raw)
  To: linux-ia64

John Hesterberg <jh@sgi.com> 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.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
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."


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Linux-ia64] CONFIG_USB_UHCI=y not possible?
  2002-02-20 15:50 [Linux-ia64] CONFIG_USB_UHCI=y not possible? John Hesterberg
                   ` (2 preceding siblings ...)
  2002-02-20 17:02 ` Andreas Schwab
@ 2002-02-20 17:14 ` John Hesterberg
  2002-02-20 17:26 ` Greg KH
  2002-02-20 17:28 ` John Hesterberg
  5 siblings, 0 replies; 7+ messages in thread
From: John Hesterberg @ 2002-02-20 17:14 UTC (permalink / raw)
  To: linux-ia64

On Wed, Feb 20, 2002 at 09:50:38AM -0600, John Hesterberg wrote:
> 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
--- 2.4.17-sn2/drivers/usb/usb-uhci.c	Wed Feb 20 17:11:49 2002
+++ linux/drivers/usb/usb-uhci.c	Wed Feb 20 17:03:53 2002
@@ -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;
 	}
 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Linux-ia64] CONFIG_USB_UHCI=y not possible?
  2002-02-20 15:50 [Linux-ia64] CONFIG_USB_UHCI=y not possible? John Hesterberg
                   ` (3 preceding siblings ...)
  2002-02-20 17:14 ` John Hesterberg
@ 2002-02-20 17:26 ` Greg KH
  2002-02-20 17:28 ` John Hesterberg
  5 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2002-02-20 17:26 UTC (permalink / raw)
  To: linux-ia64

On Wed, Feb 20, 2002 at 11:14:24AM -0600, John Hesterberg wrote:
> 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.

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

I already know about it :)

> 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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Linux-ia64] CONFIG_USB_UHCI=y not possible?
  2002-02-20 15:50 [Linux-ia64] CONFIG_USB_UHCI=y not possible? John Hesterberg
                   ` (4 preceding siblings ...)
  2002-02-20 17:26 ` Greg KH
@ 2002-02-20 17:28 ` John Hesterberg
  5 siblings, 0 replies; 7+ messages in thread
From: John Hesterberg @ 2002-02-20 17:28 UTC (permalink / raw)
  To: linux-ia64

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

On Wed, Feb 20, 2002 at 11:14:24AM -0600, John Hesterberg wrote:
> On Wed, Feb 20, 2002 at 09:50:38AM -0600, John Hesterberg wrote:
> > 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
> --- 2.4.17-sn2/drivers/usb/usb-uhci.c	Wed Feb 20 17:11:49 2002
> +++ linux/drivers/usb/usb-uhci.c	Wed Feb 20 17:03:53 2002
> @@ -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
> Linux-IA64@linuxia64.org
> http://lists.linuxia64.org/lists/listinfo/linux-ia64


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-02-20 17:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-20 15:50 [Linux-ia64] CONFIG_USB_UHCI=y not possible? John Hesterberg
2002-02-20 16:09 ` Stephane Eranian
2002-02-20 16:48 ` John Hesterberg
2002-02-20 17:02 ` Andreas Schwab
2002-02-20 17:14 ` John Hesterberg
2002-02-20 17:26 ` Greg KH
2002-02-20 17:28 ` John Hesterberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox