Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Ming Lei
Generally, system resources should be configured as disabled at default, and for drivers, the correct usage should be only requesting and enabling the resources just in need, then the sort of 'cleanup' things can be avoided. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line

Re: [PATCH 1/3] firmware: Avoid superfluous usermodehelper lock

2013-05-09 Thread Ming Lei
On Fri, May 10, 2013 at 1:04 AM, Takashi Iwai wrote: > At Thu, 9 May 2013 16:43:28 +0800, > Ming Lei wrote: >> >> On Thu, May 9, 2013 at 3:31 PM, Takashi Iwai wrote: >> > At Thu, 9 May 2013 09:25:35 +0800, >> > Ming Lei wrote: >> >> >>

x86_mce: mce_start uses number of phsical cores instead of logical cores

2013-05-10 Thread Ming Lei
I found this bug in my edac testing on intel 56xx motherboard. I did mce-inject test on AMD 64 CPU also. Thanks Subject: [PATCH] mce_start times out waiting for the logical cores which have never received the mce broadcast. It can potentially turn non fatal mce exception into kernel panic com

[Bug] ARM 'perf' regression by commit a43cb95d5

2013-05-16 Thread Ming Lei
print_info(KERN_DEFAULT); + //show_regs_print_info(KERN_DEFAULT); Looks a bit weird, anyone can give a hint? Thanks, -- Ming Lei [1], 'perf top' mistaken output Samples: 17K of event 'cpu-clock', Event count (approx.): 3516532661 97.51% [smsc95xx][k] 0x

Re: [Bug] ARM 'perf' regression by commit a43cb95d5

2013-05-16 Thread Ming Lei
On Fri, May 17, 2013 at 10:16 AM, Ming Lei wrote: > diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c > index f219703..89bc3a4 100644 > --- a/arch/arm/kernel/process.c > +++ b/arch/arm/kernel/process.c > @@ -225,7 +225,7 @@ void __show_regs(struc

Re: [Bug] ARM 'perf' regression by commit a43cb95d5

2013-05-17 Thread Ming Lei
o persue this, I guess other obvious questions are: which kernel > are you running? Does this affect multiple architectures (your diff only Either 3.10-rc1 or today's -next tree(3.10.0-rc1-next-20130516). > changes ARM)? What's the workload which you are profiling? I only tested i

Re: [Bug] ARM 'perf' regression by commit a43cb95d5

2013-05-17 Thread Ming Lei
; We need an apples-for-apples comparison if you think there's a bug in the > kernel. Can you try profiling hackbench or something? > >> Or could anyone else try to verify the problem on their own environment? > > How are you running perf top? sudo perf top Thanks -- Ming

Re: [Bug] ARM 'perf' regression by commit a43cb95d5

2013-05-17 Thread Ming Lei
On Fri, May 17, 2013 at 5:54 PM, Will Deacon wrote: > On Fri, May 17, 2013 at 10:48:23AM +0100, Ming Lei wrote: >> On Fri, May 17, 2013 at 5:36 PM, Will Deacon wrote: >> > >> > It's probably easier if you choose a workload, otherwise it's difficult to &

Re: [Consult] Why need we call device_remove_file() firstly before call device_unregister() ?

2013-05-18 Thread Ming Lei
> device_unregister(), is it correct ? Looks it is correct but it is a bit implicit. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH 0/3] firmware: Fix usermodehelper deadlock at shutdown

2013-05-21 Thread Ming Lei
fix the firmware loader side, at least, not to >> stall during shutdown. > > What's the status of these? Ming, still have objections? I have no objections now, but Takashi need to submit v2 to fix one mistake which may break current firmware cache. Thanks, -- Ming Lei -- To unsub

Re: [ANNOUNCE] ktap 0.1 released

2013-05-21 Thread Ming Lei
@@@ 70 sys_enter_select |@ 49 sys_enter_read | 25 sys_enter_write | 22 sys_enter_clock_gettime |@@@ 19 sys_enter_ioctl |@ 6 sys_enter_gettimeofday | 4 sys_enter_munmap | 3

Re: [ANNOUNCE] ktap 0.1 released

2013-05-21 Thread Ming Lei
On Wed, May 22, 2013 at 12:15 PM, Ming Lei wrote: > On Tue, May 21, 2013 at 11:56 AM, zhangwei(Jovi) > > Nice job, I have run it on ARM already with only one line change. > > But looks 'Control-C' can't stop the tracing or need some time to complete it, > see b

Re: [ANNOUNCE] ktap 0.1 released

2013-05-21 Thread Ming Lei
On Wed, May 22, 2013 at 12:19 PM, Ming Lei wrote: > On Wed, May 22, 2013 at 12:15 PM, Ming Lei wrote: >> On Tue, May 21, 2013 at 11:56 AM, zhangwei(Jovi) >> >> Nice job, I have run it on ARM already with only one line change. >> >> But looks 'Control-C

Re: [PATCH v2 2/2] firmware: Avoid deadlock of usermodehelper lock at shutdown

2013-05-22 Thread Ming Lei
isters a > reboot notifier so that it can abort all pending f/w bufs before > issuing usermodehelper_disable(). > > Signed-off-by: Takashi Iwai Acked-by: Ming Lei thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a

Re: microcode loading got really slow.

2013-05-23 Thread Ming Lei
ed to set that option, so I'm not bothered > if there's an actual bug here or not, but the behaviour seems odd. If the option isn't set, the firmware will be lost for the requested CPU, :-) Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe lin

Re: microcode loading got really slow.

2013-05-23 Thread Ming Lei
it has been already there, wrt. this problem, I think we need to know why the direct loading is failed. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: microcode loading got really slow.

2013-05-23 Thread Ming Lei
equested f/w file doesn't exist. > And it's fine, because the microcode update is an optional operation. > If no f/w file is found, it's not handled as an error. It just means > that no need to update, continuing to work. OK, as said above, the example is very specific, and might b

Re: microcode loading got really slow.

2013-05-23 Thread Ming Lei
On Thu, May 23, 2013 at 8:05 PM, Takashi Iwai wrote: > At Thu, 23 May 2013 18:45:29 +0800, > Ming Lei wrote: >> >> On Thu, May 23, 2013 at 6:36 PM, Takashi Iwai wrote: >> > >> > No, f/w loader always fall back to user mode helper, as long as its >>

Re: microcode loading got really slow.

2013-05-23 Thread Ming Lei
On Thu, May 23, 2013 at 9:21 PM, Takashi Iwai wrote: > At Thu, 23 May 2013 21:04:53 +0800, > Ming Lei wrote: >> >> On Thu, May 23, 2013 at 8:05 PM, Takashi Iwai wrote: >> > At Thu, 23 May 2013 18:45:29 +0800, >> > Ming Lei wrote: >> >> >> &

Re: microcode loading got really slow.

2013-05-23 Thread Ming Lei
On Thu, May 23, 2013 at 10:36 PM, Takashi Iwai wrote: > At Thu, 23 May 2013 22:28:51 +0800, > Ming Lei wrote: >> >> On Thu, May 23, 2013 at 9:21 PM, Takashi Iwai wrote: >> > At Thu, 23 May 2013 21:04:53 +0800, >> > Ming Lei wrote: >> >> >> &

Re: microcode loading got really slow.

2013-05-23 Thread Ming Lei
is falls back to user helper > mode, and now you're seeing the problem. The problem is that if driver call request_firmware(), it means it need the firmware and it know there should be one. So maybe the driver shouldn't call request_firmware() if it can figure out that case. > S

[PATCH 0/2] firmware loader: avoid blocking suspend by !uevent requests

2013-05-27 Thread Ming Lei
Iwai's patch of "firmware: Avoid deadlock of usermodehelper lock at shutdown". Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/m

[PATCH 1/2] driver core: firmware loader: don't cache FW_ACTION_NOHOTPLUG firmware

2013-05-27 Thread Ming Lei
t hit in direct loading too. Cc: Takashi Iwai Signed-off-by: Ming Lei --- drivers/base/firmware_class.c |9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index e650c25..64e7870 100644 --- a/drivers/base/f

[PATCH 2/2] driver core: firmware loader: kill FW_ACTION_NOHOTPLUG requests before suspend

2013-05-27 Thread Ming Lei
This patch kills the firmware loading requests of FW_ACTION_NOHOTPLUG before suspend to avoid blocking suspend because there is no timeout for these requests. Cc: Takashi Iwai Signed-off-by: Ming Lei --- This patch depends on Takashi Iwai's patch of "firmware: Avoid deadlock of user

Re: [PATCH 1/2] driver core: firmware loader: don't cache FW_ACTION_NOHOTPLUG firmware

2013-05-27 Thread Ming Lei
On Mon, May 27, 2013 at 8:40 PM, anish singh wrote: > On Mon, May 27, 2013 at 5:53 PM, Takashi Iwai wrote: >> At Mon, 27 May 2013 17:26:22 +0530, >> anish singh wrote: >>> >>> On Mon, May 27, 2013 at 4:00 PM, Ming Lei wrote: >>> > Generally there ar

[RFC PATCH 0/2] dma-unmap: allow to only unmap completed DMA buffer

2013-05-27 Thread Ming Lei
observed on ARMv7(Pandaboard) with the chage, at average ~25us is saved about ehci irq handling under usbnet ping test case. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordo

[RFC PATCH 1/2] dma-debug: allow size to become smaller in dma_unmap

2013-05-27 Thread Ming Lei
ctual completed buffer should be more efficient. Considered that unmapping is often called in hard irq context, time of irq handling can be saved. Cc: Shuah Khan Cc: Joerg Roedel Cc: Andrew Morton Cc: Alexander Duyck Cc: Konrad Rzeszutek Wilk Signed-off-by: Ming Lei --- lib/dma-debug.c |

[PATCH 2/2] USB: hcd: only unmap the actual completed DMA buffer

2013-05-27 Thread Ming Lei
: #ping -f -s 1472 IP_A - compute ehci interrupt handling time on Pandaboard during ping test Cc: Alan Stern Signed-off-by: Ming Lei --- drivers/usb/core/hcd.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/core/hcd.c b/drivers/usb

Re: [Bug] ARM 'perf' regression by commit a43cb95d5

2013-05-28 Thread Ming Lei
). It isn't related with perf tool. Finally, looks the problem disappeared after upgrading gcc to "gcc version 4.7.3 (Sourcery CodeBench Lite 2013.05-24)" from "gcc version 4.5.1 (Sourcery G++ Lite 2010.09-50)", so it should be caused by compiler. Thanks, -- Ming Lei --

Re: linux-next: build failure after merge of the usb tree

2013-03-26 Thread Ming Lei
e or 3.10, a revert commit is required. We know it is a problem, sorry, :-( Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH] sysfs: fix use after free in case of concurrent read/write and readdir

2013-04-01 Thread Ming Lei
st code on the link: https://patchwork.kernel.org/patch/2160771/ This patch fixes the use after free under this situation. Cc: Reported-by: Li Zefan Signed-off-by: Ming Lei --- fs/sysfs/dir.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/fs/sys

[RFC PATCH] ARM: keep __my_cpu_offset consistent with generic one

2013-03-06 Thread Ming Lei
efore setup_arch(), and enabling CONFIG_LOCK_STAT or CONFIG_DEBUG_LOCKDEP can trigger kernel hang. Cc: Tejun Heo Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Rob Herring Cc: Will Deacon Cc: Nicolas Pitre Cc: Russell King Signed-off-by: Ming Lei --- arch/arm/kernel/setup.c |7 +++ 1

Re: [RFC PATCH] ARM: keep __my_cpu_offset consistent with generic one

2013-03-06 Thread Ming Lei
ore cpu_init() called inside setup_arch(). Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

[PATCH v1] ARM: keep __my_cpu_offset consistent with generic one

2013-03-07 Thread Ming Lei
ccessed by lockdep before setup_arch(), and enabling CONFIG_LOCK_STAT or CONFIG_DEBUG_LOCKDEP can trigger kernel hang. Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Rob Herring Cc: Will Deacon Cc: Nicolas Pitre Cc: Russell King Signed-off-by: Ming Lei --- V1: - documents lockdep uses percp

Re: kernel BUG at fs/sysfs/group.c:65!

2013-03-09 Thread Ming Lei
((err = device_add(ddev))) + return err; if (!sysfs_deprecated) { err = sysfs_create_link(block_depr, &ddev->kobj, kobject_name(&ddev->kobj)); if (err) { device_del(ddev); - return; + return err; } } @@ -566,6 +566,7 @@ exit: while ((part = disk_part_iter_next(&piter))) kobject_uevent(&part_to_dev(part)->kobj, KOBJ_ADD); disk_part_iter_exit(&piter); + return 0; } /** @@ -613,7 +614,11 @@ void add_disk(struct gendisk *disk) blk_register_region(disk_devt(disk), disk->minors, NULL, exact_match, exact_lock, disk); - register_disk(disk); + retval = register_disk(disk); + if (retval) { + WARN_ON(retval); + return; + } blk_register_queue(disk); /* Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

[PATCH] atomic: improve atomic_inc_unless_negative/atomic_dec_unless_positive

2013-03-09 Thread Ming Lei
m a bit. Cc: Andrew Morton Cc: Shaohua Li Cc: Al Viro Signed-off-by: Ming Lei --- include/linux/atomic.h | 28 ++-- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/include/linux/atomic.h b/include/linux/atomic.h index 5b08a85..aa951d8 100644 --- a/includ

Re: kernel BUG at fs/sysfs/group.c:65!

2013-03-10 Thread Ming Lei
68] > [watchdog] kernel became tainted! Last seed was 2579687274 Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH] usb/core/devio.c: Don't use GFP_KERNEL while we cannot reset a storage device

2013-03-11 Thread Ming Lei
ice() from usbdev_do_ioctl(). I am wondering why the device lock is needed for usbdev_do_ioctl()? Looks device lock isn't required for USB transfer of kernel driver. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a messa

Re: [PATCH] usb/core/devio.c: Don't use GFP_KERNEL while we cannot reset a storage device

2013-03-11 Thread Ming Lei
we need to hold device lock in submitting URB path? Device lock isn't required before submitting URBs in kernel driver. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More major

Re: [PATCH] usb/core/devio.c: Don't use GFP_KERNEL while we cannot reset a storage device

2013-03-11 Thread Ming Lei
On Tue, Mar 12, 2013 at 12:08 AM, Alan Stern wrote: > On Mon, 11 Mar 2013, Ming Lei wrote: > >> On Mon, Mar 11, 2013 at 11:32 PM, Alan Stern >> wrote: >> > >> > Of course you have to lock the device before changing its driver. What >> > would happ

Re: [PATCH] atomic: improve atomic_inc_unless_negative/atomic_dec_unless_positive

2013-03-11 Thread Ming Lei
On Tue, Mar 12, 2013 at 7:59 AM, Frederic Weisbecker wrote: > 2013/3/9 Ming Lei : >> Generally, both atomic_inc_unless_negative() and >> atomic_dec_unless_positive() need at least two atomic_cmpxchg() >> to complete the atomic operation. In fact, the 1st atomic_cmpxchg() &g

Re: [PATCH v1] ARM: keep __my_cpu_offset consistent with generic one

2013-03-11 Thread Ming Lei
On Thu, Mar 7, 2013 at 9:35 PM, Ming Lei wrote: > Commit 14318efb(ARM: 7587/1: implement optimized percpu variable access) > introduces arm's __my_cpu_offset to optimize percpu vaiable access, > which really works well on hackbench, but will cause __my_cpu_offset > to return gar

Re: [PATCH] atomic: improve atomic_inc_unless_negative/atomic_dec_unless_positive

2013-03-11 Thread Ming Lei
) around atomic_read() can guarantee that too. Andrew, please ignore the patch, thanks. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [RFC PATCH 06/13] driver core: firmware loader: always let firmware_buf own the pages buffer

2012-08-03 Thread Ming Lei
On Wed, Jul 25, 2012 at 10:37 PM, Borislav Petkov wrote: > On Wed, Jul 25, 2012 at 01:00:06AM +0800, Ming Lei wrote: >> @@ -213,13 +291,8 @@ static ssize_t firmware_loading_show(struct device *dev, >> /* firmware holds the ownership of pages */ >> static void firmware_f

[RFC PATCH v1 00/15] firmware loader: introduce cache/uncache firmware

2012-08-03 Thread Ming Lei
| 15 + 6 files changed, 747 insertions(+), 116 deletions(-) Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

[RFC PATCH v1 01/15] firmware loader: simplify pages ownership transfer

2012-08-03 Thread Ming Lei
cycle. In fact, this patch fixes one bug: if writing data into firmware loader device is bypassed between writting 1 and 0 to 'loading', OOPS will be triggered without the patch. Also handle the vmap failure case, and add some comments to make code more readable. Signed-off-by: Ming Le

[RFC PATCH v1 02/15] firmware loader: fix races during loading firmware

2012-08-03 Thread Ming Lei
mutex_lock(&fw_lock), and 'echo 1 > loading' still may happen during the period, so this patch checks FW_STATUS_DONE to prevent pages' buffer completed from being freed in firmware_loading_store. Signed-off-by: Ming Lei --- drivers/base/firmware_class.c | 20 ++

[RFC PATCH v1 04/15] firmware loader: fix creation failure of fw loader device

2012-08-03 Thread Ming Lei
oader device name to fix the problem since the following patches for caching firmware will make sure only one loading for same firmware is alllowd at the same time. Signed-off-by: Ming Lei --- drivers/base/firmware_class.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dr

[RFC PATCH v1 05/15] firmware loader: introduce firmware_buf

2012-08-03 Thread Ming Lei
This patch introduces struct firmware_buf to describe the buffer which holds the firmware data, which will make the following cache_firmware/uncache_firmware implemented easily. Signed-off-by: Ming Lei --- drivers/base/firmware_class.c | 180 +++-- 1 file

[RFC PATCH v1 06/15] firmware loader: always let firmware_buf own the pages buffer

2012-08-03 Thread Ming Lei
mage and its drivers call request_firmware concurrently. Signed-off-by: Ming Lei --- drivers/base/firmware_class.c | 240 + include/linux/firmware.h |3 + 2 files changed, 174 insertions(+), 69 deletions(-) diff --git a/drivers/base/firmware_cl

[RFC PATCH v1 07/15] firmware loader: introduce cache_firmware and uncache_firmware

2012-08-03 Thread Ming Lei
x27;t request firmware from user space. Signed-off-by: Ming Lei --- drivers/base/firmware_class.c | 100 + include/linux/firmware.h | 12 + 2 files changed, 104 insertions(+), 8 deletions(-) diff --git a/drivers/base/firmware_class.c b/drivers

[RFC PATCH v1 08/15] firmware loader: fix device lifetime

2012-08-03 Thread Ming Lei
constraint should be reasonable and can be satisfied. Also this patch holds the reference count of @device before schedule_work() in request_firmware_nowait() to avoid that the @device is released after request_firmware_nowait returns and before the worker function is scheduled. Signed-off-by: Ming Lei

[RFC PATCH v1 09/15] firmware loader: fix comments on request_firmware_nowait

2012-08-03 Thread Ming Lei
request_firmware_nowait is allowed to be called in atomic context now if @gfp is GFP_ATOMIC, so fix the obsolete comments and states which situations are suitable for using it. Signed-off-by: Ming Lei --- drivers/base/firmware_class.c | 10 +++--- 1 file changed, 7 insertions(+), 3

[RFC PATCH v1 10/15] firmware loader: store firmware name into devres list

2012-08-03 Thread Ming Lei
This patch will store firmware name into devres list of the device which is requesting firmware loading, so that we can implement auto cache and uncache firmware for devices in need. Signed-off-by: Ming Lei --- drivers/base/firmware_class.c | 64 + 1

[RFC PATCH v1 11/15] driver core: devres: introduce devres_for_each_res

2012-08-03 Thread Ming Lei
This patch introduces one devres API of devres_for_each_res so that the device's driver can iterate each resource it has interest in. The firmware loader will use the API to get each firmware name from the device instance. Signed-off-by: Ming Lei --- drivers/base/devres.c |

[RFC PATCH v1 12/15] firmware: introduce device_cache/uncache_fw_images

2012-08-03 Thread Ming Lei
The above helpers will be used to cache device firmware during system suspend/resume cycle in the following patches. Signed-off-by: Ming Lei --- drivers/base/firmware_class.c | 221 +++-- 1 file changed, 215 insertions(+), 6 deletions(-) diff --git a/drivers

[RFC PATCH v1 13/15] firmware loader: use small timeout for cache device firmware

2012-08-03 Thread Ming Lei
Because device_cache_fw_images only cache the firmware which has been loaded sucessfully at leat once, using a small loading timeout should be reasonable. Signed-off-by: Ming Lei --- drivers/base/firmware_class.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/base

[RFC PATCH v1 14/15] firmware loader: cache devices firmware during suspend/resume cycle

2012-08-03 Thread Ming Lei
ering suspend. Signed-off-by: Ming Lei --- drivers/base/firmware_class.c | 32 1 file changed, 32 insertions(+) diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 8ca0052..5bd2100 100644 --- a/drivers/base/firmware_class.c +++ b/drivers

[RFC PATCH v1 15/15] wireless: ath9k-htc: only load firmware in need

2012-08-03 Thread Ming Lei
suspend. Cc: linux-wirel...@vger.kernel.org Cc: "Luis R. Rodriguez" Cc: Jouni Malinen Cc: Vasanthakumar Thiagarajan Cc: Senthil Balasubramanian Cc: "John W. Linville" Signed-off-by: Ming Lei --- drivers/net/wireless/ath/ath9k/hif_usb.c | 34 --

[RFC PATCH v1 03/15] firmware loader: remove unnecessary wmb()

2012-08-03 Thread Ming Lei
The wmb() inside fw_load_abort is not necessary, since complete() and wait_on_completion() has implied one pair of memory barrier. Also wmb() isn't a correct usage, so just remove it. Signed-off-by: Ming Lei --- drivers/base/firmware_class.c |1 - 1 file changed, 1 deletion(-) diff

[PATCH] PM: save 8bytes in 'struct dev_pm_info'

2012-08-06 Thread Ming Lei
On ARMv7, sizeof(struct dev_pm_info) becomes 344Bytes from 352Bytes after applying the patch which only changes fields' order, so we can save 8bytes per device. Nothing in behaviour changed. GCC: gcc version 4.5.1 Signed-off-by: Ming Lei --- include/linux/pm.h | 22 +++-

Re: udev 182: response timeout for request_firmware in module_probe path

2012-08-23 Thread Ming Lei
Cc systemd-devel Hi, On Tue, Aug 21, 2012 at 1:34 PM, Ming Lei wrote: > Hi Kay, > > I found that udev 182 doesn't response for the request_firmware in > module_probe path until 30sec later after the 'ADD' event of firmware > device, but no such problem in udev17

Re: udev 182: response timeout for request_firmware in module_probe path

2012-08-23 Thread Ming Lei
On Thu, Aug 23, 2012 at 11:31 PM, Kay Sievers wrote: > On Thu, Aug 23, 2012 at 5:16 PM, Ming Lei wrote: >> On Tue, Aug 21, 2012 at 1:34 PM, Ming Lei wrote: > >>> I found that udev 182 doesn't response for the request_firmware in >>> module_probe path until 3

Re: udev 182: response timeout for request_firmware in module_probe path

2012-08-23 Thread Ming Lei
inside its .probe(), and maybe udev need to support the usage. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [BUG] Deferred probing in driver model is racy, resulting in lost probes

2012-09-15 Thread Ming Lei
: matched device spdif-dit with driver > spdif-dit > bus: 'platform': really_probe: probing driver spdif-dit with device spdif-dit > driver: 'spdif-dit': driver_bound: bound to device 'spdif-dit' > bus: 'platform': really_probe: bound device spdif

Re: [BUG] Deferred probing in driver model is racy, resulting in lost probes

2012-09-16 Thread Ming Lei
p;priv->knode_bus, &bus->p->klist_drivers); if (drv->bus->p->drivers_autoprobe) { error = driver_attach(drv); if (error) goto out_unregister; } - klist_add_tail(&priv->knode_bus, &bus->p->klist_dri

Re: [RFC PATCH v1 00/15] firmware loader: introduce cache/uncache firmware

2012-08-10 Thread Ming Lei
On Sat, Aug 4, 2012 at 12:01 PM, Ming Lei wrote: > Hi, > > In [1][2], the problem below has been discussed for some time: > > device's firmware may be lost during suspend/resume > cycle because device might be unplugged and plugged again > or

Re: lockdep trace from posix timers

2012-08-16 Thread Ming Lei
ete: timer = lock_timer(timer_id, &flags); - if (!timer) + if (!timer) { + read_unlock(&tasklist_lock); return -EINVAL; + } if (timer_delete_hook(timer) == TIMER_RETRY) { unlock_timer(timer, flags); goto retry_del

Re: [RFC] firmware load: defer request_firmware during early boot and resume

2012-07-20 Thread Ming Lei
CC guys who discussed the problem in the below link in Jan. : http://marc.info/?t=13252895602&r=10&w=2 On Fri, Jul 20, 2012 at 8:33 PM, Ming Lei wrote: > The RFC patch is just for discussing if the idea of deferring > request_firmware is doable for addressin

Re: [RFC] firmware load: defer request_firmware during early boot and resume

2012-07-21 Thread Ming Lei
On Sat, Jul 21, 2012 at 5:56 PM, Rafael J. Wysocki wrote: > On Saturday, July 21, 2012, Ming Lei wrote: >> CC guys who discussed the problem in the below link in Jan. : >> >> http://marc.info/?t=13252895602&r=10&w=2 >> >> On Fri, Jul 20, 2012

Re: [RFC] firmware load: defer request_firmware during early boot and resume

2012-07-21 Thread Ming Lei
Thanks for your so detailed comments. On Sun, Jul 22, 2012 at 1:31 AM, Linus Torvalds wrote: > On Fri, Jul 20, 2012 at 5:33 AM, Ming Lei wrote: >> The RFC patch is just for discussing if the idea of deferring >> request_firmware is doable for addressing the issue of >>

Re: [RFC] firmware load: defer request_firmware during early boot and resume

2012-07-21 Thread Ming Lei
On Sun, Jul 22, 2012 at 1:49 AM, Rafael J. Wysocki wrote: > On Friday, July 20, 2012, Ming Lei wrote: >> + if (system_state != SYSTEM_RUNNING) >> + return -EPROBE_DEFER; > > You can't just return here, _request_firmware_cleanup() has to be done

Re: [RFC] firmware load: defer request_firmware during early boot and resume

2012-07-21 Thread Ming Lei
On Sun, Jul 22, 2012 at 4:38 AM, Linus Torvalds wrote: > > I agree that this is a problem. At the same time, early boot has some > of the exact same problems as resume has, and I do wish that people > would ask themselves: "why do I try to load the firmware at early boot > time"? > > There is real

[RFC PATCH 00/13] firmware loader: introduce cache/uncache firmware

2012-07-24 Thread Ming Lei
to do it. [1]. http://marc.info/?t=13427879084&r=1&w=2 [2]. http://marc.info/?t=13252895602&r=10&w=2 [3]. http://marc.info/?l=linux-usb&m=132554118928398&w=2 Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in t

[RFC PATCH 01/13] driver core: firmware loader: simplify pages ownership transfer

2012-07-24 Thread Ming Lei
cycle. In fact, this patch fixes one bug: if writing data into firmware loader device is bypassed between writting 1 and 0 to 'loading', OOPS will be triggered without the patch. Also add some comments to make code more readable. Signed-off-by: Ming Lei --- drivers/base/fir

[RFC PATCH 02/13] driver core: firmware loader: fix races during loading firmware

2012-07-24 Thread Ming Lei
mutex_lock(&fw_lock), and 'echo 1 > loading' still may happen during the period, so this patch checks FW_STATUS_DONE to prevent pages' buffer completed from being freed in firmware_loading_store. Signed-off-by: Ming Lei --- drivers/base/firmware_class.c | 20 ++

[RFC PATCH 03/13] driver core: firmware loader: remove unnecessary wmb()

2012-07-24 Thread Ming Lei
The wmb() inside fw_load_abort is not necessary, since complete() and wait_on_completion() has implied one pair of memory barrier. Also wmb() isn't a correct usage, so just remove it. Signed-off-by: Ming Lei --- drivers/base/firmware_class.c |1 - 1 file changed, 1 deletion(-) diff

[RFC PATCH 05/13] driver core: firmware loader: introduce firmware_buf

2012-07-24 Thread Ming Lei
This patch introduces struct firmware_buf to describe the buffer which holds the firmware data, which will make the following cache_firmware/uncache_firmware implemented easily. Signed-off-by: Ming Lei --- drivers/base/firmware_class.c | 176 +++-- 1 file

[RFC PATCH 06/13] driver core: firmware loader: always let firmware_buf own the pages buffer

2012-07-24 Thread Ming Lei
oncurrently. Signed-off-by: Ming Lei --- drivers/base/firmware_class.c | 222 - include/linux/firmware.h |3 + 2 files changed, 157 insertions(+), 68 deletions(-) diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 986

[RFC PATCH 07/13] driver core: firmware loader: introduce cache_firmware and uncache_firmware

2012-07-24 Thread Ming Lei
x27;t request firmware from user space. Signed-off-by: Ming Lei --- drivers/base/firmware_class.c | 79 + include/linux/firmware.h | 12 +++ 2 files changed, 91 insertions(+) diff --git a/drivers/base/firmware_class.c b/drivers

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

2012-07-24 Thread Ming Lei
called in atomic context now, so fix the obsolete comments. Signed-off-by: Ming Lei --- drivers/base/firmware_class.c |9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 674cb11..540b2e1 100644 --- a

[RFC PATCH 09/13] driver core: firmware loader: store firmware name into devres list

2012-07-24 Thread Ming Lei
This patch will store firmware name into devres list of the device which is requesting firmware loading, so that we can implement auto cache firmware for devices in need. Signed-off-by: Ming Lei --- drivers/base/firmware_class.c | 66 + 1 file changed

[RFC PATCH 10/13] driver core: devres: introduce devres_for_each_res

2012-07-24 Thread Ming Lei
This patch introduces one devres API of devres_for_each_res so that the device's driver can iterate each resource it has interest in. The firmware loader will use the API to get each firmware name from the device instance. Signed-off-by: Ming Lei --- drivers/base/devres.c |

[RFC PATCH 11/13] driver core: firmware: introduce devices_cache/uncache_firmwares

2012-07-24 Thread Ming Lei
ached firmwares. The above helpers should be used to cache device firmwares during system suspend/resume cycle in the following patches. Signed-off-by: Ming Lei --- drivers/base/firmware_class.c | 236 +++-- 1 file changed, 230 insertions(+), 6 deletions(-) diff --

[RFC PATCH 12/13] driver core: firmware loader: use small timeout for cache device firmware

2012-07-24 Thread Ming Lei
Because device_cache_firmwares only cache the firmware which has been loaded sucessfully at leat once, using a small loading timeout should be OK. Signed-off-by: Ming Lei --- drivers/base/firmware_class.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/base

[RFC PATCH 13/13] driver core: firmware loader: cache devices firmware during suspend/resume cycle

2012-07-24 Thread Ming Lei
ering suspend. Signed-off-by: Ming Lei --- drivers/base/firmware_class.c | 32 1 file changed, 32 insertions(+) diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 0918b26..59384e0 100644 --- a/drivers/base/firmware_class.c +++ b/drivers

[RFC PATCH 04/13] driver core: firmware loader: fix creation failure of fw loader device

2012-07-24 Thread Ming Lei
oader device name to fix the problem since the following patches for caching firmware will make sure only one loading for same firmware is alllowd at the same time. Signed-off-by: Ming Lei --- drivers/base/firmware_class.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dr

Re: [RFC PATCH 00/13] firmware loader: introduce cache/uncache firmware

2012-07-24 Thread Ming Lei
On Wed, Jul 25, 2012 at 1:00 AM, Ming Lei wrote: > Hi, > > In [1][2], the problem below has been discussed for some time: > > device's firmware may be lost during suspend/resume > cycle because device is unplugged and plugged again > or device exp

[PATCH] driver core: free devres in device_release

2012-07-24 Thread Ming Lei
From: Ming Lei device_del can happen anytime, so once it happens, the devres of the device will be freed inside device_del, but drivers can't know it has been deleted and may still add resources into the device, so memory leak is caused. This patch moves the devres_release_all to fi

Re: [RFC PATCH 00/13] firmware loader: introduce cache/uncache firmware

2012-07-24 Thread Ming Lei
can't solve the isight camera problem after warm reset. But now, this specific problem can be solved easily by letting its driver defer probe. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger

Re: [RFC PATCH 01/13] driver core: firmware loader: simplify pages ownership transfer

2012-07-24 Thread Ming Lei
pages buffer should be dropped and return failure from request_firmware or the callback of request_firmware_nowait. I will fix it against this patch set if cache/uncache firmware can be accepted. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel&q

[PATCH] kernel/watchdog.c : fix smp_processor_id() warning

2012-07-24 Thread Ming Lei
+0x0/0x48) [ 168.260375] Enabling non-boot CPUs ... Signed-off-by: Ming Lei --- kernel/watchdog.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 69add8a..7ddb11b 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -623,7

Re: [RFC PATCH 00/13] firmware loader: introduce cache/uncache firmware

2012-07-25 Thread Ming Lei
__thaw_task(p); } while_each_thread(g, p); read_unlock(&tasklist_lock); usermodehelper_enable(); + /* let kthread see usermodehelper enabled flag */ + thaw_kernel_threads(); + schedule(); printk("done.\n"); }

Re: [RFC PATCH 00/13] firmware loader: introduce cache/uncache firmware

2012-07-25 Thread Ming Lei
purpose since - usermodehelper flag should be set/get as enabled after user space tasks have been waken up - no harm to thaw all user space tasks before thawing all kernel threads (there isn't any dependency about the thawing order) Thanks, -- Ming Lei -- To unsubscribe from this

Re: [RFC PATCH 00/13] firmware loader: introduce cache/uncache firmware

2012-07-25 Thread Ming Lei
On Wed, Jul 25, 2012 at 8:50 PM, Ming Lei wrote: > - no harm to thaw all user space tasks before thawing all kernel threads > (there isn't any dependency about the thawing order) Sorry, I mean there isn't any constraint about the order, but the 'dependency'

Re: [RFC PATCH 00/13] firmware loader: introduce cache/uncache firmware

2012-07-25 Thread Ming Lei
@@ void thaw_processes(void) > pm_freezing = false; > pm_nosig_freezing = false; > > + /* > +* User mode helper are available again (or will be, > +* modulo scheduling) > +*/ > + usermodehelper_enable(); This may wake up tasks earlier than befor

Re: [RFC PATCH 07/13] driver core: firmware loader: introduce cache_firmware and uncache_firmware

2012-07-25 Thread Ming Lei
On Wed, Jul 25, 2012 at 3:54 PM, Stephen Boyd wrote: > On 7/24/2012 10:00 AM, Ming Lei wrote: >> >> + >> +int cache_firmware(const char *name) >> +{ >> + return -ENOENT; >> +} >> + >> +int uncache_firmware(const char *name) >> +{

Re: [RFC PATCH 07/13] driver core: firmware loader: introduce cache_firmware and uncache_firmware

2012-07-25 Thread Ming Lei
kup_and_alloate_buf(). I will try to introduce __fw_lookup_buf and reuse it in both fw_lookup_and_alloate_buf and fw_lookup_buf. Also will fix the comments and code style you mentioned in -v1. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel"

Re: [RFC PATCH 05/13] driver core: firmware loader: introduce firmware_buf

2012-07-25 Thread Ming Lei
offset += page_cnt; >> count -= page_cnt; >> @@ -320,12 +334,13 @@ out: > > While you're at it, you can indent this "out:" label one space to the > right so that the diff can pick up the function name in the hunk tag > above instead of the labe

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

2012-07-25 Thread Ming Lei
Asynchronous variant of request_firmware() for user contexts where * it is not possible to sleep for long time. and maybe it should be changed to below: * Asynchronous variant of request_firmware() for user contexts where * it is not possible to sleep for long time or can't

<    1   2   3   4   5   6   7   8   9   10   >