Re: [RFC PATCH 08/13] driver core: firmware loader: fix device lifetime

2012-07-28 Thread Ming Lei
On Fri, Jul 27, 2012 at 6:32 PM, Borislav Petkov wrote: > > I still don't like too much the "not possible to sleep for long time" > expression. > > Maybe change it to "should sleep for as small periods as possible since > it increases boot time of device drivers requesting firmware in their >

Re: [RFC PATCH 08/13] driver core: firmware loader: fix device lifetime

2012-07-28 Thread Ming Lei
On Fri, Jul 27, 2012 at 6:32 PM, Borislav Petkov b...@amd64.org wrote: I still don't like too much the not possible to sleep for long time expression. Maybe change it to should sleep for as small periods as possible since it increases boot time of device drivers requesting firmware in their

Re: [RFC PATCH 08/13] driver core: firmware loader: fix device lifetime

2012-07-27 Thread Borislav Petkov
On Fri, Jul 27, 2012 at 09:30:57AM +0800, Ming Lei wrote: > No, the comment above is misleading and not useless, and I think the below > is good: > > * Asynchronous variant of request_firmware() for user contexts where > * it is not possible to sleep for long time or can't sleep at

Re: [RFC PATCH 08/13] driver core: firmware loader: fix device lifetime

2012-07-27 Thread Borislav Petkov
On Fri, Jul 27, 2012 at 09:30:57AM +0800, Ming Lei wrote: No, the comment above is misleading and not useless, and I think the below is good: * Asynchronous variant of request_firmware() for user contexts where * it is not possible to sleep for long time or can't sleep at all,

Re: [RFC PATCH 08/13] driver core: firmware loader: fix device lifetime

2012-07-26 Thread Ming Lei
On Fri, Jul 27, 2012 at 1:46 AM, Borislav Petkov wrote: > On Thu, Jul 26, 2012 at 11:44:48PM +0800, Ming Lei wrote: >> On Thu, Jul 26, 2012 at 8:20 PM, Borislav Petkov wrote: >> > >> > Ok, here's what I got from looking at the patch: >> > >> > Your commit message says: "Also

Re: [RFC PATCH 08/13] driver core: firmware loader: fix device lifetime

2012-07-26 Thread Borislav Petkov
On Thu, Jul 26, 2012 at 11:44:48PM +0800, Ming Lei wrote: > On Thu, Jul 26, 2012 at 8:20 PM, Borislav Petkov wrote: > > > > Ok, here's what I got from looking at the patch: > > > > Your commit message says: "Also request_firmware_nowait should be called > > in atomic context now, so fix the

Re: [RFC PATCH 08/13] driver core: firmware loader: fix device lifetime

2012-07-26 Thread Ming Lei
On Thu, Jul 26, 2012 at 8:20 PM, Borislav Petkov wrote: > > Ok, here's what I got from looking at the patch: > > Your commit message says: "Also request_firmware_nowait should be called > in atomic context now, so fix the obsolete comments." > > Atomic context in my book means you're not allowed

Re: [RFC PATCH 08/13] driver core: firmware loader: fix device lifetime

2012-07-26 Thread Borislav Petkov
On Thu, Jul 26, 2012 at 10:59:08AM +0800, Ming Lei wrote: > On Thu, Jul 26, 2012 at 12:04 AM, Borislav Petkov wrote: > >> Also this patch holds the reference cound of @device before > > > > count > > Good catch, will fix it in -v1. > > > >> - * it is

Re: [RFC PATCH 08/13] driver core: firmware loader: fix device lifetime

2012-07-26 Thread Borislav Petkov
On Thu, Jul 26, 2012 at 10:59:08AM +0800, Ming Lei wrote: On Thu, Jul 26, 2012 at 12:04 AM, Borislav Petkov b...@amd64.org wrote: Also this patch holds the reference cound of @device before count Good catch, will fix it in -v1. - * it is

Re: [RFC PATCH 08/13] driver core: firmware loader: fix device lifetime

2012-07-26 Thread Ming Lei
On Thu, Jul 26, 2012 at 8:20 PM, Borislav Petkov b...@amd64.org wrote: Ok, here's what I got from looking at the patch: Your commit message says: Also request_firmware_nowait should be called in atomic context now, so fix the obsolete comments. Atomic context in my book means you're not

Re: [RFC PATCH 08/13] driver core: firmware loader: fix device lifetime

2012-07-26 Thread Borislav Petkov
On Thu, Jul 26, 2012 at 11:44:48PM +0800, Ming Lei wrote: On Thu, Jul 26, 2012 at 8:20 PM, Borislav Petkov b...@amd64.org wrote: Ok, here's what I got from looking at the patch: Your commit message says: Also request_firmware_nowait should be called in atomic context now, so fix the

Re: [RFC PATCH 08/13] driver core: firmware loader: fix device lifetime

2012-07-26 Thread Ming Lei
On Fri, Jul 27, 2012 at 1:46 AM, Borislav Petkov b...@amd64.org wrote: On Thu, Jul 26, 2012 at 11:44:48PM +0800, Ming Lei wrote: On Thu, Jul 26, 2012 at 8:20 PM, Borislav Petkov b...@amd64.org wrote: Ok, here's what I got from looking at the patch: Your commit message says: Also

Re: [RFC PATCH 08/13] driver core: firmware loader: fix device lifetime

2012-07-25 Thread Ming Lei
On Thu, Jul 26, 2012 at 12:04 AM, Borislav Petkov wrote: >> Also this patch holds the reference cound of @device before > > count Good catch, will fix it in -v1. >> - * it is not possible to sleep for long time. It can't be called >> - * in atomic

Re: [RFC PATCH 08/13] driver core: firmware loader: fix device lifetime

2012-07-25 Thread Borislav Petkov
On Wed, Jul 25, 2012 at 01:00:08AM +0800, Ming Lei wrote: > Callers of request_firmware* must hold the reference count of > @device, otherwise it is easy to trigger oops since the firmware > loader device is the child of @device. > > This patch adds comments about the usage. In fact, most of

Re: [RFC PATCH 08/13] driver core: firmware loader: fix device lifetime

2012-07-25 Thread Ming Lei
On Thu, Jul 26, 2012 at 12:04 AM, Borislav Petkov b...@amd64.org wrote: Also this patch holds the reference cound of @device before count Good catch, will fix it in -v1. - * it is not possible to sleep for long time. It can't be called - * in

Re: [RFC PATCH 08/13] driver core: firmware loader: fix device lifetime

2012-07-25 Thread Borislav Petkov
On Wed, Jul 25, 2012 at 01:00:08AM +0800, Ming Lei wrote: Callers of request_firmware* must hold the reference count of @device, otherwise it is easy to trigger oops since the firmware loader device is the child of @device. This patch adds comments about the usage. In fact, most of drivers

[RFC PATCH 08/13] driver core: firmware loader: fix device lifetime

2012-07-24 Thread Ming Lei
Callers of request_firmware* must hold the reference count of @device, otherwise it is easy to trigger oops since the firmware loader device is the child of @device. This patch adds comments about the usage. In fact, most of drivers call request_firmware* in its probe() or open(), so the

[RFC PATCH 08/13] driver core: firmware loader: fix device lifetime

2012-07-24 Thread Ming Lei
Callers of request_firmware* must hold the reference count of @device, otherwise it is easy to trigger oops since the firmware loader device is the child of @device. This patch adds comments about the usage. In fact, most of drivers call request_firmware* in its probe() or open(), so the