From: Greg KH <greg@kroah.com>
To: Dmitry Torokhov <dtor_core@ameritech.net>
Cc: Dave Peterson <dsp@llnl.gov>, Al Viro <viro@ftp.linux.org.uk>,
Arjan van de Ven <arjan@infradead.org>,
dthompson@lnxi.com,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] EDAC: core EDAC support code
Date: Tue, 7 Mar 2006 17:33:04 -0800 [thread overview]
Message-ID: <20060308013304.GC24739@kroah.com> (raw)
In-Reply-To: <200603072003.42327.dtor_core@ameritech.net>
On Tue, Mar 07, 2006 at 08:03:41PM -0500, Dmitry Torokhov wrote:
> On Tuesday 07 March 2006 12:04, Greg KH wrote:
> > On Tue, Mar 07, 2006 at 08:47:44AM -0800, Dave Peterson wrote:
> > > Ok, how does this sound:
> > >
> > > - Modify EDAC so it uses kmalloc() to create the kobject.
> > > - Eliminate edac_memctrl_master_release(). Instead, use kfree() as
> > > the release method for the kobject. Here, it's important to use a
> > > function -outside- of EDAC as the release method since the core
> > > EDAC module may have been unloaded by the time the release method
> > > is called.
> >
> > No, if this happens then you are using the kobject incorrectly. How
> > could it be held if your module is unloaded? Don't you have the module
> > reference counting logic correct?
> >
>
> It is pretty hard to implement kobject handling correctly. Consider the
> following:
>
> rmmod device_driver < /sys/devices/pci0000:00/...../power/state
>
> for a driver that creates/destroys device objects.
I agree, that's one reason I really hate the "default" attributes :(
To do this "right" we need to make the attributes dynamically created
and the owner set to the proper module. I did that for the module core
code and it's on my todo list for the driver core too.
> Opening 'state' attribute will pin device structure into memory but will
> not increase _your_ module's refcount. It is nice if you have a subsystem
> core split from drivers code - then you can keep core module reference
> until device objects are gone and allow individual drivers be unloaded
> freely. But for single-module system it is pretty hard, that's why
> platform devices are popular.
They are popular for when you don't have a "bus", and rightfully so.
thanks,
greg k-h
next prev parent reply other threads:[~2006-03-08 1:33 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200601190414.k0J4EZCV021775@hera.kernel.org>
2006-03-05 10:18 ` [PATCH] EDAC: core EDAC support code Arjan van de Ven
2006-03-05 10:30 ` Arjan van de Ven
2006-03-06 18:14 ` Dave Peterson
2006-03-06 18:22 ` Randy.Dunlap
2006-03-07 17:03 ` Dave Peterson
2006-03-07 17:20 ` Greg KH
2006-03-08 0:29 ` Dave Peterson
2006-03-07 19:03 ` Arjan van de Ven
2006-03-07 19:05 ` Greg KH
2006-03-09 23:51 ` Dave Peterson
2006-03-10 0:02 ` Greg KH
2006-03-10 1:46 ` Dave Peterson
2006-03-10 7:36 ` Arjan van de Ven
2006-03-10 11:06 ` Tim Small
2006-03-10 11:40 ` Arjan van de Ven
2006-03-10 17:46 ` Dave Peterson
2006-03-10 17:58 ` Arjan van de Ven
2006-03-10 19:07 ` Dave Peterson
2006-03-10 19:33 ` Arjan van de Ven
2006-03-10 21:13 ` Dave Peterson
2006-03-10 21:23 ` Arjan van de Ven
2006-03-11 1:57 ` Dave Peterson
2006-03-11 7:18 ` Arjan van de Ven
2006-03-13 19:31 ` Dave Peterson
2006-03-06 19:52 ` Greg KH
2006-03-05 15:55 ` Greg KH
2006-03-05 16:24 ` Arjan van de Ven
2006-03-06 18:52 ` Dave Peterson
2006-03-06 19:53 ` Greg KH
2006-03-06 21:01 ` Dave Peterson
2006-03-06 21:07 ` Arjan van de Ven
2006-03-09 3:19 ` Dave Peterson
2006-03-09 3:44 ` Al Viro
2006-03-09 5:51 ` Greg KH
2006-03-06 21:32 ` Al Viro
2006-03-06 21:53 ` Greg KH
2006-03-06 22:24 ` Al Viro
2006-03-06 22:55 ` Greg KH
2006-03-07 10:41 ` Andrew Morton
2006-03-07 11:08 ` Al Viro
2006-03-08 2:46 ` Rusty Russell
2006-03-07 1:45 ` Dmitry Torokhov
2006-03-07 1:57 ` Greg KH
2006-03-07 2:10 ` Dmitry Torokhov
2006-03-07 16:47 ` Dave Peterson
2006-03-07 17:04 ` Greg KH
2006-03-07 17:06 ` Dave Peterson
2006-03-08 1:03 ` Dmitry Torokhov
2006-03-08 1:33 ` Greg KH [this message]
2006-03-10 0:44 Doug Thompson
-- strict thread matches above, loose matches on Subject: below --
2006-03-10 16:56 Doug Thompson
2006-03-10 17:11 ` Arjan van de Ven
2006-03-10 17:28 Doug Thompson
2006-03-10 20:37 Doug Thompson
2006-03-11 17:04 Doug Thompson
2006-03-13 19:35 ` Dave Peterson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060308013304.GC24739@kroah.com \
--to=greg@kroah.com \
--cc=arjan@infradead.org \
--cc=dsp@llnl.gov \
--cc=dthompson@lnxi.com \
--cc=dtor_core@ameritech.net \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@ftp.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox