corresponding patches to [RFC]

Russell King rmk at arm.linux.org.uk
Mon Jul 7 00:34:29 BST 2003


On Thu, Jun 12, 2003 at 09:47:51PM +0200, Dominik Brodowski wrote:
> Just a few changes to the RFC, the most important is that for static mapped
> sockets its now enough to do "echo 1 > /sys/.../settings/start" [once all
> other things are done properly, of course...]
> 
> 	Dominik
> 
> BTW: these changes are only released with the GPL v.2

Appologies for the delay in getting to this.

Can you clear the license change with David Hinds please?  I suspect that
without David saying "ok" to it, and maybe asking for us to change the
MAINTAINERS entry, Linus may not accept the patch.

Similarly, I think David needs to be asked whether he wants his name and
email address to continue to appear in the MODULE_AUTHOR tag.

> +static struct kobj_type ktype_pcmcia_settings = {
> +	.sysfs_ops	= &sysfs_ops,
> +	.default_attrs	= default_attrs,
> +};
> +
> +static struct kobject pcmcia_settings_kobj = {
> +	.name = "settings",
> +	.parent = &pcmcia_bus_type.subsys.kset.kobj,
> +	.ktype = &ktype_pcmcia_settings,
> +};
> +
> +
> +/*====================================================================*/
> +

Hmm, this is adding attributes to the "pcmcia" bus, placing them in
a directory called /sysfs/bus/pcmcia/settings ?

Is there a reason why these can't just place them directly into the
pcmcia bus directory?

I'm also slightly worried about the lifetime of the pcmcia_bus object.
Although bus_unregister() makes it disappear from the sysfs tree, any
references to that object and any sub-object will cause other code in
the kernel to keep a reference to the pcmcia_bus_type, which gets
really messy when the module whose storage it was using has long
since gone.

Don't worry, its not only pcmcia with this problem - USB sufferes
similarly from it.  I don't think there's an easy solution for the
users; in other words, its a device model problem.

>  static int __devinit pcmcia_bus_add_socket(struct class_device *class_dev)
>  {
>  	struct pcmcia_socket *socket = class_dev->class_data;
> @@ -936,6 +1156,7 @@
>  
>  	bus_register(&pcmcia_bus_type);
>  	class_interface_register(&pcmcia_bus_interface);
> +	kobject_register(&pcmcia_settings_kobj);
>  
>  	/* Set up character device for user mode clients */
>  	i = register_chrdev(0, "pcmcia", &ds_fops);
> @@ -970,6 +1191,7 @@
>  	if (major_dev != -1)
>  		unregister_chrdev(major_dev, "pcmcia");
>  
> +	kobject_unregister(&pcmcia_settings_kobj);
>  	bus_unregister(&pcmcia_bus_type);
>  }
>  module_exit(exit_pcmcia_bus);

-- 
Russell King (rmk at arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html




More information about the linux-pcmcia mailing list