Re: [linux-usb-devel] use of __devinit in st5481

2003-08-14 Thread Oliver Neukum

> > Dangerous yes, unless hotplug is enabled.  But hotplug should _always_ be 
> > enabled when USB support is present.
> 
> You just have to use __init, __devinit correctly 8)

Well, what exactly is correctly?
Is it correct to say that that drivers for hotpluggable hardware,
whose subsystem always allows hot addition and removal, have
no use for __devinit ?

Regards
Oliver



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] use of __devinit in st5481

2003-08-14 Thread Greg KH
On Wed, Aug 06, 2003 at 11:44:00AM -0400, Alan Stern wrote:
> On Wed, 6 Aug 2003, Soewono Effendi wrote:
> 
> > On Wed, 6 Aug 2003 10:47:15 -0400 (EDT)
> > "Alan Stern" <[EMAIL PROTECTED]> wrote:
> > 
> > > The upshot is that for USB, which is hotpluggable, __devinit and __devexit 
> > > are useless.  
> > 
> > useless -> danger! if usb modules are statically linked to kernel, since
> > the functions with __init are removed! unless __devinit is used and
> > hotplug is enabled.
> 
> Dangerous yes, unless hotplug is enabled.  But hotplug should _always_ be 
> enabled when USB support is present.

No, this is not necessary.  See my other message about why this is so.

I think it's time to just always enable CONFIG_HOTPLUG as it doesn't
really buy us much these days...

thanks,

greg k-h


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] use of __devinit in st5481

2003-08-14 Thread Greg KH
On Fri, Aug 08, 2003 at 01:16:12AM +0200, Oliver Neukum wrote:
> 
> > > Dangerous yes, unless hotplug is enabled.  But hotplug should _always_ be 
> > > enabled when USB support is present.
> > 
> > You just have to use __init, __devinit correctly 8)
> 
> Well, what exactly is correctly?
> Is it correct to say that that drivers for hotpluggable hardware,
> whose subsystem always allows hot addition and removal, have
> no use for __devinit ?

No.  Well maybe...  You have to be careful, but it can be used if you
need it to be.

I think I just need to stomp __devinit* out all together as it's been
used incorrectly too many times...

thanks,

greg k-h


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] use of __devinit in st5481

2003-08-14 Thread Greg KH
On Wed, Aug 06, 2003 at 03:28:01PM +0200, Oliver Neukum wrote:
> so it seems it doesn't hurt as USB is always hotpluggable. But I fail
> to see how it might help.

Not true, you can run USB devices just fine with CONFIG_HOTPLUG
disabled.

CONFIG_HOTPLUG only causes the following to happen:
- anything marked __devinit or __devinitdata will not be thrown
  into the __init or __initdata section of the linker (and will
  not be thrown away when the init sequence is over.)
- /sbin/hotplug will be called when a new device is found or
  removed from the system.


So USB drivers can use __init just fine in their module_init() section
if they want to.

But you CAN NOT mark the usb_device_id table as __devinitdata or
__initdata as that will be touched later on if a new USB device is
added, or if a new usb module is loaded.

This is why I had to go through and remove all of those instances in the
kernel tree a while ago, and why I just had to do it all for PCI
drivers, and why the PnP drivers were just changed.

So in the end, for USB drivers, __devinit* probably should not be used,
unless you _really_ know what you are doing (for PCI drivers it can be
ok at times, as pci hotplug and cardbus systems are not always used.)

Hope this helps,

greg k-h


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] use of __devinit in st5481

2003-08-14 Thread Soewono Effendi

> Thanks,
> so it seems it doesn't hurt as USB is always hotpluggable. But I fail to see
> how it might help.

As far as I understand, __init / __devinit is only relevant for device driver (codes) 
that are statically linked.
In the case of USB Device Driver (not usbcore / usbhost ), one should actually not use 
__init/__devinit, since USB probe can happen at any time, unless the device is 
"static", i.e., not unplugable (I don't know if this word does exist :) ).

best regards,
Soewono


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] use of __devinit in st5481

2003-08-14 Thread Soewono Effendi
Hi,

__init and __devinit are defined in linux/include/linux/init.h
There are some usefull hints in the file. __devinit is used mostly by HotPlug.

This might also help: Found in linux/init/main.c

...
static int init(void * unused)
{
...

/*
 * Ok, we have completed the initial bootup, and
 * we're essentially up and running. Get rid of the
 * initmem segments and start the user-mode stuff..
 */
free_initmem();

...
}
...

best regards,
Soewono

On Wed, 6 Aug 2003 13:24:19 +0200
"Oliver Neukum" <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> probe_st5481 calls functions which are marked __devinit. Is that legal?
> Could somebody enlighten me on when to use __devinit ?
> 
>   Regards
>   Oliver
> 
> 
> 
> ---
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
> ___
> [EMAIL PROTECTED]
> To unsubscribe, use the last form field at:
> https://lists.sourceforge.net/lists/listinfo/linux-usb-devel



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] use of __devinit in st5481

2003-08-14 Thread Alan Stern
On Wed, 6 Aug 2003, Soewono Effendi wrote:

> As far as I understand, __init / __devinit is only relevant for device
> driver (codes) that are statically linked. In the case of USB Device
> Driver (not usbcore / usbhost ), one should actually not use
> __init/__devinit, since USB probe can happen at any time, unless the
> device is "static", i.e., not unplugable (I don't know if this word does
> exist :) ).

>From Documentation/pci.txt:

Please mark the initialization and cleanup functions where appropriate
(the corresponding macros are defined in ):

__init  Initialization code. Thrown away after the driver
initializes.
__exit  Exit code. Ignored for non-modular drivers.
__devinit   Device initialization code. Identical to __init if
the kernel is not compiled with CONFIG_HOTPLUG, normal
function otherwise.
__devexit   The same for __exit.

Tips:
The module_init()/module_exit() functions (and all initialization
functions called only from these) should be marked __init/exit.
The struct pci_driver shouldn't be marked with any of these tags.
The ID table array should be marked __devinitdata.
The probe() and remove() functions (and all initialization
functions called only from these) should be marked __devinit/exit.
If you are sure the driver is not a hotplug driver then use only 
__init/exit __initdata/exitdata.

Pointers to functions marked as __devexit must be created using
__devexit_p(function_name).  That will generate the function
name or NULL if the __devexit function will be discarded.


The upshot is that for USB, which is hotpluggable, __devinit and __devexit 
are useless.  __init and __exit should be used for module initialization 
and removal routines, not for probing and disconnecting.

Alan Stern



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] use of __devinit in st5481

2003-08-14 Thread Greg KH
On Wed, Aug 06, 2003 at 08:35:06PM +0200, Oliver Neukum wrote:
> 
> > But you CAN NOT mark the usb_device_id table as __devinitdata or
> > __initdata as that will be touched later on if a new USB device is
> > added, or if a new usb module is loaded.
> 
> So these need to go.

Applied, thanks.

greg k-h


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] use of __devinit in st5481

2003-08-08 Thread Oliver Neukum

> But you CAN NOT mark the usb_device_id table as __devinitdata or
> __initdata as that will be touched later on if a new USB device is
> added, or if a new usb module is loaded.

So these need to go.

Regards
Oliver

You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.

===


[EMAIL PROTECTED], 2003-08-06 20:30:45+02:00, [EMAIL PROTECTED]
  - remove __devinit from anything called from probe()


 st5481_b.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff -Nru a/drivers/isdn/hisax/st5481_b.c b/drivers/isdn/hisax/st5481_b.c
--- a/drivers/isdn/hisax/st5481_b.c Wed Aug  6 20:32:04 2003
+++ b/drivers/isdn/hisax/st5481_b.c Wed Aug  6 20:32:04 2003
@@ -245,7 +245,7 @@
}
 }
 
-static int __devinit st5481_setup_b_out(struct st5481_bcs *bcs)
+static int st5481_setup_b_out(struct st5481_bcs *bcs)
 {
struct usb_device *dev = bcs->adapter->usb_dev;
struct usb_host_interface *altsetting;
@@ -279,7 +279,7 @@
st5481_release_isocpipes(b_out->urb);
 }
 
-int __devinit st5481_setup_b(struct st5481_bcs *bcs)
+int st5481_setup_b(struct st5481_bcs *bcs)
 {
int retval;
 

===


This BitKeeper patch contains the following changesets:
1.2155
## Wrapped with gzip_uu ##


begin 664 bkpatch26997
M'XL(`*5),3\``\5476^;[EMAIL PROTECTED];5&W52K7[EMAIL PROTECTED]<:L==F[G=L09W!K=)[EMAIL PROTECTED],G%Q
MU>6Z]FO=;;K*;]JUPQ9-X["@:"[EMAIL PROTECTED]@(-,,J$^
M/V3LW4XGD\6[][>?WRP(F<[EMAIL PROTECTED]^INV28O[X_H#W#-$
M2BF3R&5(9<\BSD5/0\QR%^9L&J^R,"9C0U='.O^=BF.$(>4"J>A#*;DD-T!]
M1J4$Y`%&`8;`,.&8"'F)+$&$IZGADH*'Y"V\O/]KHL"#5E?-7L-RF>M]69<6
M5FU305K?V:*LUZ#2[5;G8W+7-ID^OR"?P,[EMAIL PROTECTED],P?;[EMAIL PROTECTED]
M=A.4)J^#HC3IC\!8*2*ZS'SU([EMAIL PROTECTED](^4N$4,Z6R:2AB(4Y[EMAIL PROTECTED]/,?#8__;<,(LO
MX+7?A^4L-#\]EG_PY`T3$5#R<=R,36VIH*PM_&(UVG:[9;9L.GMN;-NI`Y(I
H`Z_http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] use of __devinit in st5481

2003-08-07 Thread Alan Cox
On Mer, 2003-08-06 at 16:44, Alan Stern wrote:
> > useless -> danger! if usb modules are statically linked to kernel, since
> > the functions with __init are removed! unless __devinit is used and
> > hotplug is enabled.

module __init code can be ejected too

> Dangerous yes, unless hotplug is enabled.  But hotplug should _always_ be 
> enabled when USB support is present.

You just have to use __init, __devinit correctly 8)



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] use of __devinit in st5481

2003-08-06 Thread Soewono Effendi
On Wed, 6 Aug 2003 10:47:15 -0400 (EDT)
"Alan Stern" <[EMAIL PROTECTED]> wrote:

> The upshot is that for USB, which is hotpluggable, __devinit and __devexit 
> are useless.  

useless -> danger! if usb modules are statically linked to kernel, since the functions 
with __init are removed! unless __devinit is used and hotplug is enabled.

best regards,
Soewono


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] use of __devinit in st5481

2003-08-06 Thread Oliver Neukum
Am Mittwoch, 6. August 2003 14:01 schrieb Soewono Effendi:
> Hi,
> 
> __init and __devinit are defined in linux/include/linux/init.h
> There are some usefull hints in the file. __devinit is used mostly by HotPlug.
> 
> This might also help: Found in linux/init/main.c
> 
> ...
> static int init(void * unused)
> {
>   ...
> 
> /*
>  * Ok, we have completed the initial bootup, and
>  * we're essentially up and running. Get rid of the
>  * initmem segments and start the user-mode stuff..
>  */
> free_initmem();
> 
>   ...
> }
> ...
> 
> best regards,
> Soewono

Thanks,
so it seems it doesn't hurt as USB is always hotpluggable. But I fail to see
how it might help.

Regards
Oliver



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] use of __devinit in st5481

2003-08-06 Thread Alan Stern
On Wed, 6 Aug 2003, Soewono Effendi wrote:

> On Wed, 6 Aug 2003 10:47:15 -0400 (EDT)
> "Alan Stern" <[EMAIL PROTECTED]> wrote:
> 
> > The upshot is that for USB, which is hotpluggable, __devinit and __devexit 
> > are useless.  
> 
> useless -> danger! if usb modules are statically linked to kernel, since
> the functions with __init are removed! unless __devinit is used and
> hotplug is enabled.

Dangerous yes, unless hotplug is enabled.  But hotplug should _always_ be 
enabled when USB support is present.

Alan Stern



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel