Sunday, February 28, 2010

linux.kernel - 26 new messages in 21 topics - digest

linux.kernel
http://groups.google.com/group/linux.kernel?hl=en

linux.kernel@googlegroups.com

Today's topics:

* bkl removal for 2.6.34 - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/dc6c09b3939dc512?hl=en
* Driver core: Reduce the level of request_firmware() messages - 1 messages, 1
author
http://groups.google.com/group/linux.kernel/t/ba1321736f5e0e2d?hl=en
* more lockdep-RCU and RCU_FAST_NO_HZ fixes - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/c78d0afc145c64ac?hl=en
* LED driver for the Soekris net5501 board. - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/484410bbbfae8034?hl=en
* fix MTD CFI/LPDDR flash driver huge latency bug - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/8d2447104528f745?hl=en
* workqueue: update cwq alignement - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/8c5a103d75939b99?hl=en
* atang tree: make SATA Asynchronous Notification work - 2 messages, 2 authors
http://groups.google.com/group/linux.kernel/t/f97721937aaa3c1b?hl=en
* mm: used-once mapped file page detection - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/751f58286c1ac8a2?hl=en
* [GIT PULL] ftrace: Add function names to dangling } in function graph tracer
- 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/6fa565c4f63a5a1e?hl=en
* [PATCH 66/66] arch/um/sys-x86_64/shared/sysdep/skas_ptrace.h: Checkpatch
cleanup - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/e0ce05b42ac96287?hl=en
* vhost-net fixes for 2.6.34 - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/1b3f184df42b077e?hl=en
* virtio - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/1cc47e45d39371b3?hl=en
* blktrace: perform cleanup after setup error - 2 messages, 1 author
http://groups.google.com/group/linux.kernel/t/141d13ab5a2d7299?hl=en
* relay: move remove_buf_file inside relay_close_buf - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/31dc5c01c84f2b99?hl=en
* alpha: use __ratelimit - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/3b9a6cd3be193207?hl=en
* cciss driver SCSI updates - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/a120ee4fbd625ee0?hl=en
* Reworking seeky detection for 2.6.34 - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/281bc275821cdaca?hl=en
* cfq-iosched: requests "in flight" vs "in driver" clarification - 1 messages,
1 author
http://groups.google.com/group/linux.kernel/t/fae5b192d92dac50?hl=en
* [PATCH 0/11] sched: SCHED_DEADLINE v2 - 3 messages, 1 author
http://groups.google.com/group/linux.kernel/t/9133d97cf353e20c?hl=en
* i2c: convert i2c-isch to platform_device - 2 messages, 1 author
http://groups.google.com/group/linux.kernel/t/3076c00a1ad323ba?hl=en
* sound/pci/hda/hda_codec.c: various coding style fixes - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/06de93666c701ff7?hl=en

==============================================================================
TOPIC: bkl removal for 2.6.34
http://groups.google.com/group/linux.kernel/t/dc6c09b3939dc512?hl=en
==============================================================================

== 1 of 1 ==
Date: Sun, Feb 28 2010 8:30 am
From: Thomas Gleixner


Linus,

Please pull the latest bkl-drivers-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git bkl-drivers-for-linus

Thanks,

tglx

------------------>
Ingo Molnar (1):
nvram: Drop the BKL from nvram_open()


drivers/char/nvram.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
index 2100a8f..7cf4518 100644
--- a/drivers/char/nvram.c
+++ b/drivers/char/nvram.c
@@ -329,14 +329,12 @@ static int nvram_ioctl(struct inode *inode, struct file *file,

static int nvram_open(struct inode *inode, struct file *file)
{
- lock_kernel();
spin_lock(&nvram_state_lock);

if ((nvram_open_cnt && (file->f_flags & O_EXCL)) ||
(nvram_open_mode & NVRAM_EXCL) ||
((file->f_mode & FMODE_WRITE) && (nvram_open_mode & NVRAM_WRITE))) {
spin_unlock(&nvram_state_lock);
- unlock_kernel();
return -EBUSY;
}

@@ -347,7 +345,6 @@ static int nvram_open(struct inode *inode, struct file *file)
nvram_open_cnt++;

spin_unlock(&nvram_state_lock);
- unlock_kernel();

return 0;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

==============================================================================
TOPIC: Driver core: Reduce the level of request_firmware() messages
http://groups.google.com/group/linux.kernel/t/ba1321736f5e0e2d?hl=en
==============================================================================

== 1 of 1 ==
Date: Sun, Feb 28 2010 8:40 am
From: Jaswinder Singh Rajput


Hello Rafael,

On Sun, 2010-02-28 at 13:13 +0100, Rafael J. Wysocki wrote:
> On Sunday 28 February 2010, Jaswinder Singh Rajput wrote:
> > On Sun, Feb 28, 2010 at 2:13 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > > From: Rafael J. Wysocki <rjw@sisk.pl>
> > >
> > > The messages from _request_firmware() informing that firmware is
> > > being requested or built-in firmware is going to be used are printed
> > > at KERN_INFO, which produces lots of noise on systems with huge
> > > numbers of AMD CPUs. Reduce the level of these messages to
> > > KERN_DEBUG to get rid of that noise.
> > >
> >
> > Which firmware we are using is very useful information. Because of
> > huge numbers of CPUs it seems noise then better provide the
> > information for first cpu and for the rest of the CPUs you can show by
> > KERN_DEBUG.
>
> That would have been better indeed, but the problem is _request_firmware()
> doesn't allow us to change the level of its messages on demand.

Can we try this :

if (smp_processor_id())
dev_dbg(..);
else
dev_info(..);

Thanks,
--
Jaswinder Singh.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

==============================================================================
TOPIC: more lockdep-RCU and RCU_FAST_NO_HZ fixes
http://groups.google.com/group/linux.kernel/t/c78d0afc145c64ac?hl=en
==============================================================================

== 1 of 1 ==
Date: Sun, Feb 28 2010 8:40 am
From: "Paul E. McKenney"


On Sun, Feb 28, 2010 at 09:55:05AM +0100, Ingo Molnar wrote:
>
> * Paul E. McKenney <paulmck@linux.vnet.ibm.com> wrote:
>
> > Hello!
> >
> > This series (1) makes RCU_FAST_NO_HZ actually do the full number of
> > iterations specified instead of just one and (2) fixes an RCU lockdep
> > splat.
>
> Thanks, applied.
>
> This one is pretty stubborn, it still triggers:
>
> [ 0.000000] soft-irq read-recursion/321: ok |
> [ 0.000000] -------------------------------------------------------
> [ 0.000000] Good, all 218 testcases passed! |
> [ 0.000000] ---------------------------------
> [ 0.000000] allocated 10485760 bytes of page_cgroup
> [ 0.000000] please try 'cgroup_disable=memory' option if you don't want memory cgroups
> [ 0.000000]
> [ 0.000000] ===================================================
> [ 0.000000] [ INFO: suspicious rcu_dereference_check() usage. ]
> [ 0.000000] ---------------------------------------------------
> [ 0.000000] kernel/sched_fair.c:3479 invoked rcu_dereference_check() without protection!
> [ 0.000000]
> [ 0.000000] other info that might help us debug this:
> [ 0.000000]
> [ 0.000000] no locks held by swapper/0.
> [ 0.000000]
> [ 0.000000] stack backtrace:
> [ 0.000000] Pid: 0, comm: swapper Not tainted 2.6.33-tip-01015-g97e7da3-dirty #10753
> [ 0.000000] Call Trace:
> [ 0.000000] <IRQ> [<ffffffff8107f5d1>] lockdep_rcu_dereference+0xa1/0xb0
> [ 0.000000] [<ffffffff8104afd1>] scheduler_tick+0x221/0x2c0
> [ 0.000000] [<ffffffff8105f6d5>] update_process_times+0x55/0x70
> [ 0.000000] [<ffffffff8107ac27>] tick_periodic+0x27/0x70
> [ 0.000000] [<ffffffff8107ac8f>] tick_handle_periodic+0x1f/0x90
> [ 0.000000] [<ffffffff8100e29a>] timer_interrupt+0x1a/0x30
> [ 0.000000] [<ffffffff810a28aa>] handle_IRQ_event+0x3a/0xe0
> [ 0.000000] [<ffffffff810a53ab>] handle_level_irq+0x8b/0x130
> [ 0.000000] [<ffffffff8100da94>] handle_irq+0x44/0x70
> [ 0.000000] [<ffffffff8100cfde>] do_IRQ+0x6e/0xf0
> [ 0.000000] [<ffffffff817eea13>] ret_from_intr+0x0/0x16
> [ 0.000000] <EOI> [<ffffffff8102dfe6>] ? native_restore_fl+0x6/0x10
> [ 0.000000] [<ffffffff817ee3df>] _raw_spin_unlock_irqrestore+0x6f/0x80
> [ 0.000000] [<ffffffff810a37f3>] __setup_irq+0x1b3/0x3b0
> [ 0.000000] [<ffffffff810a3a18>] setup_irq+0x28/0x40
> [ 0.000000] [<ffffffff81ef2914>] setup_default_timer_irq+0x12/0x14
> [ 0.000000] [<ffffffff81ef292d>] hpet_time_init+0x17/0x19
> [ 0.000000] [<ffffffff81ef28fb>] x86_late_time_init+0xa/0x11
> [ 0.000000] [<ffffffff81eefcf4>] start_kernel+0x25f/0x2e6
> [ 0.000000] [<ffffffff81eef30b>] x86_64_start_reservations+0xf6/0xfa
> [ 0.000000] [<ffffffff81eef409>] x86_64_start_kernel+0xfa/0x109
> [ 0.000000] Fast TSC calibration using PIT
> [ 0.000000] Detected 2002.507 MHz processor.
> [ 0.004004] Calibrating delay loop (skipped), value calculated using timer frequency.. 4005.01 BogoMIPS (lpj=2002507)

Ah -- this is a new arrival from my viewpoint. Patch below!

This won't apply to tip/core/rcu, but does against current tip/master.

Thanx, Paul

------------------------------------------------------------------------

sched: fix rcu_dereference() for RCU-lockde

Make rcu_dereference() of runqueue data structures be
rcu_dereference_sched().

Located-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---

sched_fair.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 3e1fd96..5a5ea2c 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -3476,7 +3476,7 @@ static void run_rebalance_domains(struct softirq_action *h)

static inline int on_null_domain(int cpu)
{
- return !rcu_dereference(cpu_rq(cpu)->sd);
+ return !rcu_dereference_sched(cpu_rq(cpu)->sd);
}

/*
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

==============================================================================
TOPIC: LED driver for the Soekris net5501 board.
http://groups.google.com/group/linux.kernel/t/484410bbbfae8034?hl=en
==============================================================================

== 1 of 1 ==
Date: Sun, Feb 28 2010 9:10 am
From: Bjarke Istrup Pedersen


LED driver for the Soekris net5501 board.
It is based on the previously submitted code by Alessandro Zummo, but is changed to use the new GPIO driver with 2.6.33, and the driver has been moved to drivers/leds where it belongs.

Signed-off-by: Bjarke Istrup Pedersen <gurligebis@gentoo.org>
---
drivers/leds/Kconfig | 9 ++++
drivers/leds/Makefile | 1 +
drivers/leds/leds-net5501.c | 95 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 105 insertions(+), 0 deletions(-)
create mode 100644 drivers/leds/leds-net5501.c

diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 8a0e1ec..fa12ab5 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -58,6 +58,15 @@ config LEDS_NET48XX
This option enables support for the Soekris net4801 and net4826 error
LED.

+config LEDS_NET5501
+ tristate "LED Support for Soekris net5501 series Error LED"
+ depends on LEDS_CLASS && LEDS_GPIO_PLATFORM && GPIO_CS5535
+ select LEDS_TRIGGER_DEFAULT_ON
+ default n
+ help
+ Add support for the Soekris net5501 board (detection, error led
+ and GPIO).
+
config LEDS_FSG
tristate "LED Support for the Freecom FSG-3"
depends on LEDS_CLASS && MACH_FSG
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index 9e63869..123609a 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -12,6 +12,7 @@ obj-$(CONFIG_LEDS_MIKROTIK_RB532) += leds-rb532.o
obj-$(CONFIG_LEDS_S3C24XX) += leds-s3c24xx.o
obj-$(CONFIG_LEDS_AMS_DELTA) += leds-ams-delta.o
obj-$(CONFIG_LEDS_NET48XX) += leds-net48xx.o
+obj-$(CONFIG_LEDS_NET5501) += leds-net5501.o
obj-$(CONFIG_LEDS_WRAP) += leds-wrap.o
obj-$(CONFIG_LEDS_ALIX2) += leds-alix2.o
obj-$(CONFIG_LEDS_H1940) += leds-h1940.o
diff --git a/drivers/leds/leds-net5501.c b/drivers/leds/leds-net5501.c
new file mode 100644
index 0000000..90f82bf
--- /dev/null
+++ b/drivers/leds/leds-net5501.c
@@ -0,0 +1,95 @@
+/*
+ * Soekris board support code
+ *
+ * Copyright (C) 2008-2009 Tower Technologies
+ * Written by Alessandro Zummo <a.zummo@towertech.it>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/string.h>
+#include <linux/leds.h>
+#include <linux/platform_device.h>
+#include <linux/gpio.h>
+
+#include <asm/geode.h>
+
+static struct gpio_led net5501_leds[] = {
+ {
+ .name = "error",
+ .gpio = 6,
+ .default_trigger = "default-on",
+ },
+};
+
+static struct gpio_led_platform_data net5501_leds_data = {
+ .num_leds = ARRAY_SIZE(net5501_leds),
+ .leds = net5501_leds,
+};
+
+static struct platform_device net5501_leds_dev = {
+ .name = "leds-gpio",
+ .id = -1,
+ .dev.platform_data = &net5501_leds_data,
+};
+
+static void __init init_net5501(void)
+{
+ platform_device_register(&net5501_leds_dev);
+}
+
+struct soekris_board {
+ u16 offset;
+ char *sig;
+ u8 len;
+ void (*init)(void);
+};
+
+static struct soekris_board __initdata boards[] = {
+ { 0xb7b, "net5501", 7, init_net5501 }, /* net5501 v1.33/1.33c */
+ { 0xb1f, "net5501", 7, init_net5501 }, /* net5501 v1.32i */
+};
+
+static int __init soekris_init(void)
+{
+ int i;
+ unsigned char *rombase, *bios;
+
+ if (!is_geode())
+ return 0;
+
+ rombase = ioremap(0xffff0000, 0xffff);
+ if (!rombase)
+ {
+ printk(KERN_INFO "Soekris net5501 LED driver failed to get rombase");
+ return 0;
+ }
+
+ bios = rombase + 0x20; /* null terminated */
+
+ if (strncmp(bios, "comBIOS", 7))
+ goto unmap;
+
+ for (i = 0; i < ARRAY_SIZE(boards); i++) {
+ unsigned char *model = rombase + boards[i].offset;
+
+ if (strncmp(model, boards[i].sig, boards[i].len) == 0) {
+ printk(KERN_INFO "Soekris %s: %s\n", model, bios);
+
+ if (boards[i].init)
+ boards[i].init();
+ break;
+ }
+ }
+
+unmap:
+ iounmap(rombase);
+ return 0;
+}
+
+arch_initcall(soekris_init);
--
1.7.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

==============================================================================
TOPIC: fix MTD CFI/LPDDR flash driver huge latency bug
http://groups.google.com/group/linux.kernel/t/8d2447104528f745?hl=en
==============================================================================

== 1 of 1 ==
Date: Sun, Feb 28 2010 9:10 am
From: Stefani Seibold


This patch fix a huge latency problem in the MTD CFI and LPDDR flash
drivers.

The use of a memcpy() during a spinlock operation will cause very long
thread context switch delays if the flash chip bandwidth is low and the
data to be copied large, because a spinlock will disable preemption.

For example: A flash with 6,5 MB/s bandwidth will cause under ubifs,
which request sometimes 128 KB (the flash erase size), a preemption
delay of 20 milliseconds. High priority threads will not be served
during this time, regardless whether this threads access the flash or
not. This behavior breaks real time.

The patch change all the use of spin_lock operations for xxxx->mutex
into mutex operations, which is exact what the name says and means.

There is no performance regression since the mutex is normally not
acquired.

The patch is against kernel 2.6.33. Please merge it.

Signed-off-by: Stefani Seibold <stefani@seibold.net>
---
drivers/mtd/chips/cfi_cmdset_0001.c | 131 +++++++++++++++++-----------------
drivers/mtd/chips/cfi_cmdset_0002.c | 127 +++++++++++++++++----------------
drivers/mtd/chips/cfi_cmdset_0020.c | 136 ++++++++++++++++++------------------
drivers/mtd/chips/gen_probe.c | 3
drivers/mtd/lpddr/lpddr_cmds.c | 79 ++++++++++----------
include/linux/mtd/flashchip.h | 4 -
6 files changed, 240 insertions(+), 240 deletions(-)

diff -u -N -r -p linux-2.6.33.orig//drivers/mtd/chips/cfi_cmdset_0001.c linux-2.6.33/drivers/mtd/chips/cfi_cmdset_0001.c
--- linux-2.6.33.orig//drivers/mtd/chips/cfi_cmdset_0001.c 2010-02-24 19:52:17.000000000 +0100
+++ linux-2.6.33/drivers/mtd/chips/cfi_cmdset_0001.c 2010-02-28 11:19:49.845138972 +0100
@@ -727,8 +727,7 @@ static int cfi_intelext_partition_fixup(
/* those should be reset too since
they create memory references. */
init_waitqueue_head(&chip->wq);
- spin_lock_init(&chip->_spinlock);
- chip->mutex = &chip->_spinlock;
+ mutex_init(&chip->mutex);
chip++;
}
}
@@ -774,9 +773,9 @@ static int chip_ready (struct map_info *
if (chip->priv && map_word_andequal(map, status, status_PWS, status_PWS))
break;

- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
cfi_udelay(1);
- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);
/* Someone else might have been playing with it. */
return -EAGAIN;
}
@@ -823,9 +822,9 @@ static int chip_ready (struct map_info *
return -EIO;
}

- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
cfi_udelay(1);
- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);
/* Nobody will touch it while it's in state FL_ERASE_SUSPENDING.
So we can just loop here. */
}
@@ -852,10 +851,10 @@ static int chip_ready (struct map_info *
sleep:
set_current_state(TASK_UNINTERRUPTIBLE);
add_wait_queue(&chip->wq, &wait);
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
schedule();
remove_wait_queue(&chip->wq, &wait);
- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);
return -EAGAIN;
}
}
@@ -901,20 +900,20 @@ static int get_chip(struct map_info *map
* it'll happily send us to sleep. In any case, when
* get_chip returns success we're clear to go ahead.
*/
- ret = spin_trylock(contender->mutex);
+ ret = mutex_trylock(contender->mutex);
spin_unlock(&shared->lock);
if (!ret)
goto retry;
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
ret = chip_ready(map, contender, contender->start, mode);
- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);

if (ret == -EAGAIN) {
- spin_unlock(contender->mutex);
+ mutex_unlock(contender->mutex);
goto retry;
}
if (ret) {
- spin_unlock(contender->mutex);
+ mutex_unlock(contender->mutex);
return ret;
}
spin_lock(&shared->lock);
@@ -923,10 +922,10 @@ static int get_chip(struct map_info *map
* in FL_SYNCING state. Put contender and retry. */
if (chip->state == FL_SYNCING) {
put_chip(map, contender, contender->start);
- spin_unlock(contender->mutex);
+ mutex_unlock(contender->mutex);
goto retry;
}
- spin_unlock(contender->mutex);
+ mutex_unlock(contender->mutex);
}

/* Check if we already have suspended erase
@@ -936,10 +935,10 @@ static int get_chip(struct map_info *map
spin_unlock(&shared->lock);
set_current_state(TASK_UNINTERRUPTIBLE);
add_wait_queue(&chip->wq, &wait);
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
schedule();
remove_wait_queue(&chip->wq, &wait);
- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);
goto retry;
}

@@ -969,12 +968,12 @@ static void put_chip(struct map_info *ma
if (shared->writing && shared->writing != chip) {
/* give back ownership to who we loaned it from */
struct flchip *loaner = shared->writing;
- spin_lock(loaner->mutex);
+ mutex_lock(loaner->mutex);
spin_unlock(&shared->lock);
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
put_chip(map, loaner, loaner->start);
- spin_lock(chip->mutex);
- spin_unlock(loaner->mutex);
+ mutex_lock(chip->mutex);
+ mutex_unlock(loaner->mutex);
wake_up(&chip->wq);
return;
}
@@ -1144,7 +1143,7 @@ static int __xipram xip_wait_for_operati
(void) map_read(map, adr);
xip_iprefetch();
local_irq_enable();
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
xip_iprefetch();
cond_resched();

@@ -1154,15 +1153,15 @@ static int __xipram xip_wait_for_operati
* a suspended erase state. If so let's wait
* until it's done.
*/
- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);
while (chip->state != newstate) {
DECLARE_WAITQUEUE(wait, current);
set_current_state(TASK_UNINTERRUPTIBLE);
add_wait_queue(&chip->wq, &wait);
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
schedule();
remove_wait_queue(&chip->wq, &wait);
- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);
}
/* Disallow XIP again */
local_irq_disable();
@@ -1218,10 +1217,10 @@ static int inval_cache_and_wait_for_oper
int chip_state = chip->state;
unsigned int timeo, sleep_time, reset_timeo;

- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
if (inval_len)
INVALIDATE_CACHED_RANGE(map, inval_adr, inval_len);
- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);

timeo = chip_op_time_max;
if (!timeo)
@@ -1241,7 +1240,7 @@ static int inval_cache_and_wait_for_oper
}

/* OK Still waiting. Drop the lock, wait a while and retry. */
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
if (sleep_time >= 1000000/HZ) {
/*
* Half of the normal delay still remaining
@@ -1256,17 +1255,17 @@ static int inval_cache_and_wait_for_oper
cond_resched();
timeo--;
}
- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);

while (chip->state != chip_state) {
/* Someone's suspended the operation: sleep */
DECLARE_WAITQUEUE(wait, current);
set_current_state(TASK_UNINTERRUPTIBLE);
add_wait_queue(&chip->wq, &wait);
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
schedule();
remove_wait_queue(&chip->wq, &wait);
- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);
}
if (chip->erase_suspended && chip_state == FL_ERASING) {
/* Erase suspend occured while sleep: reset timeout */
@@ -1302,7 +1301,7 @@ static int do_point_onechip (struct map_
/* Ensure cmd read/writes are aligned. */
cmd_addr = adr & ~(map_bankwidth(map)-1);

- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);

ret = get_chip(map, chip, cmd_addr, FL_POINT);

@@ -1313,7 +1312,7 @@ static int do_point_onechip (struct map_
chip->state = FL_POINT;
chip->ref_point_counter++;
}
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);

return ret;
}
@@ -1398,7 +1397,7 @@ static void cfi_intelext_unpoint(struct
else
thislen = len;

- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);
if (chip->state == FL_POINT) {
chip->ref_point_counter--;
if(chip->ref_point_counter == 0)
@@ -1407,7 +1406,7 @@ static void cfi_intelext_unpoint(struct
printk(KERN_ERR "%s: Warning: unpoint called on non pointed region\n", map->name); /* Should this give an error? */

put_chip(map, chip, chip->start);
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);

len -= thislen;
ofs = 0;
@@ -1426,10 +1425,10 @@ static inline int do_read_onechip(struct
/* Ensure cmd read/writes are aligned. */
cmd_addr = adr & ~(map_bankwidth(map)-1);

- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);
ret = get_chip(map, chip, cmd_addr, FL_READY);
if (ret) {
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
return ret;
}

@@ -1443,7 +1442,7 @@ static inline int do_read_onechip(struct

put_chip(map, chip, cmd_addr);

- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
return 0;
}

@@ -1506,10 +1505,10 @@ static int __xipram do_write_oneword(str
return -EINVAL;
}

- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);
ret = get_chip(map, chip, adr, mode);
if (ret) {
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
return ret;
}

@@ -1555,7 +1554,7 @@ static int __xipram do_write_oneword(str

xip_enable(map, chip, adr);
out: put_chip(map, chip, adr);
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
return ret;
}

@@ -1664,10 +1663,10 @@ static int __xipram do_write_buffer(stru
/* Let's determine this according to the interleave only once */
write_cmd = (cfi->cfiq->P_ID != 0x0200) ? CMD(0xe8) : CMD(0xe9);

- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);
ret = get_chip(map, chip, cmd_adr, FL_WRITING);
if (ret) {
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
return ret;
}

@@ -1798,7 +1797,7 @@ static int __xipram do_write_buffer(stru

xip_enable(map, chip, cmd_adr);
out: put_chip(map, chip, cmd_adr);
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
return ret;
}

@@ -1877,10 +1876,10 @@ static int __xipram do_erase_oneblock(st
adr += chip->start;

retry:
- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);
ret = get_chip(map, chip, adr, FL_ERASING);
if (ret) {
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
return ret;
}

@@ -1936,7 +1935,7 @@ static int __xipram do_erase_oneblock(st
} else if (chipstatus & 0x20 && retries--) {
printk(KERN_DEBUG "block erase failed at 0x%08lx: status 0x%lx. Retrying...\n", adr, chipstatus);
put_chip(map, chip, adr);
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
goto retry;
} else {
printk(KERN_ERR "%s: block erase failed at 0x%08lx (status 0x%lx)\n", map->name, adr, chipstatus);
@@ -1948,7 +1947,7 @@ static int __xipram do_erase_oneblock(st

xip_enable(map, chip, adr);
out: put_chip(map, chip, adr);
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
return ret;
}

@@ -1981,7 +1980,7 @@ static void cfi_intelext_sync (struct mt
for (i=0; !ret && i<cfi->numchips; i++) {
chip = &cfi->chips[i];

- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);
ret = get_chip(map, chip, chip->start, FL_SYNCING);

if (!ret) {
@@ -1992,7 +1991,7 @@ static void cfi_intelext_sync (struct mt
* with the chip now anyway.
*/
}
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
}

/* Unlock the chips again */
@@ -2000,14 +1999,14 @@ static void cfi_intelext_sync (struct mt
for (i--; i >=0; i--) {
chip = &cfi->chips[i];

- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);

if (chip->state == FL_SYNCING) {
chip->state = chip->oldstate;
chip->oldstate = FL_READY;
wake_up(&chip->wq);
}
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
}
}

@@ -2053,10 +2052,10 @@ static int __xipram do_xxlock_oneblock(s

adr += chip->start;

- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);
ret = get_chip(map, chip, adr, FL_LOCKING);
if (ret) {
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
return ret;
}

@@ -2090,7 +2089,7 @@ static int __xipram do_xxlock_oneblock(s

xip_enable(map, chip, adr);
out: put_chip(map, chip, adr);
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
return ret;
}

@@ -2155,10 +2154,10 @@ do_otp_read(struct map_info *map, struct
struct cfi_private *cfi = map->fldrv_priv;
int ret;

- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);
ret = get_chip(map, chip, chip->start, FL_JEDEC_QUERY);
if (ret) {
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
return ret;
}

@@ -2177,7 +2176,7 @@ do_otp_read(struct map_info *map, struct
INVALIDATE_CACHED_RANGE(map, chip->start + offset, size);

put_chip(map, chip, chip->start);
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
return 0;
}

@@ -2452,7 +2451,7 @@ static int cfi_intelext_suspend(struct m
for (i=0; !ret && i<cfi->numchips; i++) {
chip = &cfi->chips[i];

- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);

switch (chip->state) {
case FL_READY:
@@ -2484,7 +2483,7 @@ static int cfi_intelext_suspend(struct m
case FL_PM_SUSPENDED:
break;
}
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
}

/* Unlock the chips again */
@@ -2493,7 +2492,7 @@ static int cfi_intelext_suspend(struct m
for (i--; i >=0; i--) {
chip = &cfi->chips[i];

- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);

if (chip->state == FL_PM_SUSPENDED) {
/* No need to force it into a known state here,
@@ -2503,7 +2502,7 @@ static int cfi_intelext_suspend(struct m
chip->oldstate = FL_READY;
wake_up(&chip->wq);
}
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
}
}

@@ -2544,7 +2543,7 @@ static void cfi_intelext_resume(struct m

chip = &cfi->chips[i];

- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);

/* Go to known state. Chip may have been power cycled */
if (chip->state == FL_PM_SUSPENDED) {
@@ -2553,7 +2552,7 @@ static void cfi_intelext_resume(struct m
wake_up(&chip->wq);
}

- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
}

if ((mtd->flags & MTD_POWERUP_LOCK)
@@ -2573,14 +2572,14 @@ static int cfi_intelext_reset(struct mtd
/* force the completion of any ongoing operation
and switch to array mode so any bootloader in
flash is accessible for soft reboot. */
- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);
ret = get_chip(map, chip, chip->start, FL_SHUTDOWN);
if (!ret) {
map_write(map, CMD(0xff), chip->start);
chip->state = FL_SHUTDOWN;
put_chip(map, chip, chip->start);
}
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
}

return 0;
diff -u -N -r -p linux-2.6.33.orig//drivers/mtd/chips/cfi_cmdset_0002.c linux-2.6.33/drivers/mtd/chips/cfi_cmdset_0002.c
--- linux-2.6.33.orig//drivers/mtd/chips/cfi_cmdset_0002.c 2010-02-24 19:52:17.000000000 +0100
+++ linux-2.6.33/drivers/mtd/chips/cfi_cmdset_0002.c 2010-02-28 11:20:32.618545872 +0100
@@ -20,6 +20,7 @@
* This code is GPL
*/

+#include <linux/ftrace.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
@@ -571,9 +572,9 @@ static int get_chip(struct map_info *map
printk(KERN_ERR "Waiting for chip to be ready timed out.\n");
return -EIO;
}
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
cfi_udelay(1);
- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);
/* Someone else might have been playing with it. */
goto retry;
}
@@ -617,9 +618,9 @@ static int get_chip(struct map_info *map
return -EIO;
}

- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
cfi_udelay(1);
- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);
/* Nobody will touch it while it's in state FL_ERASE_SUSPENDING.
So we can just loop here. */
}
@@ -643,10 +644,10 @@ static int get_chip(struct map_info *map
sleep:
set_current_state(TASK_UNINTERRUPTIBLE);
add_wait_queue(&chip->wq, &wait);
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
schedule();
remove_wait_queue(&chip->wq, &wait);
- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);
goto resettime;
}
}
@@ -778,7 +779,7 @@ static void __xipram xip_udelay(struct m
(void) map_read(map, adr);
xip_iprefetch();
local_irq_enable();
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
xip_iprefetch();
cond_resched();

@@ -788,15 +789,15 @@ static void __xipram xip_udelay(struct m
* a suspended erase state. If so let's wait
* until it's done.
*/
- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);
while (chip->state != FL_XIP_WHILE_ERASING) {
DECLARE_WAITQUEUE(wait, current);
set_current_state(TASK_UNINTERRUPTIBLE);
add_wait_queue(&chip->wq, &wait);
- spin_unlock(chip->mutex);
+ mutex_unlock(chip->mutex);
schedule();
remove_wait_queue(&chip->wq, &wait);
- spin_lock(chip->mutex);
+ mutex_lock(chip->mutex);
}
/* Disallow XIP again */
local_irq_disable();
@@ -858,21 +859,24 @@ static void __xipram xip_udelay(struct m

#define UDELAY(map, chip, adr, usec) \
do { \
- spin_unlock(chip->mutex); \
+ mutex_unlock(chip->mutex); \
cfi_udelay(usec); \
- spin_lock(chip->mutex); \
+ mutex_lock(chip->mutex); \
} while (0)

#define INVALIDATE_CACHE_UDELAY(map, chip, adr, len, usec) \
do { \
- spin_unlock(chip->mutex); \
+ mutex_unlock(chip->mutex); \
INVALIDATE_CACHED_RANGE(map, adr, len); \
cfi_udelay(usec); \
- spin_lock(chip->mutex); \
+ mutex_lock(chip->mutex); \
} while (0)

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate