epoll locks changes and cleanups

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c7ea76302547f81e4583d0d7c52a1c37c6747f5d
Commit: c7ea76302547f81e4583d0d7c52a1c37c6747f5d
Parent: d47de16c7221968d3eab899d7540efa5ba77af5a
Author: Davide Libenzi <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 01:40:47 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 08:53:59 2007 -0700

epoll locks changes and cleanups

Changes the rwlock to a spinlock, and drops the use-count variable.
Operations are always bound by the mutex now, so the use-count is no more
needed.  For the same reason, the rwlock can become a simple spinlock.

Signed-off-by: Davide Libenzi <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/eventpoll.c |  234 +--
 1 files changed, 73 insertions(+), 161 deletions(-)

diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 1dbedc7..4c16127 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -1,6 +1,6 @@
 /*
- *  fs/eventpoll.c ( Efficent event polling implementation )
- *  Copyright (C) 2001,...,2006 Davide Libenzi
+ *  fs/eventpoll.c (Efficent event polling implementation)
+ *  Copyright (C) 2001,...,2007 Davide Libenzi
  *
  *  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
@@ -44,8 +44,8 @@
  * There are three level of locking required by epoll :
  *
  * 1) epmutex (mutex)
- * 2) ep->mtx (mutes)
- * 3) ep->lock (rw_lock)
+ * 2) ep->mtx (mutex)
+ * 3) ep->lock (spinlock)
  *
  * The acquire order is the one listed above, from 1 to 3.
  * We need a spinlock (ep->lock) because we manipulate objects
@@ -140,6 +140,12 @@ struct epitem {
/* List header used to link this structure to the eventpoll ready list 
*/
struct list_head rdllink;
 
+   /*
+* Works together "struct eventpoll"->ovflist in keeping the
+* single linked chain of items.
+*/
+   struct epitem *next;
+
/* The file descriptor information this item refers to */
struct epoll_filefd ffd;
 
@@ -152,23 +158,11 @@ struct epitem {
/* The "container" of this item */
struct eventpoll *ep;
 
-   /* The structure that describe the interested events and the source fd 
*/
-   struct epoll_event event;
-
-   /*
-* Used to keep track of the usage count of the structure. This avoids
-* that the structure will desappear from underneath our processing.
-*/
-   atomic_t usecnt;
-
/* List header used to link this item to the "struct file" items list */
struct list_head fllink;
 
-   /*
-* Works together "struct eventpoll"->ovflist in keeping the
-* single linked chain of items.
-*/
-   struct epitem *next;
+   /* The structure that describe the interested events and the source fd 
*/
+   struct epoll_event event;
 };
 
 /*
@@ -178,7 +172,7 @@ struct epitem {
  */
 struct eventpoll {
/* Protect the this structure access */
-   rwlock_t lock;
+   spinlock_t lock;
 
/*
 * This mutex is used to ensure that files are not removed
@@ -394,78 +388,11 @@ static void ep_unregister_pollwait(struct eventpoll *ep, 
struct epitem *epi)
 }
 
 /*
- * Unlink the "struct epitem" from all places it might have been hooked up.
- * This function must be called with write IRQ lock on "ep->lock".
- */
-static int ep_unlink(struct eventpoll *ep, struct epitem *epi)
-{
-   int error;
-
-   /*
-* It can happen that this one is called for an item already unlinked.
-* The check protect us from doing a double unlink ( crash ).
-*/
-   error = -ENOENT;
-   if (!ep_rb_linked(&epi->rbn))
-   goto error_return;
-
-   /*
-* Clear the event mask for the unlinked item. This will avoid item
-* notifications to be sent after the unlink operation from inside
-* the kernel->userspace event transfer loop.
-*/
-   epi->event.events = 0;
-
-   /*
-* At this point is safe to do the job, unlink the item from our 
rb-tree.
-* This operation togheter with the above check closes the door to
-* double unlinks.
-*/
-   ep_rb_erase(&epi->rbn, &ep->rbr);
-
-   /*
-* If the item we are going to remove is inside the ready file 
descriptors
-* we want to remove it from this list to avoid stale events.
-*/
-   if (ep_is_linked(&epi->rdllink))
-   list_del_init(&epi->rdllink);
-
-   error = 0;
-error_return:
-
-   DNPRINTK(3, (KERN_INFO "[%p] eventpoll: ep_unlink(%p, %p) = %d\n",
-current, ep, epi->ffd.file, error));
-
-   return error;
-}
-
-/*
- * Increment the usage count of the "struct epitem" ma

fix epoll single pass code and add wait-exclusive flag

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d47de16c7221968d3eab899d7540efa5ba77af5a
Commit: d47de16c7221968d3eab899d7540efa5ba77af5a
Parent: faa8b6c3c2e1454175609167a25ae525d075f045
Author: Davide Libenzi <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 01:40:41 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 08:53:59 2007 -0700

fix epoll single pass code and add wait-exclusive flag

Fixes the epoll single pass code.  During the unlocked event delivery (to
userspace) code, the poll callback can re-issue new events, and we must
receive them correctly.  Since we loop in a lockless fashion, we want to be
O(nready), and we don't want to flash on/off the spinlock for every event, 
we
have the poll callback to use a secondary list to queue events while we're
inside the event delivery loop.  The rw_semaphore has been turned into a
mutex.  This patch also adds the wait-exclusive flag, as suggested by Davi
Arnaut.

Signed-off-by: Davide Libenzi <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/eventpoll.c |  322 +---
 1 files changed, 166 insertions(+), 156 deletions(-)

diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 1aad34e..1dbedc7 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -26,7 +26,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -39,14 +38,13 @@
 #include 
 #include 
 #include 
-#include 
 
 /*
  * LOCKING:
  * There are three level of locking required by epoll :
  *
  * 1) epmutex (mutex)
- * 2) ep->sem (rw_semaphore)
+ * 2) ep->mtx (mutes)
  * 3) ep->lock (rw_lock)
  *
  * The acquire order is the one listed above, from 1 to 3.
@@ -57,20 +55,20 @@
  * a spinlock. During the event transfer loop (from kernel to
  * user space) we could end up sleeping due a copy_to_user(), so
  * we need a lock that will allow us to sleep. This lock is a
- * read-write semaphore (ep->sem). It is acquired on read during
- * the event transfer loop and in write during epoll_ctl(EPOLL_CTL_DEL)
- * and during eventpoll_release_file(). Then we also need a global
- * semaphore to serialize eventpoll_release_file() and ep_free().
- * This semaphore is acquired by ep_free() during the epoll file
+ * mutex (ep->mtx). It is acquired during the event transfer loop,
+ * during epoll_ctl(EPOLL_CTL_DEL) and during eventpoll_release_file().
+ * Then we also need a global mutex to serialize eventpoll_release_file()
+ * and ep_free().
+ * This mutex is acquired by ep_free() during the epoll file
  * cleanup path and it is also acquired by eventpoll_release_file()
  * if a file has been pushed inside an epoll set and it is then
  * close()d without a previous call toepoll_ctl(EPOLL_CTL_DEL).
- * It is possible to drop the "ep->sem" and to use the global
- * semaphore "epmutex" (together with "ep->lock") to have it working,
- * but having "ep->sem" will make the interface more scalable.
+ * It is possible to drop the "ep->mtx" and to use the global
+ * mutex "epmutex" (together with "ep->lock") to have it working,
+ * but having "ep->mtx" will make the interface more scalable.
  * Events that require holding "epmutex" are very rare, while for
- * normal operations the epoll private "ep->sem" will guarantee
- * a greater scalability.
+ * normal operations the epoll private "ep->mtx" will guarantee
+ * a better scalability.
  */
 
 #define DEBUG_EPOLL 0
@@ -102,6 +100,8 @@
 
 #define EP_MAX_EVENTS (INT_MAX / sizeof(struct epoll_event))
 
+#define EP_UNACTIVE_PTR ((void *) -1L)
+
 struct epoll_filefd {
struct file *file;
int fd;
@@ -111,7 +111,7 @@ struct epoll_filefd {
  * Node that is linked into the "wake_task_list" member of the "struct 
poll_safewake".
  * It is used to keep track on all tasks that are currently inside the 
wake_up() code
  * to 1) short-circuit the one coming from the same task and same wait queue 
head
- * ( loop ) 2) allow a maximum number of epoll descriptors inclusion nesting
+ * (loop) 2) allow a maximum number of epoll descriptors inclusion nesting
  * 3) let go the ones coming from other tasks.
  */
 struct wake_task_node {
@@ -130,6 +130,48 @@ struct poll_safewake {
 };
 
 /*
+ * Each file descriptor added to the eventpoll interface will
+ * have an entry of this type linked to the "rbr" RB tree.
+ */
+struct epitem {
+   /* RB-Tree node used to link this structure to the eventpoll rb-tree */
+   struct rb_node rbn;
+
+   /* List header used to link this structure to the eventpoll ready list 
*/
+   struct list_head rdllink;
+
+   /* The file descriptor information this item refers to */
+   struct epoll_filefd ffd;
+
+   /* Number of active wait queue attached to poll operations */
+   int nwait;
+
+   /* List containing poll wait queues */
+  

epoll: fix some comments

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=67647d0fb8bc03609d045a9cce85f7ef6d763036
Commit: 67647d0fb8bc03609d045a9cce85f7ef6d763036
Parent: c7ea76302547f81e4583d0d7c52a1c37c6747f5d
Author: Davide Libenzi <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 01:40:52 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 08:54:00 2007 -0700

epoll: fix some comments

Fixes some epoll code comments.

Signed-off-by: Davide Libenzi <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/eventpoll.c |   48 +++-
 1 files changed, 27 insertions(+), 21 deletions(-)

diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 4c16127..d4255be 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -134,7 +134,7 @@ struct poll_safewake {
  * have an entry of this type linked to the "rbr" RB tree.
  */
 struct epitem {
-   /* RB-Tree node used to link this structure to the eventpoll rb-tree */
+   /* RB tree node used to link this structure to the eventpoll RB tree */
struct rb_node rbn;
 
/* List header used to link this structure to the eventpoll ready list 
*/
@@ -191,7 +191,7 @@ struct eventpoll {
/* List of ready file descriptors */
struct list_head rdllist;
 
-   /* RB-Tree root used to store monitored fd structs */
+   /* RB tree root used to store monitored fd structs */
struct rb_root rbr;
 
/*
@@ -241,7 +241,7 @@ static struct kmem_cache *epi_cache __read_mostly;
 static struct kmem_cache *pwq_cache __read_mostly;
 
 
-/* Setup the structure that is used as key for the rb-tree */
+/* Setup the structure that is used as key for the RB tree */
 static inline void ep_set_ffd(struct epoll_filefd *ffd,
  struct file *file, int fd)
 {
@@ -249,7 +249,7 @@ static inline void ep_set_ffd(struct epoll_filefd *ffd,
ffd->fd = fd;
 }
 
-/* Compare rb-tree keys */
+/* Compare RB tree keys */
 static inline int ep_cmp_ffd(struct epoll_filefd *p1,
 struct epoll_filefd *p2)
 {
@@ -257,20 +257,20 @@ static inline int ep_cmp_ffd(struct epoll_filefd *p1,
(p1->file < p2->file ? -1 : p1->fd - p2->fd));
 }
 
-/* Special initialization for the rb-tree node to detect linkage */
+/* Special initialization for the RB tree node to detect linkage */
 static inline void ep_rb_initnode(struct rb_node *n)
 {
rb_set_parent(n, n);
 }
 
-/* Removes a node from the rb-tree and marks it for a fast is-linked check */
+/* Removes a node from the RB tree and marks it for a fast is-linked check */
 static inline void ep_rb_erase(struct rb_node *n, struct rb_root *r)
 {
rb_erase(n, r);
rb_set_parent(n, n);
 }
 
-/* Fast check to verify that the item is linked to the main rb-tree */
+/* Fast check to verify that the item is linked to the main RB tree */
 static inline int ep_rb_linked(struct rb_node *n)
 {
return rb_parent(n) != n;
@@ -531,6 +531,8 @@ void eventpoll_release_file(struct file *file)
 * We don't want to get "file->f_ep_lock" because it is not
 * necessary. It is not necessary because we're in the "struct file"
 * cleanup path, and this means that noone is using this file anymore.
+* So, for example, epoll_ctl() cannot hit here sicne if we reach this
+* point, the file counter already went to zero and fget() would fail.
 * The only hit might come from ep_free() but by holding the mutex
 * will correctly serialize the operation. We do need to acquire
 * "ep->mtx" after "epmutex" because ep_remove() requires it when called
@@ -802,7 +804,9 @@ error_unregister:
 
/*
 * We need to do this because an event could have been arrived on some
-* allocated wait queue.
+* allocated wait queue. Note that we don't care about the ep->ovflist
+* list, since that is used/cleaned only inside a section bound by 
"mtx".
+* And ep_insert() is called with "mtx" held.
 */
spin_lock_irqsave(&ep->lock, flags);
if (ep_is_linked(&epi->rdllink))
@@ -845,8 +849,7 @@ static int ep_modify(struct eventpoll *ep, struct epitem 
*epi, struct epoll_even
 
/*
 * If the item is "hot" and it is not registered inside the ready
-* list, push it inside. If the item is not "hot" and it is currently
-* registered inside the ready list, unlink it.
+* list, push it inside.
 */
if (revents & event->events) {
if (!ep_is_linked(&epi->rdllink)) {
@@ -966,15 +969,16 @@ errxit:
ep->ovflist = EP_UNACTIVE_PTR;
 
/*
-* In case of error in the event-send loop, we might still have items
-* inside the "txlist". We need to splice them back inside ep->rdllist.
+* In case of er

epoll: move kfree inside ep_free

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f0ee9aabb0520adea5937855a9575c08a97b16e7
Commit: f0ee9aabb0520adea5937855a9575c08a97b16e7
Parent: 67647d0fb8bc03609d045a9cce85f7ef6d763036
Author: Davide Libenzi <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 01:40:57 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 08:54:00 2007 -0700

epoll: move kfree inside ep_free

Move the kfree() call inside the ep_free() function.

Signed-off-by: Davide Libenzi <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/eventpoll.c |7 ++-
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index d4255be..0b73cd4 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -469,18 +469,16 @@ static void ep_free(struct eventpoll *ep)
}
 
mutex_unlock(&epmutex);
-
mutex_destroy(&ep->mtx);
+   kfree(ep);
 }
 
 static int ep_eventpoll_release(struct inode *inode, struct file *file)
 {
struct eventpoll *ep = file->private_data;
 
-   if (ep) {
+   if (ep)
ep_free(ep);
-   kfree(ep);
-   }
 
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: close() ep=%p\n", current, ep));
return 0;
@@ -1107,7 +1105,6 @@ asmlinkage long sys_epoll_create(int size)
 
 error_free:
ep_free(ep);
-   kfree(ep);
 error_return:
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_create(%d) = %d\n",
 current, size, 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


nommu: add ioremap_page_range()

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=218f0aaee8a6b0e5772b95b154dea5b7701b33aa
Commit: 218f0aaee8a6b0e5772b95b154dea5b7701b33aa
Parent: f0ee9aabb0520adea5937855a9575c08a97b16e7
Author: Paul Mundt <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 01:41:02 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 08:54:00 2007 -0700

nommu: add ioremap_page_range()

lib/ioremap.c is presently only built in if CONFIG_MMU is set.  While this
is reasonable, platforms that support both CONFIG_MMU=y or n need to be
able to call in to this regardless.

As none of the current nommu platforms do anything special with ioremap(),
we assume that it's always successful.

This fixes the SH-4 build with CONFIG_MMU=n.

Signed-off-by: Paul Mundt <[EMAIL PROTECTED]>
Cc: David Howells <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 include/linux/io.h |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/include/linux/io.h b/include/linux/io.h
index 09d3512..8423dd3 100644
--- a/include/linux/io.h
+++ b/include/linux/io.h
@@ -27,8 +27,16 @@ struct device;
 void __iowrite32_copy(void __iomem *to, const void *from, size_t count);
 void __iowrite64_copy(void __iomem *to, const void *from, size_t count);
 
+#ifdef CONFIG_MMU
 int ioremap_page_range(unsigned long addr, unsigned long end,
   unsigned long phys_addr, pgprot_t prot);
+#else
+static inline int ioremap_page_range(unsigned long addr, unsigned long end,
+unsigned long phys_addr, pgprot_t prot)
+{
+   return 0;
+}
+#endif
 
 /*
  * Managed iomap interface
-
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


h8300 atomic.h update

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b67405a6bbd28dfd5337b29d5bc5a1140afb
Commit: b67405a6bbd28dfd5337b29d5bc5a1140afb
Parent: 218f0aaee8a6b0e5772b95b154dea5b7701b33aa
Author: Yoshinori Sato <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 01:41:07 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 08:54:00 2007 -0700

h8300 atomic.h update

add atomic_sub_and_test define.

Signed-off-by: Yoshinori Sato <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 include/asm-h8300/atomic.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/asm-h8300/atomic.h b/include/asm-h8300/atomic.h
index 21f5442..b4cf0ea 100644
--- a/include/asm-h8300/atomic.h
+++ b/include/asm-h8300/atomic.h
@@ -37,6 +37,7 @@ static __inline__ int atomic_sub_return(int i, atomic_t *v)
 }
 
 #define atomic_sub(i, v) atomic_sub_return(i, v)
+#define atomic_sub_and_test(i,v) (atomic_sub_return(i, v) == 0)
 
 static __inline__ int atomic_inc_return(atomic_t *v)
 {
-
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


alpha: fix hard_smp_processor_id compile error

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0fcdf96ca95f81a0e1fd91a2de16dc67c641c958
Commit: 0fcdf96ca95f81a0e1fd91a2de16dc67c641c958
Parent: b67405a6bbd28dfd5337b29d5bc5a1140afb
Author: Simon Horman <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 01:41:15 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 08:54:00 2007 -0700

alpha: fix hard_smp_processor_id compile error

"Remove hardcoding of hard_smp_processor_id on UP systems",
2f4dfe206a2fc07099dfad77a8ea2f4b4ae2140f in Linus' tree, moved
the definition of hard_smp_processor_id linux/smp.h to asm/smp.h
for UP systems. This causes a regression on Alpha.

cc1: warnings being treated as errors
arch/alpha/kernel/setup.c: In function 'setup_arch':
arch/alpha/kernel/setup.c:506: warning: implicit declaration of function 
'hard_smp_processor_id'
make[1]: *** [arch/alpha/kernel/setup.o] error 1
make: *** [arch/alpha/kernel] error 2

By including asm/smp.h non-conditionally in asm/mmu_context.h
the problem appears to be resolved.

Cc: Fernando Luis Vazquez Cao <[EMAIL PROTECTED]>
Signed-off-by: Simon Horman <[EMAIL PROTECTED]>
Cc: Richard Henderson <[EMAIL PROTECTED]>
Cc: Ivan Kokshaysky <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 include/asm-alpha/mmu_context.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/asm-alpha/mmu_context.h b/include/asm-alpha/mmu_context.h
index 0bd7bd2..6a5be1f 100644
--- a/include/asm-alpha/mmu_context.h
+++ b/include/asm-alpha/mmu_context.h
@@ -85,8 +85,8 @@ __reload_thread(struct pcb_struct *pcb)
  * +-++--+
  */
 
-#ifdef CONFIG_SMP
 #include 
+#ifdef CONFIG_SMP
 #define cpu_last_asn(cpuid)(cpu_data[cpuid].last_asn)
 #else
 extern unsigned long last_asn;
-
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


m68k: implement __clear_user()

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3c46bdcaec53eda069a8a9cd60621c7431aa7842
Commit: 3c46bdcaec53eda069a8a9cd60621c7431aa7842
Parent: 0fcdf96ca95f81a0e1fd91a2de16dc67c641c958
Author: Geert Uytterhoeven <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 01:41:29 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 08:54:00 2007 -0700

m68k: implement __clear_user()

m68k: implement __clear_user(), which is needed by fs/signalfd.c

Since we always let the MMU do all checking, clear_user() and __clear_user()
are identical. The old clear_user() is renamed to __clear_user() for
consistency.

Signed-off-by: Geert Uytterhoeven <[EMAIL PROTECTED]>
Cc: Davide Libenzi <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 arch/m68k/lib/uaccess.c|4 ++--
 include/asm-m68k/uaccess.h |4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/m68k/lib/uaccess.c b/arch/m68k/lib/uaccess.c
index 865f9fb..13854ed 100644
--- a/arch/m68k/lib/uaccess.c
+++ b/arch/m68k/lib/uaccess.c
@@ -181,7 +181,7 @@ EXPORT_SYMBOL(strnlen_user);
  * Zero Userspace
  */
 
-unsigned long clear_user(void __user *to, unsigned long n)
+unsigned long __clear_user(void __user *to, unsigned long n)
 {
unsigned long res;
 
@@ -219,4 +219,4 @@ unsigned long clear_user(void __user *to, unsigned long n)
 
 return res;
 }
-EXPORT_SYMBOL(clear_user);
+EXPORT_SYMBOL(__clear_user);
diff --git a/include/asm-m68k/uaccess.h b/include/asm-m68k/uaccess.h
index 6a4cf20..5c1264c 100644
--- a/include/asm-m68k/uaccess.h
+++ b/include/asm-m68k/uaccess.h
@@ -361,7 +361,9 @@ __constant_copy_to_user(void __user *to, const void *from, 
unsigned long n)
 
 long strncpy_from_user(char *dst, const char __user *src, long count);
 long strnlen_user(const char __user *src, long n);
-unsigned long clear_user(void __user *to, unsigned long n);
+unsigned long __clear_user(void __user *to, unsigned long n);
+
+#define clear_user __clear_user
 
 #define strlen_user(str) strnlen_user(str, 32767)
 
-
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


clocksource: fix lock order in the resume path

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8f89441b37536fea92b1ed7004e5e2dda011473d
Commit: 8f89441b37536fea92b1ed7004e5e2dda011473d
Parent: 3c46bdcaec53eda069a8a9cd60621c7431aa7842
Author: Thomas Gleixner <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 01:41:32 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 08:54:00 2007 -0700

clocksource: fix lock order in the resume path

lockdep complains about the lock nesting of clocksource and watchdog lock
in the resume path.

Change the resume marker to a bit operation and remove the lock from this
path.

Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
Cc: john stultz <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 kernel/time/clocksource.c |   10 +++---
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 3db5c3c..51b6a6a 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -74,7 +74,7 @@ static struct clocksource *watchdog;
 static struct timer_list watchdog_timer;
 static DEFINE_SPINLOCK(watchdog_lock);
 static cycle_t watchdog_last;
-static int watchdog_resumed;
+static unsigned long watchdog_resumed;
 
 /*
  * Interval: 0.5sec Threshold: 0.0625s
@@ -104,9 +104,7 @@ static void clocksource_watchdog(unsigned long data)
 
spin_lock(&watchdog_lock);
 
-   resumed = watchdog_resumed;
-   if (unlikely(resumed))
-   watchdog_resumed = 0;
+   resumed = test_and_clear_bit(0, &watchdog_resumed);
 
wdnow = watchdog->read();
wd_nsec = cyc2ns(watchdog, (wdnow - watchdog_last) & watchdog->mask);
@@ -151,9 +149,7 @@ static void clocksource_watchdog(unsigned long data)
 }
 static void clocksource_resume_watchdog(void)
 {
-   spin_lock(&watchdog_lock);
-   watchdog_resumed = 1;
-   spin_unlock(&watchdog_lock);
+   set_bit(0, &watchdog_resumed);
 }
 
 static void clocksource_check_watchdog(struct clocksource *cs)
-
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 "MAINTAINERS: remove invalid list address for TPM"

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3bd2aad2103314a0a09614dc29926a1437db02f7
Commit: 3bd2aad2103314a0a09614dc29926a1437db02f7
Parent: 8f89441b37536fea92b1ed7004e5e2dda011473d
Author: Stephen Rothwell <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 01:41:36 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 08:54:00 2007 -0700

Revert "MAINTAINERS: remove invalid list address for TPM"

This reverts commit b6d1c9a44744224d83125a5a89c1a6cc4db27361.

Others tell me that this address has worked for them, so I can only
assume that I hit a glitch in the sourceforge mail system.

Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]>
Cc: Kylene Hall <[EMAIL PROTECTED]>
Cc: Marcel Selhorst <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 MAINTAINERS |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 21f3fff..bbeb5b6 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3267,6 +3267,7 @@ W:http://tpmdd.sourceforge.net
 P: Marcel Selhorst
 M: [EMAIL PROTECTED]
 W: http://www.prosec.rub.de/tpm/
+L: [EMAIL PROTECTED]
 S: Maintained
 
 Telecom Clock Driver for MCPL0010
-
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 cpu hotplug defines for __INIT & __INITDATA

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=838c41184fee5e151c09972f2ba90c16493af614
Commit: 838c41184fee5e151c09972f2ba90c16493af614
Parent: 3bd2aad2103314a0a09614dc29926a1437db02f7
Author: Prarit Bhargava <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 01:41:43 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 08:54:00 2007 -0700

Remove cpu hotplug defines for __INIT & __INITDATA

After examining what was checked in and the code base I discovered that most
of 86c0baf123e474b6eb404798926ecf62b426bf3a wasn't necessary anymore

So here's a patch that reverts the last part of that changeset:

Revert part of 86c0baf123e474b6eb404798926ecf62b426bf3a.

The kernel has moved forward to a state where the original change is not
necessary.  After porting forward, this final version of the patch was
applied and broke non-x86 architectures.

Signed-off-by: Prarit Bhargava <[EMAIL PROTECTED]>
Cc: Russell King <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 include/linux/init.h |7 +--
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/include/linux/init.h b/include/linux/init.h
index 8bc32bb..e007ae4 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -52,14 +52,9 @@
 #endif
 
 /* For assembly routines */
-#ifdef CONFIG_HOTPLUG_CPU
-#define __INIT .section".text","ax"
-#define __INITDATA .section".data","aw"
-#else
 #define __INIT .section".init.text","ax"
-#define __INITDATA .section".init.data","aw"
-#endif
 #define __FINIT.previous
+#define __INITDATA .section".init.data","aw"
 
 #ifndef __ASSEMBLY__
 /*
-
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


i386: move common parts of smp into their own file

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=297d9c035edd04327fedc0d1da27c2b112b66fcc
Commit: 297d9c035edd04327fedc0d1da27c2b112b66fcc
Parent: 838c41184fee5e151c09972f2ba90c16493af614
Author: Jeremy Fitzhardinge <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 01:41:48 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 08:54:00 2007 -0700

i386: move common parts of smp into their own file

Several parts of kernel/smp.c and smpboot.c are generally useful for other
subarchitectures and paravirt_ops implementations, so make them available 
for
reuse.

Signed-off-by: Jeremy Fitzhardinge <[EMAIL PROTECTED]>
Acked-by: Chris Wright <[EMAIL PROTECTED]>
Cc: James Bottomley <[EMAIL PROTECTED]>
Cc: Eric W. Biederman <[EMAIL PROTECTED]>
Cc: Andi Kleen <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 arch/i386/kernel/Makefile|1 +
 arch/i386/kernel/smp.c   |   65 +++---
 arch/i386/kernel/smpboot.c   |   22 
 arch/i386/kernel/smpcommon.c |   79 ++
 include/asm-i386/processor.h |4 ++
 5 files changed, 90 insertions(+), 81 deletions(-)

diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile
index 91cff8d..06da59f 100644
--- a/arch/i386/kernel/Makefile
+++ b/arch/i386/kernel/Makefile
@@ -19,6 +19,7 @@ obj-$(CONFIG_X86_CPUID)   += cpuid.o
 obj-$(CONFIG_MICROCODE)+= microcode.o
 obj-$(CONFIG_APM)  += apm.o
 obj-$(CONFIG_X86_SMP)  += smp.o smpboot.o tsc_sync.o
+obj-$(CONFIG_SMP)  += smpcommon.o
 obj-$(CONFIG_X86_TRAMPOLINE)   += trampoline.o
 obj-$(CONFIG_X86_MPPARSE)  += mpparse.o
 obj-$(CONFIG_X86_LOCAL_APIC)   += apic.o nmi.o
diff --git a/arch/i386/kernel/smp.c b/arch/i386/kernel/smp.c
index 706bda7..c9a7c98 100644
--- a/arch/i386/kernel/smp.c
+++ b/arch/i386/kernel/smp.c
@@ -467,7 +467,7 @@ void flush_tlb_all(void)
  * it goes straight through and wastes no time serializing
  * anything. Worst case is that we lose a reschedule ...
  */
-void native_smp_send_reschedule(int cpu)
+static void native_smp_send_reschedule(int cpu)
 {
WARN_ON(cpu_is_offline(cpu));
send_IPI_mask(cpumask_of_cpu(cpu), RESCHEDULE_VECTOR);
@@ -546,9 +546,10 @@ static void __smp_call_function(void (*func) (void *info), 
void *info,
  * You must not call this function with disabled interrupts or from a
  * hardware interrupt handler or from a bottom half handler.
  */
-int native_smp_call_function_mask(cpumask_t mask,
- void (*func)(void *), void *info,
- int wait)
+static int
+native_smp_call_function_mask(cpumask_t mask,
+ void (*func)(void *), void *info,
+ int wait)
 {
struct call_data_struct data;
cpumask_t allbutself;
@@ -599,60 +600,6 @@ int native_smp_call_function_mask(cpumask_t mask,
return 0;
 }
 
-/**
- * smp_call_function(): Run a function on all other CPUs.
- * @func: The function to run. This must be fast and non-blocking.
- * @info: An arbitrary pointer to pass to the function.
- * @nonatomic: Unused.
- * @wait: If true, wait (atomically) until function has completed on other 
CPUs.
- *
- * Returns 0 on success, else a negative status code.
- *
- * If @wait is true, then returns once @func has returned; otherwise
- * it returns just before the target cpu calls @func.
- *
- * You must not call this function with disabled interrupts or from a
- * hardware interrupt handler or from a bottom half handler.
- */
-int smp_call_function(void (*func) (void *info), void *info, int nonatomic,
- int wait)
-{
-   return smp_call_function_mask(cpu_online_map, func, info, wait);
-}
-EXPORT_SYMBOL(smp_call_function);
-
-/**
- * smp_call_function_single - Run a function on another CPU
- * @cpu: The target CPU.  Cannot be the calling CPU.
- * @func: The function to run. This must be fast and non-blocking.
- * @info: An arbitrary pointer to pass to the function.
- * @nonatomic: Unused.
- * @wait: If true, wait until function has completed on other CPUs.
- *
- * Returns 0 on success, else a negative status code.
- *
- * If @wait is true, then returns once @func has returned; otherwise
- * it returns just before the target cpu calls @func.
- */
-int smp_call_function_single(int cpu, void (*func) (void *info), void *info,
-int nonatomic, int wait)
-{
-   /* prevent preemption and reschedule on another processor */
-   int ret;
-   int me = get_cpu();
-   if (cpu == me) {
-   WARN_ON(1);
-   put_cpu();
-   return -EBUSY;
-   }
-
-   ret = smp_call_function_mask(cpumask_of_cpu(cpu), func, info, wait);
-
-   put_cp

i386: fix voyager build

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6a3ee3d5529c5e66aedf91401bfac65c61998639
Commit: 6a3ee3d5529c5e66aedf91401bfac65c61998639
Parent: 297d9c035edd04327fedc0d1da27c2b112b66fcc
Author: Jeremy Fitzhardinge <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 01:41:59 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 08:54:01 2007 -0700

i386: fix voyager build

This adds an smp_ops for voyager, and hooks things up appropriately.  This 
is
the first baby-step to making subarch runtime switchable.

Signed-off-by: Jeremy Fitzhardinge <[EMAIL PROTECTED]>
Cc: James Bottomley <[EMAIL PROTECTED]>
Cc: Eric W. Biederman <[EMAIL PROTECTED]>
Cc: Andi Kleen <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 arch/i386/mach-voyager/voyager_smp.c |  106 +-
 1 files changed, 41 insertions(+), 65 deletions(-)

diff --git a/arch/i386/mach-voyager/voyager_smp.c 
b/arch/i386/mach-voyager/voyager_smp.c
index 50d9c52..b87f854 100644
--- a/arch/i386/mach-voyager/voyager_smp.c
+++ b/arch/i386/mach-voyager/voyager_smp.c
@@ -27,7 +27,6 @@
 #include 
 #include 
 #include 
-#include 
 
 /* TLB state -- visible externally, indexed physically */
 DEFINE_PER_CPU(struct tlb_state, cpu_tlbstate) cacheline_aligned = { 
&init_mm, 0 };
@@ -422,7 +421,7 @@ find_smp_config(void)
 VOYAGER_SUS_IN_CONTROL_PORT);
 
current_thread_info()->cpu = boot_cpu_id;
-   write_pda(cpu_number, boot_cpu_id);
+   x86_write_percpu(cpu_number, boot_cpu_id);
 }
 
 /*
@@ -435,7 +434,7 @@ smp_store_cpu_info(int id)
 
*c = boot_cpu_data;
 
-   identify_cpu(c);
+   identify_secondary_cpu(c);
 }
 
 /* set up the trampoline and return the physical address of the code */
@@ -459,7 +458,7 @@ start_secondary(void *unused)
/* external functions not defined in the headers */
extern void calibrate_delay(void);
 
-   secondary_cpu_init();
+   cpu_init();
 
/* OK, we're in the routine */
ack_CPI(VIC_CPU_BOOT_CPI);
@@ -572,7 +571,9 @@ do_boot_cpu(__u8 cpu)
/* init_tasks (in sched.c) is indexed logically */
stack_start.esp = (void *) idle->thread.esp;
 
-   init_gdt(cpu, idle);
+   init_gdt(cpu);
+   per_cpu(current_task, cpu) = idle;
+   early_gdt_descr.address = (unsigned long)get_cpu_gdt_table(cpu);
irq_ctx_init(cpu);
 
/* Note: Don't modify initial ss override */
@@ -859,8 +860,8 @@ smp_invalidate_interrupt(void)
 
 /* This routine is called with a physical cpu mask */
 static void
-flush_tlb_others (unsigned long cpumask, struct mm_struct *mm,
-   unsigned long va)
+voyager_flush_tlb_others (unsigned long cpumask, struct mm_struct *mm,
+ unsigned long va)
 {
int stuck = 5;
 
@@ -912,7 +913,7 @@ flush_tlb_current_task(void)
cpu_mask = cpus_addr(mm->cpu_vm_mask)[0] & ~(1 << smp_processor_id());
local_flush_tlb();
if (cpu_mask)
-   flush_tlb_others(cpu_mask, mm, FLUSH_ALL);
+   voyager_flush_tlb_others(cpu_mask, mm, FLUSH_ALL);
 
preempt_enable();
 }
@@ -934,7 +935,7 @@ flush_tlb_mm (struct mm_struct * mm)
leave_mm(smp_processor_id());
}
if (cpu_mask)
-   flush_tlb_others(cpu_mask, mm, FLUSH_ALL);
+   voyager_flush_tlb_others(cpu_mask, mm, FLUSH_ALL);
 
preempt_enable();
 }
@@ -955,7 +956,7 @@ void flush_tlb_page(struct vm_area_struct * vma, unsigned 
long va)
}
 
if (cpu_mask)
-   flush_tlb_others(cpu_mask, mm, va);
+   voyager_flush_tlb_others(cpu_mask, mm, va);
 
preempt_enable();
 }
@@ -1044,10 +1045,12 @@ smp_call_function_interrupt(void)
 }
 
 static int
-__smp_call_function_mask (void (*func) (void *info), void *info, int retry,
- int wait, __u32 mask)
+voyager_smp_call_function_mask (cpumask_t cpumask,
+   void (*func) (void *info), void *info,
+   int wait)
 {
struct call_data_struct data;
+   u32 mask = cpus_addr(cpumask)[0];
 
mask &= ~(1< The function to run. This must be fast and non-blocking.
- An arbitrary pointer to pass to the function.
- If true, keep retrying until ready.
- If true, wait until function has completed on other CPUs.
-[RETURNS] 0 on success, else a negative status code. Does not return until
-remote CPUs are nearly ready to execute <> or are or have executed.
-*/
-int
-smp_call_function(void (*func) (void *info), void *info, int retry,
-  int wait)
-{
-   __u32 mask = cpus_addr(cpu_online_map)[0];
-
-   return __smp_call_function_mask(func, info, retry, wait, mask);
-}
-EXPORT_SYMBOL(smp_

SLUB: CONFIG_LARGE_ALLOCS must consider MAX_ORDER limit

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cfbf07f2a80b618c42a42c20d83647ea8fcceca0
Commit: cfbf07f2a80b618c42a42c20d83647ea8fcceca0
Parent: 6a3ee3d5529c5e66aedf91401bfac65c61998639
Author: Christoph Lameter <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 01:42:06 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 08:54:01 2007 -0700

SLUB: CONFIG_LARGE_ALLOCS must consider MAX_ORDER limit

Take MAX_ORDER into consideration when determining KMALLOC_SHIFT_HIGH.
Otherwise we may run into a situation where we attempt to create general
slabs larger than MAX_ORDER.

Signed-off-by: Christoph Lameter <[EMAIL PROTECTED]>
Cc: "David S. Miller" <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 include/linux/slub_def.h |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index ea27065..fd6627e 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -60,7 +60,8 @@ struct kmem_cache {
 #define KMALLOC_SHIFT_LOW 3
 
 #ifdef CONFIG_LARGE_ALLOCS
-#define KMALLOC_SHIFT_HIGH 25
+#define KMALLOC_SHIFT_HIGH ((MAX_ORDER + PAGE_SHIFT) =< 25 ? \
+   (MAX_ORDER + PAGE_SHIFT - 1) : 25)
 #else
 #if !defined(CONFIG_MMU) || NR_CPUS > 512 || MAX_NUMNODES > 256
 #define KMALLOC_SHIFT_HIGH 20
@@ -87,6 +88,9 @@ static inline int kmalloc_index(int size)
 */
WARN_ON_ONCE(size == 0);
 
+   if (size >= (1 << KMALLOC_SHIFT_HIGH))
+   return -1;
+
if (size > 64 && size <= 96)
return 1;
if (size > 128 && size <= 192)
-
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


net: Trivial MLX4_DEBUG dependency fix.

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f550d94cf9f86bc54e31dae2aee1a03d678c6e7f
Commit: f550d94cf9f86bc54e31dae2aee1a03d678c6e7f
Parent: de5603748af8bf7deac403e6ba92887f8d18e812
Author: Paul Mundt <[EMAIL PROTECTED]>
AuthorDate: Thu May 10 12:50:28 2007 +0900
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Sun May 13 08:53:01 2007 -0700

net: Trivial MLX4_DEBUG dependency fix.

CONFIG_MLX4_DEBUG works out to a def_bool y for those that have
CONFIG_EMBEDDED set.  Make it depend on MLX4_CORE.

Signed-off-by: Paul Mundt <[EMAIL PROTECTED]>
Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/net/Kconfig |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index fa489b1..b3f4ffa 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2500,6 +2500,7 @@ config MLX4_CORE
 
 config MLX4_DEBUG
bool "Verbose debugging output" if (MLX4_CORE && EMBEDDED)
+   depends on MLX4_CORE
default y
---help---
  This option causes debugging code to be compiled into 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


mlx4_core: Remove unused doorbell_lock

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=20eebcf09c2d329e4dcdd765634c0a524195e16d
Commit: 20eebcf09c2d329e4dcdd765634c0a524195e16d
Parent: f550d94cf9f86bc54e31dae2aee1a03d678c6e7f
Author: Roland Dreier <[EMAIL PROTECTED]>
AuthorDate: Sun May 13 08:54:18 2007 -0700
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Sun May 13 08:54:18 2007 -0700

mlx4_core: Remove unused doorbell_lock

struct mlx4_priv.doorbell_lock is never used, so delete it.

Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/net/mlx4/main.c |2 --
 drivers/net/mlx4/mlx4.h |1 -
 2 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c
index 4debb02..20b8c0d 100644
--- a/drivers/net/mlx4/main.c
+++ b/drivers/net/mlx4/main.c
@@ -542,8 +542,6 @@ static int __devinit mlx4_setup_hca(struct mlx4_dev *dev)
struct mlx4_priv *priv = mlx4_priv(dev);
int err;
 
-   MLX4_INIT_DOORBELL_LOCK(&priv->doorbell_lock);
-
err = mlx4_init_uar_table(dev);
if (err) {
mlx4_err(dev, "Failed to initialize "
diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h
index 9befbae..3d3b6d2 100644
--- a/drivers/net/mlx4/mlx4.h
+++ b/drivers/net/mlx4/mlx4.h
@@ -275,7 +275,6 @@ struct mlx4_priv {
 
struct mlx4_uar driver_uar;
void __iomem   *kar;
-   MLX4_DECLARE_DOORBELL_LOCK(doorbell_lock)
 
u32 rev_id;
charboard_id[MLX4_BOARD_ID_LEN];
-
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


IB/mlx4: Fix uninitialized spinlock for 32-bit archs

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=26c6bc7b812b4157ba929035e467c0f4dd165916
Commit: 26c6bc7b812b4157ba929035e467c0f4dd165916
Parent: 20eebcf09c2d329e4dcdd765634c0a524195e16d
Author: Jack Morgenstein <[EMAIL PROTECTED]>
AuthorDate: Sun May 13 17:18:23 2007 +0300
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Mon May 14 13:02:58 2007 -0700

IB/mlx4: Fix uninitialized spinlock for 32-bit archs

uar_lock spinlock was used in mlx4_ib_cq_arm without being initialized
(this only affects 32-bit archs, because uar_lock is not used on
64-bit archs and MLX4_INIT_DOORBELL_LOCK() is a NOP).

Signed-off-by: Jack Morgenstein <[EMAIL PROTECTED]>
Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/mlx4/main.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/main.c 
b/drivers/infiniband/hw/mlx4/main.c
index 688ecb4..402f3a2 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -489,6 +489,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
ibdev->uar_map = ioremap(ibdev->priv_uar.pfn << PAGE_SHIFT, PAGE_SIZE);
if (!ibdev->uar_map)
goto err_uar;
+   MLX4_INIT_DOORBELL_LOCK(&ibdev->uar_lock);
 
INIT_LIST_HEAD(&ibdev->pgdir_list);
mutex_init(&ibdev->pgdir_mutex);
-
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


IB/ipath: Shadow the gpio_mask register

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8f140b407f3be04e7202be9aa0cfef3006d14c9f
Commit: 8f140b407f3be04e7202be9aa0cfef3006d14c9f
Parent: 26c6bc7b812b4157ba929035e467c0f4dd165916
Author: Arthur Jones <[EMAIL PROTECTED]>
AuthorDate: Thu May 10 12:10:49 2007 -0700
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Mon May 14 13:22:42 2007 -0700

IB/ipath: Shadow the gpio_mask register

Once upon a time, GPIO interrupts were rare.  But then a chip bug in
the waldo series forced the use of a GPIO interrupt to signal packet
reception.  This greatly increased the frequency of GPIO interrupts
which have the gpio_mask bits set on the waldo chips.  Other bits in
the gpio_status register are used for I2C clock and data lines, these
bits are usually on.  An "unlikely" annotation leftover from the old
days was improperly applied to these bits, and an unnecessary chip
mmio read was being accessed in the interrupt fast path on waldo.

Remove the stagnant unlikely annotation in the interrupt handler and
keep a shadow copy of the gpio_mask register to avoid the slow mmio
read when testing for interruptable GPIO bits.

Signed-off-by: Arthur Jones <[EMAIL PROTECTED]>
Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/ipath/ipath_iba6120.c |7 +++
 drivers/infiniband/hw/ipath/ipath_intr.c|7 +++
 drivers/infiniband/hw/ipath/ipath_kernel.h  |2 ++
 drivers/infiniband/hw/ipath/ipath_verbs.c   |   12 ++--
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/infiniband/hw/ipath/ipath_iba6120.c 
b/drivers/infiniband/hw/ipath/ipath_iba6120.c
index 1b9c308..4e2e3df 100644
--- a/drivers/infiniband/hw/ipath/ipath_iba6120.c
+++ b/drivers/infiniband/hw/ipath/ipath_iba6120.c
@@ -747,7 +747,6 @@ static void ipath_pe_quiet_serdes(struct ipath_devdata *dd)
 
 static int ipath_pe_intconfig(struct ipath_devdata *dd)
 {
-   u64 val;
u32 chiprev;
 
/*
@@ -760,9 +759,9 @@ static int ipath_pe_intconfig(struct ipath_devdata *dd)
if ((chiprev & INFINIPATH_R_CHIPREVMINOR_MASK) > 1) {
/* Rev2+ reports extra errors via internal GPIO pins */
dd->ipath_flags |= IPATH_GPIO_ERRINTRS;
-   val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_gpio_mask);
-   val |= IPATH_GPIO_ERRINTR_MASK;
-   ipath_write_kreg( dd, dd->ipath_kregs->kr_gpio_mask, val);
+   dd->ipath_gpio_mask |= IPATH_GPIO_ERRINTR_MASK;
+   ipath_write_kreg(dd, dd->ipath_kregs->kr_gpio_mask,
+dd->ipath_gpio_mask);
}
return 0;
 }
diff --git a/drivers/infiniband/hw/ipath/ipath_intr.c 
b/drivers/infiniband/hw/ipath/ipath_intr.c
index 45d0331..a90d3b5 100644
--- a/drivers/infiniband/hw/ipath/ipath_intr.c
+++ b/drivers/infiniband/hw/ipath/ipath_intr.c
@@ -1056,7 +1056,7 @@ irqreturn_t ipath_intr(int irq, void *data)
gpiostatus &= ~(1 << IPATH_GPIO_PORT0_BIT);
chk0rcv = 1;
}
-   if (unlikely(gpiostatus)) {
+   if (gpiostatus) {
/*
 * Some unexpected bits remain. If they could have
 * caused the interrupt, complain and clear.
@@ -1065,9 +1065,8 @@ irqreturn_t ipath_intr(int irq, void *data)
 * GPIO interrupts, possibly on a "three strikes"
 * basis.
 */
-   u32 mask;
-   mask = ipath_read_kreg32(
-   dd, dd->ipath_kregs->kr_gpio_mask);
+   const u32 mask = (u32) dd->ipath_gpio_mask;
+
if (mask & gpiostatus) {
ipath_dbg("Unexpected GPIO IRQ bits %x\n",
  gpiostatus & mask);
diff --git a/drivers/infiniband/hw/ipath/ipath_kernel.h 
b/drivers/infiniband/hw/ipath/ipath_kernel.h
index e900c25..12194f3 100644
--- a/drivers/infiniband/hw/ipath/ipath_kernel.h
+++ b/drivers/infiniband/hw/ipath/ipath_kernel.h
@@ -397,6 +397,8 @@ struct ipath_devdata {
unsigned long ipath_pioavailshadow[8];
/* shadow of kr_gpio_out, for rmw ops */
u64 ipath_gpio_out;
+   /* shadow the gpio mask register */
+   u64 ipath_gpio_mask;
/* kr_revision shadow */
u64 ipath_revision;
/*
diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.c 
b/drivers/infiniband/hw/ipath/ipath_verbs.c
index 12933e7..bb70845 100644
--- a/drivers/infiniband/hw/ipath/ipath_verbs.c
+++ b/drivers/infiniband/hw/ipath/ipath_verbs.c
@@ -1387,13 +1387,12 @@ static int enable_timer(struct ipath_devdata *dd)
 * processing.
 */
if (dd->ipath_flags & IPATH_GPIO_INTR) {
-   u64 val;
ipath_

IB/ehca: Serialize hypervisor calls in ehca_register_mr()

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5d88278e3bdb6f2e4ed43306659e930ecd715f0c
Commit: 5d88278e3bdb6f2e4ed43306659e930ecd715f0c
Parent: 8f140b407f3be04e7202be9aa0cfef3006d14c9f
Author: Stefan Roscher <[EMAIL PROTECTED]>
AuthorDate: Wed May 9 13:47:56 2007 +0200
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Mon May 14 13:38:11 2007 -0700

IB/ehca: Serialize hypervisor calls in ehca_register_mr()

Some pSeries hypervisor versions show a race condition in the allocate
MR hCall.  Serialize this call per adapter to circumvent this problem.

Signed-off-by: Joachim Fenkes <[EMAIL PROTECTED]>
Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/ehca/ehca_classes.h |1 +
 drivers/infiniband/hw/ehca/ehca_main.c|2 ++
 drivers/infiniband/hw/ehca/hcp_if.c   |   13 +++--
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/ehca/ehca_classes.h 
b/drivers/infiniband/hw/ehca/ehca_classes.h
index f64d42b..1d286d3 100644
--- a/drivers/infiniband/hw/ehca/ehca_classes.h
+++ b/drivers/infiniband/hw/ehca/ehca_classes.h
@@ -277,6 +277,7 @@ void ehca_cleanup_mrmw_cache(void);
 
 extern spinlock_t ehca_qp_idr_lock;
 extern spinlock_t ehca_cq_idr_lock;
+extern spinlock_t hcall_lock;
 extern struct idr ehca_qp_idr;
 extern struct idr ehca_cq_idr;
 
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c 
b/drivers/infiniband/hw/ehca/ehca_main.c
index fe90e74..b917cc1 100644
--- a/drivers/infiniband/hw/ehca/ehca_main.c
+++ b/drivers/infiniband/hw/ehca/ehca_main.c
@@ -98,6 +98,7 @@ MODULE_PARM_DESC(scaling_code,
 
 spinlock_t ehca_qp_idr_lock;
 spinlock_t ehca_cq_idr_lock;
+spinlock_t hcall_lock;
 DEFINE_IDR(ehca_qp_idr);
 DEFINE_IDR(ehca_cq_idr);
 
@@ -817,6 +818,7 @@ int __init ehca_module_init(void)
idr_init(&ehca_cq_idr);
spin_lock_init(&ehca_qp_idr_lock);
spin_lock_init(&ehca_cq_idr_lock);
+   spin_lock_init(&hcall_lock);
 
INIT_LIST_HEAD(&shca_list);
spin_lock_init(&shca_list_lock);
diff --git a/drivers/infiniband/hw/ehca/hcp_if.c 
b/drivers/infiniband/hw/ehca/hcp_if.c
index b564fcd..7f0beec 100644
--- a/drivers/infiniband/hw/ehca/hcp_if.c
+++ b/drivers/infiniband/hw/ehca/hcp_if.c
@@ -154,7 +154,8 @@ static long ehca_plpar_hcall9(unsigned long opcode,
  unsigned long arg9)
 {
long ret;
-   int i, sleep_msecs;
+   int i, sleep_msecs, lock_is_set = 0;
+   unsigned long flags;
 
ehca_gen_dbg("opcode=%lx arg1=%lx arg2=%lx arg3=%lx arg4=%lx "
 "arg5=%lx arg6=%lx arg7=%lx arg8=%lx arg9=%lx",
@@ -162,10 +163,18 @@ static long ehca_plpar_hcall9(unsigned long opcode,
 arg8, arg9);
 
for (i = 0; i < 5; i++) {
+   if ((opcode == H_ALLOC_RESOURCE) && (arg2 == 5)) {
+   spin_lock_irqsave(&hcall_lock, flags);
+   lock_is_set = 1;
+   }
+
ret = plpar_hcall9(opcode, outs,
   arg1, arg2, arg3, arg4, arg5,
   arg6, arg7, arg8, arg9);
 
+   if (lock_is_set)
+   spin_unlock_irqrestore(&hcall_lock, flags);
+
if (H_IS_LONG_BUSY(ret)) {
sleep_msecs = get_longbusy_msecs(ret);
msleep_interruptible(sleep_msecs);
@@ -193,11 +202,11 @@ static long ehca_plpar_hcall9(unsigned long opcode,
 opcode, ret, outs[0], outs[1], outs[2], outs[3],
 outs[4], outs[5], outs[6], outs[7], outs[8]);
return ret;
-
}
 
return H_BUSY;
 }
+
 u64 hipz_h_alloc_resource_eq(const struct ipz_adapter_handle adapter_handle,
 struct ehca_pfeq *pfeq,
 const u32 neq_control,
-
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


IB/ehca: Correctly set GRH mask bit in ehca_modify_qp()

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=92761cdaf215599a1bd81d383facb32adabfa620
Commit: 92761cdaf215599a1bd81d383facb32adabfa620
Parent: 5d88278e3bdb6f2e4ed43306659e930ecd715f0c
Author: Joachim Fenkes <[EMAIL PROTECTED]>
AuthorDate: Wed May 9 13:48:01 2007 +0200
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Mon May 14 13:38:57 2007 -0700

IB/ehca: Correctly set GRH mask bit in ehca_modify_qp()

The driver needs to always supply the "GRH present" flag to the
hypervisor, whether it's true or false. Not supplying it (i.e. not
setting the corresponding mask bit) amounts to a "perhaps", which we
don't want.

Signed-off-by: Joachim Fenkes <[EMAIL PROTECTED]>
Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/ehca/ehca_qp.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/hw/ehca/ehca_qp.c 
b/drivers/infiniband/hw/ehca/ehca_qp.c
index df0516f..e21d796 100644
--- a/drivers/infiniband/hw/ehca/ehca_qp.c
+++ b/drivers/infiniband/hw/ehca/ehca_qp.c
@@ -968,17 +968,21 @@ static int internal_modify_qp(struct ib_qp *ibqp,
((ehca_mult - 1) / ah_mult) : 0;
else
mqpcb->max_static_rate = 0;
-
update_mask |= EHCA_BMASK_SET(MQPCB_MASK_MAX_STATIC_RATE, 1);
 
/*
+* Always supply the GRH flag, even if it's zero, to give the
+* hypervisor a clear "yes" or "no" instead of a "perhaps"
+*/
+   update_mask |= EHCA_BMASK_SET(MQPCB_MASK_SEND_GRH_FLAG, 1);
+
+   /*
 * only if GRH is TRUE we might consider SOURCE_GID_IDX
 * and DEST_GID otherwise phype will return H_ATTR_PARM!!!
 */
if (attr->ah_attr.ah_flags == IB_AH_GRH) {
-   mqpcb->send_grh_flag = 1 << 31;
-   update_mask |=
-   EHCA_BMASK_SET(MQPCB_MASK_SEND_GRH_FLAG, 1);
+   mqpcb->send_grh_flag = 1;
+
mqpcb->source_gid_idx = attr->ah_attr.grh.sgid_index;
update_mask |=
EHCA_BMASK_SET(MQPCB_MASK_SOURCE_GID_IDX, 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


IB/ehca: Fix AQP0/1 QP number

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c55a0ddd8ebdd657224449c2fbfcd427e054c8cc
Commit: c55a0ddd8ebdd657224449c2fbfcd427e054c8cc
Parent: 92761cdaf215599a1bd81d383facb32adabfa620
Author: Hoang-Nam Nguyen <[EMAIL PROTECTED]>
AuthorDate: Wed May 9 13:48:11 2007 +0200
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Mon May 14 13:39:31 2007 -0700

IB/ehca: Fix AQP0/1 QP number

AQP0/1 should report qp_num={0|1} and the actual QP# should be stored
in struct ehca_qp, not the other way round.

Signed-off-by: Joachim Fenkes <[EMAIL PROTECTED]>
Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/ehca/ehca_qp.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/ehca/ehca_qp.c 
b/drivers/infiniband/hw/ehca/ehca_qp.c
index e21d796..b5bc787 100644
--- a/drivers/infiniband/hw/ehca/ehca_qp.c
+++ b/drivers/infiniband/hw/ehca/ehca_qp.c
@@ -523,6 +523,8 @@ struct ib_qp *ehca_create_qp(struct ib_pd *pd,
goto create_qp_exit1;
}
 
+   my_qp->ib_qp.qp_num = my_qp->real_qp_num;
+
switch (init_attr->qp_type) {
case IB_QPT_RC:
if (isdaqp == 0) {
@@ -568,7 +570,7 @@ struct ib_qp *ehca_create_qp(struct ib_pd *pd,
parms.act_nr_recv_wqes = init_attr->cap.max_recv_wr;
parms.act_nr_send_sges = init_attr->cap.max_send_sge;
parms.act_nr_recv_sges = init_attr->cap.max_recv_sge;
-   my_qp->real_qp_num =
+   my_qp->ib_qp.qp_num =
(init_attr->qp_type == IB_QPT_SMI) ? 0 : 1;
}
 
@@ -595,7 +597,6 @@ struct ib_qp *ehca_create_qp(struct ib_pd *pd,
my_qp->ib_qp.recv_cq = init_attr->recv_cq;
my_qp->ib_qp.send_cq = init_attr->send_cq;
 
-   my_qp->ib_qp.qp_num = my_qp->real_qp_num;
my_qp->ib_qp.qp_type = init_attr->qp_type;
 
my_qp->qp_type = init_attr->qp_type;
-
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


IB/ehca: Remove _irqsave, move #ifdef

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c7a14939e78e75dd90b54cb0df371019bc6d3e89
Commit: c7a14939e78e75dd90b54cb0df371019bc6d3e89
Parent: c55a0ddd8ebdd657224449c2fbfcd427e054c8cc
Author: Joachim Fenkes <[EMAIL PROTECTED]>
AuthorDate: Wed May 9 13:48:20 2007 +0200
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Mon May 14 13:40:05 2007 -0700

IB/ehca: Remove _irqsave, move #ifdef

- In ehca_process_eq(), we're IRQ safe throughout the whole function, so we
  don't need another _irqsave in the middle of flight.

- take_over_work() is only called by comp_pool_callback(), so it can move
  into the same #ifdef block.

Signed-off-by: Joachim Fenkes <[EMAIL PROTECTED]>
Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/ehca/ehca_irq.c |7 +++
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c 
b/drivers/infiniband/hw/ehca/ehca_irq.c
index 82dda2f..100329b 100644
--- a/drivers/infiniband/hw/ehca/ehca_irq.c
+++ b/drivers/infiniband/hw/ehca/ehca_irq.c
@@ -517,12 +517,11 @@ void ehca_process_eq(struct ehca_shca *shca, int is_irq)
else {
struct ehca_cq *cq = eq->eqe_cache[i].cq;
comp_event_callback(cq);
-   spin_lock_irqsave(&ehca_cq_idr_lock, flags);
+   spin_lock(&ehca_cq_idr_lock);
cq->nr_events--;
if (!cq->nr_events)
wake_up(&cq->wait_completion);
-   spin_unlock_irqrestore(&ehca_cq_idr_lock,
-  flags);
+   spin_unlock(&ehca_cq_idr_lock);
}
} else {
ehca_dbg(&shca->ib_device, "Got non completion event");
@@ -711,6 +710,7 @@ static void destroy_comp_task(struct ehca_comp_pool *pool,
kthread_stop(task);
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
 static void take_over_work(struct ehca_comp_pool *pool,
   int cpu)
 {
@@ -735,7 +735,6 @@ static void take_over_work(struct ehca_comp_pool *pool,
 
 }
 
-#ifdef CONFIG_HOTPLUG_CPU
 static int comp_pool_callback(struct notifier_block *nfb,
  unsigned long action,
  void *hcpu)
-
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


IB/ehca: Beautify sysfs attribute code and fix compiler warnings

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bba9b6013e604fadb298191c058149acf1cdfced
Commit: bba9b6013e604fadb298191c058149acf1cdfced
Parent: c7a14939e78e75dd90b54cb0df371019bc6d3e89
Author: Joachim Fenkes <[EMAIL PROTECTED]>
AuthorDate: Wed May 9 13:48:25 2007 +0200
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Mon May 14 13:40:45 2007 -0700

IB/ehca: Beautify sysfs attribute code and fix compiler warnings

eHCA's sysfs attributes are now being created via sysfs_create_group(),
making the process neatly table-driven. The return value is checked, thus
fixing a few compiler warnings.

Signed-off-by: Joachim Fenkes <[EMAIL PROTECTED]>
Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/ehca/ehca_main.c |   86 ++--
 1 files changed, 37 insertions(+), 49 deletions(-)

diff --git a/drivers/infiniband/hw/ehca/ehca_main.c 
b/drivers/infiniband/hw/ehca/ehca_main.c
index b917cc1..7d276e0 100644
--- a/drivers/infiniband/hw/ehca/ehca_main.c
+++ b/drivers/infiniband/hw/ehca/ehca_main.c
@@ -454,15 +454,14 @@ static ssize_t ehca_store_debug_level(struct 
device_driver *ddp,
 DRIVER_ATTR(debug_level, S_IRUSR | S_IWUSR,
ehca_show_debug_level, ehca_store_debug_level);
 
-void ehca_create_driver_sysfs(struct ibmebus_driver *drv)
-{
-   driver_create_file(&drv->driver, &driver_attr_debug_level);
-}
+static struct attribute *ehca_drv_attrs[] = {
+   &driver_attr_debug_level.attr,
+   NULL
+};
 
-void ehca_remove_driver_sysfs(struct ibmebus_driver *drv)
-{
-   driver_remove_file(&drv->driver, &driver_attr_debug_level);
-}
+static struct attribute_group ehca_drv_attr_grp = {
+   .attrs = ehca_drv_attrs
+};
 
 #define EHCA_RESOURCE_ATTR(name)   \
 static ssize_t  ehca_show_##name(struct device *dev,   \
@@ -524,44 +523,28 @@ static ssize_t ehca_show_adapter_handle(struct device 
*dev,
 }
 static DEVICE_ATTR(adapter_handle, S_IRUGO, ehca_show_adapter_handle, NULL);
 
+static struct attribute *ehca_dev_attrs[] = {
+   &dev_attr_adapter_handle.attr,
+   &dev_attr_num_ports.attr,
+   &dev_attr_hw_ver.attr,
+   &dev_attr_max_eq.attr,
+   &dev_attr_cur_eq.attr,
+   &dev_attr_max_cq.attr,
+   &dev_attr_cur_cq.attr,
+   &dev_attr_max_qp.attr,
+   &dev_attr_cur_qp.attr,
+   &dev_attr_max_mr.attr,
+   &dev_attr_cur_mr.attr,
+   &dev_attr_max_mw.attr,
+   &dev_attr_cur_mw.attr,
+   &dev_attr_max_pd.attr,
+   &dev_attr_max_ah.attr,
+   NULL
+};
 
-void ehca_create_device_sysfs(struct ibmebus_dev *dev)
-{
-   device_create_file(&dev->ofdev.dev, &dev_attr_adapter_handle);
-   device_create_file(&dev->ofdev.dev, &dev_attr_num_ports);
-   device_create_file(&dev->ofdev.dev, &dev_attr_hw_ver);
-   device_create_file(&dev->ofdev.dev, &dev_attr_max_eq);
-   device_create_file(&dev->ofdev.dev, &dev_attr_cur_eq);
-   device_create_file(&dev->ofdev.dev, &dev_attr_max_cq);
-   device_create_file(&dev->ofdev.dev, &dev_attr_cur_cq);
-   device_create_file(&dev->ofdev.dev, &dev_attr_max_qp);
-   device_create_file(&dev->ofdev.dev, &dev_attr_cur_qp);
-   device_create_file(&dev->ofdev.dev, &dev_attr_max_mr);
-   device_create_file(&dev->ofdev.dev, &dev_attr_cur_mr);
-   device_create_file(&dev->ofdev.dev, &dev_attr_max_mw);
-   device_create_file(&dev->ofdev.dev, &dev_attr_cur_mw);
-   device_create_file(&dev->ofdev.dev, &dev_attr_max_pd);
-   device_create_file(&dev->ofdev.dev, &dev_attr_max_ah);
-}
-
-void ehca_remove_device_sysfs(struct ibmebus_dev *dev)
-{
-   device_remove_file(&dev->ofdev.dev, &dev_attr_adapter_handle);
-   device_remove_file(&dev->ofdev.dev, &dev_attr_num_ports);
-   device_remove_file(&dev->ofdev.dev, &dev_attr_hw_ver);
-   device_remove_file(&dev->ofdev.dev, &dev_attr_max_eq);
-   device_remove_file(&dev->ofdev.dev, &dev_attr_cur_eq);
-   device_remove_file(&dev->ofdev.dev, &dev_attr_max_cq);
-   device_remove_file(&dev->ofdev.dev, &dev_attr_cur_cq);
-   device_remove_file(&dev->ofdev.dev, &dev_attr_max_qp);
-   device_remove_file(&dev->ofdev.dev, &dev_attr_cur_qp);
-   device_remove_file(&dev->ofdev.dev, &dev_attr_max_mr);
-   device_remove_file(&dev->ofdev.dev, &dev_attr_cur_mr);
-   device_remove_file(&dev->ofdev.dev, &dev_attr_max_mw);
-   device_remove_file(&dev->ofdev.dev, &dev_attr_cur_mw);
-   device_remove_file(&dev->ofdev.dev, &dev_attr_max_pd);
-   device_remove_file(&dev->ofdev.dev, &dev_attr_max_ah);
-}
+static struct attribute_group ehca_dev_attr_grp = {
+   .attrs = ehca_dev_attrs
+};
 
 static int __devinit ehca_probe(struct ibmebus_dev *dev,
const struct of_device_id *id)
@@ -669,7 +652,10 @@ static int __devinit ehca_probe(struct ibmebus_dev *dev,

IB/ehca: Disable scaling code by default, bump version number

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4e430dcb7b132a4076e533a9d69907acecbe71be
Commit: 4e430dcb7b132a4076e533a9d69907acecbe71be
Parent: bba9b6013e604fadb298191c058149acf1cdfced
Author: Joachim Fenkes <[EMAIL PROTECTED]>
AuthorDate: Wed May 9 13:48:31 2007 +0200
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Mon May 14 13:41:40 2007 -0700

IB/ehca: Disable scaling code by default, bump version number

- Scaling code is still considered experimental, so disable it by default
- Increase version to SVNEHCA_0023

Signed-off-by: Joachim Fenkes <[EMAIL PROTECTED]>
Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/ehca/ehca_main.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/hw/ehca/ehca_main.c 
b/drivers/infiniband/hw/ehca/ehca_main.c
index 7d276e0..c3f99f3 100644
--- a/drivers/infiniband/hw/ehca/ehca_main.c
+++ b/drivers/infiniband/hw/ehca/ehca_main.c
@@ -52,7 +52,7 @@
 MODULE_LICENSE("Dual BSD/GPL");
 MODULE_AUTHOR("Christoph Raisch <[EMAIL PROTECTED]>");
 MODULE_DESCRIPTION("IBM eServer HCA InfiniBand Device Driver");
-MODULE_VERSION("SVNEHCA_0022");
+MODULE_VERSION("SVNEHCA_0023");
 
 int ehca_open_aqp1 = 0;
 int ehca_debug_level   = 0;
@@ -62,7 +62,7 @@ int ehca_use_hp_mr = 0;
 int ehca_port_act_time = 30;
 int ehca_poll_all_eqs  = 1;
 int ehca_static_rate   = -1;
-int ehca_scaling_code  = 1;
+int ehca_scaling_code  = 0;
 
 module_param_named(open_aqp1, ehca_open_aqp1, int, 0);
 module_param_named(debug_level,   ehca_debug_level,   int, 0);
@@ -799,7 +799,7 @@ int __init ehca_module_init(void)
int ret;
 
printk(KERN_INFO "eHCA Infiniband Device Driver "
-  "(Rel.: SVNEHCA_0022)\n");
+  "(Rel.: SVNEHCA_0023)\n");
idr_init(&ehca_qp_idr);
idr_init(&ehca_cq_idr);
spin_lock_init(&ehca_qp_idr_lock);
-
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


RDMA/cma: Simplify device removal handling code

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8aa08602bdd617a9cdd147f19076a8c8a70e03ef
Commit: 8aa08602bdd617a9cdd147f19076a8c8a70e03ef
Parent: 4e430dcb7b132a4076e533a9d69907acecbe71be
Author: Sean Hefty <[EMAIL PROTECTED]>
AuthorDate: Mon May 7 11:49:00 2007 -0700
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Mon May 14 13:54:49 2007 -0700

RDMA/cma: Simplify device removal handling code

Add a new routine and rename another to encapsulate common code for
synchronizing with device removal.

Signed-off-by: Sean Hefty <[EMAIL PROTECTED]>
Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/core/cma.c |   89 ++---
 1 files changed, 48 insertions(+), 41 deletions(-)

diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index fde92ce..d026764 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -346,7 +346,23 @@ static void cma_deref_id(struct rdma_id_private *id_priv)
complete(&id_priv->comp);
 }
 
-static void cma_release_remove(struct rdma_id_private *id_priv)
+static int cma_disable_remove(struct rdma_id_private *id_priv,
+ enum cma_state state)
+{
+   unsigned long flags;
+   int ret;
+
+   spin_lock_irqsave(&id_priv->lock, flags);
+   if (id_priv->state == state) {
+   atomic_inc(&id_priv->dev_remove);
+   ret = 0;
+   } else
+   ret = -EINVAL;
+   spin_unlock_irqrestore(&id_priv->lock, flags);
+   return ret;
+}
+
+static void cma_enable_remove(struct rdma_id_private *id_priv)
 {
if (atomic_dec_and_test(&id_priv->dev_remove))
wake_up(&id_priv->wait_remove);
@@ -884,9 +900,8 @@ static int cma_ib_handler(struct ib_cm_id *cm_id, struct 
ib_cm_event *ib_event)
struct rdma_cm_event event;
int ret = 0;
 
-   atomic_inc(&id_priv->dev_remove);
-   if (!cma_comp(id_priv, CMA_CONNECT))
-   goto out;
+   if (cma_disable_remove(id_priv, CMA_CONNECT))
+   return 0;
 
memset(&event, 0, sizeof event);
switch (ib_event->event) {
@@ -942,12 +957,12 @@ static int cma_ib_handler(struct ib_cm_id *cm_id, struct 
ib_cm_event *ib_event)
/* Destroy the CM ID by returning a non-zero value. */
id_priv->cm_id.ib = NULL;
cma_exch(id_priv, CMA_DESTROYING);
-   cma_release_remove(id_priv);
+   cma_enable_remove(id_priv);
rdma_destroy_id(&id_priv->id);
return ret;
}
 out:
-   cma_release_remove(id_priv);
+   cma_enable_remove(id_priv);
return ret;
 }
 
@@ -1057,11 +1072,8 @@ static int cma_req_handler(struct ib_cm_id *cm_id, 
struct ib_cm_event *ib_event)
int offset, ret;
 
listen_id = cm_id->context;
-   atomic_inc(&listen_id->dev_remove);
-   if (!cma_comp(listen_id, CMA_LISTEN)) {
-   ret = -ECONNABORTED;
-   goto out;
-   }
+   if (cma_disable_remove(listen_id, CMA_LISTEN))
+   return -ECONNABORTED;
 
memset(&event, 0, sizeof event);
offset = cma_user_data_offset(listen_id->id.ps);
@@ -1101,11 +1113,11 @@ static int cma_req_handler(struct ib_cm_id *cm_id, 
struct ib_cm_event *ib_event)
 
 release_conn_id:
cma_exch(conn_id, CMA_DESTROYING);
-   cma_release_remove(conn_id);
+   cma_enable_remove(conn_id);
rdma_destroy_id(&conn_id->id);
 
 out:
-   cma_release_remove(listen_id);
+   cma_enable_remove(listen_id);
return ret;
 }
 
@@ -1214,12 +1226,12 @@ static int cma_iw_handler(struct iw_cm_id *iw_id, 
struct iw_cm_event *iw_event)
/* Destroy the CM ID by returning a non-zero value. */
id_priv->cm_id.iw = NULL;
cma_exch(id_priv, CMA_DESTROYING);
-   cma_release_remove(id_priv);
+   cma_enable_remove(id_priv);
rdma_destroy_id(&id_priv->id);
return ret;
}
 
-   cma_release_remove(id_priv);
+   cma_enable_remove(id_priv);
return ret;
 }
 
@@ -1234,11 +1246,8 @@ static int iw_conn_req_handler(struct iw_cm_id *cm_id,
int ret;
 
listen_id = cm_id->context;
-   atomic_inc(&listen_id->dev_remove);
-   if (!cma_comp(listen_id, CMA_LISTEN)) {
-   ret = -ECONNABORTED;
-   goto out;
-   }
+   if (cma_disable_remove(listen_id, CMA_LISTEN))
+   return -ECONNABORTED;
 
/* Create a new RDMA id for the new IW CM ID */
new_cm_id = rdma_create_id(listen_id->id.event_handler,
@@ -1255,13 +1264,13 @@ static int iw_conn_req_handler(struct iw_cm_id *cm_id,
dev = ip_dev_find(iw_event->local_addr.sin_addr.s_addr);
if (!dev) {
ret = -EADDRNOTAVAIL;
-   cma_relea

RDMA/cma: Fix synchronization with device removal in cma_iw_handler

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=be65f086f2a50c478b2f5ecf4c55a52a4e95059a
Commit: be65f086f2a50c478b2f5ecf4c55a52a4e95059a
Parent: 8aa08602bdd617a9cdd147f19076a8c8a70e03ef
Author: Sean Hefty <[EMAIL PROTECTED]>
AuthorDate: Mon May 7 11:49:12 2007 -0700
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Mon May 14 13:56:32 2007 -0700

RDMA/cma: Fix synchronization with device removal in cma_iw_handler

The cma_iw_handler needs to validate the state of the rdma_cm_id before
processing a new connection request to ensure that a device removal is
not already being processed for the same rdma_cm_id.  Without the state
check, the user can receive simultaneous callbacks for the same cm_id, or
a callback after they've destroyed the cm_id.

Signed-off-by: Sean Hefty <[EMAIL PROTECTED]>
Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/core/cma.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index d026764..cfd57b4 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -1183,9 +1183,10 @@ static int cma_iw_handler(struct iw_cm_id *iw_id, struct 
iw_cm_event *iw_event)
struct sockaddr_in *sin;
int ret = 0;
 
-   memset(&event, 0, sizeof event);
-   atomic_inc(&id_priv->dev_remove);
+   if (cma_disable_remove(id_priv, CMA_CONNECT))
+   return 0;
 
+   memset(&event, 0, sizeof event);
switch (iw_event->event) {
case IW_CM_EVENT_CLOSE:
event.event = RDMA_CM_EVENT_DISCONNECTED;
-
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


RDMA/cma: Add check to validate that cm_id is bound to a device

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6c719f5c6c823901fac2d46b83db5a69ba7e9152
Commit: 6c719f5c6c823901fac2d46b83db5a69ba7e9152
Parent: be65f086f2a50c478b2f5ecf4c55a52a4e95059a
Author: Sean Hefty <[EMAIL PROTECTED]>
AuthorDate: Mon May 7 11:49:27 2007 -0700
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Mon May 14 14:10:32 2007 -0700

RDMA/cma: Add check to validate that cm_id is bound to a device

Several checks in the rdma_cm check against the state of the
cm_id, but only to validate that the cm_id is bound to an underlying
transport specific CM and an RDMA device.  Make the check explicit
in what we're trying to check for, since we're not synchronizing
against the cm_id state.

This will allow a user to disconnect a cm_id or reject a connection
after receiving a device removal event.

Signed-off-by: Sean Hefty <[EMAIL PROTECTED]>
Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/core/cma.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index cfd57b4..2eb52b7 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -368,6 +368,11 @@ static void cma_enable_remove(struct rdma_id_private 
*id_priv)
wake_up(&id_priv->wait_remove);
 }
 
+static int cma_has_cm_dev(struct rdma_id_private *id_priv)
+{
+   return (id_priv->id.device && id_priv->cm_id.ib);
+}
+
 struct rdma_cm_id *rdma_create_id(rdma_cm_event_handler event_handler,
  void *context, enum rdma_port_space ps)
 {
@@ -2422,7 +2427,7 @@ int rdma_notify(struct rdma_cm_id *id, enum ib_event_type 
event)
int ret;
 
id_priv = container_of(id, struct rdma_id_private, id);
-   if (!cma_comp(id_priv, CMA_CONNECT))
+   if (!cma_has_cm_dev(id_priv))
return -EINVAL;
 
switch (id->device->node_type) {
@@ -2444,7 +2449,7 @@ int rdma_reject(struct rdma_cm_id *id, const void 
*private_data,
int ret;
 
id_priv = container_of(id, struct rdma_id_private, id);
-   if (!cma_comp(id_priv, CMA_CONNECT))
+   if (!cma_has_cm_dev(id_priv))
return -EINVAL;
 
switch (rdma_node_get_transport(id->device->node_type)) {
@@ -2475,8 +2480,7 @@ int rdma_disconnect(struct rdma_cm_id *id)
int ret;
 
id_priv = container_of(id, struct rdma_id_private, id);
-   if (!cma_comp(id_priv, CMA_CONNECT) &&
-   !cma_comp(id_priv, CMA_DISCONNECT))
+   if (!cma_has_cm_dev(id_priv))
return -EINVAL;
 
switch (rdma_node_get_transport(id->device->node_type)) {
-
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


IB/mthca: Fix posting >255 recv WRs for Tavor

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3e28c56b9b67347b42ba06f9a9373b408902beee
Commit: 3e28c56b9b67347b42ba06f9a9373b408902beee
Parent: 6c719f5c6c823901fac2d46b83db5a69ba7e9152
Author: Michael S. Tsirkin <[EMAIL PROTECTED]>
AuthorDate: Mon May 14 07:26:51 2007 +0300
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Mon May 14 14:10:34 2007 -0700

IB/mthca: Fix posting >255 recv WRs for Tavor

Fix posting lists of > 255 receive WRs for Tavor: rq.next_ind must
be updated each doorbell, otherwise the next doorbell will use an
incorrect index.

Found by Ronni Zimmermann at Mellanox.

Signed-off-by: Michael S. Tsirkin <[EMAIL PROTECTED]>
Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/mthca/mthca_qp.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c 
b/drivers/infiniband/hw/mthca/mthca_qp.c
index fee60c8..72fabb8 100644
--- a/drivers/infiniband/hw/mthca/mthca_qp.c
+++ b/drivers/infiniband/hw/mthca/mthca_qp.c
@@ -1862,6 +1862,7 @@ int mthca_tavor_post_receive(struct ib_qp *ibqp, struct 
ib_recv_wr *wr,
  dev->kar + MTHCA_RECEIVE_DOORBELL,
  
MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock));
 
+   qp->rq.next_ind = ind;
qp->rq.head += MTHCA_TAVOR_MAX_WQES_PER_RECV_DB;
size0 = 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


IB/mthca: Set cleaned CQEs back to HW ownership when cleaning CQ

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bd18c112774db5bb887adb981ffbe9bfe00b2f3a
Commit: bd18c112774db5bb887adb981ffbe9bfe00b2f3a
Parent: 3e28c56b9b67347b42ba06f9a9373b408902beee
Author: Michael S. Tsirkin <[EMAIL PROTECTED]>
AuthorDate: Mon May 14 17:14:50 2007 +0300
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Mon May 14 14:10:34 2007 -0700

IB/mthca: Set cleaned CQEs back to HW ownership when cleaning CQ

mthca_cq_clean() updates the CQ consumer index without moving CQEs
back to HW ownership.  As a result, the same WRID might get reported
twice, resulting in a use-after-free.  This was observed in IPoIB CM.
Fix by moving all freed CQEs to HW ownership.

This fixes 

Signed-off-by: Michael S. Tsirkin <[EMAIL PROTECTED]>
Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/mthca/mthca_cq.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/hw/mthca/mthca_cq.c 
b/drivers/infiniband/hw/mthca/mthca_cq.c
index cf0868f..ca224d0 100644
--- a/drivers/infiniband/hw/mthca/mthca_cq.c
+++ b/drivers/infiniband/hw/mthca/mthca_cq.c
@@ -284,7 +284,7 @@ void mthca_cq_clean(struct mthca_dev *dev, struct mthca_cq 
*cq, u32 qpn,
 {
struct mthca_cqe *cqe;
u32 prod_index;
-   int nfreed = 0;
+   int i, nfreed = 0;
 
spin_lock_irq(&cq->lock);
 
@@ -321,6 +321,8 @@ void mthca_cq_clean(struct mthca_dev *dev, struct mthca_cq 
*cq, u32 qpn,
}
 
if (nfreed) {
+   for (i = 0; i < nfreed; ++i)
+   set_cqe_hw(get_cqe(cq, (cq->cons_index + i) & 
cq->ibcq.cqe));
wmb();
cq->cons_index += nfreed;
update_cons_index(dev, cq, nfreed);
-
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


IPoIB/cm: Optimize stale connection detection

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7c5b9ef8577bfa7b74ea58fc9ff2934ffce13532
Commit: 7c5b9ef8577bfa7b74ea58fc9ff2934ffce13532
Parent: bd18c112774db5bb887adb981ffbe9bfe00b2f3a
Author: Michael S. Tsirkin <[EMAIL PROTECTED]>
AuthorDate: Mon May 14 07:26:51 2007 +0300
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Mon May 14 14:11:01 2007 -0700

IPoIB/cm: Optimize stale connection detection

In the presence of some running RX connections, we repeat
queue_delayed_work calls each 4 RX WRs, which is a waste.  It's enough
to start stale task when a first passive connection is added, and
rerun it every IPOIB_CM_RX_DELAY as long as there are outstanding
passive connections.

This removes some code from RX data path.

Signed-off-by: Michael S. Tsirkin <[EMAIL PROTECTED]>
Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/ulp/ipoib/ipoib_cm.c |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c 
b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 785bc85..eec833b 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -257,10 +257,11 @@ static int ipoib_cm_req_handler(struct ib_cm_id *cm_id, 
struct ib_cm_event *even
cm_id->context = p;
p->jiffies = jiffies;
spin_lock_irq(&priv->lock);
+   if (list_empty(&priv->cm.passive_ids))
+   queue_delayed_work(ipoib_workqueue,
+  &priv->cm.stale_task, IPOIB_CM_RX_DELAY);
list_add(&p->list, &priv->cm.passive_ids);
spin_unlock_irq(&priv->lock);
-   queue_delayed_work(ipoib_workqueue,
-  &priv->cm.stale_task, IPOIB_CM_RX_DELAY);
return 0;
 
 err_rep:
@@ -378,8 +379,6 @@ void ipoib_cm_handle_rx_wc(struct net_device *dev, struct 
ib_wc *wc)
if (!list_empty(&p->list))
list_move(&p->list, &priv->cm.passive_ids);
spin_unlock_irqrestore(&priv->lock, flags);
-   queue_delayed_work(ipoib_workqueue,
-  &priv->cm.stale_task, 
IPOIB_CM_RX_DELAY);
}
}
 
@@ -1100,6 +1099,10 @@ static void ipoib_cm_stale_task(struct work_struct *work)
kfree(p);
spin_lock_irq(&priv->lock);
}
+
+   if (!list_empty(&priv->cm.passive_ids))
+   queue_delayed_work(ipoib_workqueue,
+  &priv->cm.stale_task, IPOIB_CM_RX_DELAY);
spin_unlock_irq(&priv->lock);
 }
 
-
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


ll_rw_blk: fix gcc 4.2 warning on current_io_context()

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f653c34dd3d8bde2c918316fd5ba2e2c4f95afcf
Commit: f653c34dd3d8bde2c918316fd5ba2e2c4f95afcf
Parent: de7860c3f3272086a4c3a1b4280b11ffae7c32be
Author: Jens Axboe <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 19:30:07 2007 +0200
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 10:44:15 2007 -0700

ll_rw_blk: fix gcc 4.2 warning on current_io_context()

current_io_context() is both static and exported with EXPORT_SYMBOL().
As there are no users outside of ll_rw_blk.c itself, just kill the
export.

Problem reported by Martin Michlmayr <[EMAIL PROTECTED]>

Signed-off-by: Jens Axboe <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 block/ll_rw_blk.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index 74a567a..6b5173a 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -3802,7 +3802,6 @@ static struct io_context *current_io_context(gfp_t 
gfp_flags, int node)
 
return ret;
 }
-EXPORT_SYMBOL(current_io_context);
 
 /*
  * If the current task has no IO context then create one and initialise it.
-
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


[CPUFREQ] Support rev H AMD64s in powernow-k8

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=30046e5885848fe5c2c66177dca6b277323e31ab
Commit: 30046e5885848fe5c2c66177dca6b277323e31ab
Parent: 39403865d2e4590802553370a56c9ab93131e4ee
Author: Dave Jones <[EMAIL PROTECTED]>
AuthorDate: Sun May 13 11:55:14 2007 -0400
Committer:  Dave Jones <[EMAIL PROTECTED]>
CommitDate: Sun May 13 11:55:14 2007 -0400

[CPUFREQ] Support rev H AMD64s in powernow-k8

Reported-by: Calvin Dodge <[EMAIL PROTECTED]>
Signed-off-by: Dave Jones <[EMAIL PROTECTED]>
---
 arch/i386/kernel/cpu/cpufreq/powernow-k8.c |2 +-
 arch/i386/kernel/cpu/cpufreq/powernow-k8.h |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c 
b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
index 7cf3d20..5c715f1 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
@@ -521,7 +521,7 @@ static int check_supported_cpu(unsigned int cpu)
 
if ((eax & CPUID_XFAM) == CPUID_XFAM_K8) {
if (((eax & CPUID_USE_XFAM_XMOD) != CPUID_USE_XFAM_XMOD) ||
-   ((eax & CPUID_XMOD) > CPUID_XMOD_REV_G)) {
+   ((eax & CPUID_XMOD) > CPUID_XMOD_REV_H)) {
printk(KERN_INFO PFX "Processor cpuid %x not 
supported\n", eax);
goto out;
}
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.h 
b/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
index 95be501..ae2d9da 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
@@ -46,8 +46,8 @@ struct powernow_k8_data {
 #define CPUID_XFAM 0x0ff0  /* extended family */
 #define CPUID_XFAM_K8  0
 #define CPUID_XMOD 0x000f  /* extended model */
-#define CPUID_XMOD_REV_G   0x0006
-#define CPUID_XFAM_10H 0x0010  /* family 0x10 
*/
+#define CPUID_XMOD_REV_H   0x0007
+#define CPUID_XFAM_10H 0x0010  /* family 0x10 */
 #define CPUID_USE_XFAM_XMOD0x0f00
 #define CPUID_GET_MAX_CAPABILITIES 0x8000
 #define CPUID_FREQ_VOLT_CAPABILITIES   0x8007
-
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


[CPUFREQ] powernow-k7: fix MHz rounding issue with perflib

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=dc2585eb478cfeb45b3d6e235ac7b5918fb859f7
Commit: dc2585eb478cfeb45b3d6e235ac7b5918fb859f7
Parent: 30046e5885848fe5c2c66177dca6b277323e31ab
Author: Daniel Drake <[EMAIL PROTECTED]>
AuthorDate: Wed May 2 23:19:05 2007 +0100
Committer:  Dave Jones <[EMAIL PROTECTED]>
CommitDate: Sun May 13 17:25:13 2007 -0400

[CPUFREQ] powernow-k7: fix MHz rounding issue with perflib

When the PST tables are broken, powernow-k7 uses ACPI's processor_perflib to
deduce the available frequency multipliers from the _PSS tables.

Upon frequency change, processor_perflib performs some verification on the
frequency (checks that it's within allowable bounds).

powernow-k7 deals with absolute frequencies in KHz, whereas perflib only
deals with MHz values. When performing the above verification, perflib
multiplies the MHz values by 1000 to obtain the KHz value.

We then end up with situations like the following:
 - powernow-k7 multiplies the multiplier by the FSB, and obtains a value
   such as 1266768 KHz
 - perflib belives the same state has frequency of 1266 MHz
 - acpi_processor_ppc_notifier calls cpufreq_verify_within_limits to verify
   that 1266768 is in the allowable range of 0 to 1266000 (i.e. 1266 * 1000)
 - it's not, so that frequency is rejected
 - the maximum CPU frequency is not reachable

This patch solves the problem by rounding up the MHz values stored in 
perflib's
tables. Additionally it corrects a broken URL.

It also fixes http://bugzilla.kernel.org/show_bug.cgi?id=8255 although this
case is a bit different: the frequencies in the _PSS tables are wildly 
wrong,
but we get better results if we force ACPI to respect the fsb * multiplier
calculations (even though it seems that the multiplier values aren't 
entirely
correct either).

Signed-off-by: Daniel Drake <[EMAIL PROTECTED]>
Signed-off-by: Dave Jones <[EMAIL PROTECTED]>
---
 arch/i386/kernel/cpu/cpufreq/powernow-k7.c |   36 +--
 1 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c 
b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
index 837b041..ca3e1d3 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
@@ -341,15 +341,17 @@ static int powernow_acpi_init(void)
pc.val = (unsigned long) acpi_processor_perf->states[0].control;
for (i = 0; i < number_scales; i++) {
u8 fid, vid;
-   unsigned int speed;
+   struct acpi_processor_px *state =
+   &acpi_processor_perf->states[i];
+   unsigned int speed, speed_mhz;
 
-   pc.val = (unsigned long) acpi_processor_perf->states[i].control;
+   pc.val = (unsigned long) state->control;
dprintk ("acpi:  P%d: %d MHz %d mW %d uS control %08x SGTC 
%d\n",
 i,
-(u32) acpi_processor_perf->states[i].core_frequency,
-(u32) acpi_processor_perf->states[i].power,
-(u32) 
acpi_processor_perf->states[i].transition_latency,
-(u32) acpi_processor_perf->states[i].control,
+(u32) state->core_frequency,
+(u32) state->power,
+(u32) state->transition_latency,
+(u32) state->control,
 pc.bits.sgtc);
 
vid = pc.bits.vid;
@@ -360,6 +362,18 @@ static int powernow_acpi_init(void)
powernow_table[i].index |= (vid << 8); /* upper 8 bits */
 
speed = powernow_table[i].frequency;
+   speed_mhz = speed / 1000;
+
+   /* processor_perflib will multiply the MHz value by 1000 to
+* get a KHz value (e.g. 1266000). However, powernow-k7 works
+* with true KHz values (e.g. 1266768). To ensure that all
+* powernow frequencies are available, we must ensure that
+* ACPI doesn't restrict them, so we round up the MHz value
+* to ensure that perflib's computed KHz value is greater than
+* or equal to powernow's KHz value.
+*/
+   if (speed % 1000 > 0)
+   speed_mhz++;
 
if ((fid_codes[fid] % 10)==5) {
if (have_a0 == 1)
@@ -368,10 +382,16 @@ static int powernow_acpi_init(void)
 
dprintk ("   FID: 0x%x (%d.%dx [%dMHz])  "
 "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10,
-fid_codes[fid] % 10, speed/1000, vid,
+fid_codes[fid] % 10, speed_mhz, vid,
 mobile_vid_table[vid]/1000,
   

[CPUFREQ] Correct revision mask for powernow-k8

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=99fbe1ac217e8b9d4141504e879327cb4e42d4ff
Commit: 99fbe1ac217e8b9d4141504e879327cb4e42d4ff
Parent: dc2585eb478cfeb45b3d6e235ac7b5918fb859f7
Author: Dave Jones <[EMAIL PROTECTED]>
AuthorDate: Mon May 14 18:27:29 2007 -0400
Committer:  Dave Jones <[EMAIL PROTECTED]>
CommitDate: Mon May 14 18:27:29 2007 -0400

[CPUFREQ] Correct revision mask for powernow-k8

Mark Langsdorf points out that the correct define for this
revision bump is 0x8.  Also to save us having to keep
renaming the #define, give it a more meaningful name.

Signed-off-by: Dave Jones <[EMAIL PROTECTED]>
---
 arch/i386/kernel/cpu/cpufreq/powernow-k8.c |2 +-
 arch/i386/kernel/cpu/cpufreq/powernow-k8.h |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c 
b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
index 5c715f1..4ade55c 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
@@ -521,7 +521,7 @@ static int check_supported_cpu(unsigned int cpu)
 
if ((eax & CPUID_XFAM) == CPUID_XFAM_K8) {
if (((eax & CPUID_USE_XFAM_XMOD) != CPUID_USE_XFAM_XMOD) ||
-   ((eax & CPUID_XMOD) > CPUID_XMOD_REV_H)) {
+   ((eax & CPUID_XMOD) > CPUID_XMOD_REV_MASK)) {
printk(KERN_INFO PFX "Processor cpuid %x not 
supported\n", eax);
goto out;
}
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.h 
b/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
index ae2d9da..b06c812 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
@@ -46,7 +46,7 @@ struct powernow_k8_data {
 #define CPUID_XFAM 0x0ff0  /* extended family */
 #define CPUID_XFAM_K8  0
 #define CPUID_XMOD 0x000f  /* extended model */
-#define CPUID_XMOD_REV_H   0x0007
+#define CPUID_XMOD_REV_MASK0x0008
 #define CPUID_XFAM_10H 0x0010  /* family 0x10 */
 #define CPUID_USE_XFAM_XMOD0x0f00
 #define CPUID_GET_MAX_CAPABILITIES 0x8000
-
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


[AGPGART] Fix wrong ID in via-agp.c

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bbdfff86a8f0c91ad8b6dedf74bc14de4ba39679
Commit: bbdfff86a8f0c91ad8b6dedf74bc14de4ba39679
Parent: 705962ccc9d21a08b74b6b6e1d3cf10f98968a67
Author: Gabriel Mansi <[EMAIL PROTECTED]>
AuthorDate: Mon May 7 18:55:13 2007 -0300
Committer:  Dave Jones <[EMAIL PROTECTED]>
CommitDate: Sun May 13 17:41:47 2007 -0400

[AGPGART] Fix wrong ID in via-agp.c

there is a wrong id in drivers/char/agp/via-agp.c
#define PCI_DEVICE_ID_VIA_CX700 0x8324
It must be 0x0324

Notice that PCI_DEVICE_ID_VIA_CX700 is also used in
drivers/i2c/busses/i2c-viapro.c and
drivers/ide/pci/via82cxxx.c

So, I think that constant must be renamed to avoid conflicting.
I attached a proposed patch.

Signed-off-by: Dave Jones <[EMAIL PROTECTED]>
---
 drivers/char/agp/via-agp.c |6 +++---
 include/linux/pci_ids.h|1 +
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/char/agp/via-agp.c b/drivers/char/agp/via-agp.c
index a2bb4ec..9aaf401 100644
--- a/drivers/char/agp/via-agp.c
+++ b/drivers/char/agp/via-agp.c
@@ -384,9 +384,9 @@ static struct agp_device_ids via_agp_device_ids[] 
__devinitdata =
.device_id  = PCI_DEVICE_ID_VIA_P4M800CE,
.chipset_name   = "VT3314",
},
-   /* CX700 */
+   /* VT3324 / CX700 */
{
-   .device_id  = PCI_DEVICE_ID_VIA_CX700,
+   .device_id  = PCI_DEVICE_ID_VIA_VT3324,
.chipset_name   = "CX700",
},
/* VT3336 */
@@ -540,7 +540,7 @@ static const struct pci_device_id agp_via_pci_table[] = {
ID(PCI_DEVICE_ID_VIA_83_87XX_1),
ID(PCI_DEVICE_ID_VIA_3296_0),
ID(PCI_DEVICE_ID_VIA_P4M800CE),
-   ID(PCI_DEVICE_ID_VIA_CX700),
+   ID(PCI_DEVICE_ID_VIA_VT3324),
ID(PCI_DEVICE_ID_VIA_VT3336),
ID(PCI_DEVICE_ID_VIA_P4M890),
{ }
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index ccd85e4..3b1fbf4 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1288,6 +1288,7 @@
 #define PCI_DEVICE_ID_VIA_8363_0   0x0305
 #define PCI_DEVICE_ID_VIA_P4M800CE 0x0314
 #define PCI_DEVICE_ID_VIA_P4M890   0x0327
+#define PCI_DEVICE_ID_VIA_VT3324   0x0324
 #define PCI_DEVICE_ID_VIA_VT3336   0x0336
 #define PCI_DEVICE_ID_VIA_8371_0   0x0391
 #define PCI_DEVICE_ID_VIA_8501_0   0x0501
-
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


pasemi_mac: Fix register defines

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a54c545134ea77609ed9eb5df50524c097112327
Commit: a54c545134ea77609ed9eb5df50524c097112327
Parent: 0560551dca0c02a4b23f95a9c339882ff291e1c7
Author: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
AuthorDate: Sat May 12 14:57:27 2007 -0500
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Tue May 15 17:44:39 2007 -0400

pasemi_mac: Fix register defines

Some shift values were obviously wrong. Fix them to correspond with
the masks.

Signed-off-by: Olof Johansson <[EMAIL PROTECTED]>
Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/pasemi_mac.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/pasemi_mac.h b/drivers/net/pasemi_mac.h
index 8bc0cea..c29ee15 100644
--- a/drivers/net/pasemi_mac.h
+++ b/drivers/net/pasemi_mac.h
@@ -341,7 +341,7 @@ enum {
 PAS_IOB_DMA_TXCH_STAT_CNTDEL_M)
 #define PAS_IOB_DMA_RXCH_RESET(i)  (0x1500 + (i)*4)
 #definePAS_IOB_DMA_RXCH_RESET_PCNT_M   0x
-#definePAS_IOB_DMA_RXCH_RESET_PCNT_S   0
+#definePAS_IOB_DMA_RXCH_RESET_PCNT_S   16
 #definePAS_IOB_DMA_RXCH_RESET_PCNT(x)  (((x) << 
PAS_IOB_DMA_RXCH_RESET_PCNT_S) & \
 PAS_IOB_DMA_RXCH_RESET_PCNT_M)
 #definePAS_IOB_DMA_RXCH_RESET_PCNTRST  0x0020
@@ -352,7 +352,7 @@ enum {
 #definePAS_IOB_DMA_RXCH_RESET_PINTC0x0001
 #define PAS_IOB_DMA_TXCH_RESET(i)  (0x1600 + (i)*4)
 #definePAS_IOB_DMA_TXCH_RESET_PCNT_M   0x
-#definePAS_IOB_DMA_TXCH_RESET_PCNT_S   0
+#definePAS_IOB_DMA_TXCH_RESET_PCNT_S   16
 #definePAS_IOB_DMA_TXCH_RESET_PCNT(x)  (((x) << 
PAS_IOB_DMA_TXCH_RESET_PCNT_S) & \
 PAS_IOB_DMA_TXCH_RESET_PCNT_M)
 #definePAS_IOB_DMA_TXCH_RESET_PCNTRST  0x0020
-
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 discontigmem + non-HIGHMEM compile

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=28aa483f80d146a8f117eb65a4fddf31d58230d7
Commit: 28aa483f80d146a8f117eb65a4fddf31d58230d7
Parent: 0560551dca0c02a4b23f95a9c339882ff291e1c7
Author: Linus Torvalds <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 18:45:49 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 18:45:49 2007 -0700

x86: Fix discontigmem + non-HIGHMEM compile

It's not necessarily a very sane configuration, but people running "make
randconfig" noticed it wouldn't compile.  This fixes some obvious
problems in discontig.c to allow a clean compile.

Acked-by: andrew hendry <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 arch/i386/mm/discontig.c |9 +++--
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c
index aa58720..860e912 100644
--- a/arch/i386/mm/discontig.c
+++ b/arch/i386/mm/discontig.c
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -97,14 +98,8 @@ unsigned long node_memmap_size_bytes(int nid, unsigned long 
start_pfn,
 #endif
 
 extern unsigned long find_max_low_pfn(void);
-extern void find_max_pfn(void);
 extern void add_one_highpage_init(struct page *, int, int);
-
-extern struct e820map e820;
 extern unsigned long highend_pfn, highstart_pfn;
-extern unsigned long max_low_pfn;
-extern unsigned long totalram_pages;
-extern unsigned long totalhigh_pages;
 
 #define LARGE_PAGE_BYTES (PTRS_PER_PTE * PAGE_SIZE)
 
@@ -360,7 +355,9 @@ void __init zone_sizes_init(void)
max_zone_pfns[ZONE_DMA] =
virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
+#ifdef CONFIG_HIGHMEM
max_zone_pfns[ZONE_HIGHMEM] = highend_pfn;
+#endif
 
/* If SRAT has not registered memory, register it now */
if (find_max_pfn_with_active_regions() == 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


pasemi_mac: Interrupt ack fixes

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=52a9435183f961e1bb3c146a62bfbecf93d15d58
Commit: 52a9435183f961e1bb3c146a62bfbecf93d15d58
Parent: a54c545134ea77609ed9eb5df50524c097112327
Author: Olof Johansson <[EMAIL PROTECTED]>
AuthorDate: Sat May 12 18:01:09 2007 -0500
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Tue May 15 17:44:39 2007 -0400

pasemi_mac: Interrupt ack fixes

Interrupt ack fixes

Fix the packet count resets at interrupt time, using the cacheable
packet count status to set number of processed/received packets, since
the ack count is the cumulative number of packets processed, and not
incremental.

Signed-off-by: Olof Johansson <[EMAIL PROTECTED]>
Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/pasemi_mac.c |   27 +--
 1 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c
index bc7f3de..39e33ae 100644
--- a/drivers/net/pasemi_mac.c
+++ b/drivers/net/pasemi_mac.c
@@ -384,17 +384,14 @@ static void pasemi_mac_replenish_rx_ring(struct 
net_device *dev)
 
 static void pasemi_mac_restart_rx_intr(struct pasemi_mac *mac)
 {
-   unsigned int reg, stat;
+   unsigned int reg, pcnt;
/* Re-enable packet count interrupts: finally
 * ack the packet count interrupt we got in rx_intr.
 */
 
-   pci_read_config_dword(mac->iob_pdev,
- PAS_IOB_DMA_RXCH_STAT(mac->dma_rxch),
- &stat);
+   pcnt = *mac->rx_status & PAS_STATUS_PCNT_M;
 
-   reg = PAS_IOB_DMA_RXCH_RESET_PCNT(stat & PAS_IOB_DMA_RXCH_STAT_CNTDEL_M)
-   | PAS_IOB_DMA_RXCH_RESET_PINTC;
+   reg = PAS_IOB_DMA_RXCH_RESET_PCNT(pcnt) | PAS_IOB_DMA_RXCH_RESET_PINTC;
 
pci_write_config_dword(mac->iob_pdev,
   PAS_IOB_DMA_RXCH_RESET(mac->dma_rxch),
@@ -403,14 +400,12 @@ static void pasemi_mac_restart_rx_intr(struct pasemi_mac 
*mac)
 
 static void pasemi_mac_restart_tx_intr(struct pasemi_mac *mac)
 {
-   unsigned int reg, stat;
+   unsigned int reg, pcnt;
 
/* Re-enable packet count interrupts */
-   pci_read_config_dword(mac->iob_pdev,
- PAS_IOB_DMA_TXCH_STAT(mac->dma_txch), &stat);
+   pcnt = *mac->tx_status & PAS_STATUS_PCNT_M;
 
-   reg = PAS_IOB_DMA_TXCH_RESET_PCNT(stat & PAS_IOB_DMA_TXCH_STAT_CNTDEL_M)
-   | PAS_IOB_DMA_TXCH_RESET_PINTC;
+   reg = PAS_IOB_DMA_TXCH_RESET_PCNT(pcnt) | PAS_IOB_DMA_TXCH_RESET_PINTC;
 
pci_write_config_dword(mac->iob_pdev,
   PAS_IOB_DMA_TXCH_RESET(mac->dma_txch), reg);
@@ -591,21 +586,24 @@ static irqreturn_t pasemi_mac_tx_intr(int irq, void *data)
 {
struct net_device *dev = data;
struct pasemi_mac *mac = netdev_priv(dev);
-   unsigned int reg;
+   unsigned int reg, pcnt;
 
if (!(*mac->tx_status & PAS_STATUS_CAUSE_M))
return IRQ_NONE;
 
pasemi_mac_clean_tx(mac);
 
-   reg = PAS_IOB_DMA_TXCH_RESET_PINTC;
+   pcnt = *mac->tx_status & PAS_STATUS_PCNT_M;
+
+   reg = PAS_IOB_DMA_TXCH_RESET_PCNT(pcnt) | PAS_IOB_DMA_TXCH_RESET_PINTC;
 
if (*mac->tx_status & PAS_STATUS_SOFT)
reg |= PAS_IOB_DMA_TXCH_RESET_SINTC;
if (*mac->tx_status & PAS_STATUS_ERROR)
reg |= PAS_IOB_DMA_TXCH_RESET_DINTC;
 
-   pci_write_config_dword(mac->iob_pdev, 
PAS_IOB_DMA_TXCH_RESET(mac->dma_txch),
+   pci_write_config_dword(mac->iob_pdev,
+  PAS_IOB_DMA_TXCH_RESET(mac->dma_txch),
   reg);
 
return IRQ_HANDLED;
@@ -974,6 +972,7 @@ static int pasemi_mac_start_tx(struct sk_buff *skb, struct 
net_device *dev)
if (txring->next_to_clean - txring->next_to_use == TX_RING_SIZE) {
spin_unlock_irqrestore(&txring->lock, flags);
pasemi_mac_clean_tx(mac);
+   pasemi_mac_restart_tx_intr(mac);
spin_lock_irqsave(&txring->lock, flags);
 
if (txring->next_to_clean - txring->next_to_use ==
-
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


pasemi_mac: Terminate PCI ID list

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fd17825480b2de3076727c677f8e257623705963
Commit: fd17825480b2de3076727c677f8e257623705963
Parent: 52a9435183f961e1bb3c146a62bfbecf93d15d58
Author: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
AuthorDate: Sat May 12 14:57:36 2007 -0500
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Tue May 15 17:44:39 2007 -0400

pasemi_mac: Terminate PCI ID list

This caused some very interesting behaviour depending on what happened to
be built at the same time. Add terminating empty entry to the list of IDs.

Signed-off-by: Olof Johansson <[EMAIL PROTECTED]>
Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/pasemi_mac.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c
index 39e33ae..933d564 100644
--- a/drivers/net/pasemi_mac.c
+++ b/drivers/net/pasemi_mac.c
@@ -1209,6 +1209,7 @@ static void __devexit pasemi_mac_remove(struct pci_dev 
*pdev)
 static struct pci_device_id pasemi_mac_pci_tbl[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_PASEMI, 0xa005) },
{ PCI_DEVICE(PCI_VENDOR_ID_PASEMI, 0xa006) },
+   { },
 };
 
 MODULE_DEVICE_TABLE(pci, pasemi_mac_pci_tbl);
-
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


pasemi_mac: Fix local-mac-address parsing

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1af7f05628fab81fdf4412d757676412ba5db660
Commit: 1af7f05628fab81fdf4412d757676412ba5db660
Parent: fd17825480b2de3076727c677f8e257623705963
Author: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
AuthorDate: Sat May 12 14:57:46 2007 -0500
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Tue May 15 17:44:39 2007 -0400

pasemi_mac: Fix local-mac-address parsing

Turns out we have an old version of firmware that stores the mac address
in 'mac-address' as a string instead of a byte array. All versions that
use local-mac-address should have it as byte array, so no need to do
string parsing for that case.

Signed-off-by: Olof Johansson <[EMAIL PROTECTED]>
Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/pasemi_mac.c |   17 ++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c
index 933d564..8d38425 100644
--- a/drivers/net/pasemi_mac.c
+++ b/drivers/net/pasemi_mac.c
@@ -85,6 +85,7 @@ static int pasemi_get_mac_addr(struct pasemi_mac *mac)
 {
struct pci_dev *pdev = mac->pdev;
struct device_node *dn = pci_device_to_OF_node(pdev);
+   int len;
const u8 *maddr;
u8 addr[6];
 
@@ -94,9 +95,17 @@ static int pasemi_get_mac_addr(struct pasemi_mac *mac)
return -ENOENT;
}
 
-   maddr = of_get_property(dn, "local-mac-address", NULL);
+   maddr = of_get_property(dn, "local-mac-address", &len);
+
+   if (maddr && len == 6) {
+   memcpy(mac->mac_addr, maddr, 6);
+   return 0;
+   }
+
+   /* Some old versions of firmware mistakenly uses mac-address
+* (and as a string) instead of a byte array in local-mac-address.
+*/
 
-   /* Fall back to mac-address for older firmware */
if (maddr == NULL)
maddr = of_get_property(dn, "mac-address", NULL);
 
@@ -106,6 +115,7 @@ static int pasemi_get_mac_addr(struct pasemi_mac *mac)
return -ENOENT;
}
 
+
if (sscanf(maddr, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &addr[0],
   &addr[1], &addr[2], &addr[3], &addr[4], &addr[5]) != 6) {
dev_warn(&pdev->dev,
@@ -113,7 +123,8 @@ static int pasemi_get_mac_addr(struct pasemi_mac *mac)
return -EINVAL;
}
 
-   memcpy(mac->mac_addr, addr, sizeof(addr));
+   memcpy(mac->mac_addr, addr, 6);
+
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


smc911x: fix compilation breakage

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f2773a29596d835d2b00137ba925c186699ea117
Commit: f2773a29596d835d2b00137ba925c186699ea117
Parent: 1af7f05628fab81fdf4412d757676412ba5db660
Author: Vitaly Wool <[EMAIL PROTECTED]>
AuthorDate: Sun May 13 18:42:08 2007 +0400
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Tue May 15 17:44:39 2007 -0400

smc911x: fix compilation breakage

Looks like the new version of this patch has been overlooked,
so I'm resending it.

It just adapts the driver to the new IRQ API
according to what Russell has pointed out.

 drivers/net/smc911x.c |6 ++
 1 files changed, 2 insertions(+), 4 deletions(-)

Signed-off-by: Vitaly Wool <[EMAIL PROTECTED]>
Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/smc911x.c |6 ++
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 81f2484..db43e42 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -77,7 +77,6 @@ static const char version[] =
 #include 
 
 #include 
-#include 
 
 #include "smc911x.h"
 
@@ -2084,12 +2083,11 @@ static int __init smc911x_probe(struct net_device *dev, 
unsigned long ioaddr)
lp->ctl_rspeed = 100;
 
/* Grab the IRQ */
-   retval = request_irq(dev->irq, &smc911x_interrupt, IRQF_SHARED, 
dev->name, dev);
+   retval = request_irq(dev->irq, &smc911x_interrupt,
+   IRQF_SHARED | IRQF_TRIGGER_FALLING, dev->name, dev);
if (retval)
goto err_out;
 
-   set_irq_type(dev->irq, IRQT_FALLING);
-
 #ifdef SMC_USE_DMA
lp->rxdma = SMC_DMA_REQUEST(dev, smc911x_rx_dma_irq);
lp->txdma = SMC_DMA_REQUEST(dev, smc911x_tx_dma_irq);
-
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


ucc_geth: eliminate max-speed, change interface-type to phy-connection-type

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4e19b5c193454ade8d86468077078f680d121979
Commit: 4e19b5c193454ade8d86468077078f680d121979
Parent: f2773a29596d835d2b00137ba925c186699ea117
Author: Kim Phillips <[EMAIL PROTECTED]>
AuthorDate: Fri May 11 18:25:07 2007 -0500
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Tue May 15 17:44:40 2007 -0400

ucc_geth: eliminate max-speed, change interface-type to phy-connection-type

It was agreed that phy-connection-type was a better name for
the interface-type property, so this patch renames it.

Also, the max-speed property name was determined too generic,
and is therefore eliminated in favour of phy-connection-type
derivation logic.

includes corrections to copyright text.

Signed-off-by: Kim Phillips <[EMAIL PROTECTED]>
Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/ucc_geth.c |   40 
 drivers/net/ucc_geth_mii.c |9 +
 drivers/net/ucc_geth_mii.h |   10 +-
 3 files changed, 26 insertions(+), 33 deletions(-)

diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 0f66765..c2ccbd0 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved.
+ * Copyright (C) 2006-2007 Freescale Semicondutor, Inc. All rights reserved.
  *
  * Author: Shlomi Gridish <[EMAIL PROTECTED]>
  *Li Yang <[EMAIL PROTECTED]>
@@ -3737,21 +3737,21 @@ static int ucc_geth_close(struct net_device *dev)
 
 const struct ethtool_ops ucc_geth_ethtool_ops = { };
 
-static phy_interface_t to_phy_interface(const char *interface_type)
+static phy_interface_t to_phy_interface(const char *phy_connection_type)
 {
-   if (strcasecmp(interface_type, "mii") == 0)
+   if (strcasecmp(phy_connection_type, "mii") == 0)
return PHY_INTERFACE_MODE_MII;
-   if (strcasecmp(interface_type, "gmii") == 0)
+   if (strcasecmp(phy_connection_type, "gmii") == 0)
return PHY_INTERFACE_MODE_GMII;
-   if (strcasecmp(interface_type, "tbi") == 0)
+   if (strcasecmp(phy_connection_type, "tbi") == 0)
return PHY_INTERFACE_MODE_TBI;
-   if (strcasecmp(interface_type, "rmii") == 0)
+   if (strcasecmp(phy_connection_type, "rmii") == 0)
return PHY_INTERFACE_MODE_RMII;
-   if (strcasecmp(interface_type, "rgmii") == 0)
+   if (strcasecmp(phy_connection_type, "rgmii") == 0)
return PHY_INTERFACE_MODE_RGMII;
-   if (strcasecmp(interface_type, "rgmii-id") == 0)
+   if (strcasecmp(phy_connection_type, "rgmii-id") == 0)
return PHY_INTERFACE_MODE_RGMII_ID;
-   if (strcasecmp(interface_type, "rtbi") == 0)
+   if (strcasecmp(phy_connection_type, "rtbi") == 0)
return PHY_INTERFACE_MODE_RTBI;
 
return PHY_INTERFACE_MODE_MII;
@@ -3819,29 +3819,21 @@ static int ucc_geth_probe(struct of_device* ofdev, 
const struct of_device_id *ma
ug_info->phy_address = *prop;
 
/* get the phy interface type, or default to MII */
-   prop = of_get_property(np, "interface-type", NULL);
+   prop = of_get_property(np, "phy-connection-type", NULL);
if (!prop) {
/* handle interface property present in old trees */
prop = of_get_property(phy, "interface", NULL);
-   if (prop != NULL)
+   if (prop != NULL) {
phy_interface = enet_to_phy_interface[*prop];
-   else
+   max_speed = enet_to_speed[*prop];
+   } else
phy_interface = PHY_INTERFACE_MODE_MII;
} else {
phy_interface = to_phy_interface((const char *)prop);
}
 
-   /* get speed, or derive from interface */
-   prop = of_get_property(np, "max-speed", NULL);
-   if (!prop) {
-   /* handle interface property present in old trees */
-   prop = of_get_property(phy, "interface", NULL);
-   if (prop != NULL)
-   max_speed = enet_to_speed[*prop];
-   } else {
-   max_speed = *prop;
-   }
-   if (!max_speed) {
+   /* get speed, or derive from PHY interface */
+   if (max_speed == 0)
switch (phy_interface) {
case PHY_INTERFACE_MODE_GMII:
case PHY_INTERFACE_MODE_RGMII:
@@ -3854,9 +3846,9 @@ static int ucc_geth_probe(struct of_device* ofdev, const 
struct of_device_id *ma
max_speed = SPEED_100;
break;
}
-   }
 
if (max_speed == SPEED_1000) {
+   /* configure muram FIFOs for gigabit operation */
ug_info->uf_info.urfs = UCC_GETH_URFS_GIGA_INIT;
ug_info->uf_info.urfet = UCC_GETH_URFET_

pdc202xx_old: rewrite mode programming code (v2)

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4fce3164b84d5b014acbf5a3f57eb3650e154f5b
Commit: 4fce3164b84d5b014acbf5a3f57eb3650e154f5b
Parent: f653c34dd3d8bde2c918316fd5ba2e2c4f95afcf
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Wed May 16 00:51:41 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Wed May 16 00:51:41 2007 +0200

pdc202xx_old: rewrite mode programming code (v2)

This patch is based on the documentation (I would like to thank Promise
for it) and also partially on the older vendor driver.

Rewrite mode programming code:

* disable 66MHz clock in pdc202xx_tune_chipset() so it is correctly disabled
  even if both devices on the channel are not DMA capable and after reset

* enable/disable IORDY and PREFETCH bits in pdc202xx_tune_chipset()
  as they need to be setup correctly also for PIO only devices, plus IORDY
  wasn't disabled for non-IORDY devices and PREFETCH wasn't disabled for
  ATAPI devices

* remove dead code for setting SYNC_ERDDY_EN bits from 
config_chipset_for_dma()
  (driver sets ->autotune to 1 so PIO modes are always programmed => lower
   nibble of register A never equals 4 => "chipset_is_set" is always true)

* enable PIO mode programming for all ATAPI devices
  (it was limited to ->media == ide_cdrom devices)

* remove extra reads of registers A/B/C, don't read register D et all

* do clearing / programming of registers A/B/C in one go
  (gets rid of extra PCI config space read/write cycle)

* set initial values of drive_conf/AP/BP/CP variables to zero
  (paranoia for the case when PCI reads fail)

* remove XFER_UDMA6 to XFER_UDMA5 remapping case - it can't happen
  (ide_rate_filter() takes care of it)

* fix XFER_MW_DMA0 timings (they were overclocked, use the official ones)

* fix bitmasks for clearing bits of register B:

  - when programming DMA mode bit 0x10 of register B was cleared which
resulted in overclocked PIO timing setting (iff PIO0 was used)

  - when programming PIO mode bits 0x18 weren't cleared so suboptimal
timings were used for PIO1-4 if PIO0 was previously set (bit 0x10)
and for PIO0/3/4 if PIO1/2 was previously set (bit 0x08)

* add FIXME comment about missing locking for 66MHz clock register

Also while at it:

* remove unused defines

* do a few cosmetic / CodingStyle fixes

* bump driver version

v2:
* in pdc202xx_tune_chipset() the old content of drive configuration
  registers is used only by the debugging code so cover "drive_conf"
  PCI registers read by #if PDC202XX_DEBUG_DRIVE_INFO
  (Noticed by Sergei Shtylyov)

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/pci/pdc202xx_old.c |  178 ++--
 1 files changed, 44 insertions(+), 134 deletions(-)

diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index 7146fe3..a6dd9c8 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -1,8 +1,9 @@
 /*
- *  linux/drivers/ide/pci/pdc202xx_old.c   Version 0.36Sept 11, 2002
+ *  linux/drivers/ide/pci/pdc202xx_old.c   Version 0.50Mar 3, 2007
  *
  *  Copyright (C) 1998-2002Andre Hedrick <[EMAIL PROTECTED]>
  *  Copyright (C) 2006-2007MontaVista Software, Inc.
+ *  Copyright (C) 2007 Bartlomiej Zolnierkiewicz
  *
  *  Promise Ultra33 cards with BIOS v1.20 through 1.28 will need this
  *  compiled into the kernel if you have more than one card installed.
@@ -60,45 +61,7 @@ static const char *pdc_quirk_drives[] = {
NULL
 };
 
-/* A Register */
-#defineSYNC_ERRDY_EN   0xC0
-
-#defineSYNC_IN 0x80/* control bit, different for master 
vs. slave drives */
-#defineERRDY_EN0x40/* control bit, different for master 
vs. slave drives */
-#defineIORDY_EN0x20/* PIO: IOREADY */
-#definePREFETCH_EN 0x10/* PIO: PREFETCH */
-
-#definePA3 0x08/* PIO"A" timing */
-#definePA2 0x04/* PIO"A" timing */
-#definePA1 0x02/* PIO"A" timing */
-#definePA0 0x01/* PIO"A" timing */
-
-/* B Register */
-
-#defineMB2 0x80/* DMA"B" timing */
-#defineMB1 0x40/* DMA"B" timing */
-#defineMB0 0x20/* DMA"B" timing */
-
-#definePB4 0x10/* PIO_FORCE 1:0 */
-
-#definePB3 0x08/* PIO"B" timing */ /* PIO flow 
Control mode */
-#definePB2 0x04/* PIO"B" timing */ /* PIO 4 */
-#definePB1 0x02/* PIO"B" timing */ /* PIO 

serverworks: PIO mode setup fixes

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9445de76c124e90176b5116cf82f6cd1413f5230
Commit: 9445de76c124e90176b5116cf82f6cd1413f5230
Parent: 4fce3164b84d5b014acbf5a3f57eb3650e154f5b
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Wed May 16 00:51:42 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Wed May 16 00:51:42 2007 +0200

serverworks: PIO mode setup fixes

* limit max PIO mode to PIO4, this driver doesn't support PIO5 and attempt
  to program PIO5 by svwks_tune_chipset() could result in incorrect PIO
  timings being programmed and possibly the data corruption (it seems that
  the minimum possible values were used but I lack the datasheets to be 
sure)

* select best PIO mode in svwks_tune_drive() and not in svwks_tune_chipset()
  when doing PIO autotuning (pio == 255)

* don't try to tune PIO in config_chipset_for_dma() as ide_dma_enable() 
could
  return 1 if DMA was previously enabled (svwks_config_drive_xfer_rate()
  takes care of PIO tuning if no suitable DMA mode is found)

* remove config_chipset_for_pio() and use svwks_tune_drive() instead,
  config_chipset_for_pio() contained numerous bugs when selecting PIO mode
  (luckily it was only used for devices limited to PIO by 
capabilities/BIOS):

  - it didn't check for validity of id->eide_pio_modes and 
id->eide_pio_iordy
before using them

  - it tried to found out maximum PIO mode basing on minimum IORDY cycle 
time
(moreover wrong cycle times were used for PIO0/1/5)

  - it was overriding PIO blacklist and conservative PIO "downgrade" done
by ide_get_best_pio_mode()

  - if the max drive PIO was PIO5 then XFER_PIO_0/XFER_PIO_SLOW was selected
(XFER_PIO_SLOW is not supported by svwks_tune_chipset() so the result
 was the same as if using XFER_PIO_5 => wrong PIO timings were set)

  - it was overriding drive->current_speed

* bump driver version

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/pci/serverworks.c |   68 +
 1 files changed, 15 insertions(+), 53 deletions(-)

diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c
index 2fa6d92..a94e77d 100644
--- a/drivers/ide/pci/serverworks.c
+++ b/drivers/ide/pci/serverworks.c
@@ -1,9 +1,10 @@
 /*
- * linux/drivers/ide/pci/serverworks.c Version 0.8  25 Ebr 2003
+ * linux/drivers/ide/pci/serverworks.c Version 0.9 Mar 4 2007
  *
  * Copyright (C) 1998-2000 Michel Aubry
  * Copyright (C) 1998-2000 Andrzej Krzysztofowicz
  * Copyright (C) 1998-2000 Andre Hedrick <[EMAIL PROTECTED]>
+ * Copyright (C)  2007 Bartlomiej Zolnierkiewicz
  * Portions copyright (c) 2001 Sun Microsystems
  *
  *
@@ -136,19 +137,14 @@ static int svwks_tune_chipset (ide_drive_t *drive, u8 
xferspeed)
 
ide_hwif_t *hwif= HWIF(drive);
struct pci_dev *dev = hwif->pci_dev;
-   u8 speed;
-   u8 pio  = ide_get_best_pio_mode(drive, 255, 5, NULL);
+   u8 speed= ide_rate_filter(drive, xferspeed);
+   u8 pio  = ide_get_best_pio_mode(drive, 255, 4, NULL);
u8 unit = (drive->select.b.unit & 0x01);
u8 csb5 = svwks_csb_check(dev);
u8 ultra_enable = 0, ultra_timing = 0;
u8 dma_timing   = 0, pio_timing = 0;
u16 csb5_pio= 0;
 
-   if (xferspeed == 255)   /* PIO auto-tuning */
-   speed = XFER_PIO_0 + pio;
-   else
-   speed = ide_rate_filter(drive, xferspeed);
-
/* If we are about to put a disk into UDMA mode we screwed up.
   Our code assumes we never _ever_ do this on an OSB4 */
   
@@ -231,6 +227,9 @@ oem_setup_failed:
case XFER_MW_DMA_2:
case XFER_MW_DMA_1:
case XFER_MW_DMA_0:
+   /*
+* TODO: always setup PIO mode so this won't be needed
+*/
pio_timing |= pio_modes[pio];
csb5_pio   |= (pio << (4*drive->dn));
dma_timing |= dma_modes[speed - XFER_MW_DMA_0];
@@ -242,6 +241,9 @@ oem_setup_failed:
case XFER_UDMA_2:
case XFER_UDMA_1:
case XFER_UDMA_0:
+   /*
+* TODO: always setup PIO mode so this won't be needed
+*/
pio_timing   |= pio_modes[pio];
csb5_pio |= (pio << (4*drive->dn));
dma_timing   |= dma_modes[2];
@@ -262,58 +264,18 @@ oem_setup_failed:
return (ide_config_drive_speed(drive, speed));
 }
 
-static void config_chipset_for_p

sis5513: PIO mode setup fixes

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6b8cf7724bd0f8ae1f61937c5f40f4dbbda40960
Commit: 6b8cf7724bd0f8ae1f61937c5f40f4dbbda40960
Parent: 9445de76c124e90176b5116cf82f6cd1413f5230
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Wed May 16 00:51:42 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Wed May 16 00:51:42 2007 +0200

sis5513: PIO mode setup fixes

* limit max PIO mode to PIO4, this driver doesn't support PIO5 and attempt
  to program PIO5 by config_art_rwp_pio() could result in incorrect PIO
  timings being programmed and possibly the data corruption (for < ATA100
  family chipsets PIO0 timings were used, for ATA100 and ATA100a - the 
random
  content of test1 variable was used, for ATA133 - MWDMA0 timings were used)

* BUG() in sis5513_tune_chipset() if somebody tries to force unsupported 
PIO5,
  also cleanup this function a bit while at it

* add comment about PIO0 timings for < ATA100 family chipsets

* remove open-coded best PIO mode selection from config_art_rwp_pio(),
  it contained numerous bugs:

  - it didn't check for validity of id->eide_pio_modes and 
id->eide_pio_iordy
before using them

  - it tried to found out maximum PIO mode basing on minimum IORDY cycle 
time
(moreover wrong cycle times were used for PIO1/5)

  - it was overriding PIO blacklist and conservative PIO "downgrade" done
by ide_get_best_pio_mode()

* use sis5513_tune_drive() instead of config_art_rwp_pio()
  in sis5513_config_xfer_rate() so the correct PIO mode is also set
  on drive even if the device is not IORDY/DMA capable

* config_art_rwp_pio() was always setting the best possible mode and not
  the wanted one - fix it and move ide_get_best_pio_mode() call to
  config_chipset_for_pio()

* don't use ide_find_best_mode() in config_chipset_for_pio(), it was being
  overriden by config_art_rwp_pio() for the host timings anyway + we need to
  set the same PIO mode on the device and the host

* pass correct "pio" argument (255 instead of 5) to sis5513_tune_drive() 
call
  in sis5513_config_xfer_rate() so the best PIO mode is set on the drive
  and not PIO4

* rename sis5513_tune_drive() to sis5513_tuneproc()
  and config_chipset_for_pio() to sis5513_tune_driver()

* bump driver version

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/pci/sis5513.c |   85 +++--
 1 files changed, 36 insertions(+), 49 deletions(-)

diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c
index 2bde1b9..bb6cc4a 100644
--- a/drivers/ide/pci/sis5513.c
+++ b/drivers/ide/pci/sis5513.c
@@ -1,9 +1,11 @@
 /*
- * linux/drivers/ide/pci/sis5513.c Version 0.16ac+vp   Jun 18, 2003
+ * linux/drivers/ide/pci/sis5513.c Version 0.20Mar 4, 2007
  *
  * Copyright (C) 1999-2000 Andre Hedrick <[EMAIL PROTECTED]>
  * Copyright (C) 2002  Lionel Bouton <[EMAIL PROTECTED]>, Maintainer
  * Copyright (C) 2003  Vojtech Pavlik <[EMAIL PROTECTED]>
+ * Copyright (C) 2007  Bartlomiej Zolnierkiewicz
+ *
  * May be copied or modified under the terms of the GNU General Public License
  *
  *
@@ -448,36 +450,15 @@ static void config_drive_art_rwp (ide_drive_t *drive)
pci_write_config_byte(dev, 0x4b, reg4bh|rw_prefetch);
 }
 
-
 /* Set per-drive active and recovery time */
 static void config_art_rwp_pio (ide_drive_t *drive, u8 pio)
 {
ide_hwif_t *hwif= HWIF(drive);
struct pci_dev *dev = hwif->pci_dev;
 
-   u8  timing, drive_pci, test1, test2;
-
-   u16 eide_pio_timing[6] = {600, 390, 240, 180, 120, 90};
-   u16 xfer_pio = drive->id->eide_pio_modes;
+   u8 drive_pci, test1, test2;
 
config_drive_art_rwp(drive);
-   pio = ide_get_best_pio_mode(drive, 255, pio, NULL);
-
-   if (xfer_pio> 4)
-   xfer_pio = 0;
-
-   if (drive->id->eide_pio_iordy > 0) {
-   for (xfer_pio = 5;
-   (xfer_pio > 0) &&
-   (drive->id->eide_pio_iordy > eide_pio_timing[xfer_pio]);
-   xfer_pio--);
-   } else {
-   xfer_pio = (drive->id->eide_pio_modes & 4) ? 0x05 :
-  (drive->id->eide_pio_modes & 2) ? 0x04 :
-  (drive->id->eide_pio_modes & 1) ? 0x03 : xfer_pio;
-   }
-
-   timing = (xfer_pio >= pio) ? xfer_pio : pio;
 
/* In pre ATA_133 case, drives sit at 0x40 + 4*drive->dn */
drive_pci = 0x40;
@@ -500,17 +481,18 @@ static void config_art_rwp_pio (ide_drive_t *drive, u8 
pio)
test1 &= ~0x0F;
test2 &= ~0x07;
 
-   switch(timing) {
+   switch(pio) {

alim15x3: use ide_tune_dma()

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=38ff8a74e8f015f94289b84cd6572a68c3431cdd
Commit: 38ff8a74e8f015f94289b84cd6572a68c3431cdd
Parent: 6b8cf7724bd0f8ae1f61937c5f40f4dbbda40960
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Wed May 16 00:51:43 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Wed May 16 00:51:43 2007 +0200

alim15x3: use ide_tune_dma()

Use ide_tune_dma() in ali15x3_config_drive_for_dma() and remove all the open
coded DMA tuning code and also config_chipset_for_dma().  Set ->atapi_dma 
flag
correctly in init_hwif_common_ali15x3() so ide_tune_dma() can take care of
checking if ATAPI DMA is allowed and remove open coded ATAPI DMA check from
ali15x3_config_drive_for_dma().

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/pci/alim15x3.c |   69 ---
 1 files changed, 7 insertions(+), 62 deletions(-)

diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c
index 428efda..27525ec 100644
--- a/drivers/ide/pci/alim15x3.c
+++ b/drivers/ide/pci/alim15x3.c
@@ -455,28 +455,6 @@ static int ali15x3_tune_chipset (ide_drive_t *drive, u8 
xferspeed)
return (ide_config_drive_speed(drive, speed));
 }
 
-
-/**
- * config_chipset_for_dma  -   set up DMA mode
- * @drive: drive to configure for
- *
- * Place a drive into DMA mode and tune the chipset for
- * the selected speed.
- *
- * Returns true if DMA mode can be used
- */
- 
-static int config_chipset_for_dma (ide_drive_t *drive)
-{
-   u8 speed = ide_max_dma_mode(drive);
-
-   if (!(speed))
-   return 0;
-
-   (void) ali15x3_tune_chipset(drive, speed);
-   return ide_dma_enable(drive);
-}
-
 /**
  * ali15x3_config_drive_for_dma-   configure for DMA
  * @drive: drive to configure
@@ -487,48 +465,14 @@ static int config_chipset_for_dma (ide_drive_t *drive)
 
 static int ali15x3_config_drive_for_dma(ide_drive_t *drive)
 {
-   ide_hwif_t *hwif= HWIF(drive);
-   struct hd_driveid *id   = drive->id;
-
-   if ((m5229_revision<=0x20) && (drive->media!=ide_disk))
-   goto ata_pio;
-
drive->init_speed = 0;
 
-   if ((id != NULL) && ((id->capability & 1) != 0) && drive->autodma) {
-   /* Consult the list of known "bad" drives */
-   if (__ide_dma_bad_drive(drive))
-   goto ata_pio;
-   if ((id->field_valid & 4) && (m5229_revision >= 0xC2)) {
-   if (id->dma_ultra & hwif->ultra_mask) {
-   /* Force if Capable UltraDMA */
-   int dma = config_chipset_for_dma(drive);
-   if ((id->field_valid & 2) && !dma)
-   goto try_dma_modes;
-   }
-   } else if (id->field_valid & 2) {
-try_dma_modes:
-   if ((id->dma_mword & hwif->mwdma_mask) ||
-   (id->dma_1word & hwif->swdma_mask)) {
-   /* Force if Capable regular DMA modes */
-   if (!config_chipset_for_dma(drive))
-   goto ata_pio;
-   }
-   } else if (__ide_dma_good_drive(drive) &&
-  (id->eide_dma_time < 150)) {
-   /* Consult the list of known "good" drives */
-   if (!config_chipset_for_dma(drive))
-   goto ata_pio;
-   } else {
-   goto ata_pio;
-   }
-   } else {
-ata_pio:
-   hwif->tuneproc(drive, 255);
-   return -1;
-   }
+   if (ide_tune_dma(drive))
+   return 0;
 
-   return 0;
+   ali15x3_tune_drive(drive, 255);
+
+   return -1;
 }
 
 /**
@@ -739,7 +683,8 @@ static void __devinit init_hwif_common_ali15x3 (ide_hwif_t 
*hwif)
return;
}
 
-   hwif->atapi_dma = 1;
+   if (m5229_revision > 0x20)
+   hwif->atapi_dma = 1;
 
if (m5229_revision <= 0x20)
hwif->ultra_mask = 0x00; /* no udma */
-
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


pdc202xx_new: use ide_tune_dma()

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7f86723a60d287be19aee620277184f9f5455283
Commit: 7f86723a60d287be19aee620277184f9f5455283
Parent: 38ff8a74e8f015f94289b84cd6572a68c3431cdd
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Wed May 16 00:51:43 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Wed May 16 00:51:43 2007 +0200

pdc202xx_new: use ide_tune_dma()

* remove code enabling IORDY and prefetch from config_chipset_for_dma(),
  as the comment states it has no real effect because these settings are
  overriden when the PIO mode is set (and for this driver ->autotune == 1
  so PIO mode is always programmed)

* use ide_tune_dma() in pdcnew_config_drive_xfer_rate() and remove no longer
  needed config_chipset_for_dma()

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/pci/pdc202xx_new.c |   29 +
 1 files changed, 1 insertions(+), 28 deletions(-)

diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
index 65b1e12..cc0bfdc 100644
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -228,38 +228,11 @@ static u8 pdcnew_cable_detect(ide_hwif_t *hwif)
return get_indexed_reg(hwif, 0x0b) & 0x04;
 }
 
-static int config_chipset_for_dma(ide_drive_t *drive)
-{
-   struct hd_driveid *id   = drive->id;
-   ide_hwif_t *hwif= HWIF(drive);
-   u8 speed;
-
-   if (id->capability & 4) {
-   /*
-* Set IORDY_EN & PREFETCH_EN (this seems to have
-* NO real effect since this register is reloaded
-* by hardware when the transfer mode is selected)
-*/
-   u8 tmp, adj = (drive->dn & 1) ? 0x08 : 0x00;
-
-   tmp = get_indexed_reg(hwif, 0x13 + adj);
-   set_indexed_reg(hwif, 0x13 + adj, tmp | 0x03);
-   }
-
-   speed = ide_max_dma_mode(drive);
-
-   if (!speed)
-   return 0;
-
-   (void) hwif->speedproc(drive, speed);
-   return ide_dma_enable(drive);
-}
-
 static int pdcnew_config_drive_xfer_rate(ide_drive_t *drive)
 {
drive->init_speed = 0;
 
-   if (ide_use_dma(drive) && config_chipset_for_dma(drive))
+   if (ide_tune_dma(drive))
return 0;
 
if (ide_use_fast_pio(drive))
-
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


ide: always disable DMA before tuning it

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=793a97228d3da876f42b7fb4d4a52cc8cc86dc81
Commit: 793a97228d3da876f42b7fb4d4a52cc8cc86dc81
Parent: 7f86723a60d287be19aee620277184f9f5455283
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Wed May 16 00:51:43 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Wed May 16 00:51:43 2007 +0200

ide: always disable DMA before tuning it

ide_start_power_step() and set_using_dma() were missing ->dma_off_quietly
call (comment in probe_hwif() states that DMA should be always cleared 
before
tuning is attempted).  Fix it.

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-io.c |1 +
 drivers/ide/ide.c|1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 8e56814..bfe8f1b 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -223,6 +223,7 @@ static ide_startstop_t ide_start_power_step(ide_drive_t 
*drive, struct request *
break;
if (drive->hwif->ide_dma_check == NULL)
break;
+   drive->hwif->dma_off_quietly(drive);
ide_set_dma(drive);
break;
}
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index f2b547f..6002713 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -910,6 +910,7 @@ int set_using_dma(ide_drive_t *drive, int arg)
err = 0;
 
if (arg) {
+   hwif->dma_off_quietly(drive);
if (ide_set_dma(drive) || hwif->ide_dma_on(drive))
err = -EIO;
} 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


cs5530/sc1200: add ->udma_filter methods

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5fd216bbb277b645109a889c489e13a7aafbc304
Commit: 5fd216bbb277b645109a889c489e13a7aafbc304
Parent: 793a97228d3da876f42b7fb4d4a52cc8cc86dc81
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Wed May 16 00:51:43 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Wed May 16 00:51:43 2007 +0200

cs5530/sc1200: add ->udma_filter methods

CS5530/SC1200 specifies that two drives on the same cable cannot mix
UDMA/MDMA.  Add {cs5530,sc1200}_udma_filter() to handle this.  This also
makes it possible to remove open-coded best DMA mode selection and use
standard ide_use_dma()/ide_max_dma_mode() helpers.  While at it bump
version numbers.

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/pci/cs5530.c |  120 +-
 drivers/ide/pci/sc1200.c |   86 +---
 2 files changed, 89 insertions(+), 117 deletions(-)

diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c
index b2d7c13..8455001 100644
--- a/drivers/ide/pci/cs5530.c
+++ b/drivers/ide/pci/cs5530.c
@@ -1,10 +1,10 @@
 /*
- * linux/drivers/ide/pci/cs5530.c  Version 0.7 Sept 10, 2002
+ * linux/drivers/ide/pci/cs5530.c  Version 0.71Mar 10 2007
  *
  * Copyright (C) 2000  Andre Hedrick <[EMAIL PROTECTED]>
- * Ditto of GNU General Public License.
- *
  * Copyright (C) 2000  Mark Lord <[EMAIL PROTECTED]>
+ * Copyright (C) 2007  Bartlomiej Zolnierkiewicz
+ *
  * May be copied or modified under the terms of the GNU General Public License
  *
  * Development of this chipset driver was funded
@@ -88,79 +88,66 @@ static void cs5530_tuneproc (ide_drive_t *drive, u8 pio)
/* pio=255 means "autot
 }
 
 /**
- * cs5530_config_dma   -   select/set DMA and UDMA modes
+ * cs5530_udma_filter  -   UDMA filter
+ * @drive: drive
+ *
+ * cs5530_udma_filter() does UDMA mask filtering for the given drive
+ * taking into the consideration capabilities of the mate device.
+ *
+ * The CS5530 specifies that two drives sharing a cable cannot mix
+ * UDMA/MDMA.  It has to be one or the other, for the pair, though
+ * different timings can still be chosen for each drive.  We could
+ * set the appropriate timing bits on the fly, but that might be
+ * a bit confusing.  So, for now we statically handle this requirement
+ * by looking at our mate drive to see what it is capable of, before
+ * choosing a mode for our own drive.
+ *
+ * Note: This relies on the fact we never fail from UDMA to MWDMA2
+ * but instead drop to PIO.
+ */
+
+static u8 cs5530_udma_filter(ide_drive_t *drive)
+{
+   ide_hwif_t *hwif = drive->hwif;
+   ide_drive_t *mate = &hwif->drives[(drive->dn & 1) ^ 1];
+   struct hd_driveid *mateid = mate->id;
+   u8 mask = hwif->ultra_mask;
+
+   if (mate->present == 0)
+   goto out;
+
+   if ((mateid->capability & 1) && __ide_dma_bad_drive(mate) == 0) {
+   if ((mateid->field_valid & 4) && (mateid->dma_ultra & 7))
+   goto out;
+   if ((mateid->field_valid & 2) && (mateid->dma_mword & 7))
+   mask = 0;
+   }
+out:
+   return mask;
+}
+
+/**
+ * cs5530_config_dma   -   set DMA/UDMA mode
  * @drive: drive to tune
  *
- * cs5530_config_dma() handles selection/setting of DMA/UDMA modes
- * for both the chipset and drive. The CS5530 has limitations about
- * mixing DMA/UDMA on the same cable.
+ * cs5530_config_dma() handles setting of DMA/UDMA mode
+ * for both the chipset and drive.
  */
- 
-static int cs5530_config_dma (ide_drive_t *drive)
+
+static int cs5530_config_dma(ide_drive_t *drive)
 {
-   int udma_ok = 1, mode = 0;
-   ide_hwif_t  *hwif = HWIF(drive);
-   int unit = drive->select.b.unit;
-   ide_drive_t *mate = &hwif->drives[unit^1];
-   struct hd_driveid   *id = drive->id;
-   unsigned intreg, timings = 0;
-   unsigned long   basereg;
+   ide_hwif_t *hwif = drive->hwif;
+   unsigned int reg, timings = 0;
+   unsigned long basereg;
+   u8 unit = drive->dn & 1, mode = 0;
 
/*
 * Default to DMA-off in case we run into trouble here.
 */
hwif->dma_off_quietly(drive);
 
-   /*
-* The CS5530 specifies that two drives sharing a cable cannot
-* mix UDMA/MDMA.  It has to be one or the other, for the pair,
-* though different timings can still be chosen for each drive.
-* We could set the appropriate timing bits on the fly,
-* but that might b

ide: use ide_tune_dma() part #2

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bd203b57c7edd6bc457b769cd15fa7239cd2241e
Commit: bd203b57c7edd6bc457b769cd15fa7239cd2241e
Parent: 5fd216bbb277b645109a889c489e13a7aafbc304
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Wed May 16 00:51:43 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Wed May 16 00:51:43 2007 +0200

ide: use ide_tune_dma() part #2

Use ide_tune_dma() in ide-cris/it821x/pdc202xx_old/serverworks drivers.

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/cris/ide-cris.c|   14 +-
 drivers/ide/pci/it821x.c   |   21 +
 drivers/ide/pci/pdc202xx_old.c |   14 +-
 drivers/ide/pci/serverworks.c  |   13 +
 4 files changed, 4 insertions(+), 58 deletions(-)

diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c
index c04cb25..ca0341c 100644
--- a/drivers/ide/cris/ide-cris.c
+++ b/drivers/ide/cris/ide-cris.c
@@ -1002,18 +1002,6 @@ static int cris_ide_build_dmatable (ide_drive_t *drive)
return 1;   /* let the PIO routines handle this weirdness */
 }
 
-static int cris_config_drive_for_dma (ide_drive_t *drive)
-{
-   u8 speed = ide_max_dma_mode(drive);
-
-   if (!speed)
-   return 0;
-
-   speed_cris_ide(drive, speed);
-
-   return ide_dma_enable(drive);
-}
-
 /*
  * cris_dma_intr() is the handler for disk read/write DMA interrupts
  */
@@ -1043,7 +1031,7 @@ static ide_startstop_t cris_dma_intr (ide_drive_t *drive)
 
 static int cris_dma_check(ide_drive_t *drive)
 {
-   if (ide_use_dma(drive) && cris_config_drive_for_dma(drive))
+   if (ide_tune_dma(drive))
return 0;
 
return -1;
diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c
index 442f658..5faaff8 100644
--- a/drivers/ide/pci/it821x.c
+++ b/drivers/ide/pci/it821x.c
@@ -464,25 +464,6 @@ static int it821x_tune_chipset (ide_drive_t *drive, byte 
xferspeed)
 }
 
 /**
- * config_chipset_for_dma  -   configure for DMA
- * @drive: drive to configure
- *
- * Called by the IDE layer when it wants the timings set up.
- */
-
-static int config_chipset_for_dma (ide_drive_t *drive)
-{
-   u8 speed = ide_max_dma_mode(drive);
-
-   if (speed == 0)
-   return 0;
-
-   it821x_tune_chipset(drive, speed);
-
-   return ide_dma_enable(drive);
-}
-
-/**
  * it821x_configure_drive_for_dma  -   set up for DMA transfers
  * @drive: drive we are going to set up
  *
@@ -494,7 +475,7 @@ static int config_chipset_for_dma (ide_drive_t *drive)
 
 static int it821x_config_drive_for_dma (ide_drive_t *drive)
 {
-   if (ide_use_dma(drive) && config_chipset_for_dma(drive))
+   if (ide_tune_dma(drive))
return 0;
 
it821x_tuneproc(drive, 255);
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index a6dd9c8..2384468 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -181,23 +181,11 @@ static void pdc_old_disable_66MHz_clock(ide_hwif_t *hwif)
outb(clock & ~(hwif->channel ? 0x08 : 0x02), clock_reg);
 }
 
-static int config_chipset_for_dma (ide_drive_t *drive)
-{
-   u8 speed = ide_max_dma_mode(drive);
-
-   if (!speed)
-   return 0;
-
-   (void)pdc202xx_tune_chipset(drive, speed);
-
-   return ide_dma_enable(drive);
-}
-
 static int pdc202xx_config_drive_xfer_rate (ide_drive_t *drive)
 {
drive->init_speed = 0;
 
-   if (ide_use_dma(drive) && config_chipset_for_dma(drive))
+   if (ide_tune_dma(drive))
return 0;
 
if (ide_use_fast_pio(drive))
diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c
index a94e77d..6234f80 100644
--- a/drivers/ide/pci/serverworks.c
+++ b/drivers/ide/pci/serverworks.c
@@ -270,22 +270,11 @@ static void svwks_tune_drive (ide_drive_t *drive, u8 pio)
(void)svwks_tune_chipset(drive, XFER_PIO_0 + pio);
 }
 
-static int config_chipset_for_dma (ide_drive_t *drive)
-{
-   u8 speed = ide_max_dma_mode(drive);
-
-   if (!speed)
-   return 0;
-
-   (void) svwks_tune_chipset(drive, speed);
-   return ide_dma_enable(drive);
-}
-
 static int svwks_config_drive_xfer_rate (ide_drive_t *drive)
 {
drive->init_speed = 0;
 
-   if (ide_use_dma(drive) && config_chipset_for_dma(drive))
+   if (ide_tune_dma(drive))
return 0;
 
if (ide_use_fast_pio(drive))
-
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


cs5530/sc1200: DMA support cleanup

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a01ba4011aa745be44d0290c5da5cb2dfb4e37ce
Commit: a01ba4011aa745be44d0290c5da5cb2dfb4e37ce
Parent: bd203b57c7edd6bc457b769cd15fa7239cd2241e
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Wed May 16 00:51:44 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Wed May 16 00:51:44 2007 +0200

cs5530/sc1200: DMA support cleanup

sc1200.c:

* remove open-coded variant of ide_dma_host_off() (== ->dma_host_off),
  it is not needed because ->dma_off_quietly calls ->dma_host_off

* use ->dma_host_on (== ide_dma_host_on() for this driver) instead of
  open-coded variant, call it from the users of sc1200_config_dma2()

  [ there is no need to call ->dma_host_on in sc1200_config_dma() because
core code takes care of calling ->ide_dma_on on successful execution
of ->ide_dma_check ]

* add comment about ->tuneproc interface abuse

cs5530.c/sc1200.c:

* core code takes care of calling ->dma_off_quietly before calling
  ->ide_dma_check so there is no need to call it in ->ide_dma_check methods

* bump driver version

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/pci/cs5530.c |7 +--
 drivers/ide/pci/sc1200.c |   27 ---
 2 files changed, 13 insertions(+), 21 deletions(-)

diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c
index 8455001..ec52dbe 100644
--- a/drivers/ide/pci/cs5530.c
+++ b/drivers/ide/pci/cs5530.c
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/ide/pci/cs5530.c  Version 0.71Mar 10 2007
+ * linux/drivers/ide/pci/cs5530.c  Version 0.72Mar 10 2007
  *
  * Copyright (C) 2000  Andre Hedrick <[EMAIL PROTECTED]>
  * Copyright (C) 2000  Mark Lord <[EMAIL PROTECTED]>
@@ -141,11 +141,6 @@ static int cs5530_config_dma(ide_drive_t *drive)
unsigned long basereg;
u8 unit = drive->dn & 1, mode = 0;
 
-   /*
-* Default to DMA-off in case we run into trouble here.
-*/
-   hwif->dma_off_quietly(drive);
-
if (ide_use_dma(drive))
mode = ide_max_dma_mode(drive);
 
diff --git a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c
index c0254b5..65dcabe 100644
--- a/drivers/ide/pci/sc1200.c
+++ b/drivers/ide/pci/sc1200.c
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/ide/pci/sc1200.c  Version 0.92Mar 10 2007
+ * linux/drivers/ide/pci/sc1200.c  Version 0.93Mar 10 2007
  *
  * Copyright (C) 2000-2002 Mark Lord <[EMAIL PROTECTED]>
  * Copyright (C)  2007 Bartlomiej Zolnierkiewicz
@@ -137,12 +137,6 @@ static int sc1200_config_dma2 (ide_drive_t *drive, int 
mode)
unsigned intbasereg = hwif->channel ? 0x50 : 0x40;
 
/*
-* Default to DMA-off in case we run into trouble here.
-*/
-   hwif->dma_off_quietly(drive);   /* turn off DMA while we fiddle */
-   outb(inb(hwif->dma_base+2)&~(unit?0x40:0x20), hwif->dma_base+2); /* 
clear DMA_capable bit */
-
-   /*
 * Tell the drive to switch to the new mode; abort on failure.
 */
if (!mode || sc1200_set_xfer_mode(drive, mode)) {
@@ -217,8 +211,6 @@ static int sc1200_config_dma2 (ide_drive_t *drive, int mode)
pci_write_config_dword(hwif->pci_dev, basereg+12, timings);
}
 
-   outb(inb(hwif->dma_base+2)|(unit?0x40:0x20), hwif->dma_base+2); /* set 
DMA_capable bit */
-
return 0;   /* success */
 }
 
@@ -277,6 +269,9 @@ static void sc1200_tuneproc (ide_drive_t *drive, byte pio)  
/* mode=255 means "au
static byte modes[5] = {XFER_PIO_0, XFER_PIO_1, XFER_PIO_2, 
XFER_PIO_3, XFER_PIO_4};
int mode = -1;
 
+   /*
+* bad abuse of ->tuneproc interface
+*/
switch (pio) {
case 200: mode = XFER_UDMA_0;   break;
case 201: mode = XFER_UDMA_1;   break;
@@ -287,7 +282,9 @@ static void sc1200_tuneproc (ide_drive_t *drive, byte pio)  
/* mode=255 means "au
}
if (mode != -1) {
printk("SC1200: %s: changing (U)DMA mode\n", drive->name);
-   (void)sc1200_config_dma2(drive, mode);
+   hwif->dma_off_quietly(drive);
+   if (sc1200_config_dma2(drive, mode) == 0)
+   hwif->dma_host_on(drive);
return;
}
 
@@ -421,12 +418,12 @@ static int sc1200_resume (struct pci_dev *dev)
for (d = 0; d < MAX_DRIVES; ++d) {
ide_drive_t *drive = &(hwif->drives[d]);
if (drive->present && !__ide_dma_bad_drive(drive)) {
-   int was_using_dma = drive->using_dma;
+   int enable_dma = drive->using_dma;
  

cs5530/sc1200: add ->speedproc support

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3c3f5d2c9f64b47aceb88f8d80fcb70fb9f9809f
Commit: 3c3f5d2c9f64b47aceb88f8d80fcb70fb9f9809f
Parent: a01ba4011aa745be44d0290c5da5cb2dfb4e37ce
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Wed May 16 00:51:44 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Wed May 16 00:51:44 2007 +0200

cs5530/sc1200: add ->speedproc support

* add {cs5530,sc1200}_tunepio() for programming PIO timings

* add {cs5530,sc1200}_tune_chipset() (->speedproc method) for setting
  transfer mode and convert {cs5530,sc1200}_config_dma() to use it

* bump driver version

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/pci/cs5530.c |   57 +
 drivers/ide/pci/sc1200.c |   70 -
 2 files changed, 81 insertions(+), 46 deletions(-)

diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c
index ec52dbe..aacb79b 100644
--- a/drivers/ide/pci/cs5530.c
+++ b/drivers/ide/pci/cs5530.c
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/ide/pci/cs5530.c  Version 0.72Mar 10 2007
+ * linux/drivers/ide/pci/cs5530.c  Version 0.73Mar 10 2007
  *
  * Copyright (C) 2000  Andre Hedrick <[EMAIL PROTECTED]>
  * Copyright (C) 2000  Mark Lord <[EMAIL PROTECTED]>
@@ -62,6 +62,14 @@ static unsigned int cs5530_pio_timings[2][5] = {
 #define CS5530_BAD_PIO(timings) (((timings)&~0x8000)==0xe132)
 #define CS5530_BASEREG(hwif)   (((hwif)->dma_base & ~0xf) + ((hwif)->channel ? 
0x30 : 0x20))
 
+static void cs5530_tunepio(ide_drive_t *drive, u8 pio)
+{
+   unsigned long basereg = CS5530_BASEREG(drive->hwif);
+   unsigned int format = (inl(basereg + 4) >> 31) & 1;
+
+   outl(cs5530_pio_timings[format][pio], basereg + ((drive->dn & 1)<<3));
+}
+
 /**
  * cs5530_tuneproc -   select/set PIO modes
  *
@@ -74,17 +82,10 @@ static unsigned int cs5530_pio_timings[2][5] = {
 
 static void cs5530_tuneproc (ide_drive_t *drive, u8 pio)   /* pio=255 
means "autotune" */
 {
-   ide_hwif_t  *hwif = HWIF(drive);
-   unsigned intformat;
-   unsigned long basereg = CS5530_BASEREG(hwif);
-   static u8   modes[5] = { XFER_PIO_0, XFER_PIO_1, XFER_PIO_2, 
XFER_PIO_3, XFER_PIO_4};
-
pio = ide_get_best_pio_mode(drive, pio, 4, NULL);
-   if (!cs5530_set_xfer_mode(drive, modes[pio])) {
-   format = (inl(basereg + 4) >> 31) & 1;
-   outl(cs5530_pio_timings[format][pio],
-   basereg+(drive->select.b.unit<<3));
-   }
+
+   if (cs5530_set_xfer_mode(drive, XFER_PIO_0 + pio) == 0)
+   cs5530_tunepio(drive, pio);
 }
 
 /**
@@ -136,18 +137,27 @@ out:
 
 static int cs5530_config_dma(ide_drive_t *drive)
 {
-   ide_hwif_t *hwif = drive->hwif;
-   unsigned int reg, timings = 0;
+   if (ide_use_dma(drive)) {
+   u8 mode = ide_max_dma_mode(drive);
+
+   if (mode && drive->hwif->speedproc(drive, mode) == 0)
+   return 0;
+   }
+
+   return 1;
+}
+
+static int cs5530_tune_chipset(ide_drive_t *drive, u8 mode)
+{
unsigned long basereg;
-   u8 unit = drive->dn & 1, mode = 0;
+   unsigned int reg, timings = 0;
 
-   if (ide_use_dma(drive))
-   mode = ide_max_dma_mode(drive);
+   mode = ide_rate_filter(drive, mode);
 
/*
 * Tell the drive to switch to the new mode; abort on failure.
 */
-   if (!mode || cs5530_set_xfer_mode(drive, mode))
+   if (cs5530_set_xfer_mode(drive, mode))
return 1;   /* failure */
 
/*
@@ -160,14 +170,21 @@ static int cs5530_config_dma(ide_drive_t *drive)
case XFER_MW_DMA_0: timings = 0x0001; break;
case XFER_MW_DMA_1: timings = 0x00012121; break;
case XFER_MW_DMA_2: timings = 0x2020; break;
+   case XFER_PIO_4:
+   case XFER_PIO_3:
+   case XFER_PIO_2:
+   case XFER_PIO_1:
+   case XFER_PIO_0:
+   cs5530_tunepio(drive, mode - XFER_PIO_0);
+   return 0;
default:
BUG();
break;
}
-   basereg = CS5530_BASEREG(hwif);
+   basereg = CS5530_BASEREG(drive->hwif);
reg = inl(basereg + 4); /* get drive0 config register */
timings |= reg & 0x8000;/* preserve PIO format bit */
-   if (unit == 0) {/* are we configuring drive0? */
+   if ((drive-> dn & 1) == 0) {/* are we configuring drive0? */
outl(timings, basereg + 4); /* write drive0 config register 
*/
} else {
if (timi

sl82c105: add speedproc() method and MWDMA0/1 support

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=46cedc9b773795b6190c31e5d32de5207b55a356
Commit: 46cedc9b773795b6190c31e5d32de5207b55a356
Parent: 3c3f5d2c9f64b47aceb88f8d80fcb70fb9f9809f
Author: Sergei Shtylyov <[EMAIL PROTECTED]>
AuthorDate: Wed May 16 00:51:44 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Wed May 16 00:51:44 2007 +0200

sl82c105: add speedproc() method and MWDMA0/1 support

Add the speedproc() method for setting transfer modes, modify 
config_for_dma()
to call it and use ide_max_dma_mode() to select the best DMA mode.
Add support for the multiword DMA modes 0 and 1, using the upper half of the
'drive_data' field to store the DMA timings to program into the drive 
control
register when DMA is turned on for real.

Signed-off-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/pci/sl82c105.c |   71 ---
 1 files changed, 66 insertions(+), 5 deletions(-)

diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c
index fe3b4b9..3d7759c 100644
--- a/drivers/ide/pci/sl82c105.c
+++ b/drivers/ide/pci/sl82c105.c
@@ -82,7 +82,14 @@ static u8 sl82c105_tune_pio(ide_drive_t *drive, u8 pio)
 
pio = ide_get_best_pio_mode(drive, pio, 5, &p);
 
-   drive->drive_data = drv_ctrl = get_pio_timings(&p);
+   drv_ctrl = get_pio_timings(&p);
+
+   /*
+* Store the PIO timings so that we can restore them
+* in case DMA will be turned off...
+*/
+   drive->drive_data &= 0x;
+   drive->drive_data |= drv_ctrl;
 
if (!drive->using_dma) {
/*
@@ -100,14 +107,67 @@ static u8 sl82c105_tune_pio(ide_drive_t *drive, u8 pio)
 }
 
 /*
+ * Configure the drive and chipset for a new transfer speed.
+ */
+static int sl82c105_tune_chipset(ide_drive_t *drive, u8 speed)
+{
+   static u16 mwdma_timings[] = {0x0707, 0x0201, 0x0200};
+   u16 drv_ctrl;
+
+   DBG(("sl82c105_tune_chipset(drive:%s, speed:%s)\n",
+drive->name, ide_xfer_verbose(speed)));
+
+   speed = ide_rate_filter(drive, speed);
+
+   switch (speed) {
+   case XFER_MW_DMA_2:
+   case XFER_MW_DMA_1:
+   case XFER_MW_DMA_0:
+   drv_ctrl = mwdma_timings[speed - XFER_MW_DMA_0];
+
+   /*
+* Store the DMA timings so that we can actually program
+* them when DMA will be turned on...
+*/
+   drive->drive_data &= 0x;
+   drive->drive_data |= (unsigned long)drv_ctrl << 16;
+
+   /*
+* If we are already using DMA, we just reprogram
+* the drive control register.
+*/
+   if (drive->using_dma) {
+   struct pci_dev *dev = HWIF(drive)->pci_dev;
+   int reg = 0x44 + drive->dn * 4;
+
+   pci_write_config_word(dev, reg, drv_ctrl);
+   }
+   break;
+   case XFER_PIO_5:
+   case XFER_PIO_4:
+   case XFER_PIO_3:
+   case XFER_PIO_2:
+   case XFER_PIO_1:
+   case XFER_PIO_0:
+   (void) sl82c105_tune_pio(drive, speed - XFER_PIO_0);
+   break;
+   default:
+   return -1;
+   }
+
+   return ide_config_drive_speed(drive, speed);
+}
+
+/*
  * Configure the drive for DMA.
- * We'll program the chipset only when DMA is actually turned on.
  */
 static int config_for_dma(ide_drive_t *drive)
 {
+   u8 speed = ide_max_dma_mode(drive);
+
DBG(("config_for_dma(drive:%s)\n", drive->name));
 
-   if (ide_config_drive_speed(drive, XFER_MW_DMA_2) != 0)
+   if (!speed || sl82c105_tune_chipset(drive, speed))
return 0;
 
return ide_dma_enable(drive);
@@ -219,7 +279,7 @@ static int sl82c105_ide_dma_on(ide_drive_t *drive)
 
rc = __ide_dma_on(drive);
if (rc == 0) {
-   pci_write_config_word(dev, reg, 0x0200);
+   pci_write_config_word(dev, reg, drive->drive_data >> 16);
 
printk(KERN_INFO "%s: DMA enabled\n", drive->name);
}
@@ -357,6 +417,7 @@ static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
DBG(("init_hwif_sl82c105(hwif: ide%d)\n", hwif->index));
 
hwif->tuneproc  = &sl82c105_tune_drive;
+   hwif->speedproc = &sl82c105_tune_chipset;
hwif->selectproc= &sl82c105_selectproc;
hwif->resetproc = &sl82c105_resetproc;
 
@@ -388,7 +449,7 @@ static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
}
 
hwif->atapi_dma  = 1;
-   hwif->mwdma_mask = 0x04;
+   hwif->mwdma_mask = 0x07;
 
hwif->ide_dma_check = &sl82c105_ide_dma_check;
hwif->ide_dma_on= &sl82c105_ide_

ide: remove ide_dma_enable()

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4728d546d7137ad5350cc2e53d4748fd26f61a60
Commit: 4728d546d7137ad5350cc2e53d4748fd26f61a60
Parent: 46cedc9b773795b6190c31e5d32de5207b55a356
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Wed May 16 00:51:46 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Wed May 16 00:51:46 2007 +0200

ide: remove ide_dma_enable()

* check ->speedproc return value in ide_tune_dma()
* use ide_tune_dma() in cmd64x/cs5530/sc1200/siimage/sl82c105/scc_pata 
drivers
* remove no longer needed ide_dma_enable()

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-dma.c  |5 +++--
 drivers/ide/ide-lib.c  |   12 
 drivers/ide/pci/cmd64x.c   |   15 +--
 drivers/ide/pci/cs5530.c   |8 ++--
 drivers/ide/pci/sc1200.c   |8 ++--
 drivers/ide/pci/scc_pata.c |   22 +-
 drivers/ide/pci/siimage.c  |   24 +---
 drivers/ide/pci/sl82c105.c |   17 +
 include/linux/ide.h|1 -
 9 files changed, 11 insertions(+), 101 deletions(-)

diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 5fe8519..de33e6f 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -792,9 +792,10 @@ int ide_tune_dma(ide_drive_t *drive)
if (!speed)
return 0;
 
-   drive->hwif->speedproc(drive, speed);
+   if (drive->hwif->speedproc(drive, speed))
+   return 0;
 
-   return ide_dma_enable(drive);
+   return 1;
 }
 
 EXPORT_SYMBOL_GPL(ide_tune_dma);
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c
index 3be3c69..074bb32 100644
--- a/drivers/ide/ide-lib.c
+++ b/drivers/ide/ide-lib.c
@@ -111,18 +111,6 @@ u8 ide_rate_filter(ide_drive_t *drive, u8 speed)
 
 EXPORT_SYMBOL(ide_rate_filter);
 
-int ide_dma_enable (ide_drive_t *drive)
-{
-   ide_hwif_t *hwif= HWIF(drive);
-   struct hd_driveid *id   = drive->id;
-
-   return ((int)   id->dma_ultra >> 8) & hwif->ultra_mask) ||
- ((id->dma_mword >> 8) & hwif->mwdma_mask) ||
- ((id->dma_1word >> 8) & hwif->swdma_mask)) ? 1 : 0));
-}
-
-EXPORT_SYMBOL(ide_dma_enable);
-
 int ide_use_fast_pio(ide_drive_t *drive)
 {
struct hd_driveid *id = drive->id;
diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c
index 61ea96b..7c57dc6 100644
--- a/drivers/ide/pci/cmd64x.c
+++ b/drivers/ide/pci/cmd64x.c
@@ -352,22 +352,9 @@ static int cmd64x_tune_chipset (ide_drive_t *drive, u8 
speed)
return ide_config_drive_speed(drive, speed);
 }
 
-static int config_chipset_for_dma (ide_drive_t *drive)
-{
-   u8 speed = ide_max_dma_mode(drive);
-
-   if (!speed)
-   return 0;
-
-   if (cmd64x_tune_chipset(drive, speed))
-   return 0;
-
-   return ide_dma_enable(drive);
-}
-
 static int cmd64x_config_drive_for_dma (ide_drive_t *drive)
 {
-   if (ide_use_dma(drive) && config_chipset_for_dma(drive))
+   if (ide_tune_dma(drive))
return 0;
 
if (ide_use_fast_pio(drive))
diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c
index aacb79b..1eec1f3 100644
--- a/drivers/ide/pci/cs5530.c
+++ b/drivers/ide/pci/cs5530.c
@@ -137,12 +137,8 @@ out:
 
 static int cs5530_config_dma(ide_drive_t *drive)
 {
-   if (ide_use_dma(drive)) {
-   u8 mode = ide_max_dma_mode(drive);
-
-   if (mode && drive->hwif->speedproc(drive, mode) == 0)
-   return 0;
-   }
+   if (ide_tune_dma(drive))
+   return 0;
 
return 1;
 }
diff --git a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c
index c989fd9..523363c 100644
--- a/drivers/ide/pci/sc1200.c
+++ b/drivers/ide/pci/sc1200.c
@@ -240,12 +240,8 @@ static int sc1200_tune_chipset(ide_drive_t *drive, u8 mode)
  */
 static int sc1200_config_dma (ide_drive_t *drive)
 {
-   if (ide_use_dma(drive)) {
-   u8 mode = ide_max_dma_mode(drive);
-
-   if (mode && drive->hwif->speedproc(drive, mode) == 0)
-   return 0;
-   }
+   if (ide_tune_dma(drive))
+   return 0;
 
return 1;
 }
diff --git a/drivers/ide/pci/scc_pata.c b/drivers/ide/pci/scc_pata.c
index cbf9363..55bc0a3 100644
--- a/drivers/ide/pci/scc_pata.c
+++ b/drivers/ide/pci/scc_pata.c
@@ -322,26 +322,6 @@ static int scc_tune_chipset(ide_drive_t *drive, byte 
xferspeed)
 }
 
 /**
- * scc_config_chipset_for_dma  -   configure for DMA
- * @drive: drive to configure
- *
- * Called by scc_config_drive_for_dma().
- */
-
-static int scc_config_chipset_for_dma(ide_drive_t *drive)
-{
-   u8 speed = ide_max_dma_mode(drive);
-
-   if (!speed)
-   return 0;
-
-   if (scc_tune_chipset(drive, speed))
-   return 0;
-
-   return

ide: add missing validity checks for identify words 62 and 63

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3649c06e66ad3589374e8765ed69eda65658735c
Commit: 3649c06e66ad3589374e8765ed69eda65658735c
Parent: 4728d546d7137ad5350cc2e53d4748fd26f61a60
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Wed May 16 00:51:46 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Wed May 16 00:51:46 2007 +0200

ide: add missing validity checks for identify words 62 and 63

Check validity of identify words 62 and 63 before using them in
ide_get_mode_mask().

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-dma.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index de33e6f..ada2a3e 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -731,10 +731,12 @@ static unsigned int ide_get_mode_mask(ide_drive_t *drive, 
u8 base)
mask &= 0x07;
break;
case XFER_MW_DMA_0:
-   mask = id->dma_mword & hwif->mwdma_mask;
+   if (id->field_valid & 2)
+   mask = id->dma_mword & hwif->mwdma_mask;
break;
case XFER_SW_DMA_0:
-   mask = id->dma_1word & hwif->swdma_mask;
+   if (id->field_valid & 2)
+   mask = id->dma_1word & hwif->swdma_mask;
break;
default:
BUG();
-
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


ide: remove ide_use_dma()

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=122ab0887c36247bd4508c25e4fccf9264546fe2
Commit: 122ab0887c36247bd4508c25e4fccf9264546fe2
Parent: 3649c06e66ad3589374e8765ed69eda65658735c
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Wed May 16 00:51:46 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Wed May 16 00:51:46 2007 +0200

ide: remove ide_use_dma()

ide_use_dma() duplicates a lot of ide_max_dma_mode() functionality
and as all users of ide_use_dma() were converted to use ide_tune_dma()
now it is possible to add missing checks to ide_tune_dma() and remove
ide_use_dma() completely, so do it.

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-dma.c |   42 +-
 include/linux/ide.h   |2 --
 2 files changed, 5 insertions(+), 39 deletions(-)

diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index ada2a3e..b77b7d1 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -670,41 +670,6 @@ int __ide_dma_good_drive (ide_drive_t *drive)
 
 EXPORT_SYMBOL(__ide_dma_good_drive);
 
-int ide_use_dma(ide_drive_t *drive)
-{
-   struct hd_driveid *id = drive->id;
-   ide_hwif_t *hwif = drive->hwif;
-
-   if ((id->capability & 1) == 0 || drive->autodma == 0)
-   return 0;
-
-   /* consult the list of known "bad" drives */
-   if (__ide_dma_bad_drive(drive))
-   return 0;
-
-   /* capable of UltraDMA modes */
-   if (id->field_valid & 4) {
-   if (hwif->ultra_mask & id->dma_ultra)
-   return 1;
-   }
-
-   /* capable of regular DMA modes */
-   if (id->field_valid & 2) {
-   if (hwif->mwdma_mask & id->dma_mword)
-   return 1;
-   if (hwif->swdma_mask & id->dma_1word)
-   return 1;
-   }
-
-   /* consult the list of known "good" drives */
-   if (__ide_dma_good_drive(drive) && id->eide_dma_time < 150)
-   return 1;
-
-   return 0;
-}
-
-EXPORT_SYMBOL_GPL(ide_use_dma);
-
 static const u8 xfer_mode_bases[] = {
XFER_UDMA_0,
XFER_MW_DMA_0,
@@ -785,8 +750,11 @@ int ide_tune_dma(ide_drive_t *drive)
 {
u8 speed;
 
-   /* TODO: use only ide_max_dma_mode() */
-   if (!ide_use_dma(drive))
+   if ((drive->id->capability & 1) == 0 || drive->autodma == 0)
+   return 0;
+
+   /* consult the list of known "bad" drives */
+   if (__ide_dma_bad_drive(drive))
return 0;
 
speed = ide_max_dma_mode(drive);
diff --git a/include/linux/ide.h b/include/linux/ide.h
index be78961..07aba87 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1281,7 +1281,6 @@ struct drive_list_entry {
 int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *);
 int __ide_dma_bad_drive(ide_drive_t *);
 int __ide_dma_good_drive(ide_drive_t *);
-int ide_use_dma(ide_drive_t *);
 u8 ide_max_dma_mode(ide_drive_t *);
 int ide_tune_dma(ide_drive_t *);
 void ide_dma_off(ide_drive_t *);
@@ -1309,7 +1308,6 @@ extern int __ide_dma_timeout(ide_drive_t *);
 #endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
 
 #else
-static inline int ide_use_dma(ide_drive_t *drive) { return 0; }
 static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; }
 static inline int ide_tune_dma(ide_drive_t *drive) { return 0; }
 static inline void ide_dma_off(ide_drive_t *drive) { ; }
-
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


sl82c105: Switch to ref counting API

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=640b31bf1291d1fb8a3e90abed8f145410122bf8
Commit: 640b31bf1291d1fb8a3e90abed8f145410122bf8
Parent: 122ab0887c36247bd4508c25e4fccf9264546fe2
Author: Alan Cox <[EMAIL PROTECTED]>
AuthorDate: Wed May 16 00:51:46 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Wed May 16 00:51:46 2007 +0200

sl82c105: Switch to ref counting API

Not sure how this one got missed in the great purge some time ago but it 
did.

Signed-off-by: Alan Cox <[EMAIL PROTECTED]>
Cc: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/pci/sl82c105.c |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c
index ac1ec17..7c383d9 100644
--- a/drivers/ide/pci/sl82c105.c
+++ b/drivers/ide/pci/sl82c105.c
@@ -349,7 +349,7 @@ static unsigned int sl82c105_bridge_revision(struct pci_dev 
*dev)
/*
 * The bridge should be part of the same device, but function 0.
 */
-   bridge = pci_find_slot(dev->bus->number,
+   bridge = pci_get_bus_and_slot(dev->bus->number,
   PCI_DEVFN(PCI_SLOT(dev->devfn), 0));
if (!bridge)
return -1;
@@ -359,13 +359,15 @@ static unsigned int sl82c105_bridge_revision(struct 
pci_dev *dev)
 */
if (bridge->vendor != PCI_VENDOR_ID_WINBOND ||
bridge->device != PCI_DEVICE_ID_WINBOND_83C553 ||
-   bridge->class >> 8 != PCI_CLASS_BRIDGE_ISA)
+   bridge->class >> 8 != PCI_CLASS_BRIDGE_ISA) {
+   pci_dev_put(bridge);
return -1;
-
+   }
/*
 * We need to find function 0's revision, not function 1
 */
pci_read_config_byte(bridge, PCI_REVISION_ID, &rev);
+   pci_dev_put(bridge);
 
return rev;
 }
-
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


Use menuconfig objects: IDE

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e0ff9cd12a26259f8dd676124a188037e7e90b38
Commit: e0ff9cd12a26259f8dd676124a188037e7e90b38
Parent: 640b31bf1291d1fb8a3e90abed8f145410122bf8
Author: Jan Engelhardt <[EMAIL PROTECTED]>
AuthorDate: Wed May 16 00:51:46 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Wed May 16 00:51:46 2007 +0200

Use menuconfig objects: IDE

Use menuconfigs instead of menus, so the whole menu can be disabled at once
instead of going through all options.

Signed-off-by: Jan Engelhardt <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/Kconfig |   15 ---
 1 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index 9040809..b1a9b81 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -4,13 +4,10 @@
 # Andre Hedrick <[EMAIL PROTECTED]>
 #
 
-if BLOCK
-
-menu "ATA/ATAPI/MFM/RLL support"
-   depends on HAS_IOMEM
-
-config IDE
+menuconfig IDE
tristate "ATA/ATAPI/MFM/RLL support"
+   depends on BLOCK
+   depends on HAS_IOMEM
---help---
  If you say Y here, your kernel will be able to manage low cost mass
  storage units such as ATA/(E)IDE and ATAPI units. The most common
@@ -1099,8 +1096,4 @@ config BLK_DEV_HD_ONLY
 config BLK_DEV_HD
def_bool BLK_DEV_HD_IDE || BLK_DEV_HD_ONLY
 
-endif
-
-endmenu
-
-endif
+endif # IDE
-
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


sh64: ROUND_UP macro cleanup in arch/sh64/kernel/pci_sh5.c

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=47e77eeecf0b7892bba8a697c228ab846fea7a0f
Commit: 47e77eeecf0b7892bba8a697c228ab846fea7a0f
Parent: 705962ccc9d21a08b74b6b6e1d3cf10f98968a67
Author: Milind Arun Choudhary <[EMAIL PROTECTED]>
AuthorDate: Mon May 14 08:24:59 2007 +0900
Committer:  Paul Mundt <[EMAIL PROTECTED]>
CommitDate: Mon May 14 08:24:59 2007 +0900

sh64: ROUND_UP macro cleanup in arch/sh64/kernel/pci_sh5.c

ROUND_UP macro cleanup, use ALIGN where ever appropriate.

Signed-off-by: Milind Arun Choudhary <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Paul Mundt <[EMAIL PROTECTED]>
---
 arch/sh64/kernel/pci_sh5.c |   12 
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/arch/sh64/kernel/pci_sh5.c b/arch/sh64/kernel/pci_sh5.c
index 49862e1..649b336 100644
--- a/arch/sh64/kernel/pci_sh5.c
+++ b/arch/sh64/kernel/pci_sh5.c
@@ -375,8 +375,6 @@ irqreturn_t pcish5_serr_irq(int irq, void *dev_id, struct 
pt_regs *regs)
return IRQ_NONE;
 }
 
-#define ROUND_UP(x, a) (((x) + (a) - 1) & ~((a) - 1))
-
 static void __init
 pcibios_size_bridge(struct pci_bus *bus, struct resource *ior,
struct resource *memr)
@@ -433,8 +431,8 @@ pcibios_size_bridge(struct pci_bus *bus, struct resource 
*ior,
mem_res.end -= mem_res.start;
 
/* Align the sizes up by bridge rules */
-   io_res.end = ROUND_UP(io_res.end, 4*1024) - 1;
-   mem_res.end = ROUND_UP(mem_res.end, 1*1024*1024) - 1;
+   io_res.end = ALIGN(io_res.end, 4*1024) - 1;
+   mem_res.end = ALIGN(mem_res.end, 1*1024*1024) - 1;
 
/* Adjust the bridge's allocation requirements */
bridge->resource[0].end = bridge->resource[0].start + io_res.end;
@@ -447,18 +445,16 @@ pcibios_size_bridge(struct pci_bus *bus, struct resource 
*ior,
 
/* adjust parent's resource requirements */
if (ior) {
-   ior->end = ROUND_UP(ior->end, 4*1024);
+   ior->end = ALIGN(ior->end, 4*1024);
ior->end += io_res.end;
}
 
if (memr) {
-   memr->end = ROUND_UP(memr->end, 1*1024*1024);
+   memr->end = ALIGN(memr->end, 1*1024*1024);
memr->end += mem_res.end;
}
 }
 
-#undef ROUND_UP
-
 static void __init pcibios_size_bridges(void)
 {
struct resource io_res, mem_res;
-
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


spelling fixes: arch/sh64/

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0a354775af0d3e84158ff87115bdb022b2a517ee
Commit: 0a354775af0d3e84158ff87115bdb022b2a517ee
Parent: 47e77eeecf0b7892bba8a697c228ab846fea7a0f
Author: Simon Arlott <[EMAIL PROTECTED]>
AuthorDate: Mon May 14 08:25:48 2007 +0900
Committer:  Paul Mundt <[EMAIL PROTECTED]>
CommitDate: Mon May 14 08:25:48 2007 +0900

spelling fixes: arch/sh64/

Spelling fixes in arch/sh64/.

Signed-off-by: Simon Arlott <[EMAIL PROTECTED]>
Signed-off-by: Paul Mundt <[EMAIL PROTECTED]>
---
 arch/sh64/kernel/pci_sh5.h|2 +-
 arch/sh64/kernel/process.c|2 +-
 arch/sh64/kernel/time.c   |2 +-
 arch/sh64/mach-cayman/setup.c |2 +-
 arch/sh64/mm/fault.c  |2 +-
 arch/sh64/mm/tlbmiss.c|4 ++--
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/sh64/kernel/pci_sh5.h b/arch/sh64/kernel/pci_sh5.h
index 8f21f5d..c71159d 100644
--- a/arch/sh64/kernel/pci_sh5.h
+++ b/arch/sh64/kernel/pci_sh5.h
@@ -4,7 +4,7 @@
  * May be copied or modified under the terms of the GNU General Public
  * License.  See linux/COPYING for more information.
  *
- * Defintions for the SH5 PCI hardware.
+ * Definitions for the SH5 PCI hardware.
  */
 
 /* Product ID */
diff --git a/arch/sh64/kernel/process.c b/arch/sh64/kernel/process.c
index 525d0ec..1b89c9d 100644
--- a/arch/sh64/kernel/process.c
+++ b/arch/sh64/kernel/process.c
@@ -387,7 +387,7 @@ ATTRIB_NORET void kernel_thread_helper(void *arg, int 
(*fn)(void *))
  * NOTE! Only a kernel-only process(ie the swapper or direct descendants
  * who haven't done an "execve()") should use this: it will work within
  * a system call from a "real" process, but the process memory space will
- * not be free'd until both the parent and the child have exited.
+ * not be freed until both the parent and the child have exited.
  */
 int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
 {
diff --git a/arch/sh64/kernel/time.c b/arch/sh64/kernel/time.c
index 390b40d..bad0f05 100644
--- a/arch/sh64/kernel/time.c
+++ b/arch/sh64/kernel/time.c
@@ -123,7 +123,7 @@ static unsigned long long usecs_per_jiffy = 100/HZ; /* 
Approximation */
 static unsigned long long scaled_recip_ctc_ticks_per_jiffy;
 
 /* Estimate number of microseconds that have elapsed since the last timer tick,
-   by scaling the delta that has occured in the CTC register.
+   by scaling the delta that has occurred in the CTC register.
 
WARNING WARNING WARNING : This algorithm relies on the CTC decrementing at
the CPU clock rate.  If the CPU sleeps, the CTC stops counting.  Bear this
diff --git a/arch/sh64/mach-cayman/setup.c b/arch/sh64/mach-cayman/setup.c
index 3ed87cd..c3611cc 100644
--- a/arch/sh64/mach-cayman/setup.c
+++ b/arch/sh64/mach-cayman/setup.c
@@ -213,7 +213,7 @@ static int __init smsc_superio_setup(void)
SMSC_SUPERIO_WRITE_INDEXED(0x00, 0xc7); /* GP47 = nIOWOP */
 #endif
 
-   /* Exit the configuraton state */
+   /* Exit the configuration state */
outb(SMSC_EXIT_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
 
return 0;
diff --git a/arch/sh64/mm/fault.c b/arch/sh64/mm/fault.c
index 4dd8ee8..3cd93ba 100644
--- a/arch/sh64/mm/fault.c
+++ b/arch/sh64/mm/fault.c
@@ -135,7 +135,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, 
unsigned long writeaccess,
/* SIM
 * Note this is now called with interrupts still disabled
 * This is to cope with being called for a missing IO port
-* address with interupts disabled. This should be fixed as
+* address with interrupts disabled. This should be fixed as
 * soon as we have a better 'fast path' miss handler.
 *
 * Plus take care how you try and debug this stuff.
diff --git a/arch/sh64/mm/tlbmiss.c b/arch/sh64/mm/tlbmiss.c
index d4c5334..b767d6c 100644
--- a/arch/sh64/mm/tlbmiss.c
+++ b/arch/sh64/mm/tlbmiss.c
@@ -14,7 +14,7 @@
  * IMPORTANT NOTES :
  * The do_fast_page_fault function is called from a context in entry.S where 
very few registers
  * have been saved.  In particular, the code in this file must be compiled not 
to use ANY
- * caller-save regiseters that are not part of the restricted save set.  Also, 
it means that
+ * caller-save registers that are not part of the restricted save set.  Also, 
it means that
  * code in this file must not make calls to functions elsewhere in the kernel, 
or else the
  * excepting context will see corruption in its caller-save registers.  Plus, 
the entry.S save
  * area is non-reentrant, so this code has to run with SR.BL==1, i.e. no 
interrupts taken inside
@@ -249,7 +249,7 @@ asmlinkage int do_fast_page_fault(unsigned long long 
ssr_md, unsigned long long
/* SIM
 * Note this is now called with interrupts still disabled
 * This is to cope with being called for a missing IO port
-* address with interupts disabled. This should be fixed as

sh64: Wire up many new syscalls.

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6b5d1a0a2ff4fc5a26029f62eef033224ce0fa97
Commit: 6b5d1a0a2ff4fc5a26029f62eef033224ce0fa97
Parent: 0a354775af0d3e84158ff87115bdb022b2a517ee
Author: Paul Mundt <[EMAIL PROTECTED]>
AuthorDate: Mon May 14 09:07:27 2007 +0900
Committer:  Paul Mundt <[EMAIL PROTECTED]>
CommitDate: Mon May 14 09:07:27 2007 +0900

sh64: Wire up many new syscalls.

This has suffered a bit of bitrot, so we're a bit behind on the
syscalls. There were a few that were wrapped incorrectly as well,
caught by the syscall checker. Fix them all up.

Signed-off-by: Paul Mundt <[EMAIL PROTECTED]>
---
 arch/sh64/kernel/syscalls.S |   36 +---
 include/asm-sh64/unistd.h   |   43 +--
 2 files changed, 70 insertions(+), 9 deletions(-)

diff --git a/arch/sh64/kernel/syscalls.S b/arch/sh64/kernel/syscalls.S
index c0079d5..a5c680d 100644
--- a/arch/sh64/kernel/syscalls.S
+++ b/arch/sh64/kernel/syscalls.S
@@ -2,7 +2,7 @@
  * arch/sh64/kernel/syscalls.S
  *
  * Copyright (C) 2000, 2001  Paolo Alberelli
- * Copyright (C) 2004  Paul Mundt
+ * Copyright (C) 2004 - 2007  Paul Mundt
  * Copyright (C) 2003, 2004 Richard Curnow
  *
  * This file is subject to the terms and conditions of the GNU General Public
@@ -20,7 +20,7 @@
  */
.globl  sys_call_table
 sys_call_table:
-   .long sys_ni_syscall/* 0  -  old "setup()" system call  */
+   .long sys_restart_syscall   /* 0  -  old "setup()" system call  */
.long sys_exit
.long sys_fork
.long sys_read
@@ -347,4 +347,34 @@ sys_call_table:
.long sys_inotify_init
.long sys_inotify_add_watch
.long sys_inotify_rm_watch  /* 320 */
-
+   .long sys_ni_syscall
+   .long sys_migrate_pages
+   .long sys_openat
+   .long sys_mkdirat
+   .long sys_mknodat   /* 325 */
+   .long sys_fchownat
+   .long sys_futimesat
+   .long sys_fstatat64
+   .long sys_unlinkat
+   .long sys_renameat  /* 330 */
+   .long sys_linkat
+   .long sys_symlinkat
+   .long sys_readlinkat
+   .long sys_fchmodat
+   .long sys_faccessat /* 335 */
+   .long sys_pselect6
+   .long sys_ppoll
+   .long sys_unshare
+   .long sys_set_robust_list
+   .long sys_get_robust_list   /* 340 */
+   .long sys_splice
+   .long sys_sync_file_range
+   .long sys_tee
+   .long sys_vmsplice
+   .long sys_move_pages/* 345 */
+   .long sys_getcpu
+   .long sys_epoll_pwait
+   .long sys_utimensat
+   .long sys_signalfd
+   .long sys_timerfd   /* 350 */
+   .long sys_eventfd
diff --git a/include/asm-sh64/unistd.h b/include/asm-sh64/unistd.h
index 1f38a7a..ea3adc6 100644
--- a/include/asm-sh64/unistd.h
+++ b/include/asm-sh64/unistd.h
@@ -9,14 +9,14 @@
  * include/asm-sh64/unistd.h
  *
  * Copyright (C) 2000, 2001  Paolo Alberelli
- * Copyright (C) 2003  Paul Mundt
+ * Copyright (C) 2003 - 2007 Paul Mundt
  * Copyright (C) 2004  Sean McGoogan
  *
  * This file contains the system call numbers.
  *
  */
 
-#define __NR_setup   0 /* used only by init, to get system 
going */
+#define __NR_restart_syscall 0
 #define __NR_exit1
 #define __NR_fork2
 #define __NR_read3
@@ -196,8 +196,8 @@
 #define __NR_rt_sigtimedwait   177
 #define __NR_rt_sigqueueinfo   178
 #define __NR_rt_sigsuspend 179
-#define __NR_pread 180
-#define __NR_pwrite181
+#define __NR_pread64   180
+#define __NR_pwrite64  181
 #define __NR_chown 182
 #define __NR_getcwd183
 #define __NR_capget184
@@ -343,10 +343,41 @@
 #define __NR_inotify_init  318
 #define __NR_inotify_add_watch 319
 #define __NR_inotify_rm_watch  320
+/* 321 is unused */
+#define __NR_migrate_pages 322
+#define __NR_openat323
+#define __NR_mkdirat   324
+#define __NR_mknodat   325
+#define __NR_fchownat  326
+#define __NR_futimesat 327
+#define __NR_fstatat64 328
+#define __NR_unlinkat  329
+#define __NR_renameat  330
+#define __NR_linkat331
+#define __NR_symlinkat 332
+#define __NR_readlinkat333
+#define __NR_fchmodat  334
+#define __NR_faccessat 335
+#define __NR_pselect6  336
+#define __NR_ppoll 337
+#define __NR_unshare   338
+#define __NR_set_robust_list   339
+#define __NR_get_robust_list   340
+#define __NR_splice341
+#define __NR_sync_file_range   342
+#define __NR_tee   343
+#define __NR_vmsplice  344
+#define __NR_move_pages345
+#define __NR_getcpu346
+#define __NR_epoll_pwait   347
+#define __NR_utimensat   

sh64: Fixups for the irq_regs changes.

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a226d33abccff1959cec911da4143ea06ab22052
Commit: a226d33abccff1959cec911da4143ea06ab22052
Parent: 6b5d1a0a2ff4fc5a26029f62eef033224ce0fa97
Author: Paul Mundt <[EMAIL PROTECTED]>
AuthorDate: Mon May 14 09:10:01 2007 +0900
Committer:  Paul Mundt <[EMAIL PROTECTED]>
CommitDate: Mon May 14 09:10:01 2007 +0900

sh64: Fixups for the irq_regs changes.

A few interrupt handlers were never updated, fix them up.
We were missing the irq_regs conversion also, so do that
at the same time.

Signed-off-by: Paul Mundt <[EMAIL PROTECTED]>
---
 arch/sh64/kernel/irq.c  |4 +++-
 arch/sh64/kernel/pci_sh5.c  |5 +++--
 arch/sh64/kernel/time.c |   16 +---
 arch/sh64/mach-cayman/irq.c |4 ++--
 include/asm-sh64/irq_regs.h |1 +
 5 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/arch/sh64/kernel/irq.c b/arch/sh64/kernel/irq.c
index f68b4f6..9412b71 100644
--- a/arch/sh64/kernel/irq.c
+++ b/arch/sh64/kernel/irq.c
@@ -94,6 +94,7 @@ asmlinkage void do_NMI(unsigned long vector_num, struct 
pt_regs * regs)
  */
 asmlinkage int do_IRQ(unsigned long vector_num, struct pt_regs * regs)
 {
+   struct pt_regs *old_regs = set_irq_regs(regs);
int irq;
 
irq_enter();
@@ -101,13 +102,14 @@ asmlinkage int do_IRQ(unsigned long vector_num, struct 
pt_regs * regs)
irq = irq_demux(vector_num);
 
if (irq >= 0) {
-   __do_IRQ(irq, regs);
+   __do_IRQ(irq);
} else {
printk("unexpected IRQ trap at vector %03lx\n", vector_num);
}
 
irq_exit();
 
+   set_irq_regs(old_regs);
return 1;
 }
 
diff --git a/arch/sh64/kernel/pci_sh5.c b/arch/sh64/kernel/pci_sh5.c
index 649b336..fb51660 100644
--- a/arch/sh64/kernel/pci_sh5.c
+++ b/arch/sh64/kernel/pci_sh5.c
@@ -340,8 +340,9 @@ static int __init map_cayman_irq(struct pci_dev *dev, u8 
slot, u8 pin)
return result;
 }
 
-irqreturn_t pcish5_err_irq(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t pcish5_err_irq(int irq, void *dev_id)
 {
+   struct pt_regs *regs = get_irq_regs();
unsigned pci_int, pci_air, pci_cir, pci_aint;
 
pci_int = SH5PCI_READ(INT);
@@ -368,7 +369,7 @@ irqreturn_t pcish5_err_irq(int irq, void *dev_id, struct 
pt_regs *regs)
return IRQ_HANDLED;
 }
 
-irqreturn_t pcish5_serr_irq(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t pcish5_serr_irq(int irq, void *dev_id)
 {
printk("SERR IRQ\n");
 
diff --git a/arch/sh64/kernel/time.c b/arch/sh64/kernel/time.c
index bad0f05..b37f4f4 100644
--- a/arch/sh64/kernel/time.c
+++ b/arch/sh64/kernel/time.c
@@ -282,7 +282,7 @@ static long last_rtc_update = 0;
  * timer_interrupt() needs to keep up the real-time clock,
  * as well as call the "do_timer()" routine every clocktick
  */
-static inline void do_timer_interrupt(int irq, struct pt_regs *regs)
+static inline void do_timer_interrupt(void)
 {
unsigned long long current_ctc;
asm ("getcon cr62, %0" : "=r" (current_ctc));
@@ -290,9 +290,10 @@ static inline void do_timer_interrupt(int irq, struct 
pt_regs *regs)
 
do_timer(1);
 #ifndef CONFIG_SMP
-   update_process_times(user_mode(regs));
+   update_process_times(user_mode(get_irq_regs()));
 #endif
-   profile_tick(CPU_PROFILING, regs);
+   if (current->pid)
+   profile_tick(CPU_PROFILING);
 
 #ifdef CONFIG_HEARTBEAT
{
@@ -323,7 +324,7 @@ static inline void do_timer_interrupt(int irq, struct 
pt_regs *regs)
  * Time Stamp Counter value at the time of the timer interrupt, so that
  * we later on can estimate the time of day more exactly.
  */
-static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t timer_interrupt(int irq, void *dev_id)
 {
unsigned long timer_status;
 
@@ -340,7 +341,7 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, 
struct pt_regs *regs)
 * locally disabled. -arca
 */
write_lock(&xtime_lock);
-   do_timer_interrupt(irq, regs);
+   do_timer_interrupt();
write_unlock(&xtime_lock);
 
return IRQ_HANDLED;
@@ -465,9 +466,10 @@ static __init unsigned int get_cpu_hz(void)
 #endif
 }
 
-static irqreturn_t sh64_rtc_interrupt(int irq, void *dev_id,
- struct pt_regs *regs)
+static irqreturn_t sh64_rtc_interrupt(int irq, void *dev_id)
 {
+   struct pt_regs *regs = get_irq_regs();
+
ctrl_outb(0, RCR1); /* Disable Carry Interrupts */
regs->regs[3] = 1;  /* Using r3 */
 
diff --git a/arch/sh64/mach-cayman/irq.c b/arch/sh64/mach-cayman/irq.c
index 228ce61..aaad36d 100644
--- a/arch/sh64/mach-cayman/irq.c
+++ b/arch/sh64/mach-cayman/irq.c
@@ -29,13 +29,13 @@ unsigned long epld_virt;
 /* Note the SMSC SuperIO chip and SMSC LAN chip interrupts are all muxed onto
the 

sh64: dma-mapping updates.

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=599c26d32950c33bdd2a5ac6939bfe15ecf057e0
Commit: 599c26d32950c33bdd2a5ac6939bfe15ecf057e0
Parent: a226d33abccff1959cec911da4143ea06ab22052
Author: Paul Mundt <[EMAIL PROTECTED]>
AuthorDate: Mon May 14 09:10:46 2007 +0900
Committer:  Paul Mundt <[EMAIL PROTECTED]>
CommitDate: Mon May 14 09:10:46 2007 +0900

sh64: dma-mapping updates.

Follow the noncoherent changes from sh.

Signed-off-by: Paul Mundt <[EMAIL PROTECTED]>
---
 include/asm-sh64/dma-mapping.h |   14 +-
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/include/asm-sh64/dma-mapping.h b/include/asm-sh64/dma-mapping.h
index 5efe906..c7c0f05 100644
--- a/include/asm-sh64/dma-mapping.h
+++ b/include/asm-sh64/dma-mapping.h
@@ -35,6 +35,10 @@ static inline void dma_free_coherent(struct device *dev, 
size_t size,
consistent_free(NULL, size, vaddr, dma_handle);
 }
 
+#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
+#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
+#define dma_is_consistent(d, h) (1)
+
 static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
  enum dma_data_direction dir)
 {
@@ -49,7 +53,7 @@ static inline dma_addr_t dma_map_single(struct device *dev,
if (dev->bus == &pci_bus_type)
return virt_to_bus(ptr);
 #endif
-   dma_cache_sync(ptr, size, dir);
+   dma_cache_sync(dev, ptr, size, dir);
 
return virt_to_bus(ptr);
 }
@@ -63,7 +67,7 @@ static inline int dma_map_sg(struct device *dev, struct 
scatterlist *sg,
 
for (i = 0; i < nents; i++) {
 #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT)
-   dma_cache_sync(page_address(sg[i].page) + sg[i].offset,
+   dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset,
   sg[i].length, dir);
 #endif
sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset;
@@ -94,7 +98,7 @@ static inline void dma_sync_single(struct device *dev, 
dma_addr_t dma_handle,
if (dev->bus == &pci_bus_type)
return;
 #endif
-   dma_cache_sync(bus_to_virt(dma_handle), size, dir);
+   dma_cache_sync(dev, bus_to_virt(dma_handle), size, dir);
 }
 
 static inline void dma_sync_single_range(struct device *dev,
@@ -106,7 +110,7 @@ static inline void dma_sync_single_range(struct device *dev,
if (dev->bus == &pci_bus_type)
return;
 #endif
-   dma_cache_sync(bus_to_virt(dma_handle) + offset, size, dir);
+   dma_cache_sync(dev, bus_to_virt(dma_handle) + offset, size, dir);
 }
 
 static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg,
@@ -116,7 +120,7 @@ static inline void dma_sync_sg(struct device *dev, struct 
scatterlist *sg,
 
for (i = 0; i < nelems; i++) {
 #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT)
-   dma_cache_sync(page_address(sg[i].page) + sg[i].offset,
+   dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset,
   sg[i].length, dir);
 #endif
sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset;
-
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


sh64: ppoll/pselect6() and restartable syscalls.

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c18fe9a0467afaec7de05ec76cd994ae7c866760
Commit: c18fe9a0467afaec7de05ec76cd994ae7c866760
Parent: 599c26d32950c33bdd2a5ac6939bfe15ecf057e0
Author: Paul Mundt <[EMAIL PROTECTED]>
AuthorDate: Mon May 14 09:12:39 2007 +0900
Committer:  Paul Mundt <[EMAIL PROTECTED]>
CommitDate: Mon May 14 09:12:39 2007 +0900

sh64: ppoll/pselect6() and restartable syscalls.

This patch was hanging around for some time while we were waiting
for the compiler situation to improve.. now that all is well again,
finally merge it.

Signed-off-by: Paul Mundt <[EMAIL PROTECTED]>
---
 arch/sh64/kernel/entry.S   |4 ++--
 arch/sh64/kernel/signal.c  |   33 +
 include/asm-sh64/thread_info.h |6 ++
 3 files changed, 37 insertions(+), 6 deletions(-)

diff --git a/arch/sh64/kernel/entry.S b/arch/sh64/kernel/entry.S
index 40d4534..7013fcb 100644
--- a/arch/sh64/kernel/entry.S
+++ b/arch/sh64/kernel/entry.S
@@ -947,14 +947,14 @@ ret_with_reschedule:
! FIXME:!!!
! no handling of TIF_SYSCALL_TRACE yet!!
 
-   movi(1 << TIF_NEED_RESCHED), r8
+   movi_TIF_NEED_RESCHED, r8
and r8, r7, r8
pta work_resched, tr0
bne r8, ZERO, tr0
 
pta restore_all, tr1
 
-   movi(1 << TIF_SIGPENDING), r8
+   movi(_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK), r8
and r8, r7, r8
pta work_notifysig, tr0
bne r8, ZERO, tr0
diff --git a/arch/sh64/kernel/signal.c b/arch/sh64/kernel/signal.c
index b76bdfa..c8525ad 100644
--- a/arch/sh64/kernel/signal.c
+++ b/arch/sh64/kernel/signal.c
@@ -698,7 +698,9 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
if (try_to_freeze())
goto no_signal;
 
-   if (!oldset)
+   if (test_thread_flag(TIF_RESTORE_SIGMASK))
+   oldset = ¤t->saved_sigmask;
+   else if (!oldset)
oldset = ¤t->blocked;
 
signr = get_signal_to_deliver(&info, &ka, regs, 0);
@@ -706,6 +708,15 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
if (signr > 0) {
/* Whee!  Actually deliver the signal.  */
handle_signal(signr, &info, &ka, oldset, regs);
+
+   /*
+* If a signal was successfully delivered, the saved sigmask
+* is in its frame, and we can clear the TIF_RESTORE_SIGMASK
+* flag.
+*/
+   if (test_thread_flag(TIF_RESTORE_SIGMASK))
+   clear_thread_flag(TIF_RESTORE_SIGMASK);
+
return 1;
}
 
@@ -713,13 +724,27 @@ no_signal:
/* Did we come from a system call? */
if (regs->syscall_nr >= 0) {
/* Restart the system call - no handlers present */
-   if (regs->regs[REG_RET] == -ERESTARTNOHAND ||
-   regs->regs[REG_RET] == -ERESTARTSYS ||
-   regs->regs[REG_RET] == -ERESTARTNOINTR) {
+   switch (regs->regs[REG_RET]) {
+   case -ERESTARTNOHAND:
+   case -ERESTARTSYS:
+   case -ERESTARTNOINTR:
/* Decode Syscall # */
regs->regs[REG_RET] = regs->syscall_nr;
regs->pc -= 4;
+   break;
+
+   case -ERESTART_RESTARTBLOCK:
+   regs->regs[REG_RET] = __NR_restart_syscall;
+   regs->pc -= 4;
+   break;
}
}
+
+   /* No signal to deliver -- put the saved sigmask back */
+   if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
+   clear_thread_flag(TIF_RESTORE_SIGMASK);
+   sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL);
+   }
+
return 0;
 }
diff --git a/include/asm-sh64/thread_info.h b/include/asm-sh64/thread_info.h
index 1f825cb..f6d5117 100644
--- a/include/asm-sh64/thread_info.h
+++ b/include/asm-sh64/thread_info.h
@@ -78,7 +78,13 @@ static inline struct thread_info *current_thread_info(void)
 #define TIF_SIGPENDING 2   /* signal pending */
 #define TIF_NEED_RESCHED   3   /* rescheduling necessary */
 #define TIF_MEMDIE 4
+#define TIF_RESTORE_SIGMASK5   /* Restore signal mask in do_signal */
 
+#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
+#define _TIF_SIGPENDING(1 << TIF_SIGPENDING)
+#define _TIF_NEED_RESCHED  (1 << TIF_NEED_RESCHED)
+#define _TIF_MEMDIE(1 << TIF_MEMDIE)
+#define _TIF_RESTORE_SIGMASK   (1 << TIF_RESTORE_SIGMASK)
 
 #endif /* __KERNEL__ */
 
-
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


sh64: Fixup sh-sci build.

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2f32834a32dfc289ea73839dbcb98d135742947b
Commit: 2f32834a32dfc289ea73839dbcb98d135742947b
Parent: c18fe9a0467afaec7de05ec76cd994ae7c866760
Author: Paul Mundt <[EMAIL PROTECTED]>
AuthorDate: Mon May 14 09:13:54 2007 +0900
Committer:  Paul Mundt <[EMAIL PROTECTED]>
CommitDate: Mon May 14 09:13:54 2007 +0900

sh64: Fixup sh-sci build.

sh-sci needs asm/sci.h, borrow this from sh so we can build
again.

Signed-off-by: Paul Mundt <[EMAIL PROTECTED]>
---
 include/asm-sh64/sci.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/asm-sh64/sci.h b/include/asm-sh64/sci.h
new file mode 100644
index 000..793c568
--- /dev/null
+++ b/include/asm-sh64/sci.h
@@ -0,0 +1 @@
+#include 
-
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


sh64: generic quicklist support.

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6c645ac72582bacb85b90a1cf88e81a13045aba4
Commit: 6c645ac72582bacb85b90a1cf88e81a13045aba4
Parent: e827f20f1d34e91fbbb0df4674ddd8c3aad517da
Author: Paul Mundt <[EMAIL PROTECTED]>
AuthorDate: Mon May 14 09:55:35 2007 +0900
Committer:  Paul Mundt <[EMAIL PROTECTED]>
CommitDate: Mon May 14 09:55:35 2007 +0900

sh64: generic quicklist support.

Signed-off-by: Paul Mundt <[EMAIL PROTECTED]>
---
 arch/sh64/Kconfig  |3 +
 arch/sh64/mm/init.c|2 +-
 include/asm-sh64/pgalloc.h |  100 ++--
 mm/Kconfig |2 +-
 4 files changed, 28 insertions(+), 79 deletions(-)

diff --git a/arch/sh64/Kconfig b/arch/sh64/Kconfig
index e14b533..ff65420 100644
--- a/arch/sh64/Kconfig
+++ b/arch/sh64/Kconfig
@@ -17,6 +17,9 @@ config MMU
bool
default y
 
+config QUICKLIST
+   def_bool y
+
 config RWSEM_GENERIC_SPINLOCK
bool
default y
diff --git a/arch/sh64/mm/init.c b/arch/sh64/mm/init.c
index 5dc0878..559717f 100644
--- a/arch/sh64/mm/init.c
+++ b/arch/sh64/mm/init.c
@@ -84,7 +84,7 @@ void show_mem(void)
printk("%d reserved pages\n",reserved);
printk("%d pages shared\n",shared);
printk("%d pages swap cached\n",cached);
-   printk("%ld pages in page table cache\n",pgtable_cache_size);
+   printk("%ld pages in page table cache\n", quicklist_total_size());
 }
 
 /*
diff --git a/include/asm-sh64/pgalloc.h b/include/asm-sh64/pgalloc.h
index cb803e5..6eccab7 100644
--- a/include/asm-sh64/pgalloc.h
+++ b/include/asm-sh64/pgalloc.h
@@ -14,13 +14,9 @@
  *
  */
 
-#include 
 #include 
-
-#define pgd_quicklist (current_cpu_data.pgd_quick)
-#define pmd_quicklist (current_cpu_data.pmd_quick)
-#define pte_quicklist (current_cpu_data.pte_quick)
-#define pgtable_cache_size (current_cpu_data.pgtable_cache_sz)
+#include 
+#include 
 
 static inline void pgd_init(unsigned long page)
 {
@@ -45,84 +41,37 @@ static inline pgd_t *get_pgd_slow(void)
return ret;
 }
 
-static inline pgd_t *get_pgd_fast(void)
-{
-   unsigned long *ret;
-
-   if ((ret = pgd_quicklist) != NULL) {
-   pgd_quicklist = (unsigned long *)(*ret);
-   ret[0] = 0;
-   pgtable_cache_size--;
-   } else
-   ret = (unsigned long *)get_pgd_slow();
-
-   if (ret) {
-   memset(ret, 0, USER_PTRS_PER_PGD * sizeof(pgd_t));
-   }
-   return (pgd_t *)ret;
-}
-
-static inline void free_pgd_fast(pgd_t *pgd)
-{
-   *(unsigned long *)pgd = (unsigned long) pgd_quicklist;
-   pgd_quicklist = (unsigned long *) pgd;
-   pgtable_cache_size++;
-}
-
-static inline void free_pgd_slow(pgd_t *pgd)
+static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 {
-   kfree((void *)pgd);
+   return quicklist_alloc(0, GFP_KERNEL, NULL);
 }
 
-extern pte_t *get_pte_slow(pmd_t *pmd, unsigned long address_preadjusted);
-extern pte_t *get_pte_kernel_slow(pmd_t *pmd, unsigned long 
address_preadjusted);
-
-static inline pte_t *get_pte_fast(void)
+static inline void pgd_free(pgd_t *pgd)
 {
-   unsigned long *ret;
-
-   if((ret = (unsigned long *)pte_quicklist) != NULL) {
-   pte_quicklist = (unsigned long *)(*ret);
-   ret[0] = ret[1];
-   pgtable_cache_size--;
-   }
-   return (pte_t *)ret;
+   quicklist_free(0, NULL, pgd);
 }
 
-static inline void free_pte_fast(pte_t *pte)
+static inline struct page *pte_alloc_one(struct mm_struct *mm,
+unsigned long address)
 {
-   *(unsigned long *)pte = (unsigned long) pte_quicklist;
-   pte_quicklist = (unsigned long *) pte;
-   pgtable_cache_size++;
+   void *pg = quicklist_alloc(0, GFP_KERNEL, NULL);
+   return pg ? virt_to_page(pg) : NULL;
 }
 
 static inline void pte_free_kernel(pte_t *pte)
 {
-   free_page((unsigned long)pte);
+   quicklist_free(0, NULL, pte);
 }
 
 static inline void pte_free(struct page *pte)
 {
-   __free_page(pte);
+   quicklist_free_page(0, NULL, pte);
 }
 
 static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
   unsigned long address)
 {
-   pte_t *pte;
-
-   pte = (pte_t *)__get_free_page(GFP_KERNEL | __GFP_REPEAT|__GFP_ZERO);
-
-   return pte;
-}
-
-static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long 
address)
-{
-   struct page *pte;
-
-   pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0);
-
-   return pte;
+   return quicklist_alloc(0, GFP_KERNEL, NULL);
 }
 
 #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
@@ -142,31 +91,23 @@ static inline struct page *pte_alloc_one(struct mm_struct 
*mm, unsigned long add
 
 #elif defined(CONFIG_SH64_PGTABLE_3_LEVEL)
 
-static __inline__ pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long 
address)
+

sh64: Update cayman defconfig.

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e827f20f1d34e91fbbb0df4674ddd8c3aad517da
Commit: e827f20f1d34e91fbbb0df4674ddd8c3aad517da
Parent: 2f32834a32dfc289ea73839dbcb98d135742947b
Author: Paul Mundt <[EMAIL PROTECTED]>
AuthorDate: Mon May 14 09:14:29 2007 +0900
Committer:  Paul Mundt <[EMAIL PROTECTED]>
CommitDate: Mon May 14 09:14:29 2007 +0900

sh64: Update cayman defconfig.

Signed-off-by: Paul Mundt <[EMAIL PROTECTED]>
---
 arch/sh64/configs/cayman_defconfig |  199 ++--
 1 files changed, 121 insertions(+), 78 deletions(-)

diff --git a/arch/sh64/configs/cayman_defconfig 
b/arch/sh64/configs/cayman_defconfig
index d81df57..ed03508 100644
--- a/arch/sh64/configs/cayman_defconfig
+++ b/arch/sh64/configs/cayman_defconfig
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.18
-# Tue Oct  3 13:30:51 2006
+# Linux kernel version: 2.6.22-rc1
+# Mon May 14 08:43:31 2007
 #
 CONFIG_SUPERH=y
 CONFIG_SUPERH64=y
@@ -10,6 +10,8 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
@@ -33,13 +35,15 @@ CONFIG_POSIX_MQUEUE=y
 # CONFIG_UTS_NS is not set
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_SYSFS_DEPRECATED=y
 # CONFIG_RELAY is not set
-CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_BLK_DEV_INITRD is not set
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_SYSCTL=y
 # CONFIG_EMBEDDED is not set
 CONFIG_UID16=y
-# CONFIG_SYSCTL_SYSCALL is not set
+CONFIG_SYSCTL_SYSCALL=y
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -49,14 +53,19 @@ 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_SLAB=y
 CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
-# CONFIG_SLOB is not set
 
 #
 # Loadable module support
@@ -135,7 +144,7 @@ CONFIG_SH64_ID2815_WORKAROUND=y
 #
 CONFIG_HEARTBEAT=y
 CONFIG_HDSP253_LED=y
-CONFIG_SH_DMA=y
+# CONFIG_SH_DMA is not set
 CONFIG_PREEMPT=y
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
@@ -146,23 +155,20 @@ CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
 
 #
 # Bus options (PCI, PCMCIA, EISA, MCA, ISA)
 #
 CONFIG_PCI=y
 CONFIG_SH_PCIDMA_NONCOHERENT=y
-# CONFIG_PCI_MULTITHREAD_PROBE is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
 # CONFIG_PCI_DEBUG is not set
 
 #
 # PCCARD (PCMCIA/CardBus) support
 #
 # CONFIG_PCCARD is not set
-
-#
-# PCI Hotplug Support
-#
 # CONFIG_HOTPLUG_PCI is not set
 
 #
@@ -180,13 +186,13 @@ CONFIG_NET=y
 #
 # Networking options
 #
-# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
 # CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 # CONFIG_IP_MULTICAST is not set
@@ -207,11 +213,13 @@ CONFIG_IP_PNP=y
 # CONFIG_INET_TUNNEL is not set
 CONFIG_INET_XFRM_MODE_TRANSPORT=y
 CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
 CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
 # CONFIG_IPV6 is not set
 # CONFIG_INET6_XFRM_TUNNEL is not set
 # CONFIG_INET6_TUNNEL is not set
@@ -256,7 +264,16 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_HAMRADIO is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
 # CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
 
 #
 # Device Drivers
@@ -269,16 +286,13 @@ CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
 # CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
 # CONFIG_SYS_HYPERVISOR is not set
 
 #
 # Connector - unified userspace <-> kernelspace linker
 #
 # CONFIG_CONNECTOR is not set
-
-#
-# Memory Technology Devices (MTD)
-#
 # CONFIG_MTD is not set
 
 #
@@ -289,6 +303,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
 #
 # Plug and Play support
 #
+# CONFIG_PNPACPI is not set
 
 #
 # Block devices
@@ -306,11 +321,18 @@ CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
-# CONFIG_BLK_DEV_INITRD is not set
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
 
 #
+# Misc devices

sh64: Add .gitignore entry for syscalltab.

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=51a41e7d39ce0da1198837aaa495fe6dbcc4f802
Commit: 51a41e7d39ce0da1198837aaa495fe6dbcc4f802
Parent: 6c645ac72582bacb85b90a1cf88e81a13045aba4
Author: Paul Mundt <[EMAIL PROTECTED]>
AuthorDate: Mon May 14 10:15:18 2007 +0900
Committer:  Paul Mundt <[EMAIL PROTECTED]>
CommitDate: Mon May 14 10:15:18 2007 +0900

sh64: Add .gitignore entry for syscalltab.

Signed-off-by: Paul Mundt <[EMAIL PROTECTED]>
---
 arch/sh64/lib/.gitignore |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/sh64/lib/.gitignore b/arch/sh64/lib/.gitignore
new file mode 100644
index 000..3508c2c
--- /dev/null
+++ b/arch/sh64/lib/.gitignore
@@ -0,0 +1 @@
+syscalltab.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


missing mm.h in fw-ohci

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=faa2fb4e67775101a5c46074fa24f0d81cdb4deb
Commit: faa2fb4e67775101a5c46074fa24f0d81cdb4deb
Parent: 835a906c74ecf20cdb817d6d02975cc0ba421e35
Author: Al Viro <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 20:36:10 2007 +0100
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 18:56:37 2007 -0700

missing mm.h in fw-ohci

need it for page_private(), not all targets have it pulled indirectly

Signed-off-by: Al Viro <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/firewire/fw-ohci.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 1f5c704..c17342d 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
-
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


missing dependencies for USB drivers in input

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7a86edef395576f69d2513c62aea7c966043bc8d
Commit: 7a86edef395576f69d2513c62aea7c966043bc8d
Parent: faa2fb4e67775101a5c46074fa24f0d81cdb4deb
Author: Al Viro <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 20:36:20 2007 +0100
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 18:56:37 2007 -0700

missing dependencies for USB drivers in input

stuff that does select USB should depend on USB_ARCH_HAS_HCD, or we'll
end up with unbuildable configs.

Signed-off-by: Al Viro <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/input/joystick/Kconfig|1 +
 drivers/input/misc/Kconfig|5 +
 drivers/input/mouse/Kconfig   |1 +
 drivers/input/tablet/Kconfig  |4 
 drivers/input/touchscreen/Kconfig |1 +
 5 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/input/joystick/Kconfig b/drivers/input/joystick/Kconfig
index 82f563e..b002345 100644
--- a/drivers/input/joystick/Kconfig
+++ b/drivers/input/joystick/Kconfig
@@ -255,6 +255,7 @@ config JOYSTICK_JOYDUMP
 
 config JOYSTICK_XPAD
tristate "X-Box gamepad support"
+   depends on USB_ARCH_HAS_HCD
select USB
help
  Say Y here if you want to use the X-Box pad with your computer.
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 6013ace..842a7b4 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -84,6 +84,7 @@ config INPUT_ATLAS_BTNS
 
 config INPUT_ATI_REMOTE
tristate "ATI / X10 USB RF remote control"
+   depends on USB_ARCH_HAS_HCD
select USB
help
  Say Y here if you want to use an ATI or X10 "Lola" USB remote control.
@@ -99,6 +100,7 @@ config INPUT_ATI_REMOTE
 
 config INPUT_ATI_REMOTE2
tristate "ATI / Philips USB RF remote control"
+   depends on USB_ARCH_HAS_HCD
select USB
help
  Say Y here if you want to use an ATI or Philips USB RF remote control.
@@ -114,6 +116,7 @@ config INPUT_ATI_REMOTE2
 config INPUT_KEYSPAN_REMOTE
tristate "Keyspan DMR USB remote control (EXPERIMENTAL)"
depends on EXPERIMENTAL
+   depends on USB_ARCH_HAS_HCD
select USB
help
  Say Y here if you want to use a Keyspan DMR USB remote control.
@@ -128,6 +131,7 @@ config INPUT_KEYSPAN_REMOTE
 
 config INPUT_POWERMATE
tristate "Griffin PowerMate and Contour Jog support"
+   depends on USB_ARCH_HAS_HCD
select USB
help
  Say Y here if you want to use Griffin PowerMate or Contour Jog 
devices.
@@ -144,6 +148,7 @@ config INPUT_POWERMATE
 config INPUT_YEALINK
tristate "Yealink usb-p1k voip phone"
depends EXPERIMENTAL
+   depends on USB_ARCH_HAS_HCD
select USB
help
  Say Y here if you want to enable keyboard and LCD functions of the
diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig
index 2ccc114..eb0167e 100644
--- a/drivers/input/mouse/Kconfig
+++ b/drivers/input/mouse/Kconfig
@@ -111,6 +111,7 @@ config MOUSE_SERIAL
 
 config MOUSE_APPLETOUCH
tristate "Apple USB Touchpad support"
+   depends on USB_ARCH_HAS_HCD
select USB
help
  Say Y here if you want to use an Apple USB Touchpad.
diff --git a/drivers/input/tablet/Kconfig b/drivers/input/tablet/Kconfig
index 12dfb0e..d371c0b 100644
--- a/drivers/input/tablet/Kconfig
+++ b/drivers/input/tablet/Kconfig
@@ -13,6 +13,7 @@ if INPUT_TABLET
 
 config TABLET_USB_ACECAD
tristate "Acecad Flair tablet support (USB)"
+   depends on USB_ARCH_HAS_HCD
select USB
help
  Say Y here if you want to use the USB version of the Acecad Flair
@@ -25,6 +26,7 @@ config TABLET_USB_ACECAD
 
 config TABLET_USB_AIPTEK
tristate "Aiptek 6000U/8000U tablet support (USB)"
+   depends on USB_ARCH_HAS_HCD
select USB
help
  Say Y here if you want to use the USB version of the Aiptek 6000U
@@ -49,6 +51,7 @@ config TABLET_USB_GTCO
 
 config TABLET_USB_KBTAB
tristate "KB Gear JamStudio tablet support (USB)"
+   depends on USB_ARCH_HAS_HCD
select USB
help
  Say Y here if you want to use the USB version of the KB Gear
@@ -61,6 +64,7 @@ config TABLET_USB_KBTAB
 
 config TABLET_USB_WACOM
tristate "Wacom Intuos/Graphire tablet support (USB)"
+   depends on USB_ARCH_HAS_HCD
select USB
help
  Say Y here if you want to use the USB version of the Wacom Intuos
diff --git a/drivers/input/touchscreen/Kconfig 
b/drivers/input/touchscreen/Kconfig
index 5e640ae..4f09180 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -166,6 +166,7 @@ config TOUCHSCREEN_UCB1400
 
 config TOUCHSCREEN_USB_COMPOSITE
tristate "USB Touchscreen Driver"
+   depends on USB_ARC

missing includes in mlx4

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9cbe05c71251b51607d80256c3b3754957bb5ed8
Commit: 9cbe05c71251b51607d80256c3b3754957bb5ed8
Parent: 7a86edef395576f69d2513c62aea7c966043bc8d
Author: Al Viro <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 20:36:30 2007 +0100
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 18:56:37 2007 -0700

missing includes in mlx4

Signed-off-by: Al Viro <[EMAIL PROTECTED]>
Acked-by: Jeff Garzik <[EMAIL PROTECTED]>
Acked-by: Roland Dreier <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/net/mlx4/alloc.c |1 +
 drivers/net/mlx4/eq.c|1 +
 drivers/net/mlx4/icm.c   |1 +
 drivers/net/mlx4/reset.c |1 +
 4 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/net/mlx4/alloc.c b/drivers/net/mlx4/alloc.c
index 9ffdb9d..dfbd580 100644
--- a/drivers/net/mlx4/alloc.c
+++ b/drivers/net/mlx4/alloc.c
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "mlx4.h"
 
diff --git a/drivers/net/mlx4/eq.c b/drivers/net/mlx4/eq.c
index af016d0..0f11adb 100644
--- a/drivers/net/mlx4/eq.c
+++ b/drivers/net/mlx4/eq.c
@@ -33,6 +33,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 
diff --git a/drivers/net/mlx4/icm.c b/drivers/net/mlx4/icm.c
index e96feae..b7a4aa8 100644
--- a/drivers/net/mlx4/icm.c
+++ b/drivers/net/mlx4/icm.c
@@ -33,6 +33,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 
diff --git a/drivers/net/mlx4/reset.c b/drivers/net/mlx4/reset.c
index 51eef84..e4dfd4b 100644
--- a/drivers/net/mlx4/reset.c
+++ b/drivers/net/mlx4/reset.c
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "mlx4.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


em28xx and ivtv should depend on PCI

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1b2bad2f049e405530b4a8a478edc45770b219c1
Commit: 1b2bad2f049e405530b4a8a478edc45770b219c1
Parent: 9cbe05c71251b51607d80256c3b3754957bb5ed8
Author: Al Viro <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 20:36:40 2007 +0100
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 18:56:37 2007 -0700

em28xx and ivtv should depend on PCI

.. because video-buf.c requires PCI, and VIDEO_EM28XX selects it.

Signed-off-by: Al Viro <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/media/video/em28xx/Kconfig |2 +-
 drivers/media/video/ivtv/Kconfig   |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/em28xx/Kconfig 
b/drivers/media/video/em28xx/Kconfig
index 3823b62..2c450bd 100644
--- a/drivers/media/video/em28xx/Kconfig
+++ b/drivers/media/video/em28xx/Kconfig
@@ -1,6 +1,6 @@
 config VIDEO_EM28XX
tristate "Empia EM2800/2820/2840 USB video capture support"
-   depends on VIDEO_V4L1 && I2C
+   depends on VIDEO_V4L1 && I2C && PCI
select VIDEO_BUF
select VIDEO_TUNER
select VIDEO_TVEEPROM
diff --git a/drivers/media/video/ivtv/Kconfig b/drivers/media/video/ivtv/Kconfig
index e854f3f..0cc98a0 100644
--- a/drivers/media/video/ivtv/Kconfig
+++ b/drivers/media/video/ivtv/Kconfig
@@ -1,6 +1,6 @@
 config VIDEO_IVTV
tristate "Conexant cx23416/cx23415 MPEG encoder/decoder support"
-   depends on VIDEO_V4L1 && VIDEO_V4L2 && USB && I2C && EXPERIMENTAL
+   depends on VIDEO_V4L1 && VIDEO_V4L2 && USB && I2C && EXPERIMENTAL && PCI
select FW_LOADER
select VIDEO_TUNER
select VIDEO_TVEEPROM
-
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


rpadlpar breakage - fallout of struct subsystem removal

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8eafafb54bc594be8a23b00b25055b59838a9c79
Commit: 8eafafb54bc594be8a23b00b25055b59838a9c79
Parent: 1b2bad2f049e405530b4a8a478edc45770b219c1
Author: Al Viro <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 20:36:50 2007 +0100
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 18:56:37 2007 -0700

rpadlpar breakage - fallout of struct subsystem removal

Signed-off-by: Al Viro <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/pci/hotplug/rpadlpar_sysfs.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/hotplug/rpadlpar_sysfs.c 
b/drivers/pci/hotplug/rpadlpar_sysfs.c
index 6c5be3f..df07606 100644
--- a/drivers/pci/hotplug/rpadlpar_sysfs.c
+++ b/drivers/pci/hotplug/rpadlpar_sysfs.c
@@ -129,8 +129,9 @@ struct kobj_type ktype_dlpar_io = {
 };
 
 struct kset dlpar_io_kset = {
-   .subsys = &pci_hotplug_slots_subsys,
-   .kobj = {.name = DLPAR_KOBJ_NAME, .ktype=&ktype_dlpar_io,},
+   .kobj = {.name = DLPAR_KOBJ_NAME,
+.ktype = &ktype_dlpar_io,
+.parent = &pci_hotplug_slots_subsys.kobj},
.ktype = &ktype_dlpar_io,
 };
 
-
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


m32r: __xchg() should be always_inline

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b4e1ded3cf6e13c122f019532cb60347d6c88c8c
Commit: b4e1ded3cf6e13c122f019532cb60347d6c88c8c
Parent: 8eafafb54bc594be8a23b00b25055b59838a9c79
Author: Al Viro <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 20:37:00 2007 +0100
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 18:56:37 2007 -0700

m32r: __xchg() should be always_inline

it depends on elimination of unreachable branches in switch (by object
size), so we must declare it always_inline

Signed-off-by: Al Viro <[EMAIL PROTECTED]>
Acked-by: Hirokazu Takata <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 include/asm-m32r/system.h |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/asm-m32r/system.h b/include/asm-m32r/system.h
index b291b2f..8ee73d3 100644
--- a/include/asm-m32r/system.h
+++ b/include/asm-m32r/system.h
@@ -10,6 +10,7 @@
  * Copyright (C) 2004, 2006  Hirokazu Takata 
  */
 
+#include 
 #include 
 
 #ifdef __KERNEL__
@@ -154,7 +155,7 @@ extern void  __xchg_called_with_bad_pointer(void);
 #define DCACHE_CLEAR(reg0, reg1, addr)
 #endif /* CONFIG_CHIP_M32700_TS1 */
 
-static inline unsigned long
+static __always_inline unsigned long
 __xchg(unsigned long x, volatile void * ptr, int size)
 {
unsigned long flags;
-
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


audit_match_signal() and friends are used only if CONFIG_AUDITSYSCALL is set

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=327b9eebbf2b7ce632e93a9c1386d944af0dadf4
Commit: 327b9eebbf2b7ce632e93a9c1386d944af0dadf4
Parent: b4e1ded3cf6e13c122f019532cb60347d6c88c8c
Author: Al Viro <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 20:37:10 2007 +0100
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 18:56:37 2007 -0700

audit_match_signal() and friends are used only if CONFIG_AUDITSYSCALL is set

Signed-off-by: Al Viro <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 kernel/auditfilter.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index 6c61263..74cc0fc 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -311,6 +311,7 @@ int audit_match_class(int class, unsigned syscall)
return classes[class][AUDIT_WORD(syscall)] & AUDIT_BIT(syscall);
 }
 
+#ifdef CONFIG_AUDITSYSCALL
 static inline int audit_match_class_bits(int class, u32 *mask)
 {
int i;
@@ -347,6 +348,7 @@ static int audit_match_signal(struct audit_entry *entry)
return 1;
}
 }
+#endif
 
 /* Common user-space to kernel rule translation. */
 static inline struct audit_entry *audit_to_entry_common(struct audit_rule 
*rule)
-
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


fix uml-x86_64

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ecec5ba681a0bf1165899f8b1889f06fcd8e901a
Commit: ecec5ba681a0bf1165899f8b1889f06fcd8e901a
Parent: 327b9eebbf2b7ce632e93a9c1386d944af0dadf4
Author: Al Viro <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 20:36:00 2007 +0100
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 18:56:37 2007 -0700

fix uml-x86_64

__NR_syscall_max is done in x86_64 asm-offsets; do an equivalent in
uml kern_constants.h

Signed-off-by: Al Viro <[EMAIL PROTECTED]>
Acked-by: Jeff Dike <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 arch/um/include/sysdep-x86_64/kernel-offsets.h |9 +
 arch/um/include/sysdep-x86_64/syscalls.h   |3 ++-
 arch/um/sys-x86_64/syscall_table.c |5 +++--
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/arch/um/include/sysdep-x86_64/kernel-offsets.h 
b/arch/um/include/sysdep-x86_64/kernel-offsets.h
index a307237..c978b58 100644
--- a/arch/um/include/sysdep-x86_64/kernel-offsets.h
+++ b/arch/um/include/sysdep-x86_64/kernel-offsets.h
@@ -17,7 +17,16 @@
 #define OFFSET(sym, str, mem) \
DEFINE(sym, offsetof(struct str, mem));
 
+#define __NO_STUBS 1
+#undef __SYSCALL
+#undef _ASM_X86_64_UNISTD_H_
+#define __SYSCALL(nr, sym) [nr] = 1,
+static char syscalls[] = {
+#include 
+};
+
 void foo(void)
 {
 #include 
+DEFINE(UM_NR_syscall_max, sizeof(syscalls) - 1);
 }
diff --git a/arch/um/include/sysdep-x86_64/syscalls.h 
b/arch/um/include/sysdep-x86_64/syscalls.h
index 5e86aa0..cf72256 100644
--- a/arch/um/include/sysdep-x86_64/syscalls.h
+++ b/arch/um/include/sysdep-x86_64/syscalls.h
@@ -9,6 +9,7 @@
 
 #include 
 #include 
+#include 
 
 typedef long syscall_handler_t(void);
 
@@ -29,6 +30,6 @@ extern long old_mmap(unsigned long addr, unsigned long len,
 extern syscall_handler_t sys_modify_ldt;
 extern syscall_handler_t sys_arch_prctl;
 
-#define NR_syscalls (__NR_syscall_max + 1)
+#define NR_syscalls (UM_NR_syscall_max + 1)
 
 #endif
diff --git a/arch/um/sys-x86_64/syscall_table.c 
b/arch/um/sys-x86_64/syscall_table.c
index 9e9ad72..5133988 100644
--- a/arch/um/sys-x86_64/syscall_table.c
+++ b/arch/um/sys-x86_64/syscall_table.c
@@ -4,6 +4,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define __NO_STUBS
 
@@ -45,8 +46,8 @@ typedef void (*sys_call_ptr_t)(void);
 
 extern void sys_ni_syscall(void);
 
-sys_call_ptr_t sys_call_table[__NR_syscall_max+1] __cacheline_aligned = {
+sys_call_ptr_t sys_call_table[UM_NR_syscall_max+1] __cacheline_aligned = {
/* Smells like a like a compiler bug -- it doesn't work when the & 
below is removed. */
-   [0 ... __NR_syscall_max] = &sys_ni_syscall,
+   [0 ... UM_NR_syscall_max] = &sys_ni_syscall,
 #include 
 };
-
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: walk_stacktrace() needs to be exported

2007-05-15 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7b104bcb8e460e45a1aebe3da9b86aacdb4cab12
Commit: 7b104bcb8e460e45a1aebe3da9b86aacdb4cab12
Parent: ecec5ba681a0bf1165899f8b1889f06fcd8e901a
Author: Al Viro <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 20:37:20 2007 +0100
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 15 18:56:37 2007 -0700

arm: walk_stacktrace() needs to be exported

oprofile depends on having it

Signed-off-by: Al Viro <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 arch/arm/kernel/stacktrace.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/kernel/stacktrace.c b/arch/arm/kernel/stacktrace.c
index 398d0c0..8b63ad8 100644
--- a/arch/arm/kernel/stacktrace.c
+++ b/arch/arm/kernel/stacktrace.c
@@ -1,3 +1,4 @@
+#include 
 #include 
 #include 
 
@@ -30,6 +31,7 @@ int walk_stackframe(unsigned long fp, unsigned long low, 
unsigned long high,
 
return 0;
 }
+EXPORT_SYMBOL(walk_stackframe);
 
 #ifdef CONFIG_STACKTRACE
 struct stack_trace_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