sched: make early bootup sched_clock() use safer

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6892b75e60557a48c01d57ba320419a9e2ce9846
Commit: 6892b75e60557a48c01d57ba320419a9e2ce9846
Parent: bfa274e2436fc7ef72ef51c878083647f1cfd429
Author: Ingo Molnar [EMAIL PROTECTED]
AuthorDate: Wed Feb 13 14:02:36 2008 +0100
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Mon Feb 25 16:34:16 2008 +0100

sched: make early bootup sched_clock() use safer

do not call sched_clock() too early. Not only might rq-idle
not be set up - but pure per-cpu data might not be accessible
either.

this solves an ia64 early bootup hang with CONFIG_PRINTK_TIME=y.

Tested-by: Tony Luck [EMAIL PROTECTED]
Acked-by: Tony Luck [EMAIL PROTECTED]
Acked-by: David S. Miller [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 kernel/sched.c |   14 ++
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index b387a8d..7286ccb 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -668,6 +668,8 @@ const_debug unsigned int sysctl_sched_nr_migrate = 32;
  */
 unsigned int sysctl_sched_rt_period = 100;
 
+static __read_mostly int scheduler_running;
+
 /*
  * part of the period that we allow rt tasks to run in us.
  * default: 0.95s
@@ -689,14 +691,16 @@ unsigned long long cpu_clock(int cpu)
unsigned long flags;
struct rq *rq;
 
-   local_irq_save(flags);
-   rq = cpu_rq(cpu);
/*
 * Only call sched_clock() if the scheduler has already been
 * initialized (some code might call cpu_clock() very early):
 */
-   if (rq-idle)
-   update_rq_clock(rq);
+   if (unlikely(!scheduler_running))
+   return 0;
+
+   local_irq_save(flags);
+   rq = cpu_rq(cpu);
+   update_rq_clock(rq);
now = rq-clock;
local_irq_restore(flags);
 
@@ -7284,6 +7288,8 @@ void __init sched_init(void)
 * During early bootup we pretend to be a normal task:
 */
current-sched_class = fair_sched_class;
+
+   scheduler_running = 1;
 }
 
 #ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


printk: fix possible printk overrun

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cf3680b90c7842cf91ed857ac4528f4e057da366
Commit: cf3680b90c7842cf91ed857ac4528f4e057da366
Parent: bfa274e2436fc7ef72ef51c878083647f1cfd429
Author: Tejun Heo [EMAIL PROTECTED]
AuthorDate: Thu Feb 14 10:32:07 2008 +0900
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Tue Feb 26 07:42:37 2008 -0800

printk: fix possible printk overrun

printk recursion detection prepends message to printk_buf and offsets
printk_buf when actual message is printed but it forgets to trim buffer
length accordingly. This can result in overrun in extreme cases. Fix it.

[ [EMAIL PROTECTED]:

  bug was introduced by me via:

   commit 32a76006683f7b28ae3cc491da37716e002f198e
   Author: Ingo Molnar [EMAIL PROTECTED]
   Date:   Fri Jan 25 21:07:58 2008 +0100

   printk: make printk more robust by not allowing recursion
]

Signed-off-by: Tejun Heo [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 kernel/printk.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/printk.c b/kernel/printk.c
index bee3610..9adc2a4 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -666,7 +666,7 @@ asmlinkage int vprintk(const char *fmt, va_list args)
}
/* Emit the output into the temporary buffer */
printed_len += vscnprintf(printk_buf + printed_len,
- sizeof(printk_buf), fmt, args);
+ sizeof(printk_buf) - printed_len, fmt, args);
 
/*
 * Copy the output into log_buf.  If the caller didn't provide
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


sched: remove duplicate code from sched_fair.c

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=70eee74b70c1a8485ec5f2bafa13dbc66fab6e02
Commit: 70eee74b70c1a8485ec5f2bafa13dbc66fab6e02
Parent: 6892b75e60557a48c01d57ba320419a9e2ce9846
Author: Balbir Singh [EMAIL PROTECTED]
AuthorDate: Fri Feb 22 13:25:53 2008 +0530
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Mon Feb 25 16:34:17 2008 +0100

sched: remove duplicate code from sched_fair.c

pick_task_entity() duplicates existing code. This functionality can be
easily obtained using rb_last(). Avoid code duplication by using rb_last().

Signed-off-by: Balbir Singh [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 kernel/sched_fair.c |   15 ++-
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 6c091d6..7abad50 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -202,16 +202,13 @@ static struct sched_entity *__pick_next_entity(struct 
cfs_rq *cfs_rq)
 
 static inline struct sched_entity *__pick_last_entity(struct cfs_rq *cfs_rq)
 {
-   struct rb_node **link = cfs_rq-tasks_timeline.rb_node;
-   struct sched_entity *se = NULL;
-   struct rb_node *parent;
-
-   while (*link) {
-   parent = *link;
-   se = rb_entry(parent, struct sched_entity, run_node);
-   link = parent-rb_right;
-   }
+   struct rb_node *last;
+   struct sched_entity *se;
 
+   last = rb_last(cfs_rq-tasks_timeline);
+   if (!last)
+   return NULL;
+   se = rb_entry(last, struct sched_entity, run_node);
return se;
 }
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


sched: clean up __pick_last_entity() a bit

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7eee3e677d6e2e9007afcd7d79b0715525aa552e
Commit: 7eee3e677d6e2e9007afcd7d79b0715525aa552e
Parent: 70eee74b70c1a8485ec5f2bafa13dbc66fab6e02
Author: Ingo Molnar [EMAIL PROTECTED]
AuthorDate: Fri Feb 22 10:32:21 2008 +0100
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Mon Feb 25 16:34:17 2008 +0100

sched: clean up __pick_last_entity() a bit

Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 kernel/sched_fair.c |8 +++-
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 7abad50..c8e6492 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -202,14 +202,12 @@ static struct sched_entity *__pick_next_entity(struct 
cfs_rq *cfs_rq)
 
 static inline struct sched_entity *__pick_last_entity(struct cfs_rq *cfs_rq)
 {
-   struct rb_node *last;
-   struct sched_entity *se;
+   struct rb_node *last = rb_last(cfs_rq-tasks_timeline);
 
-   last = rb_last(cfs_rq-tasks_timeline);
if (!last)
return NULL;
-   se = rb_entry(last, struct sched_entity, run_node);
-   return se;
+
+   return rb_entry(last, struct sched_entity, run_node);
 }
 
 /**
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


sched: fix signedness warnings in sched.c

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=67ca7bde2e9d3516b5ae0188330ad1059ac03f38
Commit: 67ca7bde2e9d3516b5ae0188330ad1059ac03f38
Parent: 7eee3e677d6e2e9007afcd7d79b0715525aa552e
Author: Harvey Harrison [EMAIL PROTECTED]
AuthorDate: Fri Feb 15 09:56:36 2008 -0800
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Mon Feb 25 16:34:17 2008 +0100

sched: fix signedness warnings in sched.c

Unsigned long values are always assigned to switch_count,
make it unsigned long.

kernel/sched.c:3897:15: warning: incorrect type in assignment (different 
signedness)
kernel/sched.c:3897:15:expected long *switch_count
kernel/sched.c:3897:15:got unsigned long *noident
kernel/sched.c:3921:16: warning: incorrect type in assignment (different 
signedness)
kernel/sched.c:3921:16:expected long *switch_count
kernel/sched.c:3921:16:got unsigned long *noident

Signed-off-by: Harvey Harrison [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 kernel/sched.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 7286ccb..f06950c 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -3889,7 +3889,7 @@ pick_next_task(struct rq *rq, struct task_struct *prev)
 asmlinkage void __sched schedule(void)
 {
struct task_struct *prev, *next;
-   long *switch_count;
+   unsigned long *switch_count;
struct rq *rq;
int cpu;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


sched: add declaration of sched_tail to sched.h

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2d07b255c7b8a9723010e5c74778e058dc05162e
Commit: 2d07b255c7b8a9723010e5c74778e058dc05162e
Parent: 67ca7bde2e9d3516b5ae0188330ad1059ac03f38
Author: Harvey Harrison [EMAIL PROTECTED]
AuthorDate: Fri Feb 15 09:56:34 2008 -0800
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Mon Feb 25 16:34:17 2008 +0100

sched: add declaration of sched_tail to sched.h

Avoids sparse warnings:
kernel/sched.c:2170:17: warning: symbol 'schedule_tail' was not declared. 
Should it be static?

Avoids the need for an external declaration in arch/um/process.c

Signed-off-by: Harvey Harrison [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 arch/um/kernel/process.c |2 --
 include/linux/sched.h|1 +
 2 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index fc50d2f..e8cb9ff 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -128,8 +128,6 @@ void *get_current(void)
return current;
 }
 
-extern void schedule_tail(struct task_struct *prev);
-
 /*
  * This is called magically, by its address being stuffed in a jmp_buf
  * and being longjmp-d to.
diff --git a/include/linux/sched.h b/include/linux/sched.h
index e217d18..9c17e82 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -242,6 +242,7 @@ struct task_struct;
 
 extern void sched_init(void);
 extern void sched_init_smp(void);
+extern asmlinkage void schedule_tail(struct task_struct *prev);
 extern void init_idle(struct task_struct *idle, int cpu);
 extern void init_idle_bootup_task(struct task_struct *idle);
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


latencytop: fix kernel panic while reading latency proc file

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ae0027869db7d28563cd783865fab04ffd18419c
Commit: ae0027869db7d28563cd783865fab04ffd18419c
Parent: 2d07b255c7b8a9723010e5c74778e058dc05162e
Author: Hiroshi Shimamoto [EMAIL PROTECTED]
AuthorDate: Thu Feb 14 10:26:24 2008 -0800
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Mon Feb 25 16:34:17 2008 +0100

latencytop: fix kernel panic while reading latency proc file

Reading /proc/pid/latency or /proc/pid/task/tid/latency could cause
NULL pointer dereference.

In lstats_open(), get_proc_task() can return NULL, in which case the kernel
will oops at lstats_show_proc() because m-private is NULL.

When get_proc_task() returns NULL, the kernel should return -ENOENT.

This can be reproduced by the following script.
while :
do
date
bash -c 'ls  ls.$$' 
pid=$!
cat /proc/$pid/latency 
cat /proc/$pid/latency 
cat /proc/$pid/latency 
cat /proc/$pid/latency
done

Signed-off-by: Hiroshi Shimamoto [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 fs/proc/base.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 96ee899..989e307 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -350,6 +350,8 @@ static int lstats_open(struct inode *inode, struct file 
*file)
struct seq_file *m;
struct task_struct *task = get_proc_task(inode);
 
+   if (!task)
+   return -ENOENT;
ret = single_open(file, lstats_show_proc, NULL);
if (!ret) {
m = file-private_data;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


latencytop: fix memory leak on latency proc file

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d6643d12cb0885d06a1491b16c1476abcbd53d40
Commit: d6643d12cb0885d06a1491b16c1476abcbd53d40
Parent: ae0027869db7d28563cd783865fab04ffd18419c
Author: Hiroshi Shimamoto [EMAIL PROTECTED]
AuthorDate: Thu Feb 14 10:27:00 2008 -0800
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Mon Feb 25 16:34:17 2008 +0100

latencytop: fix memory leak on latency proc file

At lstats_open(), calling get_proc_task() gets task struct, but it never 
put.
put_task_struct() should be called when releasing.

Signed-off-by: Hiroshi Shimamoto [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 fs/proc/base.c |   11 ++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 989e307..85e06e4 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -360,6 +360,15 @@ static int lstats_open(struct inode *inode, struct file 
*file)
return ret;
 }
 
+static int lstats_release(struct inode *inode, struct file *file)
+{
+   struct seq_file *m = file-private_data;
+   struct task_struct *task = m-private;
+
+   put_task_struct(task);
+   return single_release(inode, file);
+}
+
 static ssize_t lstats_write(struct file *file, const char __user *buf,
size_t count, loff_t *offs)
 {
@@ -378,7 +387,7 @@ static const struct file_operations proc_lstats_operations 
= {
.read   = seq_read,
.write  = lstats_write,
.llseek = seq_lseek,
-   .release= single_release,
+   .release= lstats_release,
 };
 
 #endif
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


latencytop: change /proc task_struct access method

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=13d77c37cab2bb906022309e1e7182c327e49916
Commit: 13d77c37cab2bb906022309e1e7182c327e49916
Parent: d6643d12cb0885d06a1491b16c1476abcbd53d40
Author: Hiroshi Shimamoto [EMAIL PROTECTED]
AuthorDate: Wed Feb 20 16:53:29 2008 -0800
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Mon Feb 25 16:34:18 2008 +0100

latencytop: change /proc task_struct access method

Change getting task_struct by get_proc_task() at read or write time,
and returns -ESRCH if get_proc_task() returns NULL.
This is same behavior as other /proc files.

Signed-off-by: Hiroshi Shimamoto [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 fs/proc/base.c |   40 
 1 files changed, 12 insertions(+), 28 deletions(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 85e06e4..91a1bd6 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -314,9 +314,12 @@ static int proc_pid_schedstat(struct task_struct *task, 
char *buffer)
 static int lstats_show_proc(struct seq_file *m, void *v)
 {
int i;
-   struct task_struct *task = m-private;
-   seq_puts(m, Latency Top version : v0.1\n);
+   struct inode *inode = m-private;
+   struct task_struct *task = get_proc_task(inode);
 
+   if (!task)
+   return -ESRCH;
+   seq_puts(m, Latency Top version : v0.1\n);
for (i = 0; i  32; i++) {
if (task-latency_record[i].backtrace[0]) {
int q;
@@ -341,43 +344,24 @@ static int lstats_show_proc(struct seq_file *m, void *v)
}
 
}
+   put_task_struct(task);
return 0;
 }
 
 static int lstats_open(struct inode *inode, struct file *file)
 {
-   int ret;
-   struct seq_file *m;
-   struct task_struct *task = get_proc_task(inode);
-
-   if (!task)
-   return -ENOENT;
-   ret = single_open(file, lstats_show_proc, NULL);
-   if (!ret) {
-   m = file-private_data;
-   m-private = task;
-   }
-   return ret;
-}
-
-static int lstats_release(struct inode *inode, struct file *file)
-{
-   struct seq_file *m = file-private_data;
-   struct task_struct *task = m-private;
-
-   put_task_struct(task);
-   return single_release(inode, file);
+   return single_open(file, lstats_show_proc, inode);
 }
 
 static ssize_t lstats_write(struct file *file, const char __user *buf,
size_t count, loff_t *offs)
 {
-   struct seq_file *m;
-   struct task_struct *task;
+   struct task_struct *task = get_proc_task(file-f_dentry-d_inode);
 
-   m = file-private_data;
-   task = m-private;
+   if (!task)
+   return -ESRCH;
clear_all_latency_tracing(task);
+   put_task_struct(task);
 
return count;
 }
@@ -387,7 +371,7 @@ static const struct file_operations proc_lstats_operations 
= {
.read   = seq_read,
.write  = lstats_write,
.llseek = seq_lseek,
-   .release= lstats_release,
+   .release= single_release,
 };
 
 #endif
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86: make DEBUG_PAGEALLOC and CPA more robust

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=92cb54a37a42a41cfb2ef7f1478bfa4395198258
Commit: 92cb54a37a42a41cfb2ef7f1478bfa4395198258
Parent: 1ce70c4fac3c3954bd48c035f448793867592bc0
Author: Ingo Molnar [EMAIL PROTECTED]
AuthorDate: Wed Feb 13 14:37:52 2008 +0100
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Tue Feb 26 12:55:50 2008 +0100

x86: make DEBUG_PAGEALLOC and CPA more robust

Use PF_MEMALLOC to prevent recursive calls in the DBEUG_PAGEALLOC
case. This makes the code simpler and more robust against allocation
failures.

This fixes the following fallback to non-mmconfig:

   http://lkml.org/lkml/2008/2/20/551
   http://bugzilla.kernel.org/show_bug.cgi?id=10083

Also, for DEBUG_PAGEALLOC=n reduce the pool size to one page.

Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
---
 arch/x86/mm/pageattr.c |   84 +---
 1 files changed, 51 insertions(+), 33 deletions(-)

diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 464d8fc..14e48b5 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -44,6 +44,12 @@ static inline unsigned long highmap_end_pfn(void)
 
 #endif
 
+#ifdef CONFIG_DEBUG_PAGEALLOC
+# define debug_pagealloc 1
+#else
+# define debug_pagealloc 0
+#endif
+
 static inline int
 within(unsigned long addr, unsigned long start, unsigned long end)
 {
@@ -355,45 +361,48 @@ out_unlock:
 
 static LIST_HEAD(page_pool);
 static unsigned long pool_size, pool_pages, pool_low;
-static unsigned long pool_used, pool_failed, pool_refill;
+static unsigned long pool_used, pool_failed;
 
-static void cpa_fill_pool(void)
+static void cpa_fill_pool(struct page **ret)
 {
-   struct page *p;
gfp_t gfp = GFP_KERNEL;
+   unsigned long flags;
+   struct page *p;
 
-   /* Do not allocate from interrupt context */
-   if (in_irq() || irqs_disabled())
-   return;
/*
-* Check unlocked. I does not matter when we have one more
-* page in the pool. The bit lock avoids recursive pool
-* allocations:
+* Avoid recursion (on debug-pagealloc) and also signal
+* our priority to get to these pagetables:
 */
-   if (pool_pages = pool_size || test_and_set_bit_lock(0, pool_refill))
+   if (current-flags  PF_MEMALLOC)
return;
+   current-flags |= PF_MEMALLOC;
 
-#ifdef CONFIG_DEBUG_PAGEALLOC
/*
-* We could do:
-* gfp = in_atomic() ? GFP_ATOMIC : GFP_KERNEL;
-* but this fails on !PREEMPT kernels
+* Allocate atomically from atomic contexts:
 */
-   gfp =  GFP_ATOMIC | __GFP_NORETRY | __GFP_NOWARN;
-#endif
+   if (in_atomic() || irqs_disabled() || debug_pagealloc)
+   gfp =  GFP_ATOMIC | __GFP_NORETRY | __GFP_NOWARN;
 
-   while (pool_pages  pool_size) {
+   while (pool_pages  pool_size || (ret  !*ret)) {
p = alloc_pages(gfp, 0);
if (!p) {
pool_failed++;
break;
}
-   spin_lock_irq(pgd_lock);
+   /*
+* If the call site needs a page right now, provide it:
+*/
+   if (ret  !*ret) {
+   *ret = p;
+   continue;
+   }
+   spin_lock_irqsave(pgd_lock, flags);
list_add(p-lru, page_pool);
pool_pages++;
-   spin_unlock_irq(pgd_lock);
+   spin_unlock_irqrestore(pgd_lock, flags);
}
-   clear_bit_unlock(0, pool_refill);
+
+   current-flags = ~PF_MEMALLOC;
 }
 
 #define SHIFT_MB   (20 - PAGE_SHIFT)
@@ -414,11 +423,15 @@ void __init cpa_init(void)
 * GiB. Shift MiB to Gib and multiply the result by
 * POOL_PAGES_PER_GB:
 */
-   gb = ((si.totalram  SHIFT_MB) + ROUND_MB_GB)  SHIFT_MB_GB;
-   pool_size = POOL_PAGES_PER_GB * gb;
+   if (debug_pagealloc) {
+   gb = ((si.totalram  SHIFT_MB) + ROUND_MB_GB)  SHIFT_MB_GB;
+   pool_size = POOL_PAGES_PER_GB * gb;
+   } else {
+   pool_size = 1;
+   }
pool_low = pool_size;
 
-   cpa_fill_pool();
+   cpa_fill_pool(NULL);
printk(KERN_DEBUG
   CPA: page pool initialized %lu of %lu pages preallocated\n,
   pool_pages, pool_size);
@@ -440,16 +453,20 @@ static int split_large_page(pte_t *kpte, unsigned long 
address)
spin_lock_irqsave(pgd_lock, flags);
if (list_empty(page_pool)) {
spin_unlock_irqrestore(pgd_lock, flags);
-   return -ENOMEM;
+   base = NULL;
+   cpa_fill_pool(base);
+   if (!base)
+   return -ENOMEM;
+   

x86: hpet fix docbook comment

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b02a7f22f39f02fdf5a1380ff700293639db4490
Commit: b02a7f22f39f02fdf5a1380ff700293639db4490
Parent: 92cb54a37a42a41cfb2ef7f1478bfa4395198258
Author: Pavel Machek [EMAIL PROTECTED]
AuthorDate: Tue Feb 5 00:48:13 2008 +0100
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Tue Feb 26 12:55:50 2008 +0100

x86: hpet fix docbook comment

Signed-off-by: Pavel Machek [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
---
 arch/x86/kernel/hpet.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 429d084..235fd6c 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -368,8 +368,8 @@ static int hpet_clocksource_register(void)
return 0;
 }
 
-/*
- * Try to setup the HPET timer
+/**
+ * hpet_enable - Try to setup the HPET timer. Returns 1 on success.
  */
 int __init hpet_enable(void)
 {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86: do not promote TM3x00/TM5x00 to i686-class

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a7ef94e6889186848573a10c5bdb8271405f44de
Commit: a7ef94e6889186848573a10c5bdb8271405f44de
Parent: b02a7f22f39f02fdf5a1380ff700293639db4490
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Thu Feb 14 14:51:00 2008 -0800
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Tue Feb 26 12:55:50 2008 +0100

x86: do not promote TM3x00/TM5x00 to i686-class

We have been promoting Transmeta TM3x00/TM5x00 chips to i686-class
based on the notion that they contain all the user-space visible
features of an i686-class chip.  However, this is not actually true:
they lack the EA-taking long NOPs (0F 1F /0).  Since this is a
userspace-visible incompatibility, downgrade these CPUs to the
manufacturer-defined i586 level.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
---
 arch/x86/kernel/cpu/transmeta.c |7 ---
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/arch/x86/kernel/cpu/transmeta.c b/arch/x86/kernel/cpu/transmeta.c
index 200fb3f..e8b422c 100644
--- a/arch/x86/kernel/cpu/transmeta.c
+++ b/arch/x86/kernel/cpu/transmeta.c
@@ -76,13 +76,6 @@ static void __cpuinit init_transmeta(struct cpuinfo_x86 *c)
/* All Transmeta CPUs have a constant TSC */
set_bit(X86_FEATURE_CONSTANT_TSC, c-x86_capability);

-   /* If we can run i686 user-space code, call us an i686 */
-#define USER686 ((1  X86_FEATURE_TSC)|\
-(1  X86_FEATURE_CX8)|\
-(1  X86_FEATURE_CMOV))
-if (c-x86 == 5  (c-x86_capability[0]  USER686) == USER686)
-   c-x86 = 6;
-
 #ifdef CONFIG_SYSCTL
/* randomize_va_space slows us down enormously;
   it probably triggers retranslation of x86-native bytecode */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86: require family = 6 if we are using P6 NOPs

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7343b3b3a627eb30e24e921f004f659c8ebb91c5
Commit: 7343b3b3a627eb30e24e921f004f659c8ebb91c5
Parent: a7ef94e6889186848573a10c5bdb8271405f44de
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Thu Feb 14 14:52:05 2008 -0800
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Tue Feb 26 12:55:51 2008 +0100

x86: require family = 6 if we are using P6 NOPs

The P6 family of NOPs are only available on family = 6 or above, so
enforce that in the boot code.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
---
 arch/x86/Kconfig.cpu   |5 +
 include/asm-x86/nops.h |4 +---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index e09a6b7..86fd2a0 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -377,6 +377,10 @@ config X86_OOSTORE
def_bool y
depends on (MWINCHIP3D || MWINCHIP2 || MWINCHIPC6)  MTRR
 
+config X86_P6_NOP
+   def_bool y
+   depends on (M686 || MPENTIUMII || MPENTIUMIII || MPENTIUMM || MCORE2 || 
PENTIUM4)
+
 config X86_TSC
def_bool y
depends on ((MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || 
MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII 
|| M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || 
MGEODE_LX || MCORE2)  !X86_NUMAQ) || X86_64
@@ -390,6 +394,7 @@ config X86_CMOV
 config X86_MINIMUM_CPU_FAMILY
int
default 64 if X86_64
+   default 6 if X86_32  X86_P6_NOP
default 4 if X86_32  (X86_XADD || X86_CMPXCHG || X86_BSWAP || 
X86_WP_WORKS_OK)
default 3
 
diff --git a/include/asm-x86/nops.h b/include/asm-x86/nops.h
index fec025c..c52b334 100644
--- a/include/asm-x86/nops.h
+++ b/include/asm-x86/nops.h
@@ -63,9 +63,7 @@
 #define ASM_NOP6 K7_NOP6
 #define ASM_NOP7 K7_NOP7
 #define ASM_NOP8 K7_NOP8
-#elif defined(CONFIG_M686) || defined(CONFIG_MPENTIUMII) || \
-  defined(CONFIG_MPENTIUMIII) || defined(CONFIG_MPENTIUMM) || \
-  defined(CONFIG_MCORE2) || defined(CONFIG_PENTIUM4)
+#elif defined(CONFIG_X86_P6_NOP)
 #define ASM_NOP1 P6_NOP1
 #define ASM_NOP2 P6_NOP2
 #define ASM_NOP3 P6_NOP3
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86: don't use P6_NOPs if compiling with CONFIG_X86_GENERIC

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=959b3be64cab9160cd74532a49b89cdd918d38e9
Commit: 959b3be64cab9160cd74532a49b89cdd918d38e9
Parent: 7343b3b3a627eb30e24e921f004f659c8ebb91c5
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Thu Feb 14 14:56:45 2008 -0800
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Tue Feb 26 12:55:51 2008 +0100

x86: don't use P6_NOPs if compiling with CONFIG_X86_GENERIC

P6_NOPs are definitely not supported on some VIA CPUs, and possibly
(unverified) on AMD K7s.  It is also the only thing that prevents a
686 kernel from running on Transmeta TM3x00/5x00 (Crusoe) series.

The performance benefit over generic NOPs is very small, so when
building for generic consumption, avoid using them.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
---
 arch/x86/Kconfig.cpu |   11 ++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index 86fd2a0..6d50064 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -377,9 +377,18 @@ config X86_OOSTORE
def_bool y
depends on (MWINCHIP3D || MWINCHIP2 || MWINCHIPC6)  MTRR
 
+#
+# P6_NOPs are a relatively minor optimization that require a family =
+# 6 processor, except that it is broken on certain VIA chips.
+# Furthermore, AMD chips prefer a totally different sequence of NOPs
+# (which work on all CPUs).  As a result, disallow these if we're
+# compiling X86_GENERIC but not X86_64 (these NOPs do work on all
+# x86-64 capable chips); the list of processors in the right-hand clause
+# are the cores that benefit from this optimization.
+#
 config X86_P6_NOP
def_bool y
-   depends on (M686 || MPENTIUMII || MPENTIUMIII || MPENTIUMM || MCORE2 || 
PENTIUM4)
+   depends on (X86_64 || !X86_GENERIC)  (M686 || MPENTIUMII || 
MPENTIUMIII || MPENTIUMM || MCORE2 || PENTIUM4)
 
 config X86_TSC
def_bool y
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86: add comments for NOPs

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4cd20952d74323df06e438c0c3273b5be89d6bfd
Commit: 4cd20952d74323df06e438c0c3273b5be89d6bfd
Parent: 959b3be64cab9160cd74532a49b89cdd918d38e9
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Mon Feb 18 23:24:33 2008 -0800
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Tue Feb 26 12:55:51 2008 +0100

x86: add comments for NOPs

Add comments describing the various NOP sequences.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
---
 include/asm-x86/nops.h |   62 ++-
 1 files changed, 45 insertions(+), 17 deletions(-)

diff --git a/include/asm-x86/nops.h b/include/asm-x86/nops.h
index c52b334..e3b2bce 100644
--- a/include/asm-x86/nops.h
+++ b/include/asm-x86/nops.h
@@ -3,17 +3,29 @@
 
 /* Define nops for use with alternative() */
 
-/* generic versions from gas */
-#define GENERIC_NOP1   .byte 0x90\n
-#define GENERIC_NOP2   .byte 0x89,0xf6\n
-#define GENERIC_NOP3.byte 0x8d,0x76,0x00\n
-#define GENERIC_NOP4.byte 0x8d,0x74,0x26,0x00\n
-#define GENERIC_NOP5GENERIC_NOP1 GENERIC_NOP4
-#define GENERIC_NOP6   .byte 0x8d,0xb6,0x00,0x00,0x00,0x00\n
-#define GENERIC_NOP7   .byte 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00\n
-#define GENERIC_NOP8   GENERIC_NOP1 GENERIC_NOP7
+/* generic versions from gas
+   1: nop
+   2: movl %esi,%esi
+   3: leal 0x00(%esi),%esi
+   4: leal 0x00(,%esi,1),%esi
+   6: leal 0x(%esi),%esi
+   7: leal 0x(,%esi,1),%esi
+*/
+#define GENERIC_NOP1 .byte 0x90\n
+#define GENERIC_NOP2 .byte 0x89,0xf6\n
+#define GENERIC_NOP3 .byte 0x8d,0x76,0x00\n
+#define GENERIC_NOP4 .byte 0x8d,0x74,0x26,0x00\n
+#define GENERIC_NOP5 GENERIC_NOP1 GENERIC_NOP4
+#define GENERIC_NOP6 .byte 0x8d,0xb6,0x00,0x00,0x00,0x00\n
+#define GENERIC_NOP7 .byte 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00\n
+#define GENERIC_NOP8 GENERIC_NOP1 GENERIC_NOP7
 
-/* Opteron 64bit nops */
+/* Opteron 64bit nops
+   1: nop
+   2: osp nop
+   3: osp osp nop
+   4: osp osp osp nop
+*/
 #define K8_NOP1 GENERIC_NOP1
 #define K8_NOP2.byte 0x66,0x90\n
 #define K8_NOP3.byte 0x66,0x66,0x90\n
@@ -23,19 +35,35 @@
 #define K8_NOP7K8_NOP4 K8_NOP3
 #define K8_NOP8K8_NOP4 K8_NOP4
 
-/* K7 nops */
-/* uses eax dependencies (arbitary choice) */
-#define K7_NOP1  GENERIC_NOP1
+/* K7 nops
+   uses eax dependencies (arbitary choice)
+   1: nop
+   2: movl %eax,%eax
+   3: leal (,%eax,1),%eax
+   4: leal 0x00(,%eax,1),%eax
+   6: leal 0x(%eax),%eax
+   7: leal 0x(,%eax,1),%eax
+*/
+#define K7_NOP1GENERIC_NOP1
 #define K7_NOP2.byte 0x8b,0xc0\n
 #define K7_NOP3.byte 0x8d,0x04,0x20\n
 #define K7_NOP4.byte 0x8d,0x44,0x20,0x00\n
 #define K7_NOP5K7_NOP4 ASM_NOP1
 #define K7_NOP6.byte 0x8d,0x80,0,0,0,0\n
-#define K7_NOP7.byte 0x8D,0x04,0x05,0,0,0,0\n
-#define K7_NOP8K7_NOP7 ASM_NOP1
+#define K7_NOP7.byte 0x8D,0x04,0x05,0,0,0,0\n
+#define K7_NOP8K7_NOP7 ASM_NOP1
 
-/* P6 nops */
-/* uses eax dependencies (Intel-recommended choice) */
+/* P6 nops
+   uses eax dependencies (Intel-recommended choice)
+   1: nop
+   2: osp nop
+   3: nopl (%eax)
+   4: nopl 0x00(%eax)
+   5: nopl 0x00(%eax,%eax,1)
+   6: osp nopl 0x00(%eax,%eax,1)
+   7: nopl 0x(%eax)
+   8: nopl 0x(%eax,%eax,1)
+*/
 #define P6_NOP1GENERIC_NOP1
 #define P6_NOP2.byte 0x66,0x90\n
 #define P6_NOP3.byte 0x0f,0x1f,0x00\n
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86: rename KERNEL_TEXT_SIZE = KERNEL_IMAGE_SIZE

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d4afe414189b098d56bcd24280c018aa2ac9a990
Commit: d4afe414189b098d56bcd24280c018aa2ac9a990
Parent: 88f3aec7afd9ae3e6f6d221801996b69aad1e3a4
Author: Ingo Molnar [EMAIL PROTECTED]
AuthorDate: Thu Feb 21 13:39:30 2008 +0100
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Tue Feb 26 12:55:56 2008 +0100

x86: rename KERNEL_TEXT_SIZE = KERNEL_IMAGE_SIZE

The KERNEL_TEXT_SIZE constant was mis-named, as we not only map the kernel
text but data, bss and init sections as well.

That name led me on the wrong path with the KERNEL_TEXT_SIZE regression,
because i knew how big of _text_ my images have and i knew about the 40 MB
text limit so i wrongly thought to be on the safe side of the 40 MB limit
with my 29 MB of text, while the total image size was slightly above 40 MB.

Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 arch/x86/kernel/head_64.S |2 +-
 include/asm-x86/page_64.h |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index b037b15..a007454 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -393,7 +393,7 @@ NEXT_PAGE(level2_kernel_pgt)
 *  too.)
 */
PMDS(0, __PAGE_KERNEL_LARGE_EXEC|_PAGE_GLOBAL,
-   KERNEL_TEXT_SIZE/PMD_SIZE)
+   KERNEL_IMAGE_SIZE/PMD_SIZE)
 
 NEXT_PAGE(level2_spare_pgt)
.fill   512, 8, 0
diff --git a/include/asm-x86/page_64.h b/include/asm-x86/page_64.h
index 3e2e3ca..1435460 100644
--- a/include/asm-x86/page_64.h
+++ b/include/asm-x86/page_64.h
@@ -51,8 +51,8 @@
  * Kernel image size is limited to 128 MB (see level2_kernel_pgt in
  * arch/x86/kernel/head_64.S), and it is mapped here:
  */
-#define KERNEL_TEXT_SIZE   (128*1024*1024)
-#define KERNEL_TEXT_START  _AC(0x8000, UL)
+#define KERNEL_IMAGE_SIZE  (128*1024*1024)
+#define KERNEL_IMAGE_START _AC(0x8000, UL)
 
 #ifndef __ASSEMBLY__
 void clear_page(void *page);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86: fix vsyscall wreckage

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ce28b9864b853803320c3f1d8de1b81aa4120b14
Commit: ce28b9864b853803320c3f1d8de1b81aa4120b14
Parent: d4afe414189b098d56bcd24280c018aa2ac9a990
Author: Thomas Gleixner [EMAIL PROTECTED]
AuthorDate: Wed Feb 20 23:57:30 2008 +0100
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Tue Feb 26 12:55:57 2008 +0100

x86: fix vsyscall wreckage

based on a report from Arne Georg Gleditsch about user-space apps
misbehaving after toggling /proc/sys/kernel/vsyscall64, a review
of the code revealed that the NOP patching done there is
fundamentally unsafe for a number of reasons:

1) the patching code runs without synchronizing other CPUs

2) it inserts NOPs even if there is no clock source which provides vread

3) when the clock source changes to one without vread we run in
   exactly the same problem as in #2

4) if nobody toggles the proc entry from 1 to 0 and to 1 again, then
   the syscall is not patched out

as a result it is possible to break user-space via this patching.
The only safe thing for now is to remove the patching.

This code was broken since v2.6.21.

Reported-by: Arne Georg Gleditsch [EMAIL PROTECTED]
Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 arch/x86/kernel/vsyscall_64.c |   52 ++--
 1 files changed, 3 insertions(+), 49 deletions(-)

diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c
index 3f82427..b6be812 100644
--- a/arch/x86/kernel/vsyscall_64.c
+++ b/arch/x86/kernel/vsyscall_64.c
@@ -44,11 +44,6 @@
 
 #define __vsyscall(nr) __attribute__ ((unused,__section__(.vsyscall_ #nr)))
 #define __syscall_clobber r11,cx,memory
-#define __pa_vsymbol(x)\
-   ({unsigned long v;  \
-   extern char __vsyscall_0;   \
- asm( : =r (v) : 0 (x)); \
- ((v - VSYSCALL_START) + __pa_symbol(__vsyscall_0)); })
 
 /*
  * vsyscall_gtod_data contains data that is :
@@ -102,7 +97,7 @@ static __always_inline void do_get_tz(struct timezone * tz)
 static __always_inline int gettimeofday(struct timeval *tv, struct timezone 
*tz)
 {
int ret;
-   asm volatile(vsysc2: syscall
+   asm volatile(syscall
: =a (ret)
: 0 (__NR_gettimeofday),D (tv),S (tz)
: __syscall_clobber );
@@ -112,7 +107,7 @@ static __always_inline int gettimeofday(struct timeval *tv, 
struct timezone *tz)
 static __always_inline long time_syscall(long *t)
 {
long secs;
-   asm volatile(vsysc1: syscall
+   asm volatile(syscall
: =a (secs)
: 0 (__NR_time),D (t) : __syscall_clobber);
return secs;
@@ -227,50 +222,10 @@ long __vsyscall(3) venosys_1(void)
 }
 
 #ifdef CONFIG_SYSCTL
-
-#define SYSCALL 0x050f
-#define NOP20x9090
-
-/*
- * NOP out syscall in vsyscall page when not needed.
- */
-static int vsyscall_sysctl_change(ctl_table *ctl, int write, struct file * 
filp,
-void __user *buffer, size_t *lenp, loff_t *ppos)
-{
-   extern u16 vsysc1, vsysc2;
-   u16 __iomem *map1;
-   u16 __iomem *map2;
-   int ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
-   if (!write)
-   return ret;
-   /* gcc has some trouble with __va(__pa()), so just do it this
-  way. */
-   map1 = ioremap(__pa_vsymbol(vsysc1), 2);
-   if (!map1)
-   return -ENOMEM;
-   map2 = ioremap(__pa_vsymbol(vsysc2), 2);
-   if (!map2) {
-   ret = -ENOMEM;
-   goto out;
-   }
-   if (!vsyscall_gtod_data.sysctl_enabled) {
-   writew(SYSCALL, map1);
-   writew(SYSCALL, map2);
-   } else {
-   writew(NOP2, map1);
-   writew(NOP2, map2);
-   }
-   iounmap(map2);
-out:
-   iounmap(map1);
-   return ret;
-}
-
 static ctl_table kernel_table2[] = {
{ .procname = vsyscall64,
  .data = vsyscall_gtod_data.sysctl_enabled, .maxlen = sizeof(int),
- .mode = 0644,
- .proc_handler = vsyscall_sysctl_change },
+ .mode = 0644 },
{}
 };
 
@@ -279,7 +234,6 @@ static ctl_table kernel_root_table2[] = {
  .child = kernel_table2 },
{}
 };
-
 #endif
 
 /* Assume __initcall executes before all user space. Hopefully kmod
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86: fix execve with -fstack-protect

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5d119b2c9a490e2d647eae134211b32a18a04c7d
Commit: 5d119b2c9a490e2d647eae134211b32a18a04c7d
Parent: ce28b9864b853803320c3f1d8de1b81aa4120b14
Author: Ingo Molnar [EMAIL PROTECTED]
AuthorDate: Tue Feb 26 12:55:57 2008 +0100
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Tue Feb 26 12:55:57 2008 +0100

x86: fix execve with -fstack-protect

pointed out by [EMAIL PROTECTED]:

 what happens here is that gcc treats the argument area as owned by the
 callee, not the caller and is allowed to do certain tricks. for ssp it
 will make a copy of the struct passed by value into the local variable
 area and pass *its* address down, and it won't copy it back into the
 original instance stored in the argument area.

 so once sys_execve returns, the pt_regs passed by value hasn't at all
 changed and its default content will cause a nice double fault (FWIW,
 this part took me the longest to debug, being down with cold didn't
 help it either ;).

To fix this we pass in pt_regs by pointer.

Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
---
 arch/x86/kernel/entry_64.S   |6 --
 arch/x86/kernel/process_64.c |6 +++---
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 2ad9a1b..c20c9e7 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -453,6 +453,7 @@ ENTRY(stub_execve)
CFI_REGISTER rip, r11
SAVE_REST
FIXUP_TOP_OF_STACK %r11
+   movq %rsp, %rcx
call sys_execve
RESTORE_TOP_OF_STACK %r11
movq %rax,RAX(%rsp)
@@ -1036,15 +1037,16 @@ ENDPROC(child_rip)
  * rdi: name, rsi: argv, rdx: envp
  *
  * We want to fallback into:
- * extern long sys_execve(char *name, char **argv,char **envp, struct 
pt_regs regs)
+ * extern long sys_execve(char *name, char **argv,char **envp, struct 
pt_regs *regs)
  *
  * do_sys_execve asm fallback arguments:
- * rdi: name, rsi: argv, rdx: envp, fake frame on the stack
+ * rdi: name, rsi: argv, rdx: envp, rcx: fake frame on the stack
  */
 ENTRY(kernel_execve)
CFI_STARTPROC
FAKE_STACK_FRAME $0
SAVE_ALL
+   movq %rsp,%rcx
call sys_execve
movq %rax, RAX(%rsp)
RESTORE_REST
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index b0cc8f0..43f2877 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -730,16 +730,16 @@ __switch_to(struct task_struct *prev_p, struct 
task_struct *next_p)
  */
 asmlinkage
 long sys_execve(char __user *name, char __user * __user *argv,
-   char __user * __user *envp, struct pt_regs regs)
+   char __user * __user *envp, struct pt_regs *regs)
 {
long error;
char * filename;
 
filename = getname(name);
error = PTR_ERR(filename);
-   if (IS_ERR(filename)) 
+   if (IS_ERR(filename))
return error;
-   error = do_execve(filename, argv, envp, regs); 
+   error = do_execve(filename, argv, envp, regs);
putname(filename);
return error;
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86: don't print a warning when MTRR are blank and running in KVM

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4147c8747eace9058c606b35e700060297edaf91
Commit: 4147c8747eace9058c606b35e700060297edaf91
Parent: 5d119b2c9a490e2d647eae134211b32a18a04c7d
Author: Joerg Roedel [EMAIL PROTECTED]
AuthorDate: Thu Feb 21 15:50:14 2008 +0100
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Tue Feb 26 12:55:57 2008 +0100

x86: don't print a warning when MTRR are blank and running in KVM

Inside a KVM virtual machine the MTRRs are usually blank. This confuses 
Linux
and causes a warning message at boot. This patch removes that warning 
message
when running Linux as a KVM guest.

Signed-off-by: Joerg Roedel [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 arch/x86/kernel/cpu/mtrr/main.c |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
index c8fda3e..be83336 100644
--- a/arch/x86/kernel/cpu/mtrr/main.c
+++ b/arch/x86/kernel/cpu/mtrr/main.c
@@ -43,6 +43,7 @@
 #include asm/uaccess.h
 #include asm/processor.h
 #include asm/msr.h
+#include asm/kvm_para.h
 #include mtrr.h
 
 u32 num_var_ranges = 0;
@@ -689,8 +690,11 @@ int __init mtrr_trim_uncached_memory(unsigned long end_pfn)
 
/* kvm/qemu doesn't have mtrr set right, don't trim them all */
if (!highest_pfn) {
-   printk(KERN_WARNING WARNING: strange, CPU MTRRs all blank?\n);
-   WARN_ON(1);
+   if (!kvm_para_available()) {
+   printk(KERN_WARNING
+   WARNING: strange, CPU MTRRs all blank?\n);
+   WARN_ON(1);
+   }
return 0;
}
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86: don't save unreliable stack trace entries

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1650743cdc0db73478f72c57544ce79ea8f3dda6
Commit: 1650743cdc0db73478f72c57544ce79ea8f3dda6
Parent: ed2b7e2b1d1ae201afe8fbd111632074b7b53ed4
Author: Vegard Nossum [EMAIL PROTECTED]
AuthorDate: Fri Feb 22 19:23:58 2008 +0100
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Tue Feb 26 12:55:58 2008 +0100

x86: don't save unreliable stack trace entries

Currently, there is no way for print_stack_trace() to determine whether
a given stack trace entry was deemed reliable or not, simply because
save_stack_trace() does not record this information. (Perhaps needless
to say, this makes the saved stack traces A LOT harder to read, and
probably with no other benefits, since debugging features that use
save_stack_trace() most likely also require frame pointers, etc.)

This patch reverts to the old behaviour of only recording the reliable trace
entries for saved stack traces.

Signed-off-by: Vegard Nossum [EMAIL PROTECTED]
Acked-by: Arjan van de Ven [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 arch/x86/kernel/stacktrace.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/stacktrace.c b/arch/x86/kernel/stacktrace.c
index 02f0f61..c28c342 100644
--- a/arch/x86/kernel/stacktrace.c
+++ b/arch/x86/kernel/stacktrace.c
@@ -25,6 +25,8 @@ static int save_stack_stack(void *data, char *name)
 static void save_stack_address(void *data, unsigned long addr, int reliable)
 {
struct stack_trace *trace = data;
+   if (!reliable)
+   return;
if (trace-skip  0) {
trace-skip--;
return;
@@ -37,6 +39,8 @@ static void
 save_stack_address_nosched(void *data, unsigned long addr, int reliable)
 {
struct stack_trace *trace = (struct stack_trace *)data;
+   if (!reliable)
+   return;
if (in_sched_functions(addr))
return;
if (trace-skip  0) {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86: make c_idle.work have a static address.

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2b775a27c0d9fdf8078d5b31e1e27411e5bf2a91
Commit: 2b775a27c0d9fdf8078d5b31e1e27411e5bf2a91
Parent: 1650743cdc0db73478f72c57544ce79ea8f3dda6
Author: Glauber Costa [EMAIL PROTECTED]
AuthorDate: Fri Feb 22 12:09:29 2008 -0300
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Tue Feb 26 12:56:02 2008 +0100

x86: make c_idle.work have a static address.

Currently, c_idle is declared in the stack, and thus, have no static 
address.

Peter Zijlstra points out this simple solution, in which c_idle.work
is initializated separatedly. Note that the INIT_WORK macro has a static
declaration of a key inside.

Signed-off-by: Glauber Costa [EMAIL PROTECTED]
Acked-by: Peter Zijlstra [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 arch/x86/kernel/smpboot_64.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/smpboot_64.c b/arch/x86/kernel/smpboot_64.c
index d53bd6f..0880f2c 100644
--- a/arch/x86/kernel/smpboot_64.c
+++ b/arch/x86/kernel/smpboot_64.c
@@ -554,10 +554,10 @@ static int __cpuinit do_boot_cpu(int cpu, int apicid)
int timeout;
unsigned long start_rip;
struct create_idle c_idle = {
-   .work = __WORK_INITIALIZER(c_idle.work, do_fork_idle),
.cpu = cpu,
.done = COMPLETION_INITIALIZER_ONSTACK(c_idle.done),
};
+   INIT_WORK(c_idle.work, do_fork_idle);
 
/* allocate memory for gdts of secondary cpus. Hotplug is considered */
if (!cpu_gdt_descr[cpu].address 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86: fix build on non-C locales.

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=03994f01e8b72b3d01fd3d09d1cc7c9f421a727c
Commit: 03994f01e8b72b3d01fd3d09d1cc7c9f421a727c
Parent: 2b775a27c0d9fdf8078d5b31e1e27411e5bf2a91
Author: Priit Laes [EMAIL PROTECTED]
AuthorDate: Sun Feb 24 18:36:05 2008 +0200
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Tue Feb 26 12:56:02 2008 +0100

x86: fix build on non-C locales.

For some locales regex range [a-zA-Z] does not work as it is supposed to.
so we have to use [:alnum:] and [:xdigit:] to make it work as intended.

[1] http://en.wikipedia.org/wiki/Estonian_alphabet

Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 arch/x86/vdso/Makefile |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
index f385a4b..b8bd0c4 100644
--- a/arch/x86/vdso/Makefile
+++ b/arch/x86/vdso/Makefile
@@ -48,7 +48,7 @@ obj-$(VDSO64-y)   += vdso-syms.lds
 # Match symbols in the DSO that look like VDSO*; produce a file of constants.
 #
 sed-vdsosym := -e 's/^00*/0/' \
-   -e 's/^\([0-9a-fA-F]*\) . \(VDSO[a-zA-Z0-9_]*\)$$/\2 = 0x\1;/p'
+   -e 's/^\([[:xdigit:]]*\) . \(VDSO[[:alnum:]_]*\)$$/\2 = 0x\1;/p'
 quiet_cmd_vdsosym = VDSOSYM $@
   cmd_vdsosym = $(NM) $ | sed -n $(sed-vdsosym) | LC_ALL=C sort  $@
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86: fix boot failure on 486 due to TSC breakage

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=12c247a6719987aad65f83158d2bb3e73c75c1f5
Commit: 12c247a6719987aad65f83158d2bb3e73c75c1f5
Parent: 03994f01e8b72b3d01fd3d09d1cc7c9f421a727c
Author: Mikael Pettersson [EMAIL PROTECTED]
AuthorDate: Sun Feb 24 18:27:03 2008 +0100
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Tue Feb 26 12:56:04 2008 +0100

x86: fix boot failure on 486 due to TSC breakage

  Diffing dmesg between git7 and git8 doesn't sched any light since
  git8 also removed the printouts of the x86 caps as they were being
  initialised and updated. I'm currently adding those printouts back
  in the hope of seeing where and when the caps get broken.

That turned out to be very illuminating:

 --- dmesg-2.6.24-git7  2008-02-24 18:01:25.295851000 +0100
 +++ dmesg-2.6.24-git8  2008-02-24 18:01:25.530358000 +0100
 ...
 CPU: After generic identify, caps: 0003    
   

 CPU: After all inits, caps: 0003     
  
+CPU: After applying cleared_cpu_caps, caps: 0013   
    

Notice how the TSC cap bit goes from Off to On.

(The first two lines are printout loops from -git7 forward-ported
to -git8, the third line is the same printout loop added just after
the xor-with-cleared_cpu_caps[] loop.)

Here's how the breakage occurs:
1. arch/x86/kernel/tsc_32.c:tsc_init() sees !cpu_has_tsc,
   so bails and calls setup_clear_cpu_cap(X86_FEATURE_TSC).
2. include/asm-x86/cpufeature.h:setup_clear_cpu_cap(bit) clears
   the bit in boot_cpu_data and sets it in cleared_cpu_caps
3. arch/x86/kernel/cpu/common.c:identify_cpu() XORs all caps
   in with cleared_cpu_caps
   HOWEVER, at this point c-x86_capability correctly has TSC
   Off, cleared_cpu_caps has TSC On, so the XOR incorrectly
   sets TSC to On in c-x86_capability, with disastrous results.

The real bug is that clearing bits with XOR only works if the
bits are known to be 1 prior to the XOR, and that's not true here.

A simple fix is to convert the XOR to AND-NOT instead. The following
patch does that, and allows my 486 to boot 2.6.25-rc kernels again.

[ [EMAIL PROTECTED]: fixed a similar bug in setup_64.c as well. ]

The breakage was introduced via commit 7d851c8d3db0.

Signed-off-by: Mikael Pettersson [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 arch/x86/kernel/cpu/common.c |2 +-
 arch/x86/kernel/setup_64.c   |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index f86a3c4..a38aafa 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -504,7 +504,7 @@ void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
 
/* Clear all flags overriden by options */
for (i = 0; i  NCAPINTS; i++)
-   c-x86_capability[i] ^= cleared_cpu_caps[i];
+   c-x86_capability[i] = ~cleared_cpu_caps[i];
 
/* Init Machine Check Exception if available. */
mcheck_init(c);
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index 6fd804f..7637dc9 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -1021,7 +1021,7 @@ void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
 
/* Clear all flags overriden by options */
for (i = 0; i  NCAPINTS; i++)
-   c-x86_capability[i] ^= cleared_cpu_caps[i];
+   c-x86_capability[i] = ~cleared_cpu_caps[i];
 
 #ifdef CONFIG_X86_MCE
mcheck_init(c);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86: no robust/pi futex for real i386 CPUs

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f18edc95a37a901ffcbe91f5e05105f916a04fae
Commit: f18edc95a37a901ffcbe91f5e05105f916a04fae
Parent: 12c247a6719987aad65f83158d2bb3e73c75c1f5
Author: Thomas Gleixner [EMAIL PROTECTED]
AuthorDate: Sat Feb 16 14:05:01 2008 +0100
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Tue Feb 26 12:56:06 2008 +0100

x86: no robust/pi futex for real i386 CPUs

Real i386 CPUs do not have cmpxchg instructions. Catch it before
crashing on an invalid opcode.

Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
---
 include/asm-x86/futex.h |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/futex.h b/include/asm-x86/futex.h
index cd9f894..c9952ea 100644
--- a/include/asm-x86/futex.h
+++ b/include/asm-x86/futex.h
@@ -102,6 +102,13 @@ futex_atomic_op_inuser(int encoded_op, int __user *uaddr)
 static inline int
 futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
 {
+
+#if defined(CONFIG_X86_32)  !defined(CONFIG_X86_BSWAP)
+   /* Real i386 machines have no cmpxchg instruction */
+   if (boot_cpu_data.x86 == 3)
+   return -ENOSYS;
+#endif
+
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
return -EFAULT;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


firewire: fw-sbp2: unsigned int vs. unsigned

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=05cca7381429e12d66c5b5c8b5c5848055b88bf7
Commit: 05cca7381429e12d66c5b5c8b5c5848055b88bf7
Parent: 19af35546de68c872dcb687613e0902a602cb20e
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Sat Jan 26 17:42:45 2008 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Sat Feb 16 15:40:32 2008 +0100

firewire: fw-sbp2: unsigned int vs. unsigned

Standardize on unsigned int style.
Sort some struct members thematically.

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-sbp2.c |   14 ++
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 19ece9b..f2a9a33 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -141,15 +141,13 @@ struct sbp2_logical_unit {
 struct sbp2_target {
struct kref kref;
struct fw_unit *unit;
+   struct list_head lu_list;
 
u64 management_agent_address;
int directory_id;
int node_id;
int address_high;
-
-   unsigned workarounds;
-   struct list_head lu_list;
-
+   unsigned int workarounds;
unsigned int mgt_orb_timeout;
 };
 
@@ -160,7 +158,7 @@ struct sbp2_target {
  */
 #define SBP2_MIN_LOGIN_ORB_TIMEOUT 5000U   /* Timeout in ms */
 #define SBP2_MAX_LOGIN_ORB_TIMEOUT 4U  /* Timeout in ms */
-#define SBP2_ORB_TIMEOUT   2000/* Timeout in ms */
+#define SBP2_ORB_TIMEOUT   2000U   /* Timeout in ms */
 #define SBP2_ORB_NULL  0x8000
 #define SBP2_MAX_SG_ELEMENT_LENGTH 0xf000
 
@@ -297,7 +295,7 @@ struct sbp2_command_orb {
 static const struct {
u32 firmware_revision;
u32 model;
-   unsigned workarounds;
+   unsigned int workarounds;
 } sbp2_workarounds_table[] = {
/* DViCO Momobay CX-1 with TSB42AA9 bridge */ {
.firmware_revision  = 0x002800,
@@ -836,7 +834,7 @@ static void sbp2_init_workarounds(struct sbp2_target *tgt, 
u32 model,
  u32 firmware_revision)
 {
int i;
-   unsigned w = sbp2_param_workarounds;
+   unsigned int w = sbp2_param_workarounds;
 
if (w)
fw_notify(Please notify [EMAIL PROTECTED] 
@@ -1197,7 +1195,7 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, 
scsi_done_fn_t done)
struct sbp2_logical_unit *lu = cmd-device-hostdata;
struct fw_device *device = fw_device(lu-tgt-unit-device.parent);
struct sbp2_command_orb *orb;
-   unsigned max_payload;
+   unsigned int max_payload;
int retval = SCSI_MLQUEUE_HOST_BUSY;
 
/*
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


firewire: fw-sbp2: fix logout before login retry

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1b9c12ba2fdf802a23630f70eddb0e821296634e
Commit: 1b9c12ba2fdf802a23630f70eddb0e821296634e
Parent: 05cca7381429e12d66c5b5c8b5c5848055b88bf7
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Sat Jan 26 17:43:23 2008 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Sat Feb 16 15:40:32 2008 +0100

firewire: fw-sbp2: fix logout before login retry

This fixes a can't recognize device kind of bug.

If the SCSI INQUIRY failed and hence __scsi_add_device failed due to a
bus reset, we tried a logout and then waited for the already scheduled
login work to happen.  So far so good, but the generation used for the
logout was outdated, hence the logout never reached the target.  The
target might therefore deny the subsequent relogin attempt, which would
also leave the target inaccessible.

Therefore fetch a fresh device-generation for the logout.  Use memory
barriers to prevent our plan being foiled by compiler or hardware
optimizations.

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-sbp2.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index f2a9a33..a15e3c7 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -716,7 +716,11 @@ static void sbp2_login(struct work_struct *work)
sdev = __scsi_add_device(shost, 0, 0,
 scsilun_to_int(eight_bytes_lun), lu);
if (IS_ERR(sdev)) {
-   sbp2_send_management_orb(lu, node_id, generation,
+   smp_rmb(); /* generation may have changed */
+   generation = device-generation;
+   smp_rmb(); /* node_id must not be older than generation */
+
+   sbp2_send_management_orb(lu, device-node_id, generation,
SBP2_LOGOUT_REQUEST, lu-login_id, NULL);
/*
 * Set this back to sbp2_login so we fall back and
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


firewire: fix kobject_add failed for fw* with -EEXIST

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=96b19062e741b715cf399312c30e0672d8889569
Commit: 96b19062e741b715cf399312c30e0672d8889569
Parent: 1b9c12ba2fdf802a23630f70eddb0e821296634e
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Sat Feb 2 15:01:09 2008 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Sat Feb 16 15:40:33 2008 +0100

firewire: fix kobject_add failed for fw* with -EEXIST

There is a race between shutdown and creation of devices:  fw-core may
attempt to add a device with the same name of an already existing
device.  http://bugzilla.kernel.org/show_bug.cgi?id=9828

Impact of the bug:  Happens rarely (when shutdown of a device coincides
with creation of another), forces the user to unplug and replug the new
device to get it working.

The fix is obvious:  Free the minor number *after* instead of *before*
device_unregister().  This requires to take an additional reference of
the fw_device as long as the IDR tree points to it.

And while we are at it, we fix an additional race condition:
fw_device_op_open() took its reference of the fw_device a little bit too
late, hence was in danger to access an already invalid fw_device.

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-cdev.c   |8 +---
 drivers/firewire/fw-device.c |   20 ++--
 drivers/firewire/fw-device.h |2 +-
 3 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/drivers/firewire/fw-cdev.c b/drivers/firewire/fw-cdev.c
index 7e73cba..44ccee2 100644
--- a/drivers/firewire/fw-cdev.c
+++ b/drivers/firewire/fw-cdev.c
@@ -109,15 +109,17 @@ static int fw_device_op_open(struct inode *inode, struct 
file *file)
struct client *client;
unsigned long flags;
 
-   device = fw_device_from_devt(inode-i_rdev);
+   device = fw_device_get_by_devt(inode-i_rdev);
if (device == NULL)
return -ENODEV;
 
client = kzalloc(sizeof(*client), GFP_KERNEL);
-   if (client == NULL)
+   if (client == NULL) {
+   fw_device_put(device);
return -ENOMEM;
+   }
 
-   client-device = fw_device_get(device);
+   client-device = device;
INIT_LIST_HEAD(client-event_list);
INIT_LIST_HEAD(client-resource_list);
spin_lock_init(client-lock);
diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c
index de9066e..c04c288 100644
--- a/drivers/firewire/fw-device.c
+++ b/drivers/firewire/fw-device.c
@@ -610,12 +610,14 @@ static DECLARE_RWSEM(idr_rwsem);
 static DEFINE_IDR(fw_device_idr);
 int fw_cdev_major;
 
-struct fw_device *fw_device_from_devt(dev_t devt)
+struct fw_device *fw_device_get_by_devt(dev_t devt)
 {
struct fw_device *device;
 
down_read(idr_rwsem);
device = idr_find(fw_device_idr, MINOR(devt));
+   if (device)
+   fw_device_get(device);
up_read(idr_rwsem);
 
return device;
@@ -627,13 +629,14 @@ static void fw_device_shutdown(struct work_struct *work)
container_of(work, struct fw_device, work.work);
int minor = MINOR(device-device.devt);
 
-   down_write(idr_rwsem);
-   idr_remove(fw_device_idr, minor);
-   up_write(idr_rwsem);
-
fw_device_cdev_remove(device);
device_for_each_child(device-device, NULL, shutdown_unit);
device_unregister(device-device);
+
+   down_write(idr_rwsem);
+   idr_remove(fw_device_idr, minor);
+   up_write(idr_rwsem);
+   fw_device_put(device);
 }
 
 static struct device_type fw_device_type = {
@@ -682,10 +685,13 @@ static void fw_device_init(struct work_struct *work)
}
 
err = -ENOMEM;
+
+   fw_device_get(device);
down_write(idr_rwsem);
if (idr_pre_get(fw_device_idr, GFP_KERNEL))
err = idr_get_new(fw_device_idr, device, minor);
up_write(idr_rwsem);
+
if (err  0)
goto error;
 
@@ -741,7 +747,9 @@ static void fw_device_init(struct work_struct *work)
idr_remove(fw_device_idr, minor);
up_write(idr_rwsem);
  error:
-   put_device(device-device);
+   fw_device_put(device);  /* fw_device_idr's reference */
+
+   put_device(device-device);/* our reference */
 }
 
 static int update_unit(struct device *dev, void *data)
diff --git a/drivers/firewire/fw-device.h b/drivers/firewire/fw-device.h
index 0854fe2..43808c0 100644
--- a/drivers/firewire/fw-device.h
+++ b/drivers/firewire/fw-device.h
@@ -77,13 +77,13 @@ fw_device_is_shutdown(struct fw_device *device)
 }
 
 struct fw_device *fw_device_get(struct fw_device *device);
+struct fw_device *fw_device_get_by_devt(dev_t devt);
 void fw_device_put(struct fw_device *device);
 int fw_device_enable_phys_dma(struct fw_device *device);
 
 void fw_device_cdev_update(struct fw_device *device);
 void 

firewire: log GUID of new devices

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fa6e697b85d705d37b3b03829095c22bcbe95ab6
Commit: fa6e697b85d705d37b3b03829095c22bcbe95ab6
Parent: be6f48b0174584c9c415012ca14803c7e941e27e
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Sun Feb 3 23:03:00 2008 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Sat Feb 16 15:40:34 2008 +0100

firewire: log GUID of new devices

This should help to interpret user reports.  E.g. one can look up the
vendor OUI (first three bytes of the GUID) and thus tell what is what.

Also simplifies the math in the GUID sysfs attribute.

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
Signed-off-by: Jarod Wilson [EMAIL PROTECTED]
---
 drivers/firewire/fw-device.c |   28 +---
 1 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c
index c04c288..2ab13e0 100644
--- a/drivers/firewire/fw-device.c
+++ b/drivers/firewire/fw-device.c
@@ -358,12 +358,9 @@ static ssize_t
 guid_show(struct device *dev, struct device_attribute *attr, char *buf)
 {
struct fw_device *device = fw_device(dev);
-   u64 guid;
 
-   guid = ((u64)device-config_rom[3]  32) | device-config_rom[4];
-
-   return snprintf(buf, PAGE_SIZE, 0x%016llx\n,
-   (unsigned long long)guid);
+   return snprintf(buf, PAGE_SIZE, 0x%08x%08x\n,
+   device-config_rom[3], device-config_rom[4]);
 }
 
 static struct device_attribute fw_device_attributes[] = {
@@ -723,13 +720,22 @@ static void fw_device_init(struct work_struct *work)
 */
if (atomic_cmpxchg(device-state,
FW_DEVICE_INITIALIZING,
-   FW_DEVICE_RUNNING) == FW_DEVICE_SHUTDOWN)
+   FW_DEVICE_RUNNING) == FW_DEVICE_SHUTDOWN) {
fw_device_shutdown(device-work.work);
-   else
-   fw_notify(created new fw device %s 
- (%d config rom retries, S%d00)\n,
- device-device.bus_id, device-config_rom_retries,
- 1  device-max_speed);
+   } else {
+   if (device-config_rom_retries)
+   fw_notify(created device %s: GUID %08x%08x, S%d00, 
+ %d config ROM retries\n,
+ device-device.bus_id,
+ device-config_rom[3], device-config_rom[4],
+ 1  device-max_speed,
+ device-config_rom_retries);
+   else
+   fw_notify(created device %s: GUID %08x%08x, S%d00\n,
+ device-device.bus_id,
+ device-config_rom[3], device-config_rom[4],
+ 1  device-max_speed);
+   }
 
/*
 * Reschedule the IRM work if we just finished reading the
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


firewire: fw-sbp2: add INQUIRY delay workaround

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9220f1946209a5b3335ea2d28f8462695885791b
Commit: 9220f1946209a5b3335ea2d28f8462695885791b
Parent: fa6e697b85d705d37b3b03829095c22bcbe95ab6
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Sun Feb 3 23:04:38 2008 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Sat Feb 16 15:40:34 2008 +0100

firewire: fw-sbp2: add INQUIRY delay workaround

Several different SBP-2 bridges accept a login early while the IDE
device is still powering up.  They are therefore unable to respond to
SCSI INQUIRY immediately, and the SCSI core has to retry the INQUIRY.
One of these retries is typically successful, and all is well.

But in case of Momobay FX-3A, the INQUIRY retries tend to fail entirely.
This can usually be avoided by waiting a little while after login before
letting the SCSI core send the INQUIRY.  The old sbp2 driver handles
this more gracefully for as yet unknown reasons (perhaps because it
waits for fetch agent resets to complete, unlike fw-sbp2 which quickly
proceeds after requesting the agent reset).  Therefore the workaround is
not as much necessary for sbp2.

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
Signed-off-by: Jarod Wilson [EMAIL PROTECTED]
---
 drivers/firewire/fw-sbp2.c |   15 +++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 72fddf5..4a118fb 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -32,6 +32,7 @@
 #include linux/module.h
 #include linux/moduleparam.h
 #include linux/mod_devicetable.h
+#include linux/delay.h
 #include linux/device.h
 #include linux/scatterlist.h
 #include linux/dma-mapping.h
@@ -82,6 +83,9 @@ MODULE_PARM_DESC(exclusive_login, Exclusive login to sbp2 
device 
  *   Avoids access beyond actual disk limits on devices with an off-by-one bug.
  *   Don't use this with devices which don't have this bug.
  *
+ * - delay inquiry
+ *   Wait extra SBP2_INQUIRY_DELAY seconds after login before SCSI inquiry.
+ *
  * - override internal blacklist
  *   Instead of adding to the built-in blacklist, use only the workarounds
  *   specified in the module load parameter.
@@ -91,6 +95,8 @@ MODULE_PARM_DESC(exclusive_login, Exclusive login to sbp2 
device 
 #define SBP2_WORKAROUND_INQUIRY_36 0x2
 #define SBP2_WORKAROUND_MODE_SENSE_8   0x4
 #define SBP2_WORKAROUND_FIX_CAPACITY   0x8
+#define SBP2_WORKAROUND_DELAY_INQUIRY  0x10
+#define SBP2_INQUIRY_DELAY 12
 #define SBP2_WORKAROUND_OVERRIDE   0x100
 
 static int sbp2_param_workarounds;
@@ -100,6 +106,7 @@ MODULE_PARM_DESC(workarounds, Work around device bugs 
(default = 0
, 36 byte inquiry = __stringify(SBP2_WORKAROUND_INQUIRY_36)
, skip mode page 8 =__stringify(SBP2_WORKAROUND_MODE_SENSE_8)
, fix capacity =__stringify(SBP2_WORKAROUND_FIX_CAPACITY)
+   , delay inquiry =   __stringify(SBP2_WORKAROUND_DELAY_INQUIRY)
, override internal blacklist =  __stringify(SBP2_WORKAROUND_OVERRIDE)
, or a combination));
 
@@ -303,6 +310,11 @@ static const struct {
.workarounds= SBP2_WORKAROUND_INQUIRY_36 |
  SBP2_WORKAROUND_MODE_SENSE_8,
},
+   /* DViCO Momobay FX-3A with TSB42AA9A bridge */ {
+   .firmware_revision  = 0x002800,
+   .model  = 0x00,
+   .workarounds= SBP2_WORKAROUND_DELAY_INQUIRY,
+   },
/* Initio bridges, actually only needed for some older ones */ {
.firmware_revision  = 0x000200,
.model  = ~0,
@@ -712,6 +724,9 @@ static void sbp2_login(struct work_struct *work)
PREPARE_DELAYED_WORK(lu-work, sbp2_reconnect);
sbp2_agent_reset(lu);
 
+   if (lu-tgt-workarounds  SBP2_WORKAROUND_DELAY_INQUIRY)
+   ssleep(SBP2_INQUIRY_DELAY);
+
memset(eight_bytes_lun, 0, sizeof(eight_bytes_lun));
eight_bytes_lun.scsi_lun[0] = (lu-lun  8)  0xff;
eight_bytes_lun.scsi_lun[1] = lu-lun  0xff;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ieee1394: sbp2: add INQUIRY delay workaround

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d94a983526cb868658c958ab689410dc1c6a31f3
Commit: d94a983526cb868658c958ab689410dc1c6a31f3
Parent: 9220f1946209a5b3335ea2d28f8462695885791b
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Sun Feb 3 23:07:44 2008 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Sat Feb 16 15:40:34 2008 +0100

ieee1394: sbp2: add INQUIRY delay workaround

Add the same workaround as found in fw-sbp2 for feature parity and
compatibility of the workarounds module parameter.

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
Signed-off-by: Jarod Wilson [EMAIL PROTECTED]
---
 drivers/ieee1394/sbp2.c |   12 
 drivers/ieee1394/sbp2.h |2 ++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index 28e155a..accb2ad 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -183,6 +183,9 @@ MODULE_PARM_DESC(exclusive_login, Exclusive login to sbp2 
device 
  *   Avoids access beyond actual disk limits on devices with an off-by-one bug.
  *   Don't use this with devices which don't have this bug.
  *
+ * - delay inquiry
+ *   Wait extra SBP2_INQUIRY_DELAY seconds after login before SCSI inquiry.
+ *
  * - override internal blacklist
  *   Instead of adding to the built-in blacklist, use only the workarounds
  *   specified in the module load parameter.
@@ -195,6 +198,7 @@ MODULE_PARM_DESC(workarounds, Work around device bugs 
(default = 0
, 36 byte inquiry = __stringify(SBP2_WORKAROUND_INQUIRY_36)
, skip mode page 8 =__stringify(SBP2_WORKAROUND_MODE_SENSE_8)
, fix capacity =__stringify(SBP2_WORKAROUND_FIX_CAPACITY)
+   , delay inquiry =   __stringify(SBP2_WORKAROUND_DELAY_INQUIRY)
, override internal blacklist =  __stringify(SBP2_WORKAROUND_OVERRIDE)
, or a combination));
 
@@ -357,6 +361,11 @@ static const struct {
.workarounds= SBP2_WORKAROUND_INQUIRY_36 |
  SBP2_WORKAROUND_MODE_SENSE_8,
},
+   /* DViCO Momobay FX-3A with TSB42AA9A bridge */ {
+   .firmware_revision  = 0x002800,
+   .model_id   = 0x00,
+   .workarounds= SBP2_WORKAROUND_DELAY_INQUIRY,
+   },
/* Initio bridges, actually only needed for some older ones */ {
.firmware_revision  = 0x000200,
.model_id   = SBP2_ROM_VALUE_WILDCARD,
@@ -914,6 +923,9 @@ static int sbp2_start_device(struct sbp2_lu *lu)
sbp2_agent_reset(lu, 1);
sbp2_max_speed_and_size(lu);
 
+   if (lu-workarounds  SBP2_WORKAROUND_DELAY_INQUIRY)
+   ssleep(SBP2_INQUIRY_DELAY);
+
error = scsi_add_device(lu-shost, 0, lu-ud-id, 0);
if (error) {
SBP2_ERR(scsi_add_device failed);
diff --git a/drivers/ieee1394/sbp2.h b/drivers/ieee1394/sbp2.h
index d2ecb0d..80d8e09 100644
--- a/drivers/ieee1394/sbp2.h
+++ b/drivers/ieee1394/sbp2.h
@@ -343,6 +343,8 @@ enum sbp2lu_state_types {
 #define SBP2_WORKAROUND_INQUIRY_36 0x2
 #define SBP2_WORKAROUND_MODE_SENSE_8   0x4
 #define SBP2_WORKAROUND_FIX_CAPACITY   0x8
+#define SBP2_WORKAROUND_DELAY_INQUIRY  0x10
+#define SBP2_INQUIRY_DELAY 12
 #define SBP2_WORKAROUND_OVERRIDE   0x100
 
 #endif /* SBP2_H */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


firewire: fw-sbp2: don't add scsi_device twice

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0fa6dfdb0a2768541e998a5dab10b368de56c60a
Commit: 0fa6dfdb0a2768541e998a5dab10b368de56c60a
Parent: 48f18c761c001a66ef1928b42799c717368b1d64
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Sun Feb 3 23:10:47 2008 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Sat Feb 16 15:40:35 2008 +0100

firewire: fw-sbp2: don't add scsi_device twice

When a reconnect failed but re-login succeeded, __scsi_add_device was
called again.

In those cases, __scsi_add_device succeeded and returned the pointer to
the existing scsi_device.  fw-sbp2 then continued orderly, except that
it missed to call sbp2_cancel_orbs.  SCSI core would call fw-sbp2's
eh_abort_handler eventually if there had been an outstanding command.

This patch avoids the needless lookups and temporary allocations in SCSI
core and I/O stall and timeout until eh_abort_handler hits.

Also, __scsi_add_device tolerating calls for devices which already exist
is undocumented behavior on which we shouldn't rely.

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
Signed-off-by: Jarod Wilson [EMAIL PROTECTED]
---
 drivers/firewire/fw-sbp2.c |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 077f1c0..914170b 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -741,6 +741,12 @@ static void sbp2_login(struct work_struct *work)
PREPARE_DELAYED_WORK(lu-work, sbp2_reconnect);
sbp2_agent_reset(lu);
 
+   /* This was a re-login. */
+   if (lu-sdev) {
+   sbp2_cancel_orbs(lu);
+   goto out;
+   }
+
if (lu-tgt-workarounds  SBP2_WORKAROUND_DELAY_INQUIRY)
ssleep(SBP2_INQUIRY_DELAY);
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


firewire: fw-sbp2: logout and login after failed reconnect

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ce896d95cc7886ae05859c5b409a7b2f3b606ec1
Commit: ce896d95cc7886ae05859c5b409a7b2f3b606ec1
Parent: 0fa6dfdb0a2768541e998a5dab10b368de56c60a
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Sun Feb 3 23:11:39 2008 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Sat Feb 16 15:40:35 2008 +0100

firewire: fw-sbp2: logout and login after failed reconnect

If fw-sbp2 was too late with requesting the reconnect, the target would
reject this.  In this case, log out before attempting the reconnect.
Else several firmwares will deny the re-login because they somehow
didn't invalidate the old login.

Also, don't retry reconnects in this situation.  The retries won't
succeed either.

These changes improve chances for successful re-login and shorten the
period during which the logical unit is inaccessible.

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
Signed-off-by: Jarod Wilson [EMAIL PROTECTED]
---
 drivers/firewire/fw-sbp2.c |   17 +++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 914170b..80ab651 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -710,6 +710,11 @@ static void sbp2_login(struct work_struct *work)
node_id   = device-node_id;
local_node_id = device-card-node_id;
 
+   /* If this is a re-login attempt, log out, or we might be rejected. */
+   if (lu-sdev)
+   sbp2_send_management_orb(lu, device-node_id, generation,
+   SBP2_LOGOUT_REQUEST, lu-login_id, NULL);
+
if (sbp2_send_management_orb(lu, node_id, generation,
SBP2_LOGIN_REQUEST, lu-lun, response)  0) {
if (lu-retries++  5)
@@ -997,9 +1002,17 @@ static void sbp2_reconnect(struct work_struct *work)
if (sbp2_send_management_orb(lu, node_id, generation,
 SBP2_RECONNECT_REQUEST,
 lu-login_id, NULL)  0) {
-   if (lu-retries++ = 5) {
+   /*
+* If reconnect was impossible even though we are in the
+* current generation, fall back and try to log in again.
+*
+* We could check for Function rejected status, but
+* looking at the bus generation as simpler and more general.
+*/
+   smp_rmb(); /* get current card generation */
+   if (generation == device-card-generation ||
+   lu-retries++ = 5) {
fw_error(%s: failed to reconnect\n, tgt-bus_id);
-   /* Fall back and try to log in again. */
lu-retries = 0;
PREPARE_DELAYED_WORK(lu-work, sbp2_login);
}
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


firewire: fw-sbp2: sort includes

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7bb6bf7c8ba0b4ccfecaa00d6faea51b0bd42c8c
Commit: 7bb6bf7c8ba0b4ccfecaa00d6faea51b0bd42c8c
Parent: ce896d95cc7886ae05859c5b409a7b2f3b606ec1
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Sun Feb 3 23:12:17 2008 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Sat Feb 16 15:40:35 2008 +0100

firewire: fw-sbp2: sort includes

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-sbp2.c |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 80ab651..323b03b 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -28,15 +28,15 @@
  * and many others.
  */
 
+#include linux/blkdev.h
+#include linux/delay.h
+#include linux/device.h
+#include linux/dma-mapping.h
 #include linux/kernel.h
+#include linux/mod_devicetable.h
 #include linux/module.h
 #include linux/moduleparam.h
-#include linux/mod_devicetable.h
-#include linux/delay.h
-#include linux/device.h
 #include linux/scatterlist.h
-#include linux/dma-mapping.h
-#include linux/blkdev.h
 #include linux/string.h
 #include linux/stringify.h
 #include linux/timer.h
@@ -48,9 +48,9 @@
 #include scsi/scsi_device.h
 #include scsi/scsi_host.h
 
-#include fw-transaction.h
-#include fw-topology.h
 #include fw-device.h
+#include fw-topology.h
+#include fw-transaction.h
 
 /*
  * So far only bridges from Oxford Semiconductor are known to support
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


firewire: fw-sbp2: enforce a retry of __scsi_add_device if bus generation changed

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e80de3704ac30ddb7f9a12447a2ecee32ccd7880
Commit: e80de3704ac30ddb7f9a12447a2ecee32ccd7880
Parent: 7bb6bf7c8ba0b4ccfecaa00d6faea51b0bd42c8c
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Fri Feb 15 21:29:02 2008 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Sat Feb 16 15:40:35 2008 +0100

firewire: fw-sbp2: enforce a retry of __scsi_add_device if bus generation 
changed

fw-sbp2 is unable to reconnect while performing __scsi_add_device
because there is only a single workqueue thread context available for
both at the moment.  This should be fixed eventually.

An actual failure of __scsi_add_device is easy to handle, but an
incomplete execution of __scsi_add_device with an sdev returned would
remain undetected and leave the SBP-2 target unusable.

Therefore we use a workaround:  If there was a bus reset during
__scsi_add_device (i.e. during the SCSI probe), we remove the new sdev
immediately, log out, and attempt login and SCSI probe again.

Tested-by: Jarod Wilson [EMAIL PROTECTED] (earlier version)
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-sbp2.c |   49 +++
 1 files changed, 35 insertions(+), 14 deletions(-)

diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 323b03b..6d10934 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -762,22 +762,43 @@ static void sbp2_login(struct work_struct *work)
 
sdev = __scsi_add_device(shost, 0, 0,
 scsilun_to_int(eight_bytes_lun), lu);
-   if (IS_ERR(sdev)) {
-   smp_rmb(); /* generation may have changed */
-   generation = device-generation;
-   smp_rmb(); /* node_id must not be older than generation */
+   /*
+* FIXME:  We are unable to perform reconnects while in sbp2_login().
+* Therefore __scsi_add_device() will get into trouble if a bus reset
+* happens in parallel.  It will either fail or leave us with an
+* unusable sdev.  As a workaround we check for this and retry the
+* whole login and SCSI probing.
+*/
 
-   sbp2_send_management_orb(lu, device-node_id, generation,
-   SBP2_LOGOUT_REQUEST, lu-login_id, NULL);
-   /*
-* Set this back to sbp2_login so we fall back and
-* retry login on bus reset.
-*/
-   PREPARE_DELAYED_WORK(lu-work, sbp2_login);
-   } else {
-   lu-sdev = sdev;
-   scsi_device_put(sdev);
+   /* Reported error during __scsi_add_device() */
+   if (IS_ERR(sdev))
+   goto out_logout_login;
+
+   scsi_device_put(sdev);
+
+   /* Unreported error during __scsi_add_device() */
+   smp_rmb(); /* get current card generation */
+   if (generation != device-card-generation) {
+   scsi_remove_device(sdev);
+   goto out_logout_login;
}
+
+   /* No error during __scsi_add_device() */
+   lu-sdev = sdev;
+   goto out;
+
+ out_logout_login:
+   smp_rmb(); /* generation may have changed */
+   generation = device-generation;
+   smp_rmb(); /* node_id must not be older than generation */
+
+   sbp2_send_management_orb(lu, device-node_id, generation,
+SBP2_LOGOUT_REQUEST, lu-login_id, NULL);
+   /*
+* If a bus reset happened, sbp2_update will have requeued
+* lu-work already.  Reset the work from reconnect to login.
+*/
+   PREPARE_DELAYED_WORK(lu-work, sbp2_login);
  out:
sbp2_target_put(tgt);
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


firewire: fw-sbp2: (try to) avoid I/O errors during reconnect

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2e2705bdcb959372d54bf7f79dd9a555ec2adfb4
Commit: 2e2705bdcb959372d54bf7f79dd9a555ec2adfb4
Parent: e80de3704ac30ddb7f9a12447a2ecee32ccd7880
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Sat Feb 16 16:37:28 2008 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Tue Feb 19 19:57:23 2008 +0100

firewire: fw-sbp2: (try to) avoid I/O errors during reconnect

While fw-sbp2 takes the necessary time to reconnect to a logical unit
after bus reset, the SCSI core keeps sending new commands.  They are all
immediately completed with host busy status, and application clients or
filesystems will break quickly.  The SCSI device might even be taken
offline:  http://bugzilla.kernel.org/show_bug.cgi?id=9734

The only remedy seems to be to block the SCSI device until reconnect.
Alas the SCSI core has no useful API to block only one logical unit i.e.
the scsi_device, therefore we block the entire Scsi_Host.  This
currently corresponds to an SBP-2 target.  In case of targets with
multiple logical units, we need to satisfy the dependencies between
logical units by carefully tracking the blocking state of the target and
its units.  We block all logical units of a target as soon as one of
them needs to be blocked, and keep them blocked until all of them are
ready to be unblocked.

Furthermore, as the history of the old sbp2 driver has shown, the
scsi_block_requests() API is a minefield with high potential of
deadlocks.  We therefore take extra measures to keep logical units
unblocked during __scsi_add_device() and during shutdown.

This avoids I/O errors during reconnect in many but alas not in all
cases.  There may still be errors after a re-login had to be performed.
Also, some bridges have been seen to cease fetching management ORBs if
I/O went on up until a bus reset.  In these cases, all management ORBs
time out after mgt_orb_timeout.  The old sbp2 driver is less vulnerable
or maybe not vulnerable to this, for as yet unknown reasons.

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-sbp2.c |  126 ++--
 1 files changed, 122 insertions(+), 4 deletions(-)

diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 6d10934..ea4811c 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -139,6 +139,7 @@ struct sbp2_logical_unit {
int generation;
int retries;
struct delayed_work work;
+   bool blocked;
 };
 
 /*
@@ -157,6 +158,9 @@ struct sbp2_target {
int address_high;
unsigned int workarounds;
unsigned int mgt_orb_timeout;
+
+   int dont_block; /* counter for each logical unit */
+   int blocked;/* ditto */
 };
 
 /*
@@ -646,6 +650,107 @@ static void sbp2_agent_reset_no_wait(struct 
sbp2_logical_unit *lu)
z, sizeof(z), complete_agent_reset_write_no_wait, t);
 }
 
+static void sbp2_set_generation(struct sbp2_logical_unit *lu, int generation)
+{
+   struct fw_card *card = fw_device(lu-tgt-unit-device.parent)-card;
+   unsigned long flags;
+
+   /* serialize with comparisons of lu-generation and card-generation */
+   spin_lock_irqsave(card-lock, flags);
+   lu-generation = generation;
+   spin_unlock_irqrestore(card-lock, flags);
+}
+
+static inline void sbp2_allow_block(struct sbp2_logical_unit *lu)
+{
+   /*
+* We may access dont_block without taking card-lock here:
+* All callers of sbp2_allow_block() and all callers of sbp2_unblock()
+* are currently serialized against each other.
+* And a wrong result in sbp2_conditionally_block()'s access of
+* dont_block is rather harmless, it simply misses its first chance.
+*/
+   --lu-tgt-dont_block;
+}
+
+/*
+ * Blocks lu-tgt if all of the following conditions are met:
+ *   - Login, INQUIRY, and high-level SCSI setup of all of the target's
+ * logical units have been finished (indicated by dont_block == 0).
+ *   - lu-generation is stale.
+ *
+ * Note, scsi_block_requests() must be called while holding card-lock,
+ * otherwise it might foil sbp2_[conditionally_]unblock()'s attempt to
+ * unblock the target.
+ */
+static void sbp2_conditionally_block(struct sbp2_logical_unit *lu)
+{
+   struct sbp2_target *tgt = lu-tgt;
+   struct fw_card *card = fw_device(tgt-unit-device.parent)-card;
+   struct Scsi_Host *shost =
+   container_of((void *)tgt, struct Scsi_Host, hostdata[0]);
+   unsigned long flags;
+
+   spin_lock_irqsave(card-lock, flags);
+   if (!tgt-dont_block  !lu-blocked 
+   lu-generation != card-generation) {
+   lu-blocked = true;
+   if (++tgt-blocked == 1) {
+   

firewire: fw-sbp2: fix NULL pointer deref. in slave_alloc

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5513c5f6f9bd8c8ad3727130910fa288c62526a7
Commit: 5513c5f6f9bd8c8ad3727130910fa288c62526a7
Parent: 2e2705bdcb959372d54bf7f79dd9a555ec2adfb4
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Sun Feb 17 14:56:19 2008 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Tue Feb 19 19:57:23 2008 +0100

firewire: fw-sbp2: fix NULL pointer deref. in slave_alloc

Fix a kernel bug when running rescan-scsi-bus while a FireWire disk is
connected:  http://bugzilla.kernel.org/show_bug.cgi?id=10008

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-sbp2.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index ea4811c..60ebcb5 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -1473,6 +1473,10 @@ static int sbp2_scsi_slave_alloc(struct scsi_device 
*sdev)
 {
struct sbp2_logical_unit *lu = sdev-hostdata;
 
+   /* (Re-)Adding logical units via the SCSI stack is not supported. */
+   if (!lu)
+   return -ENOSYS;
+
sdev-allow_restart = 1;
 
/*
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


firewire: fw-sbp2: fix NULL pointer deref. in scsi_remove_device

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=33f1c6c3529f5f279e2e98e5cca0c5bac152153b
Commit: 33f1c6c3529f5f279e2e98e5cca0c5bac152153b
Parent: 5513c5f6f9bd8c8ad3727130910fa288c62526a7
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Tue Feb 19 09:05:49 2008 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Tue Feb 19 19:57:23 2008 +0100

firewire: fw-sbp2: fix NULL pointer deref. in scsi_remove_device

Fix a kernel bug when unplugging an SBP-2 device after having its
scsi_device already removed via the delete sysfs attribute.

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-sbp2.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 60ebcb5..5259491 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -762,9 +762,10 @@ static void sbp2_release_target(struct kref *kref)
sbp2_unblock(tgt);
 
list_for_each_entry_safe(lu, next, tgt-lu_list, link) {
-   if (lu-sdev)
+   if (lu-sdev) {
scsi_remove_device(lu-sdev);
-
+   scsi_device_put(lu-sdev);
+   }
sbp2_send_management_orb(lu, tgt-node_id, lu-generation,
SBP2_LOGOUT_REQUEST, lu-login_id, NULL);
 
@@ -886,12 +887,11 @@ static void sbp2_login(struct work_struct *work)
if (IS_ERR(sdev))
goto out_logout_login;
 
-   scsi_device_put(sdev);
-
/* Unreported error during __scsi_add_device() */
smp_rmb(); /* get current card generation */
if (generation != device-card-generation) {
scsi_remove_device(sdev);
+   scsi_device_put(sdev);
goto out_logout_login;
}
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ieee1394: sbp2: fix rescan-scsi-bus

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ef774c16a744f130f27c654bf9c4806e767fc773
Commit: ef774c16a744f130f27c654bf9c4806e767fc773
Parent: 33f1c6c3529f5f279e2e98e5cca0c5bac152153b
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Sun Feb 17 14:57:10 2008 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Tue Feb 19 19:57:24 2008 +0100

ieee1394: sbp2: fix rescan-scsi-bus

rescan-scsi-bus used to add SBP-2 targets which weren't there.

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/ieee1394/sbp2.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index accb2ad..9e2b196 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -1974,6 +1974,9 @@ static int sbp2scsi_slave_alloc(struct scsi_device *sdev)
 {
struct sbp2_lu *lu = (struct sbp2_lu *)sdev-host-hostdata[0];
 
+   if (sdev-lun != 0 || sdev-id != lu-ud-id || sdev-channel != 0)
+   return -ENODEV;
+
lu-sdev = sdev;
sdev-allow_restart = 1;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


firewire: fix NULL pointer deref. and resource leak

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fae603121428ba83b7343c88e68a7144525ab3eb
Commit: fae603121428ba83b7343c88e68a7144525ab3eb
Parent: 09d7328e62e3b4cefe4bf3acb54f62a7ae5c
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Wed Feb 20 21:10:06 2008 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Thu Feb 21 19:05:56 2008 +0100

firewire: fix NULL pointer deref. and resource leak

By supplying ioctl()s in the wrong order, a userspace client was able to
trigger NULL pointer dereferences.  Furthermore, by calling
ioctl_create_iso_context more than once, new contexts could be created
without ever freeing the previously created contexts.

Thanks to Anders Blomdell for the report.

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-cdev.c |9 +++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/firewire/fw-cdev.c b/drivers/firewire/fw-cdev.c
index 44ccee2..46bc197 100644
--- a/drivers/firewire/fw-cdev.c
+++ b/drivers/firewire/fw-cdev.c
@@ -646,6 +646,10 @@ static int ioctl_create_iso_context(struct client *client, 
void *buffer)
struct fw_cdev_create_iso_context *request = buffer;
struct fw_iso_context *context;
 
+   /* We only support one context at this time. */
+   if (client-iso_context != NULL)
+   return -EBUSY;
+
if (request-channel  63)
return -EINVAL;
 
@@ -792,8 +796,9 @@ static int ioctl_start_iso(struct client *client, void 
*buffer)
 {
struct fw_cdev_start_iso *request = buffer;
 
-   if (request-handle != 0)
+   if (client-iso_context == NULL || request-handle != 0)
return -EINVAL;
+
if (client-iso_context-type == FW_ISO_CONTEXT_RECEIVE) {
if (request-tags == 0 || request-tags  15)
return -EINVAL;
@@ -810,7 +815,7 @@ static int ioctl_stop_iso(struct client *client, void 
*buffer)
 {
struct fw_cdev_stop_iso *request = buffer;
 
-   if (request-handle != 0)
+   if (client-iso_context == NULL || request-handle != 0)
return -EINVAL;
 
return fw_iso_context_stop(client-iso_context);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


lockdep: increase MAX_LOCK_DEPTH

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bdb9441e9c325d50b5ae17f7d3205d65b8ed2e5f
Commit: bdb9441e9c325d50b5ae17f7d3205d65b8ed2e5f
Parent: bfa274e2436fc7ef72ef51c878083647f1cfd429
Author: Peter Zijlstra [EMAIL PROTECTED]
AuthorDate: Mon Feb 25 23:02:48 2008 +0100
Committer:  Peter Zijlstra [EMAIL PROTECTED]
CommitDate: Mon Feb 25 23:02:48 2008 +0100

lockdep: increase MAX_LOCK_DEPTH

Some code paths exceed the current max lock depth (XFS), so increase
this limit a bit. I looked at making this a dynamic allocated array,
but we should not advocate insane lock depths, so stay with this as
long as it works...

Signed-off-by: Peter Zijlstra [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 include/linux/sched.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index e217d18..e3ea124 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1189,7 +1189,7 @@ struct task_struct {
int softirq_context;
 #endif
 #ifdef CONFIG_LOCKDEP
-# define MAX_LOCK_DEPTH 30UL
+# define MAX_LOCK_DEPTH 48UL
u64 curr_chain_key;
int lockdep_depth;
struct held_lock held_locks[MAX_LOCK_DEPTH];
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Subject: lockdep: include all lock classes in all_lock_classes

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1481197b50114d7212d659d41cb97f31a8934883
Commit: 1481197b50114d7212d659d41cb97f31a8934883
Parent: bdb9441e9c325d50b5ae17f7d3205d65b8ed2e5f
Author: Dale Farnsworth [EMAIL PROTECTED]
AuthorDate: Mon Feb 25 23:03:02 2008 +0100
Committer:  Peter Zijlstra [EMAIL PROTECTED]
CommitDate: Mon Feb 25 23:03:02 2008 +0100

Subject: lockdep: include all lock classes in all_lock_classes
Add each lock class to the all_lock_classes list when it is
first registered.

Previously, lock classes were added to all_lock_classes when
the lock class was first used.  Since one of the uses of the
list is to find unused locks, this didn't work well.

Signed-off-by: Dale Farnsworth [EMAIL PROTECTED]
Signed-off-by: Peter Zijlstra [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 kernel/lockdep.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 3574379..81a4e4a 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -779,6 +779,10 @@ register_lock_class(struct lockdep_map *lock, unsigned int 
subclass, int force)
 * parallel walking of the hash-list safe:
 */
list_add_tail_rcu(class-hash_entry, hash_head);
+   /*
+* Add it to the global list of classes:
+*/
+   list_add_tail_rcu(class-lock_entry, all_lock_classes);
 
if (verbose(class)) {
graph_unlock();
@@ -2282,10 +2286,6 @@ static int mark_lock(struct task_struct *curr, struct 
held_lock *this,
return 0;
break;
case LOCK_USED:
-   /*
-* Add it to the global list of classes:
-*/
-   list_add_tail_rcu(this-class-lock_entry, all_lock_classes);
debug_atomic_dec(nr_unused_locks);
break;
default:
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


make atapi_dmadir static

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c5c61bda5ecceaa0f16d326cd2c2147468a4c443
Commit: c5c61bda5ecceaa0f16d326cd2c2147468a4c443
Parent: bfa274e2436fc7ef72ef51c878083647f1cfd429
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Mon Feb 25 02:07:25 2008 +0200
Committer:  Jeff Garzik [EMAIL PROTECTED]
CommitDate: Mon Feb 25 17:29:35 2008 -0500

make atapi_dmadir static

atapi_dmadir can now become static.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
---
 drivers/ata/libata-core.c |2 +-
 drivers/ata/libata.h  |1 -
 2 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index fbc2435..b57fad3 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -113,7 +113,7 @@ int atapi_enabled = 1;
 module_param(atapi_enabled, int, 0444);
 MODULE_PARM_DESC(atapi_enabled, Enable discovery of ATAPI devices (0=off, 
1=on));
 
-int atapi_dmadir = 0;
+static int atapi_dmadir = 0;
 module_param(atapi_dmadir, int, 0444);
 MODULE_PARM_DESC(atapi_dmadir, Enable ATAPI DMADIR bridge support (0=off, 
1=on));
 
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
index 6036ded..aa884f7 100644
--- a/drivers/ata/libata.h
+++ b/drivers/ata/libata.h
@@ -56,7 +56,6 @@ enum {
 extern unsigned int ata_print_id;
 extern struct workqueue_struct *ata_aux_wq;
 extern int atapi_enabled;
-extern int atapi_dmadir;
 extern int atapi_passthru16;
 extern int libata_fua;
 extern int libata_noacpi;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Revert power_state: get rid of write-only variable in SATA

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=72ad6ec48989d4b5477128e739b960be11155036
Commit: 72ad6ec48989d4b5477128e739b960be11155036
Parent: c5c61bda5ecceaa0f16d326cd2c2147468a4c443
Author: Jeff Garzik [EMAIL PROTECTED]
AuthorDate: Mon Feb 25 17:31:10 2008 -0500
Committer:  Jeff Garzik [EMAIL PROTECTED]
CommitDate: Mon Feb 25 17:31:10 2008 -0500

Revert power_state: get rid of write-only variable in SATA

This reverts commit 559bbe6cbd0d8c68d40076a5f7dc98e3bf5864b2.

Michael S. Tsirkin reports that this changes breaks suspend/resume.

Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
---
 drivers/ata/libata-core.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index b57fad3..4fbcce7 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -6567,6 +6567,8 @@ int ata_host_suspend(struct ata_host *host, pm_message_t 
mesg)
ata_lpm_enable(host);
 
rc = ata_host_request_pm(host, mesg, 0, ATA_EHI_QUIET, 1);
+   if (rc == 0)
+   host-dev-power.power_state = mesg;
return rc;
 }
 
@@ -6585,6 +6587,7 @@ void ata_host_resume(struct ata_host *host)
 {
ata_host_request_pm(host, PMSG_ON, ATA_EH_SOFTRESET,
ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET, 0);
+   host-dev-power.power_state = PMSG_ON;
 
/* reenable link pm */
ata_lpm_disable(host);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Remove incorrect BKL comments in ext4

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=642be6ec218b956fbae88304449720f76ba0d578
Commit: 642be6ec218b956fbae88304449720f76ba0d578
Parent: bfa274e2436fc7ef72ef51c878083647f1cfd429
Author: Andi Kleen [EMAIL PROTECTED]
AuthorDate: Mon Feb 25 17:20:46 2008 -0500
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Mon Feb 25 17:20:46 2008 -0500

Remove incorrect BKL comments in ext4

Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/dir.c   |2 +-
 fs/ext4/inode.c |1 -
 2 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c
index 33888bb..2c23bad 100644
--- a/fs/ext4/dir.c
+++ b/fs/ext4/dir.c
@@ -46,7 +46,7 @@ const struct file_operations ext4_dir_operations = {
 #ifdef CONFIG_COMPAT
.compat_ioctl   = ext4_compat_ioctl,
 #endif
-   .fsync  = ext4_sync_file,   /* BKL held */
+   .fsync  = ext4_sync_file,
.release= ext4_release_dir,
 };
 
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 7dd9b50..d3c6f58 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -768,7 +768,6 @@ err_out:
  *
  * `handle' can be NULL if create == 0.
  *
- * The BKL may not be held on entry here.  Be sure to take it early.
  * return  0, # of blocks mapped or allocated.
  * return = 0, if plain lookup failed.
  * return  0, error case.
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ext4: Fix locking hierarchy violation in ext4_fallocate()

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=55bd725aa3a83b3935988f37275b5a80e10d4169
Commit: 55bd725aa3a83b3935988f37275b5a80e10d4169
Parent: 642be6ec218b956fbae88304449720f76ba0d578
Author: Aneesh Kumar K.V [EMAIL PROTECTED]
AuthorDate: Fri Feb 15 12:47:21 2008 -0500
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Fri Feb 15 12:47:21 2008 -0500

ext4: Fix locking hierarchy violation in ext4_fallocate()

ext4_fallocate() was trying to acquire i_data_sem outside of
jbd2_start_transaction/jbd2_journal_stop, which violates ext4's locking
hierarchy.  So we take i_mutex to prevent writes and truncates during
the complete fallocate operation, and use ext4_get_block_wrap() which
acquires and releases i_data_sem for each block allocation.

Signed-off-by: Aneesh Kumar K.V [EMAIL PROTECTED]
Signed-off-by: Mingming Cao [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/extents.c |   10 +++---
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index bc7081f..e856f66 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2623,7 +2623,7 @@ long ext4_fallocate(struct inode *inode, int mode, loff_t 
offset, loff_t len)
 * modify 1 super block, 1 block bitmap and 1 group descriptor.
 */
credits = EXT4_DATA_TRANS_BLOCKS(inode-i_sb) + 3;
-   down_write((EXT4_I(inode)-i_data_sem));
+   mutex_lock(inode-i_mutex);
 retry:
while (ret = 0  ret  max_blocks) {
block = block + ret;
@@ -2634,7 +2634,7 @@ retry:
break;
}
 
-   ret = ext4_ext_get_blocks(handle, inode, block,
+   ret = ext4_get_blocks_wrap(handle, inode, block,
  max_blocks, map_bh,
  EXT4_CREATE_UNINITIALIZED_EXT, 0);
WARN_ON(ret = 0);
@@ -2680,7 +2680,6 @@ retry:
if (ret == -ENOSPC  ext4_should_retry_alloc(inode-i_sb, retries))
goto retry;
 
-   up_write((EXT4_I(inode)-i_data_sem));
/*
 * Time to update the file size.
 * Update only when preallocation was requested beyond the file size.
@@ -2692,21 +2691,18 @@ retry:
 * if no error, we assume preallocation succeeded
 * completely
 */
-   mutex_lock(inode-i_mutex);
i_size_write(inode, offset + len);
EXT4_I(inode)-i_disksize = i_size_read(inode);
-   mutex_unlock(inode-i_mutex);
} else if (ret  0  nblocks) {
/* Handle partial allocation scenario */
loff_t newsize;
 
-   mutex_lock(inode-i_mutex);
newsize  = (nblocks  blkbits) + i_size_read(inode);
i_size_write(inode, EXT4_BLOCK_ALIGN(newsize, blkbits));
EXT4_I(inode)-i_disksize = i_size_read(inode);
-   mutex_unlock(inode-i_mutex);
}
}
 
+   mutex_unlock(inode-i_mutex);
return ret  0 ? ret2 : ret;
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ext4: Fix kernel BUG at fs/ext4/mballoc.c:910!

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b73fce69ecb091a178ef9286027c370a63eb25aa
Commit: b73fce69ecb091a178ef9286027c370a63eb25aa
Parent: 55bd725aa3a83b3935988f37275b5a80e10d4169
Author: Valerie Clement [EMAIL PROTECTED]
AuthorDate: Fri Feb 15 13:48:51 2008 -0500
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Fri Feb 15 13:48:51 2008 -0500

ext4: Fix kernel BUG at fs/ext4/mballoc.c:910!

With the flex_bg feature enabled, a large file creation oopses the
kernel.   The BUG_ON is:
BUG_ON(len = EXT4_BLOCKS_PER_GROUP(sb));

As the allocation of the bitmaps and the inode table can be done
outside the block group with flex_bg, this allows to allocate up to
EXT4_BLOCKS_PER_GROUP blocks in a group.

This patch fixes the oops.

Signed-off-by: Valerie Clement [EMAIL PROTECTED]
Signed-off-by: Mingming Cao [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/mballoc.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index dd0fcfc..2121184 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -906,7 +906,7 @@ static void ext4_mb_mark_free_simple(struct super_block *sb,
unsigned short chunk;
unsigned short border;
 
-   BUG_ON(len = EXT4_BLOCKS_PER_GROUP(sb));
+   BUG_ON(len  EXT4_BLOCKS_PER_GROUP(sb));
 
border = 2  sb-s_blocksize_bits;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ext4: Don't leave behind a half-created inode if ext4_mkdir() fails

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4cdeed861b5f797b3fa661eb331a6bd6ad669c6a
Commit: 4cdeed861b5f797b3fa661eb331a6bd6ad669c6a
Parent: b73fce69ecb091a178ef9286027c370a63eb25aa
Author: Aneesh Kumar K.V [EMAIL PROTECTED]
AuthorDate: Fri Feb 22 06:17:31 2008 -0500
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Fri Feb 22 06:17:31 2008 -0500

ext4: Don't leave behind a half-created inode if ext4_mkdir() fails

If ext4_mkdir() fails to allocate the initial block for the directory,
don't leave behind a half-created directory inode with the link count
left at one.  This was caused by an inappropriate call to ext4_dec_count().

Signed-off-by: Aneesh Kumar K.V [EMAIL PROTECTED]
Signed-off-by: Mingming Cao [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/namei.c |   11 ---
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index a9347fb..fffd080 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1804,12 +1804,8 @@ retry:
inode-i_fop = ext4_dir_operations;
inode-i_size = EXT4_I(inode)-i_disksize = inode-i_sb-s_blocksize;
dir_block = ext4_bread (handle, inode, 0, 1, err);
-   if (!dir_block) {
-   ext4_dec_count(handle, inode); /* is this nlink == 0? */
-   ext4_mark_inode_dirty(handle, inode);
-   iput (inode);
-   goto out_stop;
-   }
+   if (!dir_block)
+   goto out_clear_inode;
BUFFER_TRACE(dir_block, get_write_access);
ext4_journal_get_write_access(handle, dir_block);
de = (struct ext4_dir_entry_2 *) dir_block-b_data;
@@ -1832,7 +1828,8 @@ retry:
ext4_mark_inode_dirty(handle, inode);
err = ext4_add_entry (handle, dentry, inode);
if (err) {
-   inode-i_nlink = 0;
+out_clear_inode:
+   clear_nlink(inode);
ext4_mark_inode_dirty(handle, inode);
iput (inode);
goto out_stop;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ext4: Fix memory and buffer head leak in callers to ext4_ext_find_extent()

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b35905c16ad6428551eb9e49525011bd2700cf56
Commit: b35905c16ad6428551eb9e49525011bd2700cf56
Parent: 4cdeed861b5f797b3fa661eb331a6bd6ad669c6a
Author: Aneesh Kumar K.V [EMAIL PROTECTED]
AuthorDate: Mon Feb 25 16:54:37 2008 -0500
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Mon Feb 25 16:54:37 2008 -0500

ext4: Fix memory and buffer head leak in callers to ext4_ext_find_extent()

The path variable returned via ext4_ext_find_extent is a kmalloc
variable and needs to be freeded.  It also contains a reference to
buffer_head which needs to be dropped.

Signed-off-by: Aneesh Kumar K.V [EMAIL PROTECTED]
Signed-off-by: Mingming Cao [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/extents.c   |6 +++---
 fs/ext4/migrate.c   |5 +
 include/linux/ext4_fs_extents.h |1 +
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index e856f66..995ac16 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -349,7 +349,7 @@ static void ext4_ext_show_leaf(struct inode *inode, struct 
ext4_ext_path *path)
 #define ext4_ext_show_leaf(inode,path)
 #endif
 
-static void ext4_ext_drop_refs(struct ext4_ext_path *path)
+void ext4_ext_drop_refs(struct ext4_ext_path *path)
 {
int depth = path-p_depth;
int i;
@@ -2200,10 +2200,10 @@ static int ext4_ext_convert_to_initialized(handle_t 
*handle,
newdepth = ext_depth(inode);
if (newdepth != depth) {
depth = newdepth;
-   path = ext4_ext_find_extent(inode, iblock, NULL);
+   ext4_ext_drop_refs(path);
+   path = ext4_ext_find_extent(inode, iblock, path);
if (IS_ERR(path)) {
err = PTR_ERR(path);
-   path = NULL;
goto out;
}
eh = path[depth].p_hdr;
diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c
index 8c6c685..5c1e27d 100644
--- a/fs/ext4/migrate.c
+++ b/fs/ext4/migrate.c
@@ -43,6 +43,7 @@ static int finish_range(handle_t *handle, struct inode *inode,
 
if (IS_ERR(path)) {
retval = PTR_ERR(path);
+   path = NULL;
goto err_out;
}
 
@@ -74,6 +75,10 @@ static int finish_range(handle_t *handle, struct inode 
*inode,
}
retval = ext4_ext_insert_extent(handle, inode, path, newext);
 err_out:
+   if (path) {
+   ext4_ext_drop_refs(path);
+   kfree(path);
+   }
lb-first_pblock = 0;
return retval;
 }
diff --git a/include/linux/ext4_fs_extents.h b/include/linux/ext4_fs_extents.h
index 697da4b..1285c58 100644
--- a/include/linux/ext4_fs_extents.h
+++ b/include/linux/ext4_fs_extents.h
@@ -227,5 +227,6 @@ extern int ext4_ext_search_left(struct inode *, struct 
ext4_ext_path *,
ext4_lblk_t *, ext4_fsblk_t *);
 extern int ext4_ext_search_right(struct inode *, struct ext4_ext_path *,
ext4_lblk_t *, ext4_fsblk_t *);
+extern void ext4_ext_drop_refs(struct ext4_ext_path *);
 #endif /* _LINUX_EXT4_EXTENTS */
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ext4: Get journal write access before modifying the extent tree

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9df5643ad135c7f8c02d3b69020de4ec910f9fc0
Commit: 9df5643ad135c7f8c02d3b69020de4ec910f9fc0
Parent: b35905c16ad6428551eb9e49525011bd2700cf56
Author: Aneesh Kumar K.V [EMAIL PROTECTED]
AuthorDate: Fri Feb 22 06:17:31 2008 -0500
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Fri Feb 22 06:17:31 2008 -0500

ext4: Get journal write access before modifying the extent tree

When the user was writing into an unitialized extent,
ext4_ext_convert_to_initialize() was not requesting journal write access
before it started to modify the extent tree.   Fix this oversight.

Signed-off-by: Aneesh Kumar K.V [EMAIL PROTECTED]
Signed-off-by: Mingming Cao [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/extents.c |   11 ---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 995ac16..c4d6f19 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2168,6 +2168,10 @@ static int ext4_ext_convert_to_initialized(handle_t 
*handle,
newblock = iblock - ee_block + ext_pblock(ex);
ex2 = ex;
 
+   err = ext4_ext_get_access(handle, inode, path + depth);
+   if (err)
+   goto out;
+
/* ex1: ee_block to iblock - 1 : uninitialized */
if (iblock  ee_block) {
ex1 = ex;
@@ -2210,6 +2214,10 @@ static int ext4_ext_convert_to_initialized(handle_t 
*handle,
ex = path[depth].p_ext;
if (ex2 != newex)
ex2 = ex;
+
+   err = ext4_ext_get_access(handle, inode, path + depth);
+   if (err)
+   goto out;
}
allocated = max_blocks;
}
@@ -2230,9 +2238,6 @@ static int ext4_ext_convert_to_initialized(handle_t 
*handle,
ex2-ee_len = cpu_to_le16(allocated);
if (ex2 != ex)
goto insert;
-   err = ext4_ext_get_access(handle, inode, path + depth);
-   if (err)
-   goto out;
/*
 * New (initialized) extent starts from the first block
 * in the current extent. i.e., ex2 == ex
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ext4: Don't claim block from group which has corrupt bitmap

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e56eb6590693a5a340e8f596db2768a6e1b9e236
Commit: e56eb6590693a5a340e8f596db2768a6e1b9e236
Parent: 9df5643ad135c7f8c02d3b69020de4ec910f9fc0
Author: Aneesh Kumar K.V [EMAIL PROTECTED]
AuthorDate: Fri Feb 15 13:48:21 2008 -0500
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Fri Feb 15 13:48:21 2008 -0500

ext4: Don't claim block from group which has corrupt bitmap

In ext4_mb_complex_scan_group, if the extent length of the newly
found extentet is greater than than the total free blocks counted
in group info, break without claiming the block.

Document different ext4_error usage, explaining the state with which we
continue if we mount with errors=continue

Signed-off-by: Aneesh Kumar K.V [EMAIL PROTECTED]
Signed-off-by: Mingming Cao [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/mballoc.c |   16 +++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 2121184..6968c53 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -967,6 +967,10 @@ static void ext4_mb_generate_buddy(struct super_block *sb,
ext4_error(sb, __FUNCTION__,
EXT4-fs: group %lu: %u blocks in bitmap, %u in gd\n,
group, free, grp-bb_free);
+   /*
+* If we intent to continue, we consider group descritor
+* corrupt and update bb_free using bitmap value
+*/
grp-bb_free = free;
}
 
@@ -1822,7 +1826,7 @@ static void ext4_mb_complex_scan_group(struct 
ext4_allocation_context *ac,
EXT4_BLOCKS_PER_GROUP(sb), i);
if (i = EXT4_BLOCKS_PER_GROUP(sb)) {
/*
-* IF we corrupt the bitmap  we won't find any
+* IF we have corrupt bitmap, we won't find any
 * free blocks even though group info says we
 * we have free blocks
 */
@@ -1838,6 +1842,12 @@ static void ext4_mb_complex_scan_group(struct 
ext4_allocation_context *ac,
ext4_error(sb, __FUNCTION__, %d free blocks as per 
group info. But got %d blocks\n,
free, ex.fe_len);
+   /*
+* The number of free blocks differs. This mostly
+* indicate that the bitmap is corrupt. So exit
+* without claiming the space.
+*/
+   break;
}
 
ext4_mb_measure_extent(ac, ex, e4b);
@@ -3771,6 +3781,10 @@ static int ext4_mb_release_inode_pa(struct ext4_buddy 
*e4b,
(unsigned long) pa-pa_len);
ext4_error(sb, __FUNCTION__, free %u, pa_free %u\n,
free, pa-pa_free);
+   /*
+* pa is already deleted so we use the value obtained
+* from the bitmap and continue.
+*/
}
atomic_add(free, sbi-s_mb_discarded);
if (ac)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ext4: modify block allocation algorithm for the last group

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=74d3487fc8aa58cec16dff7239dea1ca59bdab0e
Commit: 74d3487fc8aa58cec16dff7239dea1ca59bdab0e
Parent: e56eb6590693a5a340e8f596db2768a6e1b9e236
Author: Valerie Clement [EMAIL PROTECTED]
AuthorDate: Fri Feb 15 13:43:07 2008 -0500
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Fri Feb 15 13:43:07 2008 -0500

ext4: modify block allocation algorithm for the last group

When a directory inode is allocated in the last group and the last group
contains less than s_blocks_per_group blocks, the initial block allocated
for the directory is not always allocated in the same group as the
directory inode, but in one of the first groups of the filesystem (group 1
for example).
Depending on the current process's pid, ext4_find_near() and
ext4_ext_find_goal() can return a block number greater than the maximum
blocks count in the filesystem and in that case the block will be not
allocated in the same group as the inode.

The following patch fixes the problem.

Should the modification also be done in ext2/3 code?

Signed-off-by: Valerie Clement [EMAIL PROTECTED]
Signed-off-by: Mingming Cao [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/extents.c |8 +++-
 fs/ext4/inode.c   |8 +++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index c4d6f19..8a59f7b 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -148,6 +148,7 @@ static ext4_fsblk_t ext4_ext_find_goal(struct inode *inode,
 {
struct ext4_inode_info *ei = EXT4_I(inode);
ext4_fsblk_t bg_start;
+   ext4_fsblk_t last_block;
ext4_grpblk_t colour;
int depth;
 
@@ -169,8 +170,13 @@ static ext4_fsblk_t ext4_ext_find_goal(struct inode *inode,
/* OK. use inode's group */
bg_start = (ei-i_block_group * EXT4_BLOCKS_PER_GROUP(inode-i_sb)) +
le32_to_cpu(EXT4_SB(inode-i_sb)-s_es-s_first_data_block);
-   colour = (current-pid % 16) *
+   last_block = ext4_blocks_count(EXT4_SB(inode-i_sb)-s_es) - 1;
+
+   if (bg_start + EXT4_BLOCKS_PER_GROUP(inode-i_sb) = last_block)
+   colour = (current-pid % 16) *
(EXT4_BLOCKS_PER_GROUP(inode-i_sb) / 16);
+   else
+   colour = (current-pid % 16) * ((last_block - bg_start) / 16);
return bg_start + colour + block;
 }
 
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index d3c6f58..34f3eb6 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -403,6 +403,7 @@ static ext4_fsblk_t ext4_find_near(struct inode *inode, 
Indirect *ind)
__le32 *start = ind-bh ? (__le32*) ind-bh-b_data : ei-i_data;
__le32 *p;
ext4_fsblk_t bg_start;
+   ext4_fsblk_t last_block;
ext4_grpblk_t colour;
 
/* Try to find previous block */
@@ -420,8 +421,13 @@ static ext4_fsblk_t ext4_find_near(struct inode *inode, 
Indirect *ind)
 * into the same cylinder group then.
 */
bg_start = ext4_group_first_block_no(inode-i_sb, ei-i_block_group);
-   colour = (current-pid % 16) *
+   last_block = ext4_blocks_count(EXT4_SB(inode-i_sb)-s_es) - 1;
+
+   if (bg_start + EXT4_BLOCKS_PER_GROUP(inode-i_sb) = last_block)
+   colour = (current-pid % 16) *
(EXT4_BLOCKS_PER_GROUP(inode-i_sb) / 16);
+   else
+   colour = (current-pid % 16) * ((last_block - bg_start) / 16);
return bg_start + colour;
 }
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ext4: Don't use ext4_dec_count() if not needed

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=825f1481ead4ce40671089bae7412ac3519e8caa
Commit: 825f1481ead4ce40671089bae7412ac3519e8caa
Parent: 74d3487fc8aa58cec16dff7239dea1ca59bdab0e
Author: Theodore Ts'o [EMAIL PROTECTED]
AuthorDate: Fri Feb 15 15:00:38 2008 -0500
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Fri Feb 15 15:00:38 2008 -0500

ext4: Don't use ext4_dec_count() if not needed

The ext4_dec_count() function is only needed when dropping the i_nlink
count on inodes which are (or which could be) directories.  If we
*know* that the inode in question can't possibly be a directory, use
drop_nlink or clear_nlink() if we know i_nlink is 1.

Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/namei.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index fffd080..5a79c6b 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -2161,7 +2161,7 @@ static int ext4_unlink(struct inode * dir, struct dentry 
*dentry)
dir-i_ctime = dir-i_mtime = ext4_current_time(dir);
ext4_update_dx_flag(dir);
ext4_mark_inode_dirty(handle, dir);
-   ext4_dec_count(handle, inode);
+   drop_nlink(inode);
if (!inode-i_nlink)
ext4_orphan_add(handle, inode);
inode-i_ctime = ext4_current_time(inode);
@@ -2211,7 +2211,7 @@ retry:
err = __page_symlink(inode, symname, l,
mapping_gfp_mask(inode-i_mapping)  ~__GFP_FS);
if (err) {
-   ext4_dec_count(handle, inode);
+   clear_nlink(inode);
ext4_mark_inode_dirty(handle, inode);
iput (inode);
goto out_stop;
@@ -2404,7 +2404,7 @@ static int ext4_rename (struct inode * old_dir, struct 
dentry *old_dentry,
ext4_dec_count(handle, old_dir);
if (new_inode) {
/* checked empty_dir above, can't have another parent,
-* ext3_dec_count() won't work for many-linked dirs */
+* ext4_dec_count() won't work for many-linked dirs */
new_inode-i_nlink = 0;
} else {
ext4_inc_count(handle, new_dir);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ext4: Fix BUG when writing to an unitialized extent

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f5ab0d1f8f7df937778c60c3da6f4ef939a54a7b
Commit: f5ab0d1f8f7df937778c60c3da6f4ef939a54a7b
Parent: 825f1481ead4ce40671089bae7412ac3519e8caa
Author: Mingming Cao [EMAIL PROTECTED]
AuthorDate: Mon Feb 25 15:29:55 2008 -0500
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Mon Feb 25 15:29:55 2008 -0500

ext4: Fix BUG when writing to an unitialized extent

This patch fixes a bug when writing to preallocated but uninitialized
blocks, which resulted in a BUG in fs/buffer.c saying that the buffer
is not mapped.

When writing to a file, ext4_get_block_wrap() is called with create=1 in
order to request that blocks be allocated if necessary.  It currently
calls ext4_get_blocks() with create=0 in order to do a lookup first.  If
the inode contains an unitialized data block, the buffer head is left
unampped, which ext4_get_blocks_wrap() returns, causing the BUG.

We fix this by checking to see if the buffer head is unmapped, and if
so, we make sure the the buffer head is mapped by calling
ext4_ext_get_blocks with create=1.

Signed-off-by: Mingming Cao [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/extents.c |   13 +
 fs/ext4/inode.c   |   47 ---
 2 files changed, 57 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 8a59f7b..bcf5d04 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2287,9 +2287,22 @@ out:
 }
 
 /*
+ * Block allocation/map/preallocation routine for extents based files
+ *
+ *
  * Need to be called with
  * down_read(EXT4_I(inode)-i_data_sem) if not allocating file system block
  * (ie, create is zero). Otherwise down_write(EXT4_I(inode)-i_data_sem)
+ *
+ * return  0, number of of blocks already mapped/allocated
+ *  if create == 0 and these are pre-allocated blocks
+ * buffer head is unmapped
+ *  otherwise blocks are mapped
+ *
+ * return = 0, if plain look up failed (blocks have not been allocated)
+ *  buffer head is unmapped
+ *
+ * return  0, error case.
  */
 int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
ext4_lblk_t iblock,
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 34f3eb6..945cbf6 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -908,11 +908,38 @@ out:
  */
 #define DIO_CREDITS 25
 
+
+/*
+ *
+ *
+ * ext4_ext4 get_block() wrapper function
+ * It will do a look up first, and returns if the blocks already mapped.
+ * Otherwise it takes the write lock of the i_data_sem and allocate blocks
+ * and store the allocated blocks in the result buffer head and mark it
+ * mapped.
+ *
+ * If file type is extents based, it will call ext4_ext_get_blocks(),
+ * Otherwise, call with ext4_get_blocks_handle() to handle indirect mapping
+ * based files
+ *
+ * On success, it returns the number of blocks being mapped or allocate.
+ * if create==0 and the blocks are pre-allocated and uninitialized block,
+ * the result buffer head is unmapped. If the create ==1, it will make sure
+ * the buffer head is mapped.
+ *
+ * It returns 0 if plain look up failed (blocks have not been allocated), in
+ * that casem, buffer head is unmapped
+ *
+ * It returns the error in case of allocation failure.
+ */
 int ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, sector_t block,
unsigned long max_blocks, struct buffer_head *bh,
int create, int extend_disksize)
 {
int retval;
+
+   clear_buffer_mapped(bh);
+
/*
 * Try to see if we can get  the block without requesting
 * for new file system block.
@@ -926,12 +953,26 @@ int ext4_get_blocks_wrap(handle_t *handle, struct inode 
*inode, sector_t block,
inode, block, max_blocks, bh, 0, 0);
}
up_read((EXT4_I(inode)-i_data_sem));
-   if (!create || (retval  0))
+
+   /* If it is only a block(s) look up */
+   if (!create)
+   return retval;
+
+   /*
+* Returns if the blocks have already allocated
+*
+* Note that if blocks have been preallocated
+* ext4_ext_get_block() returns th create = 0
+* with buffer head unmapped.
+*/
+   if (retval  0  buffer_mapped(bh))
return retval;
 
/*
-* We need to allocate new blocks which will result
-* in i_data update
+* New blocks allocate and/or writing to uninitialized extent
+* will possibly result in updating i_data, so we take
+* the write lock of i_data_sem, and call get_blocks()
+* with create == 1 flag.
 */
down_write((EXT4_I(inode)-i_data_sem));
/*
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the 

ext4: set EXT4_EXTENTS_FL only for directory and regular files

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=42bf0383d1e09dd1b38f3debb13a76b2f87634b3
Commit: 42bf0383d1e09dd1b38f3debb13a76b2f87634b3
Parent: 2c98615d3b64ce7888cd46cc668023f456daf287
Author: Aneesh Kumar K.V [EMAIL PROTECTED]
AuthorDate: Mon Feb 25 16:38:03 2008 -0500
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Mon Feb 25 16:38:03 2008 -0500

ext4: set EXT4_EXTENTS_FL only for directory and regular files

In addition, don't inherit EXT4_EXTENTS_FL from parent directory.
If we have a directory with extent flag set and later mount the file
system with -o noextents, the files created in that directory will also
have extent flag set but we would not have called ext4_ext_tree_init for
them. This will cause error later when we are verifying the extent header

Signed-off-by: Aneesh Kumar K.V [EMAIL PROTECTED]
Acked-off-by: Eric Sandeen [EMAIL PROTECTED]
Signed-off-by: Mingming Cao [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/ialloc.c |   22 +++---
 fs/ext4/namei.c  |1 -
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index da18a74..8036b9b 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -702,7 +702,12 @@ got:
ei-i_dir_start_lookup = 0;
ei-i_disksize = 0;
 
-   ei-i_flags = EXT4_I(dir)-i_flags  ~EXT4_INDEX_FL;
+   /*
+* Don't inherit extent flag from directory. We set extent flag on
+* newly created directory and file only if -o extent mount option is
+* specified
+*/
+   ei-i_flags = EXT4_I(dir)-i_flags  ~(EXT4_INDEX_FL|EXT4_EXTENTS_FL);
if (S_ISLNK(mode))
ei-i_flags = ~(EXT4_IMMUTABLE_FL|EXT4_APPEND_FL);
/* dirsync only applies to directories */
@@ -745,12 +750,15 @@ got:
goto fail_free_drop;
}
if (test_opt(sb, EXTENTS)) {
-   EXT4_I(inode)-i_flags |= EXT4_EXTENTS_FL;
-   ext4_ext_tree_init(handle, inode);
-   err = ext4_update_incompat_feature(handle, sb,
-   EXT4_FEATURE_INCOMPAT_EXTENTS);
-   if (err)
-   goto fail;
+   /* set extent flag only for directory and file */
+   if (S_ISDIR(mode) || S_ISREG(mode)) {
+   EXT4_I(inode)-i_flags |= EXT4_EXTENTS_FL;
+   ext4_ext_tree_init(handle, inode);
+   err = ext4_update_incompat_feature(handle, sb,
+   EXT4_FEATURE_INCOMPAT_EXTENTS);
+   if (err)
+   goto fail;
+   }
}
 
ext4_debug(allocating inode %lu\n, inode-i_ino);
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 5a79c6b..28aa2ed 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -2220,7 +2220,6 @@ retry:
inode-i_op = ext4_fast_symlink_inode_operations;
memcpy((char*)EXT4_I(inode)-i_data,symname,l);
inode-i_size = l-1;
-   EXT4_I(inode)-i_flags = ~EXT4_EXTENTS_FL;
}
EXT4_I(inode)-i_disksize = inode-i_size;
err = ext4_add_nondir(handle, dentry, inode);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ext4: ext4_find_next_zero_bit needs an aligned address on some arch

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ffad0a44b7216d0f079dcf95a351082099d1e5fb
Commit: ffad0a44b7216d0f079dcf95a351082099d1e5fb
Parent: 42bf0383d1e09dd1b38f3debb13a76b2f87634b3
Author: Aneesh Kumar K.V [EMAIL PROTECTED]
AuthorDate: Sat Feb 23 01:38:34 2008 -0500
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Sat Feb 23 01:38:34 2008 -0500

ext4: ext4_find_next_zero_bit needs an aligned address on some arch

ext4_find_next_zero_bit and ext4_find_next_bit needs a long aligned
address on x8_64. Add mb_find_next_zero_bit and mb_find_next_bit
and use them in the mballoc.

Fix: https://bugzilla.redhat.com/show_bug.cgi?id=433286

Eric Sandeen debugged the problem and suggested the fix.

Signed-off-by: Aneesh Kumar K.V [EMAIL PROTECTED]
Acked-by:  Eric Sandeen [EMAIL PROTECTED]
Signed-off-by: Mingming Cao [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/mballoc.c |   62 ++--
 1 files changed, 40 insertions(+), 22 deletions(-)

diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 6968c53..ef97f19 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -627,21 +627,19 @@ static ext4_fsblk_t ext4_grp_offs_to_block(struct 
super_block *sb,
return block;
 }
 
+static inline void *mb_correct_addr_and_bit(int *bit, void *addr)
+{
 #if BITS_PER_LONG == 64
-#define mb_correct_addr_and_bit(bit, addr) \
-{  \
-   bit += ((unsigned long) addr  7UL)  3;   \
-   addr = (void *) ((unsigned long) addr  ~7UL);  \
-}
+   *bit += ((unsigned long) addr  7UL)  3;
+   addr = (void *) ((unsigned long) addr  ~7UL);
 #elif BITS_PER_LONG == 32
-#define mb_correct_addr_and_bit(bit, addr) \
-{  \
-   bit += ((unsigned long) addr  3UL)  3;   \
-   addr = (void *) ((unsigned long) addr  ~3UL);  \
-}
+   *bit += ((unsigned long) addr  3UL)  3;
+   addr = (void *) ((unsigned long) addr  ~3UL);
 #else
 #error how many bits you are?!
 #endif
+   return addr;
+}
 
 static inline int mb_test_bit(int bit, void *addr)
 {
@@ -649,34 +647,54 @@ static inline int mb_test_bit(int bit, void *addr)
 * ext4_test_bit on architecture like powerpc
 * needs unsigned long aligned address
 */
-   mb_correct_addr_and_bit(bit, addr);
+   addr = mb_correct_addr_and_bit(bit, addr);
return ext4_test_bit(bit, addr);
 }
 
 static inline void mb_set_bit(int bit, void *addr)
 {
-   mb_correct_addr_and_bit(bit, addr);
+   addr = mb_correct_addr_and_bit(bit, addr);
ext4_set_bit(bit, addr);
 }
 
 static inline void mb_set_bit_atomic(spinlock_t *lock, int bit, void *addr)
 {
-   mb_correct_addr_and_bit(bit, addr);
+   addr = mb_correct_addr_and_bit(bit, addr);
ext4_set_bit_atomic(lock, bit, addr);
 }
 
 static inline void mb_clear_bit(int bit, void *addr)
 {
-   mb_correct_addr_and_bit(bit, addr);
+   addr = mb_correct_addr_and_bit(bit, addr);
ext4_clear_bit(bit, addr);
 }
 
 static inline void mb_clear_bit_atomic(spinlock_t *lock, int bit, void *addr)
 {
-   mb_correct_addr_and_bit(bit, addr);
+   addr = mb_correct_addr_and_bit(bit, addr);
ext4_clear_bit_atomic(lock, bit, addr);
 }
 
+static inline int mb_find_next_zero_bit(void *addr, int max, int start)
+{
+   int fix = 0;
+   addr = mb_correct_addr_and_bit(fix, addr);
+   max += fix;
+   start += fix;
+
+   return ext4_find_next_zero_bit(addr, max, start) - fix;
+}
+
+static inline int mb_find_next_bit(void *addr, int max, int start)
+{
+   int fix = 0;
+   addr = mb_correct_addr_and_bit(fix, addr);
+   max += fix;
+   start += fix;
+
+   return ext4_find_next_bit(addr, max, start) - fix;
+}
+
 static void *mb_find_buddy(struct ext4_buddy *e4b, int order, int *max)
 {
char *bb;
@@ -946,12 +964,12 @@ static void ext4_mb_generate_buddy(struct super_block *sb,
 
/* initialize buddy from bitmap which is aggregation
 * of on-disk bitmap and preallocations */
-   i = ext4_find_next_zero_bit(bitmap, max, 0);
+   i = mb_find_next_zero_bit(bitmap, max, 0);
grp-bb_first_free = i;
while (i  max) {
fragments++;
first = i;
-   i = ext4_find_next_bit(bitmap, max, i);
+   i = mb_find_next_bit(bitmap, max, i);
len = i - first;
free += len;
if (len  1)
@@ -959,7 +977,7 @@ static void ext4_mb_generate_buddy(struct super_block *sb,
else
grp-bb_counters[0]++;
if (i  max)
-   i = ext4_find_next_zero_bit(bitmap, max, i);
+   i = mb_find_next_zero_bit(bitmap, max, i);
 

ext4: add missing ext4_journal_stop()

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5606bf5d0cbfbc3dfa78793a3793c43dd045fb1b
Commit: 5606bf5d0cbfbc3dfa78793a3793c43dd045fb1b
Parent: ffad0a44b7216d0f079dcf95a351082099d1e5fb
Author: Akinobu Mita [EMAIL PROTECTED]
AuthorDate: Mon Feb 25 15:37:42 2008 -0500
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Mon Feb 25 15:37:42 2008 -0500

ext4: add missing ext4_journal_stop()

Add missing ext4_journal_stop() in error handling.

Signed-off-by: Akinobu Mita [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
Cc: Stephen Tweedie [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Cc: Andrew Morton [EMAIL PROTECTED]
Cc: Mingming Cao [EMAIL PROTECTED]
---
 fs/ext4/resize.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 9477a2b..e29efa0 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -1037,6 +1037,7 @@ int ext4_group_extend(struct super_block *sb, struct 
ext4_super_block *es,
ext4_warning(sb, __FUNCTION__,
 multiple resizers run on filesystem!);
unlock_super(sb);
+   ext4_journal_stop(handle);
err = -EBUSY;
goto exit_put;
}
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Remove empty file fs/xfs/Makefile-linux-2.6.

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6e5e93424dc66542c548dfaa3bfebe30d46d50dd
Commit: 6e5e93424dc66542c548dfaa3bfebe30d46d50dd
Parent: c58310bf4933986513020fa90b4190c7492995ae
Author: Lachlan McIlroy [EMAIL PROTECTED]
AuthorDate: Fri Feb 22 15:36:19 2008 +1100
Committer:  Lachlan McIlroy [EMAIL PROTECTED]
CommitDate: Fri Feb 22 15:39:10 2008 +1100

Remove empty file fs/xfs/Makefile-linux-2.6.
---
 0 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/fs/xfs/Makefile-linux-2.6 b/fs/xfs/Makefile-linux-2.6
deleted file mode 100644
index e69de29..000
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[XFS] Undo bit ops cleanup mod due to regression on 32-bit powermac

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=db69c915e67705daac25cad06d816c09be634de0
Commit: db69c915e67705daac25cad06d816c09be634de0
Parent: 91e229bbad6524aabaac8717b2f559283670c37a
Author: Lachlan McIlroy [EMAIL PROTECTED]
AuthorDate: Tue Feb 26 17:00:14 2008 +1100
Committer:  Lachlan McIlroy [EMAIL PROTECTED]
CommitDate: Tue Feb 26 17:05:37 2008 +1100

[XFS] Undo bit ops cleanup mod due to regression on 32-bit powermac
platform.

SGI-PV: 974005
SGI-Modid: xfs-linux-melb:xfs-kern:30558a

Signed-off-by: Lachlan McIlroy [EMAIL PROTECTED]
---
 fs/xfs/xfs_bit.h |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/xfs/xfs_bit.h b/fs/xfs/xfs_bit.h
index 325a007..0f9fc9a 100644
--- a/fs/xfs/xfs_bit.h
+++ b/fs/xfs/xfs_bit.h
@@ -61,15 +61,15 @@ static inline int xfs_highbit64(__uint64_t v)
 /* Get low bit set out of 32-bit argument, -1 if none set */
 static inline int xfs_lowbit32(__uint32_t v)
 {
-   __uint32_t t = v;
-   return (t) ? find_first_bit((unsigned long *)t, 32) : -1;
+   unsigned long   t = v;
+   return (v) ? find_first_bit(t, 32) : -1;
 }
 
 /* Get low bit set out of 64-bit argument, -1 if none set */
 static inline int xfs_lowbit64(__uint64_t v)
 {
-   __uint64_t t = v;
-   return (t) ? find_first_bit((unsigned long *)t, 64) : -1;
+   unsigned long   t = v;
+   return (v) ? find_first_bit(t, 64) : -1;
 }
 
 /* Return whether bitmap is empty (1 == empty) */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[XFS] Undo bit ops cleanup mod due to regression on 32-bit powermac

2008-02-26 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ef8ece55d9b6825c28a5c1a4bd89b94040cb7b32
Commit: ef8ece55d9b6825c28a5c1a4bd89b94040cb7b32
Parent: db69c915e67705daac25cad06d816c09be634de0
Author: Lachlan McIlroy [EMAIL PROTECTED]
AuthorDate: Tue Feb 26 17:00:22 2008 +1100
Committer:  Lachlan McIlroy [EMAIL PROTECTED]
CommitDate: Tue Feb 26 17:05:44 2008 +1100

[XFS] Undo bit ops cleanup mod due to regression on 32-bit powermac
platform.

SGI-PV: 971186
SGI-Modid: xfs-linux-melb:xfs-kern:30559a

Signed-off-by: Lachlan McIlroy [EMAIL PROTECTED]
---
 fs/xfs/xfs_bit.c |  103 ++
 fs/xfs/xfs_bit.h |   27 ++---
 fs/xfs/xfs_rtalloc.c |   19 ++---
 3 files changed, 120 insertions(+), 29 deletions(-)

diff --git a/fs/xfs/xfs_bit.c b/fs/xfs/xfs_bit.c
index 4822884..fab0b6d 100644
--- a/fs/xfs/xfs_bit.c
+++ b/fs/xfs/xfs_bit.c
@@ -25,6 +25,109 @@
  * XFS bit manipulation routines, used in non-realtime code.
  */
 
+#ifndef HAVE_ARCH_HIGHBIT
+/*
+ * Index of high bit number in byte, -1 for none set, 0..7 otherwise.
+ */
+static const char xfs_highbit[256] = {
+   -1, 0, 1, 1, 2, 2, 2, 2,/* 00 .. 07 */
+   3, 3, 3, 3, 3, 3, 3, 3, /* 08 .. 0f */
+   4, 4, 4, 4, 4, 4, 4, 4, /* 10 .. 17 */
+   4, 4, 4, 4, 4, 4, 4, 4, /* 18 .. 1f */
+   5, 5, 5, 5, 5, 5, 5, 5, /* 20 .. 27 */
+   5, 5, 5, 5, 5, 5, 5, 5, /* 28 .. 2f */
+   5, 5, 5, 5, 5, 5, 5, 5, /* 30 .. 37 */
+   5, 5, 5, 5, 5, 5, 5, 5, /* 38 .. 3f */
+   6, 6, 6, 6, 6, 6, 6, 6, /* 40 .. 47 */
+   6, 6, 6, 6, 6, 6, 6, 6, /* 48 .. 4f */
+   6, 6, 6, 6, 6, 6, 6, 6, /* 50 .. 57 */
+   6, 6, 6, 6, 6, 6, 6, 6, /* 58 .. 5f */
+   6, 6, 6, 6, 6, 6, 6, 6, /* 60 .. 67 */
+   6, 6, 6, 6, 6, 6, 6, 6, /* 68 .. 6f */
+   6, 6, 6, 6, 6, 6, 6, 6, /* 70 .. 77 */
+   6, 6, 6, 6, 6, 6, 6, 6, /* 78 .. 7f */
+   7, 7, 7, 7, 7, 7, 7, 7, /* 80 .. 87 */
+   7, 7, 7, 7, 7, 7, 7, 7, /* 88 .. 8f */
+   7, 7, 7, 7, 7, 7, 7, 7, /* 90 .. 97 */
+   7, 7, 7, 7, 7, 7, 7, 7, /* 98 .. 9f */
+   7, 7, 7, 7, 7, 7, 7, 7, /* a0 .. a7 */
+   7, 7, 7, 7, 7, 7, 7, 7, /* a8 .. af */
+   7, 7, 7, 7, 7, 7, 7, 7, /* b0 .. b7 */
+   7, 7, 7, 7, 7, 7, 7, 7, /* b8 .. bf */
+   7, 7, 7, 7, 7, 7, 7, 7, /* c0 .. c7 */
+   7, 7, 7, 7, 7, 7, 7, 7, /* c8 .. cf */
+   7, 7, 7, 7, 7, 7, 7, 7, /* d0 .. d7 */
+   7, 7, 7, 7, 7, 7, 7, 7, /* d8 .. df */
+   7, 7, 7, 7, 7, 7, 7, 7, /* e0 .. e7 */
+   7, 7, 7, 7, 7, 7, 7, 7, /* e8 .. ef */
+   7, 7, 7, 7, 7, 7, 7, 7, /* f0 .. f7 */
+   7, 7, 7, 7, 7, 7, 7, 7, /* f8 .. ff */
+};
+#endif
+
+/*
+ * xfs_highbit32: get high bit set out of 32-bit argument, -1 if none set.
+ */
+inline int
+xfs_highbit32(
+   __uint32_t  v)
+{
+#ifdef HAVE_ARCH_HIGHBIT
+   return highbit32(v);
+#else
+   int i;
+
+   if (v  0x)
+   if (v  0xff00)
+   i = 24;
+   else
+   i = 16;
+   else if (v  0x)
+   if (v  0xff00)
+   i = 8;
+   else
+   i = 0;
+   else
+   return -1;
+   return i + xfs_highbit[(v  i)  0xff];
+#endif
+}
+
+/*
+ * xfs_lowbit64: get low bit set out of 64-bit argument, -1 if none set.
+ */
+int
+xfs_lowbit64(
+   __uint64_t  v)
+{
+   __uint32_t  w = (__uint32_t)v;
+   int n = 0;
+
+   if (w) {/* lower bits */
+   n = ffs(w);
+   } else {/* upper bits */
+   w = (__uint32_t)(v  32);
+   if (w  (n = ffs(w)))
+   n += 32;
+   }
+   return n - 1;
+}
+
+/*
+ * xfs_highbit64: get high bit set out of 64-bit argument, -1 if none set.
+ */
+int
+xfs_highbit64(
+   __uint64_t  v)
+{
+   __uint32_t  h = (__uint32_t)(v  32);
+
+   if (h)
+   return xfs_highbit32(h) + 32;
+   return xfs_highbit32((__uint32_t)v);
+}
+
+
 /*
  * Return whether bitmap is empty.
  * Size is number of words in the bitmap, which is padded to word boundary
diff --git a/fs/xfs/xfs_bit.h b/fs/xfs/xfs_bit.h
index 0f9fc9a..082641a 100644
--- a/fs/xfs/xfs_bit.h
+++ b/fs/xfs/xfs_bit.h
@@ -47,30 +47,13 @@ static inline __uint64_t xfs_mask64lo(int n)
 }
 
 /* Get high bit set out of 32-bit 

i2c-i801: Add support for the ICH10

2008-02-24 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d28dc711217a2d5cafb64ec4e33a469b01376d91
Commit: d28dc711217a2d5cafb64ec4e33a469b01376d91
Parent: 263867631ea02741baf878ca9faaf94b1563b9d7
Author: Gaston, Jason D [EMAIL PROTECTED]
AuthorDate: Sun Feb 24 20:03:42 2008 +0100
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Sun Feb 24 20:03:42 2008 +0100

i2c-i801: Add support for the ICH10

Add the Intel ICH10 SMBus Controller DeviceID's and updates
Tolapai support.

Signed-off-by: Jason Gaston [EMAIL PROTECTED]
Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 Documentation/i2c/busses/i2c-i801 |3 ++-
 drivers/i2c/busses/Kconfig|2 ++
 drivers/i2c/busses/i2c-i801.c |   10 --
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/Documentation/i2c/busses/i2c-i801 
b/Documentation/i2c/busses/i2c-i801
index 3bd9583..c31e029 100644
--- a/Documentation/i2c/busses/i2c-i801
+++ b/Documentation/i2c/busses/i2c-i801
@@ -12,8 +12,9 @@ Supported adapters:
   * Intel 82801G (ICH7)
   * Intel 631xESB/632xESB (ESB2)
   * Intel 82801H (ICH8)
-  * Intel ICH9
+  * Intel 82801I (ICH9)
   * Intel Tolapai
+  * Intel ICH10
Datasheets: Publicly available at the Intel website
 
 Authors: 
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index b61f56b..476b0bb 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -177,6 +177,8 @@ config I2C_I801
ESB2
ICH8
ICH9
+   Tolapai
+   ICH10
 
  This driver can also be built as a module.  If so, the module
  will be called i2c-i801.
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index aa91579..b0f771f 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -40,7 +40,9 @@
   82801G   (ICH7)   0x27da 32 hard yes yes yes
   82801H   (ICH8)   0x283e 32 hard yes yes yes
   82801I   (ICH9)   0x2930 32 hard yes yes yes
-  Tolapai   0x5032 32 hard yes ?   ?
+  Tolapai   0x5032 32 hard yes yes yes
+  ICH10 0x3a30 32 hard yes yes yes
+  ICH10 0x3a60 32 hard yes yes yes
 
   Features supported by this driver:
   Software PEC no
@@ -588,6 +590,8 @@ static struct pci_device_id i801_ids[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_5) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_6) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TOLAPAI_1) },
+   { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10_4) },
+   { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10_5) },
{ 0, }
 };
 
@@ -608,10 +612,12 @@ static int __devinit i801_probe(struct pci_dev *dev, 
const struct pci_device_id
case PCI_DEVICE_ID_INTEL_ESB2_17:
case PCI_DEVICE_ID_INTEL_ICH8_5:
case PCI_DEVICE_ID_INTEL_ICH9_6:
+   case PCI_DEVICE_ID_INTEL_TOLAPAI_1:
+   case PCI_DEVICE_ID_INTEL_ICH10_4:
+   case PCI_DEVICE_ID_INTEL_ICH10_5:
i801_features |= FEATURE_I2C_BLOCK_READ;
/* fall through */
case PCI_DEVICE_ID_INTEL_82801DB_3:
-   case PCI_DEVICE_ID_INTEL_TOLAPAI_1:
i801_features |= FEATURE_SMBUS_PEC;
i801_features |= FEATURE_BLOCK_BUFFER;
break;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ARM: OMAP: Release i2c_adapter after use (Siemens SX1)

2008-02-24 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c9a2c46d7f32a884510b20f0cfa79a2c6a2f1413
Commit: c9a2c46d7f32a884510b20f0cfa79a2c6a2f1413
Parent: 4fa2b1cde0e3797549f711ce9e51c395b3d6d2a7
Author: Jean Delvare [EMAIL PROTECTED]
AuthorDate: Sun Feb 24 20:03:41 2008 +0100
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Sun Feb 24 20:03:41 2008 +0100

ARM: OMAP: Release i2c_adapter after use (Siemens SX1)

Each call to i2c_get_adapter() must be followed by a call to
i2c_put_adapter() to release the grabbed reference. Otherwise the
reference count grows forever and the adapter can never be
unregistered.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Acked-by: Vladimir Ananiev [EMAIL PROTECTED]
Acked-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/board-sx1.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
index 1c7f09a..e473fa6 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -61,6 +61,7 @@ int sx1_i2c_write_byte(u8 devaddr, u8 regoffset, u8 value)
data[0] = regoffset;/* register num */
data[1] = value;/* register data */
err = i2c_transfer(adap, msg, 1);
+   i2c_put_adapter(adap);
if (err = 0)
return 0;
return err;
@@ -91,6 +92,7 @@ int sx1_i2c_read_byte(u8 devaddr, u8 regoffset, u8 *value)
msg-buf = data;
err = i2c_transfer(adap, msg, 1);
*value = data[0];
+   i2c_put_adapter(adap);
 
if (err = 0)
return 0;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Alchemy: compile fix

2008-02-24 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9e39ffeff6e54ef65832e4eb58059133f1a8aadf
Commit: 9e39ffeff6e54ef65832e4eb58059133f1a8aadf
Parent: 305183fc3ec8aac55179ef0fcb65dab9b97a9145
Author: Manuel Lauss [EMAIL PROTECTED]
AuthorDate: Sun Feb 24 20:03:42 2008 +0100
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Sun Feb 24 20:03:42 2008 +0100

Alchemy: compile fix

Commit 8b798c4d16b762d15f4055597ff8d87f73b35552 broke
alchemy build, fix it.  Pointed out by Adrian Bunk.

Signed-off-by: Manuel Lauss [EMAIL PROTECTED]
Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 include/asm-mips/mach-db1x00/db1200.h |1 +
 include/asm-mips/mach-db1x00/db1x00.h |1 +
 include/asm-mips/mach-pb1x00/pb1200.h |1 +
 include/asm-mips/mach-pb1x00/pb1550.h |1 +
 4 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/asm-mips/mach-db1x00/db1200.h 
b/include/asm-mips/mach-db1x00/db1200.h
index 050eae8..a6bdac6 100644
--- a/include/asm-mips/mach-db1x00/db1200.h
+++ b/include/asm-mips/mach-db1x00/db1200.h
@@ -25,6 +25,7 @@
 #define __ASM_DB1200_H
 
 #include linux/types.h
+#include asm/mach-au1x00/au1xxx_psc.h
 
 // This is defined in au1000.h with bogus value
 #undef AU1X00_EXTERNAL_INT
diff --git a/include/asm-mips/mach-db1x00/db1x00.h 
b/include/asm-mips/mach-db1x00/db1x00.h
index 0f5f4c2..e7a88ba 100644
--- a/include/asm-mips/mach-db1x00/db1x00.h
+++ b/include/asm-mips/mach-db1x00/db1x00.h
@@ -28,6 +28,7 @@
 #ifndef __ASM_DB1X00_H
 #define __ASM_DB1X00_H
 
+#include asm/mach-au1x00/au1xxx_psc.h
 
 #ifdef CONFIG_MIPS_DB1550
 
diff --git a/include/asm-mips/mach-pb1x00/pb1200.h 
b/include/asm-mips/mach-pb1x00/pb1200.h
index d9f384a..ed5fd73 100644
--- a/include/asm-mips/mach-pb1x00/pb1200.h
+++ b/include/asm-mips/mach-pb1x00/pb1200.h
@@ -25,6 +25,7 @@
 #define __ASM_PB1200_H
 
 #include linux/types.h
+#include asm/mach-au1x00/au1xxx_psc.h
 
 // This is defined in au1000.h with bogus value
 #undef AU1X00_EXTERNAL_INT
diff --git a/include/asm-mips/mach-pb1x00/pb1550.h 
b/include/asm-mips/mach-pb1x00/pb1550.h
index 9a4955c..c2ab0e2 100644
--- a/include/asm-mips/mach-pb1x00/pb1550.h
+++ b/include/asm-mips/mach-pb1x00/pb1550.h
@@ -28,6 +28,7 @@
 #define __ASM_PB1550_H
 
 #include linux/types.h
+#include asm/mach-au1x00/au1xxx_psc.h
 
 #define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
 #define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Linux 2.6.25-rc3

2008-02-24 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bfa274e2436fc7ef72ef51c878083647f1cfd429
Commit: bfa274e2436fc7ef72ef51c878083647f1cfd429
Parent: d28dc711217a2d5cafb64ec4e33a469b01376d91
Author: Linus Torvalds [EMAIL PROTECTED]
AuthorDate: Sun Feb 24 13:25:54 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sun Feb 24 13:25:54 2008 -0800

Linux 2.6.25-rc3
---
 Makefile |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 99300dc..a229784 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 25
-EXTRAVERSION = -rc2
+EXTRAVERSION = -rc3
 NAME = Funky Weasel is Jiggy wit it
 
 # *DOCUMENTATION*
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i2c: Storage class should be before const qualifier

2008-02-24 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=305183fc3ec8aac55179ef0fcb65dab9b97a9145
Commit: 305183fc3ec8aac55179ef0fcb65dab9b97a9145
Parent: a92b36ed33800435a2356a78489e129aaf30f673
Author: Tobias Klauser [EMAIL PROTECTED]
AuthorDate: Sun Feb 24 20:03:42 2008 +0100
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Sun Feb 24 20:03:42 2008 +0100

i2c: Storage class should be before const qualifier

The C99 specification states in section 6.11.5:

The placement of a storage-class specifier other than at the
beginning of the declaration specifiers in a declaration is an
obsolescent feature.

Signed-off-by: Tobias Klauser [EMAIL PROTECTED]
Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 drivers/i2c/busses/i2c-pmcmsp.c |4 ++--
 include/linux/i2c.h |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pmcmsp.c b/drivers/i2c/busses/i2c-pmcmsp.c
index be99c02..b03af56 100644
--- a/drivers/i2c/busses/i2c-pmcmsp.c
+++ b/drivers/i2c/busses/i2c-pmcmsp.c
@@ -122,7 +122,7 @@ struct pmcmsptwi_data {
 };
 
 /* The default settings */
-const static struct pmcmsptwi_clockcfg pmcmsptwi_defclockcfg = {
+static const struct pmcmsptwi_clockcfg pmcmsptwi_defclockcfg = {
.standard = {
.filter = 0x3,
.clock  = 0x1f,
@@ -133,7 +133,7 @@ const static struct pmcmsptwi_clockcfg 
pmcmsptwi_defclockcfg = {
},
 };
 
-const static struct pmcmsptwi_cfg pmcmsptwi_defcfg = {
+static const struct pmcmsptwi_cfg pmcmsptwi_defcfg = {
.arbf   = 0x03,
.nak= 0x03,
.add10  = 0x00,
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 76014f8..2d1c608 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -598,7 +598,7 @@ I2C_CLIENT_MODULE_PARM(probe, List of adapter,address 
pairs to scan   \
   additionally); \
 I2C_CLIENT_MODULE_PARM(ignore, List of adapter,address pairs not to  \
   scan); \
-const static struct i2c_client_address_data addr_data = {  \
+static const struct i2c_client_address_data addr_data = {  \
.normal_i2c = normal_i2c,   \
.probe  = probe,\
.ignore = ignore,   \
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i2c-pca-isa: Add access check to legacy ioports

2008-02-24 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=104cb574feb3033299568483a3f68031f47e0d43
Commit: 104cb574feb3033299568483a3f68031f47e0d43
Parent: 9e39ffeff6e54ef65832e4eb58059133f1a8aadf
Author: Christian Krafft [EMAIL PROTECTED]
AuthorDate: Sun Feb 24 20:03:42 2008 +0100
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Sun Feb 24 20:03:42 2008 +0100

i2c-pca-isa: Add access check to legacy ioports

When probing i2c-pca-isa writes to legacy ioports, which crashes the kernel
if there is no device at that port.
This patch adds a check_legacy_ioport call, so probe fails gracefully
and thus prevents the oops.

Signed-off-by: Christian Krafft [EMAIL PROTECTED]
Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 drivers/i2c/busses/i2c-pca-isa.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pca-isa.c b/drivers/i2c/busses/i2c-pca-isa.c
index 5161aaf..496ee87 100644
--- a/drivers/i2c/busses/i2c-pca-isa.c
+++ b/drivers/i2c/busses/i2c-pca-isa.c
@@ -125,6 +125,13 @@ static int __devinit pca_isa_probe(struct device *dev, 
unsigned int id)
 
dev_info(dev, i/o base %#08lx. irq %d\n, base, irq);
 
+#ifdef CONFIG_PPC_MERGE
+   if (check_legacy_ioport(base)) {
+   dev_err(dev, I/O address %#08lx is not available\n, base);
+   goto out;
+   }
+#endif
+
if (!request_region(base, IO_SIZE, i2c-pca-isa)) {
dev_err(dev, I/O address %#08lx is in use\n, base);
goto out;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i2c-pxa: Misc fixes

2008-02-24 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a92b36ed33800435a2356a78489e129aaf30f673
Commit: a92b36ed33800435a2356a78489e129aaf30f673
Parent: c9a2c46d7f32a884510b20f0cfa79a2c6a2f1413
Author: Wolfram Sang [EMAIL PROTECTED]
AuthorDate: Sun Feb 24 20:03:42 2008 +0100
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Sun Feb 24 20:03:42 2008 +0100

i2c-pxa: Misc fixes

While working on the PCA9564-platform driver, I sometimes had a glimpse at 
the
pxa-driver. I found some suspicious places, and this patch contains my
suggestions. Note: They are not tested, due to no hardware.

[JD: Some more fixes.]

Signed-off-by: Wolfram Sang [EMAIL PROTECTED]
Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Tested-by: Mike Rapoport [EMAIL PROTECTED]
Tested-by: Eric Miao [EMAIL PROTECTED]
---
 drivers/i2c/busses/i2c-pxa.c |   25 ++---
 1 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 2b557bf..2d2087a 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -999,7 +999,14 @@ static int i2c_pxa_probe(struct platform_device *dev)
spin_lock_init(i2c-lock);
init_waitqueue_head(i2c-wait);
 
-   sprintf(i2c-adap.name, pxa_i2c-i2c.%u, dev-id);
+   /*
+* If dev-id is negative we consider it as zero.
+* The reason to do so is to avoid sysfs names that only make
+* sense when there are multiple adapters.
+*/
+   i2c-adap.nr = dev-id != -1 ? dev-id : 0;
+   snprintf(i2c-adap.name, sizeof(i2c-adap.name), pxa_i2c-i2c.%u,
+i2c-adap.nr);
 
i2c-clk = clk_get(dev-dev, I2CCLK);
if (IS_ERR(i2c-clk)) {
@@ -1050,13 +1057,6 @@ static int i2c_pxa_probe(struct platform_device *dev)
i2c-adap.algo_data = i2c;
i2c-adap.dev.parent = dev-dev;
 
-   /*
-* If dev-id is negative we consider it as zero.
-* The reason to do so is to avoid sysfs names that only make
-* sense when there are multiple adapters.
-*/
-   i2c-adap.nr = dev-id != -1 ? dev-id : 0;
-
ret = i2c_add_numbered_adapter(i2c-adap);
if (ret  0) {
printk(KERN_INFO I2C: Failed to add bus\n);
@@ -1080,6 +1080,7 @@ eadapt:
 ereqirq:
clk_disable(i2c-clk);
i2c_pxa_disable(dev);
+   iounmap(i2c-reg_base);
 eremap:
clk_put(i2c-clk);
 eclk:
@@ -1089,7 +1090,7 @@ emalloc:
return ret;
 }
 
-static int i2c_pxa_remove(struct platform_device *dev)
+static int __exit i2c_pxa_remove(struct platform_device *dev)
 {
struct pxa_i2c *i2c = platform_get_drvdata(dev);
 
@@ -1103,6 +1104,7 @@ static int i2c_pxa_remove(struct platform_device *dev)
clk_put(i2c-clk);
i2c_pxa_disable(dev);
 
+   iounmap(i2c-reg_base);
release_mem_region(i2c-iobase, i2c-iosize);
kfree(i2c);
 
@@ -,9 +1113,10 @@ static int i2c_pxa_remove(struct platform_device *dev)
 
 static struct platform_driver i2c_pxa_driver = {
.probe  = i2c_pxa_probe,
-   .remove = i2c_pxa_remove,
+   .remove = __exit_p(i2c_pxa_remove),
.driver = {
.name   = pxa2xx-i2c,
+   .owner  = THIS_MODULE,
},
 };
 
@@ -1122,7 +1125,7 @@ static int __init i2c_adap_pxa_init(void)
return platform_driver_register(i2c_pxa_driver);
 }
 
-static void i2c_adap_pxa_exit(void)
+static void __exit i2c_adap_pxa_exit(void)
 {
platform_driver_unregister(i2c_pxa_driver);
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i2c: Make i2c_register_board_info() a NOP when CONFIG_I2C_BOARDINFO=n

2008-02-24 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=263867631ea02741baf878ca9faaf94b1563b9d7
Commit: 263867631ea02741baf878ca9faaf94b1563b9d7
Parent: 104cb574feb3033299568483a3f68031f47e0d43
Author: David Brownell [EMAIL PROTECTED]
AuthorDate: Sun Feb 24 20:03:42 2008 +0100
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Sun Feb 24 20:03:42 2008 +0100

i2c: Make i2c_register_board_info() a NOP when CONFIG_I2C_BOARDINFO=n

Don't require platform code to be #ifdeffed according to whether
I2C is enabled or not ... if it's not enabled, let GCC compile out
all I2C device declarations.  (Issue noted on an NSLU2 build that
didn't configure I2C.)

Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 include/linux/i2c.h |9 -
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 2d1c608..365e0df 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -271,9 +271,16 @@ extern void i2c_unregister_device(struct i2c_client *);
  * This is done at arch_initcall time, before declaring any i2c adapters.
  * Modules for add-on boards must use other calls.
  */
+#ifdef CONFIG_I2C_BOARDINFO
 extern int
 i2c_register_board_info(int busnum, struct i2c_board_info const *info, 
unsigned n);
-
+#else
+static inline int
+i2c_register_board_info(int busnum, struct i2c_board_info const *info, 
unsigned n)
+{
+   return 0;
+}
+#endif
 
 /*
  * The following structs are for those who like to implement new bus drivers:
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


percpu: fix DEBUG_PREEMPT per_cpu checking

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1e8352784abaedb424e63fa700e93e6c1307785f
Commit: 1e8352784abaedb424e63fa700e93e6c1307785f
Parent: 3a2d5b700132f35401f1d9e22fe3c2cab02c2549
Author: Hugh Dickins [EMAIL PROTECTED]
AuthorDate: Sat Feb 23 19:40:17 2008 +
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Feb 23 12:09:28 2008 -0800

percpu: fix DEBUG_PREEMPT per_cpu checking

2.6.25-rc1 percpu changes broke CONFIG_DEBUG_PREEMPT's per_cpu checking
on several architectures.  On s390, sparc64 and x86 it's been weakened to
not checking at all; whereas on powerpc64 it's become too strict, issuing
warnings from __raw_get_cpu_var in io_schedule and init_timer for example.

Fix this by weakening powerpc's __my_cpu_offset to use the non-checking
local_paca instead of get_paca (which itself contains such a check);
and strengthening the generic my_cpu_offset to go the old slow way via
smp_processor_id when CONFIG_DEBUG_PREEMPT (debug_smp_processor_id is
where all the knowledge of what's correct when lives).

Signed-off-by: Hugh Dickins [EMAIL PROTECTED]
Reviewed-by: Mike Travis [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/asm-generic/percpu.h |2 ++
 include/asm-powerpc/percpu.h |2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
index 4b8d31c..b0e63c6 100644
--- a/include/asm-generic/percpu.h
+++ b/include/asm-generic/percpu.h
@@ -32,6 +32,8 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
  */
 #ifndef __my_cpu_offset
 #define __my_cpu_offset per_cpu_offset(raw_smp_processor_id())
+#endif
+#ifdef CONFIG_DEBUG_PREEMPT
 #define my_cpu_offset per_cpu_offset(smp_processor_id())
 #else
 #define my_cpu_offset __my_cpu_offset
diff --git a/include/asm-powerpc/percpu.h b/include/asm-powerpc/percpu.h
index ccb0523..f879252 100644
--- a/include/asm-powerpc/percpu.h
+++ b/include/asm-powerpc/percpu.h
@@ -13,7 +13,7 @@
 #include asm/paca.h
 
 #define __per_cpu_offset(cpu) (paca[cpu].data_offset)
-#define __my_cpu_offset get_paca()-data_offset
+#define __my_cpu_offset local_paca-data_offset
 #define per_cpu_offset(x) (__per_cpu_offset(x))
 
 #endif /* CONFIG_SMP */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


PM: Introduce PM_EVENT_HIBERNATE callback state

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3a2d5b700132f35401f1d9e22fe3c2cab02c2549
Commit: 3a2d5b700132f35401f1d9e22fe3c2cab02c2549
Parent: 39273b58a409cd6d65c9732bdca00bacd1626672
Author: Rafael J. Wysocki [EMAIL PROTECTED]
AuthorDate: Sat Feb 23 19:13:25 2008 +0100
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Feb 23 10:40:04 2008 -0800

PM: Introduce PM_EVENT_HIBERNATE callback state

During the last step of hibernation in the platform mode (with the
help of ACPI) we use the suspend code, including the devices'
-suspend() methods, to prepare the system for entering the ACPI S4
system sleep state.

But at least for some devices the operations performed by the
-suspend() callback in that case must be different from its operations
during regular suspend.

For this reason, introduce the new PM event type PM_EVENT_HIBERNATE and
pass it to the device drivers' -suspend() methods during the last phase
of hibernation, so that they can distinguish this case and handle it as
appropriate.  Modify the drivers that handle PM_EVENT_SUSPEND in a
special way and need to handle PM_EVENT_HIBERNATE in the same way.

These changes are necessary to fix a hibernation regression related
to the i915 driver (ref. http://lkml.org/lkml/2008/2/22/488).

Signed-off-by: Rafael J. Wysocki [EMAIL PROTECTED]
Acked-by: Pavel Machek [EMAIL PROTECTED]
Tested-by: Jeff Chua [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 Documentation/power/devices.txt|   13 -
 drivers/ata/ahci.c |2 +-
 drivers/ata/ata_piix.c |2 +-
 drivers/ata/libata-core.c  |2 +-
 drivers/ide/ppc/pmac.c |4 ++--
 drivers/macintosh/mediabay.c   |3 ++-
 drivers/pci/pci.c  |1 +
 drivers/scsi/aic7xxx/aic79xx_osm_pci.c |2 +-
 drivers/scsi/aic7xxx/aic7xxx_osm_pci.c |2 +-
 drivers/scsi/mesh.c|1 +
 drivers/scsi/sd.c  |3 +--
 drivers/usb/host/sl811-hcd.c   |1 +
 drivers/usb/host/u132-hcd.c|   11 ---
 drivers/video/chipsfb.c|2 +-
 drivers/video/nvidia/nvidia.c  |2 +-
 include/linux/pm.h |9 -
 kernel/power/disk.c|4 ++--
 net/rfkill/rfkill.c|2 +-
 18 files changed, 42 insertions(+), 24 deletions(-)

diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt
index c53d263..461e4f1 100644
--- a/Documentation/power/devices.txt
+++ b/Documentation/power/devices.txt
@@ -310,9 +310,12 @@ used with suspend-to-disk:
 PM_EVENT_SUSPEND -- quiesce the driver and put hardware into a low-power
state.  When used with system sleep states like suspend-to-RAM or
standby, the upcoming resume() call will often be able to rely on
-   state kept in hardware, or issue system wakeup events.  When used
-   instead with suspend-to-disk, few devices support this capability;
-   most are completely powered off.
+   state kept in hardware, or issue system wakeup events.
+
+PM_EVENT_HIBERNATE -- Put hardware into a low-power state and enable wakeup
+   events as appropriate.  It is only used with hibernation
+   (suspend-to-disk) and few devices are able to wake up the system from
+   this state; most are completely powered off.
 
 PM_EVENT_FREEZE -- quiesce the driver, but don't necessarily change into
any low power mode.  A system snapshot is about to be taken, often
@@ -329,8 +332,8 @@ used with suspend-to-disk:
wakeup events nor DMA are allowed.
 
 To enter standby (ACPI S1) or Suspend to RAM (STR, ACPI S3) states, or
-the similarly named APM states, only PM_EVENT_SUSPEND is used; for Suspend
-to Disk (STD, hibernate, ACPI S4), all of those event codes are used.
+the similarly named APM states, only PM_EVENT_SUSPEND is used; the other event
+codes are used for hibernation (Suspend to Disk, STD, ACPI S4).
 
 There's also PM_EVENT_ON, a value which never appears as a suspend event
 but is sometimes used to record the not suspended device state.
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 3c06e45..6dd12f7 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1932,7 +1932,7 @@ static int ahci_pci_device_suspend(struct pci_dev *pdev, 
pm_message_t mesg)
void __iomem *mmio = host-iomap[AHCI_PCI_BAR];
u32 ctl;
 
-   if (mesg.event == PM_EVENT_SUSPEND) {
+   if (mesg.event  PM_EVENT_SLEEP) {
/* AHCI spec rev1.1 section 8.3.3:
 * Software must disable interrupts prior to requesting a
 * transition of the HBA to D3 state.
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 752e7d2..fae8404 100644

[SCSI] ses: fix data corruption

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=691b4773aa556d0975dbc25c93e6c8b839dad325
Commit: 691b4773aa556d0975dbc25c93e6c8b839dad325
Parent: 1309d4e68497184d2fd87e892ddf14076c2bda98
Author: Yinghai Lu [EMAIL PROTECTED]
AuthorDate: Wed Feb 13 16:25:16 2008 -0800
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Mon Feb 18 08:57:15 2008 -0600

[SCSI] ses: fix data corruption

one system: initrd get courrupted:

RAMDISK: Compressed image found at block 0
RAMDISK: incomplete write (-28 != 2048) 134217728
crc error
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 388k freed
init_special_inode: bogus i_mode (17)
Warning: unable to open an initial console.
init_special_inode: bogus i_mode (17)
init_special_inode: bogus i_mode (17)
Kernel panic - not syncing: No init found.  Try passing init= option to 
kernel.

bisected to
commit 9927c68864e9c39cc317b4f559309ba29e642168
Author: James Bottomley [EMAIL PROTECTED]
Date:   Sun Feb 3 15:48:56 2008 -0600

[SCSI] ses: add new Enclosure ULD

changes:
1. change char to unsigned char to avoid type change later.
2. preserve len for page1
3. need to move desc_ptr even the entry is not 
enclosure_component_device/raid.
   so keep desc_ptr on right position
4. record page7 len, and double check if desc_ptr out of boundary before 
touch.
5. fix typo in subenclosure checking: should use hdr_buf instead.

[jejb: style fixes]

Signed-off-by: Yinghai Lu [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/ses.c |  126 +++
 1 files changed, 67 insertions(+), 59 deletions(-)

diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c
index a57fed4..a6d9669 100644
--- a/drivers/scsi/ses.c
+++ b/drivers/scsi/ses.c
@@ -33,9 +33,9 @@
 #include scsi/scsi_host.h
 
 struct ses_device {
-   char *page1;
-   char *page2;
-   char *page10;
+   unsigned char *page1;
+   unsigned char *page2;
+   unsigned char *page10;
short page1_len;
short page2_len;
short page10_len;
@@ -67,7 +67,7 @@ static int ses_probe(struct device *dev)
 static int ses_recv_diag(struct scsi_device *sdev, int page_code,
 void *buf, int bufflen)
 {
-   char cmd[] = {
+   unsigned char cmd[] = {
RECEIVE_DIAGNOSTIC,
1,  /* Set PCV bit */
page_code,
@@ -85,7 +85,7 @@ static int ses_send_diag(struct scsi_device *sdev, int 
page_code,
 {
u32 result;
 
-   char cmd[] = {
+   unsigned char cmd[] = {
SEND_DIAGNOSTIC,
0x10,   /* Set PF bit */
0,
@@ -104,13 +104,13 @@ static int ses_send_diag(struct scsi_device *sdev, int 
page_code,
 
 static int ses_set_page2_descriptor(struct enclosure_device *edev,
  struct enclosure_component *ecomp,
- char *desc)
+ unsigned char *desc)
 {
int i, j, count = 0, descriptor = ecomp-number;
struct scsi_device *sdev = to_scsi_device(edev-cdev.dev);
struct ses_device *ses_dev = edev-scratch;
-   char *type_ptr = ses_dev-page1 + 12 + ses_dev-page1[11];
-   char *desc_ptr = ses_dev-page2 + 8;
+   unsigned char *type_ptr = ses_dev-page1 + 12 + ses_dev-page1[11];
+   unsigned char *desc_ptr = ses_dev-page2 + 8;
 
/* Clear everything */
memset(desc_ptr, 0, ses_dev-page2_len - 8);
@@ -133,14 +133,14 @@ static int ses_set_page2_descriptor(struct 
enclosure_device *edev,
return ses_send_diag(sdev, 2, ses_dev-page2, ses_dev-page2_len);
 }
 
-static char *ses_get_page2_descriptor(struct enclosure_device *edev,
+static unsigned char *ses_get_page2_descriptor(struct enclosure_device *edev,
  struct enclosure_component *ecomp)
 {
int i, j, count = 0, descriptor = ecomp-number;
struct scsi_device *sdev = to_scsi_device(edev-cdev.dev);
struct ses_device *ses_dev = edev-scratch;
-   char *type_ptr = ses_dev-page1 + 12 + ses_dev-page1[11];
-   char *desc_ptr = ses_dev-page2 + 8;
+   unsigned char *type_ptr = ses_dev-page1 + 12 + ses_dev-page1[11];
+   unsigned char *desc_ptr = ses_dev-page2 + 8;
 
ses_recv_diag(sdev, 2, ses_dev-page2, ses_dev-page2_len);
 
@@ -160,17 +160,18 @@ static char *ses_get_page2_descriptor(struct 
enclosure_device *edev,
 static void ses_get_fault(struct enclosure_device *edev,
  struct enclosure_component *ecomp)
 {
-   char *desc;
+   unsigned char *desc;
 
desc = ses_get_page2_descriptor(edev, ecomp);
-   ecomp-fault = (desc[3]  0x60)  4;
+   if (desc)
+   

[SCSI] aic94xx: fix REQ_TASK_ABORT and REQ_DEVICE_RESET

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cb84e2d2ff3b50c0da5a7604a6d8634294a00a01
Commit: cb84e2d2ff3b50c0da5a7604a6d8634294a00a01
Parent: 691b4773aa556d0975dbc25c93e6c8b839dad325
Author: James Bottomley [EMAIL PROTECTED]
AuthorDate: Fri Feb 15 09:28:43 2008 -0600
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Mon Feb 18 08:57:15 2008 -0600

[SCSI] aic94xx: fix REQ_TASK_ABORT and REQ_DEVICE_RESET

This driver has been failing under heavy load with

aic94xx: escb_tasklet_complete: REQ_TASK_ABORT, reason=0x6
aic94xx: escb_tasklet_complete: Can't find task (tc=4) to abort!

The second message is because the driver fails to identify the task
it's being asked to abort.  On closer inpection, there's a thinko in
the for each task loop over pending tasks in both the REQ_TASK_ABORT
and REQ_DEVICE_RESET cases where it doesn't look at the task on the
pending list but at the one on the ESCB (which is always NULL).

Fix by looking at the right task.  Also add a print for the case where
the pending SCB doesn't have a task attached.

Not sure if this will fix all the problems, but it's a definite first
step.

Cc: Stable Tree [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/aic94xx/aic94xx_scb.c |   14 ++
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/aic94xx/aic94xx_scb.c 
b/drivers/scsi/aic94xx/aic94xx_scb.c
index 0febad4..ab35050 100644
--- a/drivers/scsi/aic94xx/aic94xx_scb.c
+++ b/drivers/scsi/aic94xx/aic94xx_scb.c
@@ -458,13 +458,19 @@ static void escb_tasklet_complete(struct asd_ascb *ascb,
tc_abort = le16_to_cpu(tc_abort);
 
list_for_each_entry_safe(a, b, asd_ha-seq.pend_q, list) {
-   struct sas_task *task = ascb-uldd_task;
+   struct sas_task *task = a-uldd_task;
+
+   if (a-tc_index != tc_abort)
+   continue;
 
-   if (task  a-tc_index == tc_abort) {
+   if (task) {
failed_dev = task-dev;
sas_task_abort(task);
-   break;
+   } else {
+   ASD_DPRINTK(R_T_A for non TASK scb 0x%x\n,
+   a-scb-header.opcode);
}
+   break;
}
 
if (!failed_dev) {
@@ -478,7 +484,7 @@ static void escb_tasklet_complete(struct asd_ascb *ascb,
 * that the EH will wake up and do something.
 */
list_for_each_entry_safe(a, b, asd_ha-seq.pend_q, list) {
-   struct sas_task *task = ascb-uldd_task;
+   struct sas_task *task = a-uldd_task;
 
if (task 
task-dev == failed_dev 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] mpt fusion: kill warnings in mptbase.h on parisc64

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2939deaab257924c9afd87575dbd9100ae08160d
Commit: 2939deaab257924c9afd87575dbd9100ae08160d
Parent: cb84e2d2ff3b50c0da5a7604a6d8634294a00a01
Author: Kyle McMartin [EMAIL PROTECTED]
AuthorDate: Wed Oct 17 12:25:00 2007 -0400
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Mon Feb 18 08:57:16 2008 -0600

[SCSI] mpt fusion: kill warnings in mptbase.h on parisc64

Verified all the arches necessary select the CONFIG_64BIT symbol. This
also kills the warning (since it was using the 32-bit case) on parisc64
and mips64.

Signed-off-by: Kyle McMartin [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/message/fusion/mptbase.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h
index d83ea96..caadc68 100644
--- a/drivers/message/fusion/mptbase.h
+++ b/drivers/message/fusion/mptbase.h
@@ -923,7 +923,7 @@ extern struct proc_dir_entry*mpt_proc_root_dir;
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 #endif /* } __KERNEL__ */
 
-#if defined(__alpha__) || defined(__sparc_v9__) || defined(__ia64__) || 
defined(__x86_64__) || defined(__powerpc__)
+#ifdef CONFIG_64BIT
 #define CAST_U32_TO_PTR(x) ((void *)(u64)x)
 #define CAST_PTR_TO_U32(x) ((u32)(u64)x)
 #else
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] megaraid: outb_p extermination

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7d1abbe82434d29dd0d7d69dc0e6acdf25a8c2b5
Commit: 7d1abbe82434d29dd0d7d69dc0e6acdf25a8c2b5
Parent: 2939deaab257924c9afd87575dbd9100ae08160d
Author: Alan Cox [EMAIL PROTECTED]
AuthorDate: Fri Feb 8 15:34:24 2008 +
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Mon Feb 18 08:57:16 2008 -0600

[SCSI] megaraid: outb_p extermination

From conversations with the maintainers the _p isn't needed so kill it.
That removes the last non ISA _p user from the SCSI layer to my knowledge.

Signed-off-by: Alan Cox [EMAIL PROTECTED]
Acked-by: Yang, Bo [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/megaraid.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index 4d59ae8..b135a1e 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -151,19 +151,19 @@ mega_setup_mailbox(adapter_t *adapter)
 */
if( adapter-flag  BOARD_IOMAP ) {
 
-   outb_p(adapter-mbox_dma  0xFF,
+   outb(adapter-mbox_dma  0xFF,
adapter-host-io_port + MBOX_PORT0);
 
-   outb_p((adapter-mbox_dma  8)  0xFF,
+   outb((adapter-mbox_dma  8)  0xFF,
adapter-host-io_port + MBOX_PORT1);
 
-   outb_p((adapter-mbox_dma  16)  0xFF,
+   outb((adapter-mbox_dma  16)  0xFF,
adapter-host-io_port + MBOX_PORT2);
 
-   outb_p((adapter-mbox_dma  24)  0xFF,
+   outb((adapter-mbox_dma  24)  0xFF,
adapter-host-io_port + MBOX_PORT3);
 
-   outb_p(ENABLE_MBOX_BYTE,
+   outb(ENABLE_MBOX_BYTE,
adapter-host-io_port + ENABLE_MBOX_REGION);
 
irq_ack(adapter);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] fas216: fix up the previous fas216 commit

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0e935c9ebacf2f54ab1226192d1a62f7ea1b9303
Commit: 0e935c9ebacf2f54ab1226192d1a62f7ea1b9303
Parent: 7d1abbe82434d29dd0d7d69dc0e6acdf25a8c2b5
Author: James Bottomley [EMAIL PROTECTED]
AuthorDate: Sat Feb 16 15:53:21 2008 -0600
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Mon Feb 18 08:57:16 2008 -0600

[SCSI] fas216: fix up the previous fas216 commit

Apparently the fix to [SCSI] fas216: Use scsi_eh API for REQUEST_SENSE
invocation didn't show up in the final version sent to linus.

Correct this omission.

Cc: Russell King [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/arm/fas216.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/arm/fas216.h b/drivers/scsi/arm/fas216.h
index 3e73e26..b65f4cf 100644
--- a/drivers/scsi/arm/fas216.h
+++ b/drivers/scsi/arm/fas216.h
@@ -313,7 +313,7 @@ typedef struct {
 
/* miscellaneous */
int internal_done;  /* flag to indicate 
request done */
-   struct scsi_eh_save *ses;   /* holds request sense restore 
info */
+   struct scsi_eh_save ses;/* holds request sense restore 
info */
unsigned long   magic_end;
 } FAS216_Info;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] scsi_debug: disable clustering

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cbccc207128e8bbdb047f6c5fc261acf207749c1
Commit: cbccc207128e8bbdb047f6c5fc261acf207749c1
Parent: 0e935c9ebacf2f54ab1226192d1a62f7ea1b9303
Author: FUJITA Tomonori [EMAIL PROTECTED]
AuthorDate: Sat Feb 16 23:57:15 2008 +0900
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Mon Feb 18 08:57:16 2008 -0600

[SCSI] scsi_debug: disable clustering

scsi_debug does at several places:

for_each_sg(sdb-table.sgl, sg, sdb-table.nents, k) {
kaddr = (unsigned char *)
kmap_atomic(sg_page(sg), KM_USER0);

We cannot do something like that with the clustering enabled (or we
can use scsi_kmap_atomic_sg).

Signed-off-by: FUJITA Tomonori [EMAIL PROTECTED]
Acked-by: Douglas Gilbert [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/scsi_debug.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 1541c17..d1777a9 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -222,7 +222,7 @@ static struct scsi_host_template sdebug_driver_template = {
.cmd_per_lun =  16,
.max_sectors =  0x,
.unchecked_isa_dma =0,
-   .use_clustering =   ENABLE_CLUSTERING,
+   .use_clustering =   DISABLE_CLUSTERING,
.module =   THIS_MODULE,
 };
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] aic7xx: mitigate HOST_MSG_LOOP invalid SCB ff panic

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5e2f22d39ec29c33bc5a3a558ac545b952aab8b7
Commit: 5e2f22d39ec29c33bc5a3a558ac545b952aab8b7
Parent: cbccc207128e8bbdb047f6c5fc261acf207749c1
Author: James Bottomley [EMAIL PROTECTED]
AuthorDate: Tue Feb 12 15:55:48 2008 -0600
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Mon Feb 18 08:57:17 2008 -0600

[SCSI] aic7xx: mitigate HOST_MSG_LOOP invalid SCB ff panic

The panic occurs if we get a MSGIN or MSGOUT for an unidentified SCB
(meaning we didn't identify the outstanding command it was for).  For
MSGIN this is wrong because it could be an unsolicited negotiation
MSGIN from the target.

Still panic on unsolicited MSGOUT because this would represent a
mistake in the negotiation phases.  However, we should fix this as
well.  The specs say we should go to bus free for unexpected msgin.

Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/aic7xxx/aic7xxx_core.c |   11 ++-
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c 
b/drivers/scsi/aic7xxx/aic7xxx_core.c
index 6d2ae64..64e62ce 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -695,15 +695,16 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat)
scb_index = ahc_inb(ahc, SCB_TAG);
scb = ahc_lookup_scb(ahc, scb_index);
if (devinfo.role == ROLE_INITIATOR) {
-   if (scb == NULL)
-   panic(HOST_MSG_LOOP with 
- invalid SCB %x\n, scb_index);
+   if (bus_phase == P_MESGOUT) {
+   if (scb == NULL)
+   panic(HOST_MSG_LOOP with 
+ invalid SCB %x\n,
+ scb_index);
 
-   if (bus_phase == P_MESGOUT)
ahc_setup_initiator_msgout(ahc,
   devinfo,
   scb);
-   else {
+   } else {
ahc-msg_type =
MSG_TYPE_INITIATOR_MSGIN;
ahc-msgin_index = 0;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] qla2xxx: fix compile warning for printk format

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=279e7f5425c5e6da6ca61b1d8576356a939789f9
Commit: 279e7f5425c5e6da6ca61b1d8576356a939789f9
Parent: 5e2f22d39ec29c33bc5a3a558ac545b952aab8b7
Author: FUJITA Tomonori [EMAIL PROTECTED]
AuthorDate: Sat Feb 16 15:24:41 2008 +0900
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Mon Feb 18 08:57:17 2008 -0600

[SCSI] qla2xxx: fix compile warning for printk format

scsi/qla2xxx/qla_dfs.c: In function 'qla2x00_dfs_fce_show':
scsi/qla2xxx/qla_dfs.c:26: warning: format '%llx' expects type 'long long 
unsigned int', but argument 3 has type 'uint64_t'

Signed-off-by: FUJITA Tomonori [EMAIL PROTECTED]
Acked-by: Andrew Vasquez [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/qla2xxx/qla_dfs.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_dfs.c b/drivers/scsi/qla2xxx/qla_dfs.c
index 1479c60..2cd899b 100644
--- a/drivers/scsi/qla2xxx/qla_dfs.c
+++ b/drivers/scsi/qla2xxx/qla_dfs.c
@@ -23,7 +23,7 @@ qla2x00_dfs_fce_show(struct seq_file *s, void *unused)
mutex_lock(ha-fce_mutex);
 
seq_printf(s, FCE Trace Buffer\n);
-   seq_printf(s, In Pointer = %llx\n\n, ha-fce_wr);
+   seq_printf(s, In Pointer = %llx\n\n, (unsigned long long)ha-fce_wr);
seq_printf(s, Base = %llx\n\n, (unsigned long long) ha-fce_dma);
seq_printf(s, FCE Enable Registers\n);
seq_printf(s, %08x %08x %08x %08x %08x %08x\n,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] gdth: don't call pci_free_consistent under spinlock

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ff83efacf2b77a1fe8942db6613825a4b80ee5e2
Commit: ff83efacf2b77a1fe8942db6613825a4b80ee5e2
Parent: 279e7f5425c5e6da6ca61b1d8576356a939789f9
Author: James Bottomley [EMAIL PROTECTED]
AuthorDate: Sun Feb 17 11:24:51 2008 -0600
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Mon Feb 18 09:02:25 2008 -0600

[SCSI] gdth: don't call pci_free_consistent under spinlock

The spinlock is held over too large a region: pscratch is a permanent
address (it's allocated at boot time and never changes).  All you need
the smp lock for is mediating the scratch in use flag, so fix this by
moving the spinlock into the case where we set the pscratch_busy flag
to false.

Cc: Stable Tree [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/gdth_proc.c |6 ++
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/gdth_proc.c b/drivers/scsi/gdth_proc.c
index de57734..ce0228e 100644
--- a/drivers/scsi/gdth_proc.c
+++ b/drivers/scsi/gdth_proc.c
@@ -694,15 +694,13 @@ static void gdth_ioctl_free(gdth_ha_str *ha, int size, 
char *buf, ulong64 paddr)
 {
 ulong flags;
 
-spin_lock_irqsave(ha-smp_lock, flags);
-
 if (buf == ha-pscratch) {
+   spin_lock_irqsave(ha-smp_lock, flags);
 ha-scratch_busy = FALSE;
+   spin_unlock_irqrestore(ha-smp_lock, flags);
 } else {
 pci_free_consistent(ha-pdev, size, buf, paddr);
 }
-
-spin_unlock_irqrestore(ha-smp_lock, flags);
 }
 
 #ifdef GDTH_IOCTL_PROC
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] ips: fix data buffer accessors conversion bug

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2b28a4721e068ac89bd5435472723a1bc2fe
Commit: 2b28a4721e068ac89bd5435472723a1bc2fe
Parent: ff83efacf2b77a1fe8942db6613825a4b80ee5e2
Author: FUJITA Tomonori [EMAIL PROTECTED]
AuthorDate: Tue Feb 19 17:02:27 2008 +0900
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Feb 19 10:49:27 2008 -0600

[SCSI] ips: fix data buffer accessors conversion bug

This fixes a bug that can't handle a passthru command with more than
two sg entries.

Big thanks to Tim Pepper for debugging the problem.

Signed-off-by: FUJITA Tomonori [EMAIL PROTECTED]
Acked-by: Mark Salyzyn [EMAIL PROTECTED]
Cc: Stable Tree [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/ips.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
index bb152fb..7ed568f 100644
--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -1576,7 +1576,7 @@ ips_make_passthru(ips_ha_t *ha, struct scsi_cmnd *SC, 
ips_scb_t *scb, int intr)
METHOD_TRACE(ips_make_passthru, 1);
 
 scsi_for_each_sg(SC, sg, scsi_sg_count(SC), i)
-length += sg[i].length;
+   length += sg-length;
 
if (length  sizeof (ips_passthru_t)) {
/* wrong size */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] lpfc: make lpfc_disable_node() static

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4d9db01ef8f62b03c46f1258fd45a8c8235687ba
Commit: 4d9db01ef8f62b03c46f1258fd45a8c8235687ba
Parent: 2b28a4721e068ac89bd5435472723a1bc2fe
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Thu Feb 14 23:24:02 2008 +0200
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Fri Feb 22 09:08:12 2008 -0600

[SCSI] lpfc: make lpfc_disable_node() static

This patch makes the needlessly global lpfc_disable_node() static.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Acked-by: James Smart [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/lpfc/lpfc_crtn.h|1 -
 drivers/scsi/lpfc/lpfc_hbadisc.c |2 +-
 2 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h
index 848d977..0819f5f 100644
--- a/drivers/scsi/lpfc/lpfc_crtn.h
+++ b/drivers/scsi/lpfc/lpfc_crtn.h
@@ -55,7 +55,6 @@ void lpfc_mbx_cmpl_ns_reg_login(struct lpfc_hba *, 
LPFC_MBOXQ_t *);
 void lpfc_mbx_cmpl_fdmi_reg_login(struct lpfc_hba *, LPFC_MBOXQ_t *);
 void lpfc_enqueue_node(struct lpfc_vport *, struct lpfc_nodelist *);
 void lpfc_dequeue_node(struct lpfc_vport *, struct lpfc_nodelist *);
-void lpfc_disable_node(struct lpfc_vport *, struct lpfc_nodelist *);
 struct lpfc_nodelist *lpfc_enable_node(struct lpfc_vport *,
struct lpfc_nodelist *, int);
 void lpfc_nlp_set_state(struct lpfc_vport *, struct lpfc_nodelist *, int);
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index bd572d6..9766534 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -1694,7 +1694,7 @@ lpfc_dequeue_node(struct lpfc_vport *vport, struct 
lpfc_nodelist *ndlp)
NLP_STE_UNUSED_NODE);
 }
 
-void
+static void
 lpfc_disable_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
 {
if ((ndlp-nlp_flag  NLP_DELAY_TMO) != 0)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] iscsi transport: make 2 functions static

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3b0f208a583f130f1e551a6b8673734f51ab7dcd
Commit: 3b0f208a583f130f1e551a6b8673734f51ab7dcd
Parent: 4d9db01ef8f62b03c46f1258fd45a8c8235687ba
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Wed Feb 13 23:30:17 2008 +0200
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Fri Feb 22 09:08:12 2008 -0600

[SCSI] iscsi transport: make 2 functions static

This patch makes the following needlessly global functions static:
- __iscsi_unblock_session()
- iscsi_session_state_name()

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Acked-by: Mike Christie [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/scsi_transport_iscsi.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/scsi_transport_iscsi.c 
b/drivers/scsi/scsi_transport_iscsi.c
index fac7534..9981682 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -231,7 +231,7 @@ static struct {
{ ISCSI_SESSION_FREE,   FREE },
 };
 
-const char *iscsi_session_state_name(int state)
+static const char *iscsi_session_state_name(int state)
 {
int i;
char *name = NULL;
@@ -373,7 +373,7 @@ static void session_recovery_timedout(struct work_struct 
*work)
scsi_target_unblock(session-dev);
 }
 
-void __iscsi_unblock_session(struct iscsi_cls_session *session)
+static void __iscsi_unblock_session(struct iscsi_cls_session *session)
 {
if (!cancel_delayed_work(session-recovery_work))
flush_workqueue(iscsi_eh_timer_workq);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] mptbase: fix use-after-free's

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ad008d42bcec99911b3270a8349f8ec8405a1c4e
Commit: ad008d42bcec99911b3270a8349f8ec8405a1c4e
Parent: 3b0f208a583f130f1e551a6b8673734f51ab7dcd
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Tue Feb 19 20:03:57 2008 -0600
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Fri Feb 22 09:08:13 2008 -0600

[SCSI] mptbase: fix use-after-free's

ioc-name is used in the printk's after ioc has been freed.  Free
after prinks to fix this.

This patch fixes two use-after-free's introduced by
commit e78d5b8f1e73ab82f3fd041d05824cfee7d83a2c and spotted by the
Coverity checker.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/message/fusion/mptbase.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index bfda731..0c303c8 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -1481,15 +1481,15 @@ mpt_attach(struct pci_dev *pdev, const struct 
pci_device_id *id)
 
ioc-bars = pci_select_bars(pdev, IORESOURCE_MEM);
if (pci_enable_device_mem(pdev)) {
-   kfree(ioc);
printk(MYIOC_s_ERR_FMT pci_enable_device_mem() 
   failed\n, ioc-name);
+   kfree(ioc);
return r;
}
if (pci_request_selected_regions(pdev, ioc-bars, mpt)) {
-   kfree(ioc);
printk(MYIOC_s_ERR_FMT pci_request_selected_regions() with 
   MEM failed\n, ioc-name);
+   kfree(ioc);
return r;
}
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] arcmsr: fix message allocation

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=69e562c234440fb7410877b5b24f4b29ef8521d1
Commit: 69e562c234440fb7410877b5b24f4b29ef8521d1
Parent: ad008d42bcec99911b3270a8349f8ec8405a1c4e
Author: Daniel Drake [EMAIL PROTECTED]
AuthorDate: Wed Feb 20 13:29:05 2008 +
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Fri Feb 22 09:08:13 2008 -0600

[SCSI] arcmsr: fix message allocation

arcmsr_iop_message_xfer() is called from atomic context under the
queuecommand scsi_host_template handler. James Bottomley pointed out
that the current GFP_KERNEL|GFP_DMA flags are wrong: firstly we are in
atomic context, secondly this memory is not used for DMA.
Also removed some unneeded casts.

Signed-off-by: Daniel Drake [EMAIL PROTECTED]
Cc: Nick Cheng [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/arcmsr/arcmsr_hba.c |   26 +++---
 1 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
index 4f9ff32..f91f79c 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -1387,18 +1387,16 @@ static int arcmsr_iop_message_xfer(struct 
AdapterControlBlock *acb, \
switch(controlcode) {
 
case ARCMSR_MESSAGE_READ_RQBUFFER: {
-   unsigned long *ver_addr;
+   unsigned char *ver_addr;
uint8_t *pQbuffer, *ptmpQbuffer;
int32_t allxfer_len = 0;
-   void *tmp;
 
-   tmp = kmalloc(1032, GFP_KERNEL|GFP_DMA);
-   ver_addr = (unsigned long *)tmp;
-   if (!tmp) {
+   ver_addr = kmalloc(1032, GFP_ATOMIC);
+   if (!ver_addr) {
retvalue = ARCMSR_MESSAGE_FAIL;
goto message_out;
}
-   ptmpQbuffer = (uint8_t *) ver_addr;
+   ptmpQbuffer = ver_addr;
while ((acb-rqbuf_firstindex != acb-rqbuf_lastindex)
 (allxfer_len  1031)) {
pQbuffer = acb-rqbuffer[acb-rqbuf_firstindex];
@@ -1427,26 +1425,24 @@ static int arcmsr_iop_message_xfer(struct 
AdapterControlBlock *acb, \
}
arcmsr_iop_message_read(acb);
}
-   memcpy(pcmdmessagefld-messagedatabuffer, (uint8_t *)ver_addr, 
allxfer_len);
+   memcpy(pcmdmessagefld-messagedatabuffer, ver_addr, 
allxfer_len);
pcmdmessagefld-cmdmessage.Length = allxfer_len;
pcmdmessagefld-cmdmessage.ReturnCode = 
ARCMSR_MESSAGE_RETURNCODE_OK;
-   kfree(tmp);
+   kfree(ver_addr);
}
break;
 
case ARCMSR_MESSAGE_WRITE_WQBUFFER: {
-   unsigned long *ver_addr;
+   unsigned char *ver_addr;
int32_t my_empty_len, user_len, wqbuf_firstindex, 
wqbuf_lastindex;
uint8_t *pQbuffer, *ptmpuserbuffer;
-   void *tmp;
 
-   tmp = kmalloc(1032, GFP_KERNEL|GFP_DMA);
-   ver_addr = (unsigned long *)tmp;
-   if (!tmp) {
+   ver_addr = kmalloc(1032, GFP_ATOMIC);
+   if (!ver_addr) {
retvalue = ARCMSR_MESSAGE_FAIL;
goto message_out;
}
-   ptmpuserbuffer = (uint8_t *)ver_addr;
+   ptmpuserbuffer = ver_addr;
user_len = pcmdmessagefld-cmdmessage.Length;
memcpy(ptmpuserbuffer, pcmdmessagefld-messagedatabuffer, 
user_len);
wqbuf_lastindex = acb-wqbuf_lastindex;
@@ -1492,7 +1488,7 @@ static int arcmsr_iop_message_xfer(struct 
AdapterControlBlock *acb, \
retvalue = ARCMSR_MESSAGE_FAIL;
}
}
-   kfree(tmp);
+   kfree(ver_addr);
}
break;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] stex: stex_direct_copy shouldn't call dma_map_sg

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=26106e3ca379e30790c41d8835e79395437152ec
Commit: 26106e3ca379e30790c41d8835e79395437152ec
Parent: eafe1df9e311034cce204e43c0e45c91723b802f
Author: FUJITA Tomonori [EMAIL PROTECTED]
AuthorDate: Fri Feb 22 23:11:03 2008 +0900
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Fri Feb 22 17:20:39 2008 -0600

[SCSI] stex: stex_direct_copy shouldn't call dma_map_sg

stex_direct_copy copies an in-kernel buffer to a sg list in order to
spoof some SCSI commands. stex_direct_copy calls dma_map_sg and then
stex_internal_copy with the value that dma_map_sg returned. It calls
scsi_kmap_atomic_sg to copy data.

scsi_kmap_atomic_sg doesn't see sg-dma_length so if dma_map_sg merges
sg entries, stex_internal_copy gets the smaller number of sg entries
than the acutual number, which means it wrongly think that the data
length in the sg list is shorter than the actual length.

stex_direct_copy shouldn't call dma_map_sg and it doesn't need since
this code path doesn't involve dma transfers. This patch removes
stex_direct_copy and simply calls stex_internal_copy with the actual
number of sg entries.

Signed-off-by: FUJITA Tomonori [EMAIL PROTECTED]
Acked-by: Ed Lin [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/stex.c |   34 --
 1 files changed, 12 insertions(+), 22 deletions(-)

diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c
index 72f6d80..4b6861c 100644
--- a/drivers/scsi/stex.c
+++ b/drivers/scsi/stex.c
@@ -461,23 +461,6 @@ static void stex_internal_copy(struct scsi_cmnd *cmd,
}
 }
 
-static int stex_direct_copy(struct scsi_cmnd *cmd,
-   const void *src, size_t count)
-{
-   size_t cp_len = count;
-   int n_elem = 0;
-
-   n_elem = scsi_dma_map(cmd);
-   if (n_elem  0)
-   return 0;
-
-   stex_internal_copy(cmd, src, cp_len, n_elem, ST_TO_CMD);
-
-   scsi_dma_unmap(cmd);
-
-   return cp_len == count;
-}
-
 static void stex_controller_info(struct st_hba *hba, struct st_ccb *ccb)
 {
struct st_frame *p;
@@ -569,8 +552,10 @@ stex_queuecommand(struct scsi_cmnd *cmd, void (* 
done)(struct scsi_cmnd *))
unsigned char page;
page = cmd-cmnd[2]  0x3f;
if (page == 0x8 || page == 0x3f) {
-   stex_direct_copy(cmd, ms10_caching_page,
-   sizeof(ms10_caching_page));
+   size_t cp_len = sizeof(ms10_caching_page);
+   stex_internal_copy(cmd, ms10_caching_page,
+  cp_len, scsi_sg_count(cmd),
+  ST_TO_CMD);
cmd-result = DID_OK  16 | COMMAND_COMPLETE  8;
done(cmd);
} else
@@ -599,8 +584,10 @@ stex_queuecommand(struct scsi_cmnd *cmd, void (* 
done)(struct scsi_cmnd *))
if (id != host-max_id - 1)
break;
if (lun == 0  (cmd-cmnd[1]  INQUIRY_EVPD) == 0) {
-   stex_direct_copy(cmd, console_inq_page,
-   sizeof(console_inq_page));
+   size_t cp_len = sizeof(console_inq_page);
+   stex_internal_copy(cmd, console_inq_page,
+  cp_len, scsi_sg_count(cmd),
+  ST_TO_CMD);
cmd-result = DID_OK  16 | COMMAND_COMPLETE  8;
done(cmd);
} else
@@ -609,6 +596,7 @@ stex_queuecommand(struct scsi_cmnd *cmd, void (* 
done)(struct scsi_cmnd *))
case PASSTHRU_CMD:
if (cmd-cmnd[1] == PASSTHRU_GET_DRVVER) {
struct st_drvver ver;
+   size_t cp_len = sizeof(ver);
ver.major = ST_VER_MAJOR;
ver.minor = ST_VER_MINOR;
ver.oem = ST_OEM;
@@ -616,7 +604,9 @@ stex_queuecommand(struct scsi_cmnd *cmd, void (* 
done)(struct scsi_cmnd *))
ver.signature[0] = PASSTHRU_SIGNATURE;
ver.console_id = host-max_id - 1;
ver.host_no = hba-host-host_no;
-   cmd-result = stex_direct_copy(cmd, ver, sizeof(ver)) ?
+   stex_internal_copy(cmd, ver, cp_len,
+  scsi_sg_count(cmd), ST_TO_CMD);
+   cmd-result = sizeof(ver) == cp_len ?
DID_OK  16 | COMMAND_COMPLETE  8 :
DID_ERROR  16 | COMMAND_COMPLETE  8;
done(cmd);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL 

[SCSI] stex: stex_internal_copy should be called with sg_count in struct st_ccb

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c9872fe1add5709fffd42249e6ca1080999aa06a
Commit: c9872fe1add5709fffd42249e6ca1080999aa06a
Parent: 26106e3ca379e30790c41d8835e79395437152ec
Author: FUJITA Tomonori [EMAIL PROTECTED]
AuthorDate: Fri Feb 22 23:11:04 2008 +0900
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Fri Feb 22 17:20:59 2008 -0600

[SCSI] stex: stex_internal_copy should be called with sg_count in struct 
st_ccb

stex_internal_copy copies an in-kernel buffer to a sg list by using
scsi_kmap_atomic_sg. Some functions calls stex_internal_copy with
sg_count in struct st_ccb, which is the value that dma_map_sg
returned. However it might be shorter than the actual number of sg
entries (if the IOMMU merged the sg entries).

scsi_kmap_atomic_sg doesn't see sg-dma_length so stex_internal_copy
should be called with the actual number of sg entries
(i.e. scsi_sg_count), because if the sg entries were merged,
stex_direct_copy wrongly think that the data length in the sg list is
shorter than the actual length.

Signed-off-by: FUJITA Tomonori [EMAIL PROTECTED]
Acked-by: Ed Lin [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/stex.c |   10 ++
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c
index 4b6861c..654430e 100644
--- a/drivers/scsi/stex.c
+++ b/drivers/scsi/stex.c
@@ -467,7 +467,8 @@ static void stex_controller_info(struct st_hba *hba, struct 
st_ccb *ccb)
size_t count = sizeof(struct st_frame);
 
p = hba-copy_buffer;
-   stex_internal_copy(ccb-cmd, p, count, ccb-sg_count, ST_FROM_CMD);
+   stex_internal_copy(ccb-cmd, p, count, scsi_sg_count(ccb-cmd),
+  ST_FROM_CMD);
memset(p-base, 0, sizeof(u32)*6);
*(unsigned long *)(p-base) = pci_resource_start(hba-pdev, 0);
p-rom_addr = 0;
@@ -485,7 +486,8 @@ static void stex_controller_info(struct st_hba *hba, struct 
st_ccb *ccb)
p-subid =
hba-pdev-subsystem_vendor  16 | hba-pdev-subsystem_device;
 
-   stex_internal_copy(ccb-cmd, p, count, ccb-sg_count, ST_TO_CMD);
+   stex_internal_copy(ccb-cmd, p, count, scsi_sg_count(ccb-cmd),
+  ST_TO_CMD);
 }
 
 static void
@@ -699,7 +701,7 @@ static void stex_copy_data(struct st_ccb *ccb,
if (ccb-cmd == NULL)
return;
stex_internal_copy(ccb-cmd,
-   resp-variable, count, ccb-sg_count, ST_TO_CMD);
+   resp-variable, count, scsi_sg_count(ccb-cmd), ST_TO_CMD);
 }
 
 static void stex_ys_commands(struct st_hba *hba,
@@ -724,7 +726,7 @@ static void stex_ys_commands(struct st_hba *hba,
 
count = STEX_EXTRA_SIZE;
stex_internal_copy(ccb-cmd, hba-copy_buffer,
-   count, ccb-sg_count, ST_FROM_CMD);
+   count, scsi_sg_count(ccb-cmd), ST_FROM_CMD);
inq_data = (ST_INQ *)hba-copy_buffer;
if (inq_data-DeviceTypeQualifier != 0)
ccb-srb_status = SRB_STATUS_SELECTION_TIMEOUT;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] st: compile fix when DEBUG set to one

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=deee13dfd6dd6c18518ea725f1ebd9bf4fa8
Commit: deee13dfd6dd6c18518ea725f1ebd9bf4fa8
Parent: c9872fe1add5709fffd42249e6ca1080999aa06a
Author: Kai Makisara [EMAIL PROTECTED]
AuthorDate: Fri Feb 22 20:11:21 2008 +0200
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Fri Feb 22 17:21:37 2008 -0600

[SCSI] st: compile fix when DEBUG set to one

Remove the now useless counting of adjacent pages from the debugging code in
to make it compile when DEBUG is set non-zero.

Signed-off-by: Kai Makisara [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/st.c |   11 ---
 drivers/scsi/st.h |1 -
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 7195270..0a52d9d 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -17,7 +17,7 @@
Last modified: 18-JAN-1998 Richard Gooch [EMAIL PROTECTED] Devfs support
  */
 
-static const char *verstr = 20080117;
+static const char *verstr = 20080221;
 
 #include linux/module.h
 
@@ -1172,7 +1172,7 @@ static int st_open(struct inode *inode, struct file *filp)
STp-try_dio_now = STp-try_dio;
STp-recover_count = 0;
DEB( STp-nbr_waits = STp-nbr_finished = 0;
-STp-nbr_requests = STp-nbr_dio = STp-nbr_pages = 
STp-nbr_combinable = 0; )
+STp-nbr_requests = STp-nbr_dio = STp-nbr_pages = 0; )
 
retval = check_tape(STp, filp);
if (retval  0)
@@ -1226,8 +1226,8 @@ static int st_flush(struct file *filp, fl_owner_t id)
}
 
DEBC( if (STp-nbr_requests)
-   printk(KERN_DEBUG %s: Number of r/w requests %d, dio used in 
%d, pages %d (%d).\n,
-  name, STp-nbr_requests, STp-nbr_dio, STp-nbr_pages, 
STp-nbr_combinable));
+   printk(KERN_DEBUG %s: Number of r/w requests %d, dio used in 
%d, pages %d.\n,
+  name, STp-nbr_requests, STp-nbr_dio, STp-nbr_pages));
 
if (STps-rw == ST_WRITING  !STp-pos_unknown) {
struct st_cmdstatus *cmdstatp = STp-buffer-cmdstat;
@@ -1422,9 +1422,6 @@ static int setup_buffering(struct scsi_tape *STp, const 
char __user *buf,
 if (STbp-do_dio) {
STp-nbr_dio++;
STp-nbr_pages += STbp-do_dio;
-   for (i=1; i  STbp-do_dio; i++)
-   if (page_to_pfn(STbp-sg[i].page) == 
page_to_pfn(STbp-sg[i-1].page) + 1)
-   STp-nbr_combinable++;
 }
)
} else
diff --git a/drivers/scsi/st.h b/drivers/scsi/st.h
index 6c80757..5931726 100644
--- a/drivers/scsi/st.h
+++ b/drivers/scsi/st.h
@@ -164,7 +164,6 @@ struct scsi_tape {
int nbr_requests;
int nbr_dio;
int nbr_pages;
-   int nbr_combinable;
unsigned char last_cmnd[6];
unsigned char last_sense[16];
 #endif
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] aic94xx: fix sequencer hang on error recovery

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=91b550604480eadcdadc7db8a7d19f496ccad6bd
Commit: 91b550604480eadcdadc7db8a7d19f496ccad6bd
Parent: deee13dfd6dd6c18518ea725f1ebd9bf4fa8
Author: James Bottomley [EMAIL PROTECTED]
AuthorDate: Fri Feb 22 17:01:59 2008 -0600
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Fri Feb 22 17:23:36 2008 -0600

[SCSI] aic94xx: fix sequencer hang on error recovery

The clear nexus I_T and clear nexus I_T_L functions in the aic94xx
specify the SUSPEND_TX flag which causes the sequencer to be suspended
until it receives a RESUME_TX.  Unfortunately, nothing ever sends the
resume, so the sequencer on the link is stopped forever, leading to
eventual timeouts and I/O errors.

Since clear nexus commands are only executed as part of error recovery,
it's perfectly fine to keep the sequencer running on the link ... as
soon as the recovery function is completed, we'll send it the commands
to retry.

Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/aic94xx/aic94xx_tmf.c |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/aic94xx/aic94xx_tmf.c 
b/drivers/scsi/aic94xx/aic94xx_tmf.c
index b52124f..144f5ad 100644
--- a/drivers/scsi/aic94xx/aic94xx_tmf.c
+++ b/drivers/scsi/aic94xx/aic94xx_tmf.c
@@ -151,8 +151,6 @@ static int asd_clear_nexus_I_T(struct domain_device *dev)
CLEAR_NEXUS_PRE;
scb-clear_nexus.nexus = NEXUS_I_T;
scb-clear_nexus.flags = SEND_Q | EXEC_Q | NOTINQ;
-   if (dev-tproto)
-   scb-clear_nexus.flags |= SUSPEND_TX;
scb-clear_nexus.conn_handle = cpu_to_le16((u16)(unsigned long)
   dev-lldd_dev);
CLEAR_NEXUS_POST;
@@ -169,8 +167,6 @@ static int asd_clear_nexus_I_T_L(struct domain_device *dev, 
u8 *lun)
CLEAR_NEXUS_PRE;
scb-clear_nexus.nexus = NEXUS_I_T_L;
scb-clear_nexus.flags = SEND_Q | EXEC_Q | NOTINQ;
-   if (dev-tproto)
-   scb-clear_nexus.flags |= SUSPEND_TX;
memcpy(scb-clear_nexus.ssp_task.lun, lun, 8);
scb-clear_nexus.conn_handle = cpu_to_le16((u16)(unsigned long)
   dev-lldd_dev);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] libsas: correctly flush the LU queue on error recovery

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=63e4563b9cf77875286312758f61a20f912afbbb
Commit: 63e4563b9cf77875286312758f61a20f912afbbb
Parent: 91b550604480eadcdadc7db8a7d19f496ccad6bd
Author: James Bottomley [EMAIL PROTECTED]
AuthorDate: Fri Feb 22 17:07:52 2008 -0600
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Fri Feb 22 17:23:47 2008 -0600

[SCSI] libsas: correctly flush the LU queue on error recovery

The current sas_scsi_clear_queue_lu() is wrongly checking for commands
which match the pointer to the one passed in.  It should be checking for
commands which are on the same logical unit as the one passed in.  Fix
this by checking target pointer and LUN for equality.

Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/libsas/sas_scsi_host.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/libsas/sas_scsi_host.c 
b/drivers/scsi/libsas/sas_scsi_host.c
index 9c96d1b..704ea06 100644
--- a/drivers/scsi/libsas/sas_scsi_host.c
+++ b/drivers/scsi/libsas/sas_scsi_host.c
@@ -280,7 +280,8 @@ static void sas_scsi_clear_queue_lu(struct list_head 
*error_q, struct scsi_cmnd
struct scsi_cmnd *cmd, *n;
 
list_for_each_entry_safe(cmd, n, error_q, eh_entry) {
-   if (cmd == my_cmd)
+   if (cmd-device-sdev_target == my_cmd-device-sdev_target 
+   cmd-device-lun == my_cmd-device-lun)
sas_eh_finish_cmd(cmd);
}
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] mvsas: Add Marvell 6440 SAS/SATA driver

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b5762948263dd5e9725a380e7a9626f99e40ae9d
Commit: b5762948263dd5e9725a380e7a9626f99e40ae9d
Parent: 63e4563b9cf77875286312758f61a20f912afbbb
Author: Jeff Garzik [EMAIL PROTECTED]
AuthorDate: Thu Oct 25 20:58:22 2007 -0400
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sat Feb 23 07:29:31 2008 -0600

[SCSI] mvsas: Add Marvell 6440 SAS/SATA driver

Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/Kconfig  |   10 +
 drivers/scsi/Makefile |1 +
 drivers/scsi/mvsas.c  | 1825 +
 3 files changed, 1836 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index a7a0813..c4a 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -992,6 +992,16 @@ config SCSI_IZIP_SLOW_CTR
 
  Generally, saying N is fine.
 
+config SCSI_MVSAS
+   tristate Marvell 88SE6440 SAS/SATA support
+   depends on PCI  SCSI
+   select SCSI_SAS_LIBSAS
+   help
+ This driver supports Marvell SAS/SATA PCI devices.
+
+ To compiler this driver as a module, choose M here: the module
+ will be called mvsas.
+
 config SCSI_NCR53C406A
tristate NCR53c406a SCSI support
depends on ISA  SCSI
diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile
index 925c26b..23e6ecb 100644
--- a/drivers/scsi/Makefile
+++ b/drivers/scsi/Makefile
@@ -119,6 +119,7 @@ obj-$(CONFIG_SCSI_IBMVSCSI) += ibmvscsi/
 obj-$(CONFIG_SCSI_IBMVSCSIS)   += ibmvscsi/
 obj-$(CONFIG_SCSI_HPTIOP)  += hptiop.o
 obj-$(CONFIG_SCSI_STEX)+= stex.o
+obj-$(CONFIG_SCSI_MVSAS)   += mvsas.o
 obj-$(CONFIG_PS3_ROM)  += ps3rom.o
 
 obj-$(CONFIG_ARM)  += arm/
diff --git a/drivers/scsi/mvsas.c b/drivers/scsi/mvsas.c
new file mode 100644
index 000..03638b9
--- /dev/null
+++ b/drivers/scsi/mvsas.c
@@ -0,0 +1,1825 @@
+/*
+   mvsas.c - Marvell 88SE6440 SAS/SATA support
+
+   Copyright 2007 Red Hat, Inc.
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2,
+   or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty
+   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+   See the GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with this program; see the file COPYING.  If not,
+   write to the Free Software Foundation, 675 Mass Ave, Cambridge,
+   MA 02139, USA.
+
+   ---
+
+   Random notes:
+   * hardware supports controlling the endian-ness of data
+ structures.  this permits elimination of all the le32_to_cpu()
+ and cpu_to_le32() conversions.
+
+ */
+
+#include linux/kernel.h
+#include linux/module.h
+#include linux/pci.h
+#include linux/interrupt.h
+#include linux/spinlock.h
+#include linux/delay.h
+#include linux/dma-mapping.h
+#include scsi/libsas.h
+#include asm/io.h
+
+#define DRV_NAME mvsas
+#define DRV_VERSION 0.1
+
+#define mr32(reg)  readl(regs + MVS_##reg)
+#define mw32(reg,val)  writel((val), regs + MVS_##reg)
+#define mw32_f(reg,val)do {\
+   writel((val), regs + MVS_##reg);\
+   readl(regs + MVS_##reg);\
+   } while (0)
+
+/* driver compile-time configuration */
+enum driver_configuration {
+   MVS_TX_RING_SZ  = 1024, /* TX ring size (12-bit) */
+   MVS_RX_RING_SZ  = 1024, /* RX ring size (12-bit) */
+   /* software requires power-of-2
+  ring size */
+
+   MVS_SLOTS   = 512,  /* command slots */
+   MVS_SLOT_BUF_SZ = 8192, /* cmd tbl + IU + status + PRD */
+   MVS_SSP_CMD_SZ  = 64,   /* SSP command table buffer size */
+   MVS_ATA_CMD_SZ  = 128,  /* SATA command table buffer size */
+   MVS_OAF_SZ  = 64,   /* Open address frame buffer size */
+
+   MVS_RX_FIS_COUNT= 17,   /* Optional rx'd FISs (max 17) */
+};
+
+/* unchangeable hardware details */
+enum hardware_details {
+   MVS_MAX_PHYS= 8,/* max. possible phys */
+   MVS_MAX_PORTS   = 8,/* max. possible ports */
+   MVS_RX_FISL_SZ  = 0x400 + (MVS_RX_FIS_COUNT * 0x100),
+};
+
+/* peripheral registers (BAR2) */
+enum peripheral_registers {
+   SPI_CTL = 0x10, /* EEPROM control */
+   SPI_CMD = 0x14, /* EEPROM command */
+   SPI_DATA

[SCSI] qlogicpt: section fixes

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cfb37ae1e9d31fe2c1d21734ab51405e0c3afb7e
Commit: cfb37ae1e9d31fe2c1d21734ab51405e0c3afb7e
Parent: 8f261aaf9be5c1246013cf6a65b98586d24832a5
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Wed Jan 30 22:03:36 2008 +0200
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sat Feb 23 09:07:32 2008 -0600

[SCSI] qlogicpt: section fixes

In current mainline, __devinit qpti_sbus_probe() still is calling __init
qpti_chain_add().  Change occurrences of __init to __devinit to fix.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/qlogicpti.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c
index 65455ab..4a1cf63 100644
--- a/drivers/scsi/qlogicpti.c
+++ b/drivers/scsi/qlogicpti.c
@@ -651,7 +651,7 @@ static int qlogicpti_verify_tmon(struct qlogicpti *qpti)
 
 static irqreturn_t qpti_intr(int irq, void *dev_id);
 
-static void __init qpti_chain_add(struct qlogicpti *qpti)
+static void __devinit qpti_chain_add(struct qlogicpti *qpti)
 {
spin_lock_irq(qptichain_lock);
if (qptichain != NULL) {
@@ -667,7 +667,7 @@ static void __init qpti_chain_add(struct qlogicpti *qpti)
spin_unlock_irq(qptichain_lock);
 }
 
-static void __init qpti_chain_del(struct qlogicpti *qpti)
+static void __devexit qpti_chain_del(struct qlogicpti *qpti)
 {
spin_lock_irq(qptichain_lock);
if (qptichain == qpti) {
@@ -682,7 +682,7 @@ static void __init qpti_chain_del(struct qlogicpti *qpti)
spin_unlock_irq(qptichain_lock);
 }
 
-static int __init qpti_map_regs(struct qlogicpti *qpti)
+static int __devinit qpti_map_regs(struct qlogicpti *qpti)
 {
struct sbus_dev *sdev = qpti-sdev;
 
@@ -705,7 +705,7 @@ static int __init qpti_map_regs(struct qlogicpti *qpti)
return 0;
 }
 
-static int __init qpti_register_irq(struct qlogicpti *qpti)
+static int __devinit qpti_register_irq(struct qlogicpti *qpti)
 {
struct sbus_dev *sdev = qpti-sdev;
 
@@ -730,7 +730,7 @@ fail:
return -1;
 }
 
-static void __init qpti_get_scsi_id(struct qlogicpti *qpti)
+static void __devinit qpti_get_scsi_id(struct qlogicpti *qpti)
 {
qpti-scsi_id = prom_getintdefault(qpti-prom_node,
   initiator-id,
@@ -783,7 +783,7 @@ static void qpti_get_clock(struct qlogicpti *qpti)
 /* The request and response queues must each be aligned
  * on a page boundary.
  */
-static int __init qpti_map_queues(struct qlogicpti *qpti)
+static int __devinit qpti_map_queues(struct qlogicpti *qpti)
 {
struct sbus_dev *sdev = qpti-sdev;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


uml: fix initrd printk

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4631a9a1517654748aaf89cbc46503819a29eb30
Commit: 4631a9a1517654748aaf89cbc46503819a29eb30
Parent: b23c9cc0ce652089a2f0af8c7f1541f10dc9b5db
Author: Johann Felix Soden [EMAIL PROTECTED]
AuthorDate: Sat Feb 23 15:23:23 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Feb 23 17:12:13 2008 -0800

uml: fix initrd printk

If the initrd file has zero-length, the error message should contain
the filepath.

Cc: WANG Cong [EMAIL PROTECTED]
Signed-off-by: Johann Felix Soden [EMAIL PROTECTED]
Signed-off-by: Jeff Dike [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/um/kernel/initrd.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/um/kernel/initrd.c b/arch/um/kernel/initrd.c
index fa01556..d386c75 100644
--- a/arch/um/kernel/initrd.c
+++ b/arch/um/kernel/initrd.c
@@ -32,7 +32,7 @@ static int __init read_initrd(void)
 * ask for no memory.
 */
if (size == 0) {
-   printk(KERN_ERR \%\ is a zero-size initrd\n);
+   printk(KERN_ERR \%s\ is a zero-size initrd\n, initrd);
return 0;
}
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


UML: update defconfig

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7b59ebcd178b5b1d03760c89b318c7a7fdadd051
Commit: 7b59ebcd178b5b1d03760c89b318c7a7fdadd051
Parent: 4631a9a1517654748aaf89cbc46503819a29eb30
Author: Jeff Dike [EMAIL PROTECTED]
AuthorDate: Sat Feb 23 15:23:24 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Feb 23 17:12:13 2008 -0800

UML: update defconfig

Update defconfig.

Cc: Christoph Hellwig [EMAIL PROTECTED]
Signed-off-by: Jeff Dike [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/um/defconfig |  280 +++--
 1 files changed, 187 insertions(+), 93 deletions(-)

diff --git a/arch/um/defconfig b/arch/um/defconfig
index 59215bc..6bd456f 100644
--- a/arch/um/defconfig
+++ b/arch/um/defconfig
@@ -1,13 +1,22 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.17-rc3
-# Fri Apr 28 09:31:20 2006
+# Linux kernel version: 2.6.24
+# Thu Feb  7 11:48:55 2008
 #
+CONFIG_DEFCONFIG_LIST=arch/$ARCH/defconfig
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_UML=y
 CONFIG_MMU=y
+CONFIG_NO_IOMEM=y
+# CONFIG_TRACE_IRQFLAGS_SUPPORT is not set
+CONFIG_LOCKDEP_SUPPORT=y
+# CONFIG_STACKTRACE_SUPPORT is not set
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_BUG=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_IRQ_RELEASE_METHOD=y
+CONFIG_HZ=100
 
 #
 # UML-specific options
@@ -40,11 +49,13 @@ CONFIG_M686=y
 # CONFIG_MCYRIXIII is not set
 # CONFIG_MVIAC3_2 is not set
 # CONFIG_MVIAC7 is not set
+# CONFIG_MPSC is not set
+# CONFIG_MCORE2 is not set
+# CONFIG_GENERIC_CPU is not set
 # CONFIG_X86_GENERIC is not set
 CONFIG_X86_CMPXCHG=y
-CONFIG_X86_XADD=y
 CONFIG_X86_L1_CACHE_SHIFT=5
-CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_X86_XADD=y
 CONFIG_X86_PPRO_FENCE=y
 CONFIG_X86_WP_WORKS_OK=y
 CONFIG_X86_INVLPG=y
@@ -53,7 +64,12 @@ CONFIG_X86_POPAD_OK=y
 CONFIG_X86_GOOD_APIC=y
 CONFIG_X86_USE_PPRO_CHECKSUM=y
 CONFIG_X86_TSC=y
+CONFIG_X86_CMOV=y
+CONFIG_X86_MINIMUM_CPU_FAMILY=4
+CONFIG_X86_DEBUGCTLMSR=y
 CONFIG_UML_X86=y
+CONFIG_X86_32=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 # CONFIG_64BIT is not set
 CONFIG_SEMAPHORE_SLEEPERS=y
 # CONFIG_3_LEVEL_PGTABLES is not set
@@ -67,13 +83,18 @@ CONFIG_FLATMEM_MANUAL=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
+CONFIG_VIRT_TO_BUS=y
 CONFIG_TICK_ONESHOT=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
 CONFIG_LD_SCRIPT_DYN=y
-CONFIG_NET=y
 CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
 CONFIG_BINFMT_MISC=m
 CONFIG_HOSTFS=y
 # CONFIG_HPPFS is not set
@@ -83,31 +104,38 @@ CONFIG_MAGIC_SYSRQ=y
 CONFIG_KERNEL_STACK_ORDER=0
 
 #
-# Code maturity level options
+# General setup
 #
 CONFIG_EXPERIMENTAL=y
 CONFIG_BROKEN_ON_SMP=y
-CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
+CONFIG_INIT_ENV_ARG_LIMIT=128
 CONFIG_LOCALVERSION=
 CONFIG_LOCALVERSION_AUTO=y
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_BSD_PROCESS_ACCT=y
 # CONFIG_BSD_PROCESS_ACCT_V3 is not set
-CONFIG_SYSCTL=y
+# CONFIG_TASKSTATS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
 # CONFIG_AUDIT is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
 # CONFIG_RELAY is not set
-CONFIG_INITRAMFS_SOURCE=
-CONFIG_UID16=y
+# CONFIG_BLK_DEV_INITRD is not set
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
 # CONFIG_EMBEDDED is not set
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
 CONFIG_KALLSYMS_EXTRA_PASS=y
@@ -117,29 +145,36 @@ CONFIG_BUG=y
 CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
 CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+# CONFIG_HAVE_OPROFILE is not set
+# CONFIG_HAVE_KPROBES is not set
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
-# CONFIG_SLOB is not set
-
-#
-# Loadable module support
-#
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
 # CONFIG_MODVERSIONS is not set
 # CONFIG_MODULE_SRCVERSION_ALL is not set
 CONFIG_KMOD=y
-
-#
-# Block layer
-#
+CONFIG_BLOCK=y
 # CONFIG_LBD is not set
 # CONFIG_BLK_DEV_IO_TRACE is not set
 # CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
 
 #
 # IO Schedulers
@@ -153,19 +188,16 @@ CONFIG_DEFAULT_AS=y
 # 

arch/um/kernel/mem.c: fix a shadowed variable

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c3be10f75757e681b34766b24264c83b5ba08041
Commit: c3be10f75757e681b34766b24264c83b5ba08041
Parent: 7b59ebcd178b5b1d03760c89b318c7a7fdadd051
Author: WANG Cong [EMAIL PROTECTED]
AuthorDate: Sat Feb 23 15:23:26 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Feb 23 17:12:13 2008 -0800

arch/um/kernel/mem.c: fix a shadowed variable

Fix a shadowed variable in arch/um/kernel/mem.c, since there is a global
variable has the same name.

Cc: Jeff Dike [EMAIL PROTECTED]
Signed-off-by: WANG Cong [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/um/kernel/mem.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c
index 2627ce8..2eea1ff 100644
--- a/arch/um/kernel/mem.c
+++ b/arch/um/kernel/mem.c
@@ -299,7 +299,7 @@ void show_mem(void)
 {
int pfn, total = 0, reserved = 0;
int shared = 0, cached = 0;
-   int highmem = 0;
+   int high_mem = 0;
struct page *page;
 
printk(KERN_INFO Mem-info:\n);
@@ -311,7 +311,7 @@ void show_mem(void)
page = pfn_to_page(pfn);
total++;
if (PageHighMem(page))
-   highmem++;
+   high_mem++;
if (PageReserved(page))
reserved++;
else if (PageSwapCache(page))
@@ -320,7 +320,7 @@ void show_mem(void)
shared += page_count(page) - 1;
}
printk(KERN_INFO %d pages of RAM\n, total);
-   printk(KERN_INFO %d pages of HIGHMEM\n, highmem);
+   printk(KERN_INFO %d pages of HIGHMEM\n, high_mem);
printk(KERN_INFO %d reserved pages\n, reserved);
printk(KERN_INFO %d pages shared\n, shared);
printk(KERN_INFO %d pages swap cached\n, cached);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


make LKDTM depend on BLOCK

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fddd9cf82c9f9617d134ae878a8f6b116ebbd43d
Commit: fddd9cf82c9f9617d134ae878a8f6b116ebbd43d
Parent: c3be10f75757e681b34766b24264c83b5ba08041
Author: Chris Snook [EMAIL PROTECTED]
AuthorDate: Sat Feb 23 15:23:26 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Feb 23 17:12:13 2008 -0800

make LKDTM depend on BLOCK

Make LKDTM depend on BLOCK to prevent build failures with certain configs.

Signed-off-by: Chris Snook [EMAIL PROTECTED]
Acked-by: Randy Dunlap [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 lib/Kconfig.debug |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index ab408aa..0796c1a 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -527,6 +527,7 @@ config LKDTM
tristate Linux Kernel Dump Test Tool Module
depends on DEBUG_KERNEL
depends on KPROBES
+   depends on BLOCK
default n
help
This module enables testing of the different dumping mechanisms by
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


MN10300: define HZ as a config option

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=860f7be283f8b8d7830a741cb72338057a753283
Commit: 860f7be283f8b8d7830a741cb72338057a753283
Parent: 1a823ac9ff09cbdf39201df37b7ede1f9395de83
Author: David Howells [EMAIL PROTECTED]
AuthorDate: Sat Feb 23 15:23:28 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Feb 23 17:12:13 2008 -0800

MN10300: define HZ as a config option

Define HZ as a config option.

Signed-off-by: David Howells [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/mn10300/Kconfig|4 
 include/asm-mn10300/param.h |2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig
index eedc3a5..6a6409a 100644
--- a/arch/mn10300/Kconfig
+++ b/arch/mn10300/Kconfig
@@ -63,6 +63,10 @@ config GENERIC_HARDIRQS
 config HOTPLUG_CPU
def_bool n
 
+config HZ
+   int
+   default 1000
+
 mainmenu Matsushita MN10300/AM33 Kernel Configuration
 
 source init/Kconfig
diff --git a/include/asm-mn10300/param.h b/include/asm-mn10300/param.h
index 54b883e..789b1df 100644
--- a/include/asm-mn10300/param.h
+++ b/include/asm-mn10300/param.h
@@ -12,7 +12,7 @@
 #define _ASM_PARAM_H
 
 #ifdef __KERNEL__
-#define HZ 1000/* Internal kernel timer frequency */
+#define HZ CONFIG_HZ   /* Internal kernel timer frequency */
 #define USER_HZ100 /* .. some user interfaces are 
in
 * ticks */
 #define CLOCKS_PER_SEC (USER_HZ)   /* like times() */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


file capabilities: simplify signal check

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=094972840f2e7c1c6fc9e1a97d817cc17085378e
Commit: 094972840f2e7c1c6fc9e1a97d817cc17085378e
Parent: e5df70ab194543522397fa3da8c8f80564a0f7d3
Author: Serge E. Hallyn [EMAIL PROTECTED]
AuthorDate: Sat Feb 23 15:23:33 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Feb 23 17:12:13 2008 -0800

file capabilities: simplify signal check

Simplify the uid equivalence check in cap_task_kill().  Anyone can kill a
process owned by the same uid.

Without this patch wireshark is reported to fail.

Signed-off-by: Serge E. Hallyn [EMAIL PROTECTED]
Signed-off-by: Andrew G. Morgan [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 security/commoncap.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/security/commoncap.c b/security/commoncap.c
index 5aba826..bb0c095 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -552,7 +552,7 @@ int cap_task_kill(struct task_struct *p, struct siginfo 
*info,
 * allowed.
 * We must preserve legacy signal behavior in this case.
 */
-   if (p-euid == 0  p-uid == current-uid)
+   if (p-uid == current-uid)
return 0;
 
/* sigcont is permitted within same session */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


hugetlb: ensure we do not reference a surplus page after handing it to buddy

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e5df70ab194543522397fa3da8c8f80564a0f7d3
Commit: e5df70ab194543522397fa3da8c8f80564a0f7d3
Parent: 745329c4a2a25efbf5ba6cd7842e07840e4e9775
Author: Andy Whitcroft [EMAIL PROTECTED]
AuthorDate: Sat Feb 23 15:23:32 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Feb 23 17:12:13 2008 -0800

hugetlb: ensure we do not reference a surplus page after handing it to buddy

When we free a page via free_huge_page and we detect that we are in surplus
the page will be returned to the buddy.  After this we no longer own the 
page.

However at the end free_huge_page we clear out our mapping pointer from
page private.  Even where the page is not a surplus we free the page to
the hugepage pool, drop the pool locks and then clear page private.  In
either case the page may have been reallocated.  BAD.

Make sure we clear out page private before we free the page.

Signed-off-by: Andy Whitcroft [EMAIL PROTECTED]
Acked-by: Adam Litke [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 mm/hugetlb.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index cb1b3a7..89e6286 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -120,6 +120,7 @@ static void free_huge_page(struct page *page)
struct address_space *mapping;
 
mapping = (struct address_space *) page_private(page);
+   set_page_private(page, 0);
BUG_ON(page_count(page));
INIT_LIST_HEAD(page-lru);
 
@@ -134,7 +135,6 @@ static void free_huge_page(struct page *page)
spin_unlock(hugetlb_lock);
if (mapping)
hugetlb_put_quota(mapping, 1);
-   set_page_private(page, 0);
 }
 
 /*
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


markers: fix sparse warnings in markers.c

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=de4fc64f0f2a4efbaad3e7c1e1e05a28f69b45e5
Commit: de4fc64f0f2a4efbaad3e7c1e1e05a28f69b45e5
Parent: 094972840f2e7c1c6fc9e1a97d817cc17085378e
Author: Harvey Harrison [EMAIL PROTECTED]
AuthorDate: Sat Feb 23 15:23:33 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Feb 23 17:12:14 2008 -0800

markers: fix sparse warnings in markers.c

char can be unsigned
kernel/marker.c:64:20: error: dubious one-bit signed bitfield
kernel/marker.c:65:14: error: dubious one-bit signed bitfield

Signed-off-by: Harvey Harrison [EMAIL PROTECTED]
Acked-by: Mathieu Desnoyers [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 kernel/marker.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/marker.c b/kernel/marker.c
index c4c2cd8..50effc0 100644
--- a/kernel/marker.c
+++ b/kernel/marker.c
@@ -61,8 +61,8 @@ struct marker_entry {
int refcount;   /* Number of times armed. 0 if disarmed. */
struct rcu_head rcu;
void *oldptr;
-   char rcu_pending:1;
-   char ptype:1;
+   unsigned char rcu_pending:1;
+   unsigned char ptype:1;
char name[0];   /* Contains name'\0'format'\0' */
 };
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


sparc: fix build

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=eaeb16883bd6aa2d6b6b61b825c0d2b0dc793f60
Commit: eaeb16883bd6aa2d6b6b61b825c0d2b0dc793f60
Parent: de4fc64f0f2a4efbaad3e7c1e1e05a28f69b45e5
Author: David Rientjes [EMAIL PROTECTED]
AuthorDate: Sat Feb 23 15:23:34 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Feb 23 17:12:14 2008 -0800

sparc: fix build

Fix build failure on sparc:

In file included from include/linux/mm.h:39,
from include/linux/memcontrol.h:24,
from include/linux/swap.h:8,
from include/linux/suspend.h:7,
from init/do_mounts.c:6:
include/asm/pgtable.h:344: warning: parameter names (without
types) in function declaration
include/asm/pgtable.h:345: warning: parameter names (without
types) in function declaration
include/asm/pgtable.h:346: error: expected '=', ',', ';', 'asm' or
'__attribute__' before '___f___swp_entry'

viro sayeth:

  I've run allmodconfig builds on a bunch of target, FWIW (essentially the
  same patch).  Note that these includes are recent addition caused by added
  inline function that had since then become a define.  So while I agree 
with
  your comments in general, in _this_ case it's pretty safe.

  The commit that had done it is 3062fc67dad01b1d2a15d58c709eff946389eca4
  (memcontrol: move mm_cgroup to header file) and the switch to #define
  is in commit 60c12b1202a60eabb1c61317e5d2678fcea9893f (memcontrol: add
  vm_match_cgroup()) (BTW, that probably warranted mentioning in the
  changelog of the latter).

Cc: Adrian Bunk [EMAIL PROTECTED]
Cc: Robert Reif [EMAIL PROTECTED]
Signed-off-by: David Rientjes [EMAIL PROTECTED]
Cc: David S. Miller [EMAIL PROTECTED]
Cc: Al Viro [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/linux/memcontrol.h |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 925d57b..0407562 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -20,9 +20,6 @@
 #ifndef _LINUX_MEMCONTROL_H
 #define _LINUX_MEMCONTROL_H
 
-#include linux/rcupdate.h
-#include linux/mm.h
-
 struct mem_cgroup;
 struct page_cgroup;
 struct page;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


copyright owner and author clean up for intel iommu and related files

2008-02-23 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=98bcef56cadb4da138e2c1a2a0790f372382b236
Commit: 98bcef56cadb4da138e2c1a2a0790f372382b236
Parent: eaeb16883bd6aa2d6b6b61b825c0d2b0dc793f60
Author: mark gross [EMAIL PROTECTED]
AuthorDate: Sat Feb 23 15:23:35 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Feb 23 17:12:14 2008 -0800

copyright owner and author clean up for intel iommu and related files

The following is a clean up and correction of the copyright holding
entities for the files associated with the intel iommu code.

Signed-off-by: [EMAIL PROTECTED]
Cc: Greg KH [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/pci/dmar.c|9 +
 drivers/pci/intel-iommu.c |7 ---
 drivers/pci/intel-iommu.h |5 +++--
 drivers/pci/iova.c|3 ++-
 drivers/pci/iova.h|3 ++-
 5 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c
index 8ed2648..f941f60 100644
--- a/drivers/pci/dmar.c
+++ b/drivers/pci/dmar.c
@@ -14,11 +14,12 @@
  * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  * Place - Suite 330, Boston, MA 02111-1307 USA.
  *
- * Copyright (C) Ashok Raj [EMAIL PROTECTED]
- * Copyright (C) Shaohua Li [EMAIL PROTECTED]
- * Copyright (C) Anil S Keshavamurthy [EMAIL PROTECTED]
+ * Copyright (C) 2006-2008 Intel Corporation
+ * Author: Ashok Raj [EMAIL PROTECTED]
+ * Author: Shaohua Li [EMAIL PROTECTED]
+ * Author: Anil S Keshavamurthy [EMAIL PROTECTED]
  *
- * This file implements early detection/parsing of DMA Remapping Devices
+ * This file implements early detection/parsing of DMA Remapping Devices
  * reported to OS through BIOS via DMA remapping reporting (DMAR) ACPI
  * tables.
  */
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index a4c3089..977d29b 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -14,9 +14,10 @@
  * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  * Place - Suite 330, Boston, MA 02111-1307 USA.
  *
- * Copyright (C) Ashok Raj [EMAIL PROTECTED]
- * Copyright (C) Shaohua Li [EMAIL PROTECTED]
- * Copyright (C) Anil S Keshavamurthy [EMAIL PROTECTED]
+ * Copyright (C) 2006-2008 Intel Corporation
+ * Author: Ashok Raj [EMAIL PROTECTED]
+ * Author: Shaohua Li [EMAIL PROTECTED]
+ * Author: Anil S Keshavamurthy [EMAIL PROTECTED]
  */
 
 #include linux/init.h
diff --git a/drivers/pci/intel-iommu.h b/drivers/pci/intel-iommu.h
index 07f5f63..afc0ad9 100644
--- a/drivers/pci/intel-iommu.h
+++ b/drivers/pci/intel-iommu.h
@@ -14,8 +14,9 @@
  * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  * Place - Suite 330, Boston, MA 02111-1307 USA.
  *
- * Copyright (C) Ashok Raj [EMAIL PROTECTED]
- * Copyright (C) Anil S Keshavamurthy [EMAIL PROTECTED]
+ * Copyright (C) 2006-2008 Intel Corporation
+ * Author: Ashok Raj [EMAIL PROTECTED]
+ * Author: Anil S Keshavamurthy [EMAIL PROTECTED]
  */
 
 #ifndef _INTEL_IOMMU_H_
diff --git a/drivers/pci/iova.c b/drivers/pci/iova.c
index 8de7ab6..dbcdd6b 100644
--- a/drivers/pci/iova.c
+++ b/drivers/pci/iova.c
@@ -3,7 +3,8 @@
  *
  * This file is released under the GPLv2.
  *
- * Copyright (C) 2006 Anil S Keshavamurthy [EMAIL PROTECTED]
+ * Copyright (C) 2006-2008 Intel Corporation
+ * Author: Anil S Keshavamurthy [EMAIL PROTECTED]
  */
 
 #include iova.h
diff --git a/drivers/pci/iova.h b/drivers/pci/iova.h
index d521b5b..228f6c9 100644
--- a/drivers/pci/iova.h
+++ b/drivers/pci/iova.h
@@ -3,7 +3,8 @@
  *
  * This file is released under the GPLv2.
  *
- * Copyright (C) 2006 Anil S Keshavamurthy [EMAIL PROTECTED]
+ * Copyright (C) 2006-2008 Intel Corporation
+ * Author: Anil S Keshavamurthy [EMAIL PROTECTED]
  *
  */
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


  1   2   3   4   5   6   7   8   9   10   >