checkpatch.pl: should be executable
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8381e04b90ce9e7669a2d20aa7aaff3be910e447 Commit: 8381e04b90ce9e7669a2d20aa7aaff3be910e447 Parent: 5ecd3100e695228ac5e0ce0e325e252c0f11806f Author: Andy Whitcroft <[EMAIL PROTECTED]> AuthorDate: Thu Jun 7 16:16:40 2007 +0100 Committer: Linus Torvalds <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 08:52:15 2007 -0700 checkpatch.pl: should be executable scripts/checkpatch.pl should be executable, make it so. Signed-off-by: Andy Whitcroft <[EMAIL PROTECTED]> Acked-by: Andrew Morton <[EMAIL PROTECTED]> Acked-by: Joel Schopp <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> --- 0 files changed, 0 insertions(+), 0 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl old mode 100644 new mode 100755 - 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
Restrict clearing TIF_SIGPENDING
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b74d0deb968e1f85942f17080eace015ce3c332c Commit: b74d0deb968e1f85942f17080eace015ce3c332c Parent: 8381e04b90ce9e7669a2d20aa7aaff3be910e447 Author: Roland McGrath <[EMAIL PROTECTED]> AuthorDate: Wed Jun 6 03:59:00 2007 -0700 Committer: Linus Torvalds <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 08:52:15 2007 -0700 Restrict clearing TIF_SIGPENDING This patch should get a few birds. It prevents sigaction calls from clearing TIF_SIGPENDING in other threads, which could leak -ERESTART*. And It fixes ptrace_stop not to clear it, which done at the syscall exit stop could leak -ERESTART*. It probably removes the harm from signalfd, at least assuming it never calls dequeue_signal on kernel threads that might have used block_all_signals. Signed-off-by: Roland McGrath <[EMAIL PROTECTED]> Cc: Andrew Morton <[EMAIL PROTECTED]> Cc: Benjamin Herrenschmidt <[EMAIL PROTECTED]> Cc: Paul Mackerras <[EMAIL PROTECTED]> Cc: Satoru Takeuchi <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> --- kernel/signal.c | 16 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/kernel/signal.c b/kernel/signal.c index acdfc05..fe590e0 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -105,7 +105,11 @@ static int recalc_sigpending_tsk(struct task_struct *t) set_tsk_thread_flag(t, TIF_SIGPENDING); return 1; } - clear_tsk_thread_flag(t, TIF_SIGPENDING); + /* +* We must never clear the flag in another thread, or in current +* when it's possible the current syscall is returning -ERESTART*. +* So we don't clear it here, and only callers who know they should do. +*/ return 0; } @@ -121,7 +125,9 @@ void recalc_sigpending_and_wake(struct task_struct *t) void recalc_sigpending(void) { - recalc_sigpending_tsk(current); + if (!recalc_sigpending_tsk(current)) + clear_thread_flag(TIF_SIGPENDING); + } /* Given the mask, find the first available signal that should be serviced. */ @@ -385,7 +391,8 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info) } } } - recalc_sigpending_tsk(tsk); + if (likely(tsk == current)) + recalc_sigpending(); if (signr && unlikely(sig_kernel_stop(signr))) { /* * Set a marker that we have dequeued a stop signal. Our @@ -1580,8 +1587,9 @@ static void ptrace_stop(int exit_code, int nostop_code, siginfo_t *info) /* * Queued signals ignored us while we were stopped for tracing. * So check for any that we should take before resuming user mode. +* This sets TIF_SIGPENDING, but never clears it. */ - recalc_sigpending(); + recalc_sigpending_tsk(current); } void ptrace_notify(int exit_code) - 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
[POWERPC] pasemi: Fix iommu + 64K PAGE_SIZE bug
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6291ed3c04d5c83c26e77d4fa47e06d0416be81d Commit: 6291ed3c04d5c83c26e77d4fa47e06d0416be81d Parent: 5ecd3100e695228ac5e0ce0e325e252c0f11806f Author: Olof Johansson <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 10:49:05 2007 +1000 Committer: Paul Mackerras <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 11:44:39 2007 +1000 [POWERPC] pasemi: Fix iommu + 64K PAGE_SIZE bug The powerpc iommu code was refactored by Linas back in the 2.6.20 time frame to map 4K pages from the generic code, but I had forgotten to go back and fix my platform driver before submitting it. Signed-off-by: Olof Johansson <[EMAIL PROTECTED]> Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]> --- arch/powerpc/platforms/pasemi/iommu.c |8 1 files changed, 0 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/platforms/pasemi/iommu.c b/arch/powerpc/platforms/pasemi/iommu.c index 95fa6a7..f33b21b 100644 --- a/arch/powerpc/platforms/pasemi/iommu.c +++ b/arch/powerpc/platforms/pasemi/iommu.c @@ -31,8 +31,6 @@ #define IOBMAP_PAGE_SIZE (1 << IOBMAP_PAGE_SHIFT) #define IOBMAP_PAGE_MASK (IOBMAP_PAGE_SIZE - 1) -#define IOBMAP_PAGE_FACTOR (PAGE_SHIFT - IOBMAP_PAGE_SHIFT) - #define IOB_BASE 0xe000 #define IOB_SIZE 0x3000 /* Configuration registers */ @@ -97,9 +95,6 @@ static void iobmap_build(struct iommu_table *tbl, long index, bus_addr = (tbl->it_offset + index) << PAGE_SHIFT; - npages <<= IOBMAP_PAGE_FACTOR; - index <<= IOBMAP_PAGE_FACTOR; - ip = ((u32 *)tbl->it_base) + index; while (npages--) { @@ -125,9 +120,6 @@ static void iobmap_free(struct iommu_table *tbl, long index, bus_addr = (tbl->it_offset + index) << PAGE_SHIFT; - npages <<= IOBMAP_PAGE_FACTOR; - index <<= IOBMAP_PAGE_FACTOR; - ip = ((u32 *)tbl->it_base) + index; while (npages--) { - 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
[POWERPC] spufs: Refuse to load the module when not running on cell
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8f18a158192ef6dc63a572bdbbdf5613cfbbe2e4 Commit: 8f18a158192ef6dc63a572bdbbdf5613cfbbe2e4 Parent: 6291ed3c04d5c83c26e77d4fa47e06d0416be81d Author: Arnd Bergmann <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 23:26:51 2007 +1000 Committer: Paul Mackerras <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 11:44:39 2007 +1000 [POWERPC] spufs: Refuse to load the module when not running on cell As noticed by David Woodhouse, it's currently possible to mount spufs on any machine, which means that it actually will get mounted by fedora. This refuses to load the module on platforms that have no support for SPUs. Cc: David Woodhouse <[EMAIL PROTECTED]> Signed-off-by: Arnd Bergmann <[EMAIL PROTECTED]> Signed-off-by: Jeremy Kerr <[EMAIL PROTECTED]> Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]> --- arch/powerpc/platforms/cell/spufs/inode.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 7150730..01c4805 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c @@ -600,6 +600,10 @@ spufs_create_root(struct super_block *sb, void *data) struct inode *inode; int ret; + ret = -ENODEV; + if (!spu_management_ops) + goto out; + ret = -ENOMEM; inode = spufs_new_inode(sb, S_IFDIR | 0775); if (!inode) - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[POWERPC] spufs: Hook up spufs_release_mem
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ce92987baba60bc082b9eedddfaf4ae3f8435dac Commit: ce92987baba60bc082b9eedddfaf4ae3f8435dac Parent: 8f18a158192ef6dc63a572bdbbdf5613cfbbe2e4 Author: Christoph Hellwig <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 23:26:51 2007 +1000 Committer: Paul Mackerras <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 11:44:39 2007 +1000 [POWERPC] spufs: Hook up spufs_release_mem Currently spufs_mem_release and the mem file doesn't have any release method hooked up, leading to leaks everytime is used. Signed-off-by: Christoph Hellwig <[EMAIL PROTECTED]> Signed-off-by: Jeremy Kerr <[EMAIL PROTECTED]> Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]> --- arch/powerpc/platforms/cell/spufs/file.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index 45614c7..89a5011 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/platforms/cell/spufs/file.c @@ -217,6 +217,7 @@ unsigned long spufs_get_unmapped_area(struct file *file, unsigned long addr, static const struct file_operations spufs_mem_fops = { .open = spufs_mem_open, + .release= spufs_mem_release, .read = spufs_mem_read, .write = spufs_mem_write, .llseek = generic_file_llseek, - 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
[POWERPC] spufs: Fix gang destroy leaks
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=877907d37da9694a34adc9dc3e2ce09400148cb5 Commit: 877907d37da9694a34adc9dc3e2ce09400148cb5 Parent: ce92987baba60bc082b9eedddfaf4ae3f8435dac Author: Jeremy Kerr <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 23:26:51 2007 +1000 Committer: Paul Mackerras <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 11:44:39 2007 +1000 [POWERPC] spufs: Fix gang destroy leaks Previously, closing a SPE gang that still has contexts would trigger a WARN_ON, and leak the allocated gang. This change fixes the problem by using the gang's reference counts to destroy the gang instead. The gangs will persist until their last reference (be it context or open file handle) is gone. Also, avoid using statements with side-effects in a WARN_ON(). Signed-off-by: Jeremy Kerr <[EMAIL PROTECTED]> Signed-off-by: Arnd Bergmann <[EMAIL PROTECTED]> Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]> --- arch/powerpc/platforms/cell/spufs/inode.c | 40 +++- 1 files changed, 5 insertions(+), 35 deletions(-) diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 01c4805..fe960dd 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c @@ -349,37 +349,6 @@ out: return ret; } -static int spufs_rmgang(struct inode *root, struct dentry *dir) -{ - /* FIXME: this fails if the dir is not empty, - which causes a leak of gangs. */ - return simple_rmdir(root, dir); -} - -static int spufs_gang_close(struct inode *inode, struct file *file) -{ - struct inode *parent; - struct dentry *dir; - int ret; - - dir = file->f_path.dentry; - parent = dir->d_parent->d_inode; - - ret = spufs_rmgang(parent, dir); - WARN_ON(ret); - - return dcache_dir_close(inode, file); -} - -const struct file_operations spufs_gang_fops = { - .open = dcache_dir_open, - .release= spufs_gang_close, - .llseek = dcache_dir_lseek, - .read = generic_read_dir, - .readdir= dcache_readdir, - .fsync = simple_sync_file, -}; - static int spufs_mkgang(struct inode *dir, struct dentry *dentry, int mode) { @@ -407,7 +376,6 @@ spufs_mkgang(struct inode *dir, struct dentry *dentry, int mode) inode->i_fop = &simple_dir_operations; d_instantiate(dentry, inode); - dget(dentry); dir->i_nlink++; dentry->d_inode->i_nlink++; return ret; @@ -437,7 +405,7 @@ static int spufs_gang_open(struct dentry *dentry, struct vfsmount *mnt) goto out; } - filp->f_op = &spufs_gang_fops; + filp->f_op = &simple_dir_operations; fd_install(ret, filp); out: return ret; @@ -458,8 +426,10 @@ static int spufs_create_gang(struct inode *inode, * in error path of *_open(). */ ret = spufs_gang_open(dget(dentry), mntget(mnt)); - if (ret < 0) - WARN_ON(spufs_rmgang(inode, dentry)); + if (ret < 0) { + int err = simple_rmdir(inode, dentry); + WARN_ON(err); + } out: mutex_unlock(&inode->i_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
[POWERPC] spufs: Free mm if spufs_fill_dir() failed
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=89df00855beabfa700f9a9ed52f0983bdc4b021d Commit: 89df00855beabfa700f9a9ed52f0983bdc4b021d Parent: 877907d37da9694a34adc9dc3e2ce09400148cb5 Author: Sebastian Siewior <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 23:26:51 2007 +1000 Committer: Paul Mackerras <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 11:44:39 2007 +1000 [POWERPC] spufs: Free mm if spufs_fill_dir() failed In case spufs_fill_dir() fails only put_spu_context() gets called for cleanup and the acquired mm_struct never gets freed. Signed-off-by: Sebastian Siewior <[EMAIL PROTECTED]> Signed-off-by: Arnd Bergmann <[EMAIL PROTECTED]> Signed-off-by: Jeremy Kerr <[EMAIL PROTECTED]> Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]> --- arch/powerpc/platforms/cell/spufs/inode.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index fe960dd..0835681 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c @@ -274,6 +274,7 @@ spufs_mkdir(struct inode *dir, struct dentry *dentry, unsigned int flags, goto out; out_free_ctx: + spu_forget(ctx); put_spu_context(ctx); out_iput: iput(inode); - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[POWERPC] spufs: Synchronize pte invalidation vs ps close
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=47d3a5faa3f72186f769ed9579c630afb8433f2b Commit: 47d3a5faa3f72186f769ed9579c630afb8433f2b Parent: 89df00855beabfa700f9a9ed52f0983bdc4b021d Author: Christoph Hellwig <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 23:26:51 2007 +1000 Committer: Paul Mackerras <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 11:44:39 2007 +1000 [POWERPC] spufs: Synchronize pte invalidation vs ps close Make sure the mapping_lock also protects access to the various address_space pointers used for tearing down the ptes on a spu context switch. Because unmap_mapping_range can sleep we need to turn mapping_lock from a spinlock into a sleeping mutex. Signed-off-by: Christoph Hellwig <[EMAIL PROTECTED]> Signed-off-by: Arnd Bergmann <[EMAIL PROTECTED]> Signed-off-by: Jeremy Kerr <[EMAIL PROTECTED]> Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]> --- arch/powerpc/platforms/cell/spufs/context.c |4 +- arch/powerpc/platforms/cell/spufs/file.c| 56 +- arch/powerpc/platforms/cell/spufs/spufs.h |2 +- 3 files changed, 32 insertions(+), 30 deletions(-) diff --git a/arch/powerpc/platforms/cell/spufs/context.c b/arch/powerpc/platforms/cell/spufs/context.c index 8654749..7c51cb5 100644 --- a/arch/powerpc/platforms/cell/spufs/context.c +++ b/arch/powerpc/platforms/cell/spufs/context.c @@ -39,7 +39,7 @@ struct spu_context *alloc_spu_context(struct spu_gang *gang) if (spu_init_csa(&ctx->csa)) goto out_free; spin_lock_init(&ctx->mmio_lock); - spin_lock_init(&ctx->mapping_lock); + mutex_init(&ctx->mapping_lock); kref_init(&ctx->kref); mutex_init(&ctx->state_mutex); mutex_init(&ctx->run_mutex); @@ -103,6 +103,7 @@ void spu_forget(struct spu_context *ctx) void spu_unmap_mappings(struct spu_context *ctx) { + mutex_lock(&ctx->mapping_lock); if (ctx->local_store) unmap_mapping_range(ctx->local_store, 0, LS_SIZE, 1); if (ctx->mfc) @@ -117,6 +118,7 @@ void spu_unmap_mappings(struct spu_context *ctx) unmap_mapping_range(ctx->mss, 0, 0x1000, 1); if (ctx->psmap) unmap_mapping_range(ctx->psmap, 0, 0x2, 1); + mutex_unlock(&ctx->mapping_lock); } /** diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index 89a5011..b1e7e2f 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/platforms/cell/spufs/file.c @@ -45,11 +45,11 @@ spufs_mem_open(struct inode *inode, struct file *file) struct spufs_inode_info *i = SPUFS_I(inode); struct spu_context *ctx = i->i_ctx; - spin_lock(&ctx->mapping_lock); + mutex_lock(&ctx->mapping_lock); file->private_data = ctx; if (!i->i_openers++) ctx->local_store = inode->i_mapping; - spin_unlock(&ctx->mapping_lock); + mutex_unlock(&ctx->mapping_lock); return 0; } @@ -59,10 +59,10 @@ spufs_mem_release(struct inode *inode, struct file *file) struct spufs_inode_info *i = SPUFS_I(inode); struct spu_context *ctx = i->i_ctx; - spin_lock(&ctx->mapping_lock); + mutex_lock(&ctx->mapping_lock); if (!--i->i_openers) ctx->local_store = NULL; - spin_unlock(&ctx->mapping_lock); + mutex_unlock(&ctx->mapping_lock); return 0; } @@ -310,11 +310,11 @@ static int spufs_cntl_open(struct inode *inode, struct file *file) struct spufs_inode_info *i = SPUFS_I(inode); struct spu_context *ctx = i->i_ctx; - spin_lock(&ctx->mapping_lock); + mutex_lock(&ctx->mapping_lock); file->private_data = ctx; if (!i->i_openers++) ctx->cntl = inode->i_mapping; - spin_unlock(&ctx->mapping_lock); + mutex_unlock(&ctx->mapping_lock); return simple_attr_open(inode, file, spufs_cntl_get, spufs_cntl_set, "0x%08lx"); } @@ -327,10 +327,10 @@ spufs_cntl_release(struct inode *inode, struct file *file) simple_attr_close(inode, file); - spin_lock(&ctx->mapping_lock); + mutex_lock(&ctx->mapping_lock); if (!--i->i_openers) ctx->cntl = NULL; - spin_unlock(&ctx->mapping_lock); + mutex_unlock(&ctx->mapping_lock); return 0; } @@ -813,11 +813,11 @@ static int spufs_signal1_open(struct inode *inode, struct file *file) struct spufs_inode_info *i = SPUFS_I(inode); struct spu_context *ctx = i->i_ctx; - spin_lock(&ctx->mapping_lock); + mutex_lock(&ctx->mapping_lock); file->private_data = ctx; if (!i->i_openers++) ctx->signal1 = inode->i_mapping; - spin_unlock(&ctx->mapping_lock); + mutex_unlock(&ctx->mapping_lock); return nonseekable_open(inode, file); } @@
[POWERPC] spufs scheduler: Fix wakeup races
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bb5db29aa0379f0f3ef857a3a3715f17261c611b Commit: bb5db29aa0379f0f3ef857a3a3715f17261c611b Parent: 47d3a5faa3f72186f769ed9579c630afb8433f2b Author: Christoph Hellwig <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 23:26:51 2007 +1000 Committer: Paul Mackerras <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 11:44:39 2007 +1000 [POWERPC] spufs scheduler: Fix wakeup races Fix the race between checking for contexts on the runqueue and actually waking them in spu_deactive and spu_yield. The guts of spu_reschedule are split into a new helper called grab_runnable_context which shows if there is a runnable thread below a specified priority and if yes removes if from the runqueue and uses it. This function is used by the new __spu_deactivate hepler shared by preemption and spu_yield to grab a new context before deactivating a specified priority and if yes removes if from the runqueue and uses it. This function is used by the new __spu_deactivate hepler shared by preemption and spu_yield to grab a new context before deactivating the old one. Signed-off-by: Christoph Hellwig <[EMAIL PROTECTED]> Signed-off-by: Arnd Bergmann <[EMAIL PROTECTED]> Signed-off-by: Jeremy Kerr <[EMAIL PROTECTED]> Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]> --- arch/powerpc/platforms/cell/spufs/sched.c | 159 ++--- 1 files changed, 77 insertions(+), 82 deletions(-) diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c index b6ecb30..68fcdc4 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c @@ -93,43 +93,6 @@ void spu_stop_tick(struct spu_context *ctx) } } -void spu_sched_tick(struct work_struct *work) -{ - struct spu_context *ctx = - container_of(work, struct spu_context, sched_work.work); - struct spu *spu; - int preempted = 0; - - /* -* If this context is being stopped avoid rescheduling from the -* scheduler tick because we would block on the state_mutex. -* The caller will yield the spu later on anyway. -*/ - if (test_bit(SPU_SCHED_EXITING, &ctx->sched_flags)) - return; - - mutex_lock(&ctx->state_mutex); - spu = ctx->spu; - if (spu) { - int best = sched_find_first_bit(spu_prio->bitmap); - if (best <= ctx->prio) { - spu_deactivate(ctx); - preempted = 1; - } - } - mutex_unlock(&ctx->state_mutex); - - if (preempted) { - /* -* We need to break out of the wait loop in spu_run manually -* to ensure this context gets put on the runqueue again -* ASAP. -*/ - wake_up(&ctx->stop_wq); - } else - spu_start_tick(ctx); -} - /** * spu_add_to_active_list - add spu to active list * @spu: spu to add to the active list @@ -273,34 +236,6 @@ static void spu_prio_wait(struct spu_context *ctx) remove_wait_queue(&ctx->stop_wq, &wait); } -/** - * spu_reschedule - try to find a runnable context for a spu - * @spu: spu available - * - * This function is called whenever a spu becomes idle. It looks for the - * most suitable runnable spu context and schedules it for execution. - */ -static void spu_reschedule(struct spu *spu) -{ - int best; - - spu_free(spu); - - spin_lock(&spu_prio->runq_lock); - best = sched_find_first_bit(spu_prio->bitmap); - if (best < MAX_PRIO) { - struct list_head *rq = &spu_prio->runq[best]; - struct spu_context *ctx; - - BUG_ON(list_empty(rq)); - - ctx = list_entry(rq->next, struct spu_context, rq); - __spu_del_from_rq(ctx); - wake_up(&ctx->stop_wq); - } - spin_unlock(&spu_prio->runq_lock); -} - static struct spu *spu_get_idle(struct spu_context *ctx) { struct spu *spu = NULL; @@ -429,6 +364,51 @@ int spu_activate(struct spu_context *ctx, unsigned long flags) } /** + * grab_runnable_context - try to find a runnable context + * + * Remove the highest priority context on the runqueue and return it + * to the caller. Returns %NULL if no runnable context was found. + */ +static struct spu_context *grab_runnable_context(int prio) +{ + struct spu_context *ctx = NULL; + int best; + + spin_lock(&spu_prio->runq_lock); + best = sched_find_first_bit(spu_prio->bitmap); + if (best < prio) { + struct list_head *rq = &spu_prio->runq[best]; + + BUG_ON(list_empty(rq)); + + ctx = list_entry(rq->next, struct spu_context, rq); + __spu_del_from_rq(ctx); + } + spin_unloc
[POWERPC] Fix pci_setup_phb_io_dynamic for pci_iomap
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e7c40012b84f670ba57fe4a3f453ddecc8813e9b Commit: e7c40012b84f670ba57fe4a3f453ddecc8813e9b Parent: bb5db29aa0379f0f3ef857a3a3715f17261c611b Author: Arnd Bergmann <[EMAIL PROTECTED]> AuthorDate: Tue Jun 5 04:14:39 2007 +1000 Committer: Paul Mackerras <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 11:44:40 2007 +1000 [POWERPC] Fix pci_setup_phb_io_dynamic for pci_iomap We had a problem on a system with only dynamically allocated PCI buses (using of_pci_phb_driver) in combination with libata. This setup ended up having no "primary" phb, which means that pci_io_base never got initialized and all IO port numbers are 64 bit numbers, which is larger than the PIO_MASK limit. Signed-off-by: Arnd Bergmann <[EMAIL PROTECTED]> Acked-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]> Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]> --- arch/powerpc/kernel/of_platform.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c index d501c23..d454f61 100644 --- a/arch/powerpc/kernel/of_platform.c +++ b/arch/powerpc/kernel/of_platform.c @@ -433,7 +433,7 @@ static int __devinit of_pci_phb_probe(struct of_device *dev, * Note also that we don't do ISA, this will also be fixed with a * more massive rework. */ - pci_setup_phb_io(phb, 0); + pci_setup_phb_io(phb, pci_io_base == 0); /* Init pci_dn data structures */ pci_devs_phb_init_dynamic(phb); - 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
[POWERPC] cbe_cpufreq: Limit frequency via cpufreq notifier chain
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1552cb923efcd0f5499104256010d2ace437581d Commit: 1552cb923efcd0f5499104256010d2ace437581d Parent: e7c40012b84f670ba57fe4a3f453ddecc8813e9b Author: Thomas Renninger <[EMAIL PROTECTED]> AuthorDate: Tue Jun 5 04:14:40 2007 +1000 Committer: Paul Mackerras <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 11:44:40 2007 +1000 [POWERPC] cbe_cpufreq: Limit frequency via cpufreq notifier chain ... and get rid of cpufreq_set_policy call that caused a build failure due interfering commits. Signed-off-by: Thomas Renninger <[EMAIL PROTECTED]> Signed-off-by: Christian Krafft <[EMAIL PROTECTED]> Signed-off-by: Arnd Bergmann <[EMAIL PROTECTED]> Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]> --- arch/powerpc/platforms/cell/cbe_cpufreq.c | 33 +++- 1 files changed, 27 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/platforms/cell/cbe_cpufreq.c b/arch/powerpc/platforms/cell/cbe_cpufreq.c index f9ac3fe..ac44599 100644 --- a/arch/powerpc/platforms/cell/cbe_cpufreq.c +++ b/arch/powerpc/platforms/cell/cbe_cpufreq.c @@ -67,6 +67,7 @@ static u64 MIC_Slow_Next_Timer_table[] = { 0x3FC0ull, }; +static unsigned int pmi_frequency_limit = 0; /* * hardware specific functions */ @@ -164,7 +165,6 @@ static int set_pmode(int cpu, unsigned int slow_mode) { static void cbe_cpufreq_handle_pmi(struct of_device *dev, pmi_message_t pmi_msg) { - struct cpufreq_policy policy; u8 cpu; u8 cbe_pmode_new; @@ -173,15 +173,27 @@ static void cbe_cpufreq_handle_pmi(struct of_device *dev, pmi_message_t pmi_msg) cpu = cbe_node_to_cpu(pmi_msg.data1); cbe_pmode_new = pmi_msg.data2; - cpufreq_get_policy(&policy, cpu); + pmi_frequency_limit = cbe_freqs[cbe_pmode_new].frequency; - policy.max = min(policy.max, cbe_freqs[cbe_pmode_new].frequency); - policy.min = min(policy.min, policy.max); + pr_debug("cbe_handle_pmi: max freq=%d\n", pmi_frequency_limit); +} + +static int pmi_notifier(struct notifier_block *nb, + unsigned long event, void *data) +{ + struct cpufreq_policy *policy = data; - pr_debug("cbe_handle_pmi: new policy.min=%d policy.max=%d\n", policy.min, policy.max); - cpufreq_set_policy(&policy); + if (event != CPUFREQ_INCOMPATIBLE) + return 0; + + cpufreq_verify_within_limits(policy, 0, pmi_frequency_limit); + return 0; } +static struct notifier_block pmi_notifier_block = { + .notifier_call = pmi_notifier, +}; + static struct pmi_handler cbe_pmi_handler = { .type = PMI_TYPE_FREQ_CHANGE, .handle_pmi_message = cbe_cpufreq_handle_pmi, @@ -238,12 +250,21 @@ static int cbe_cpufreq_cpu_init(struct cpufreq_policy *policy) cpufreq_frequency_table_get_attr(cbe_freqs, policy->cpu); + if (pmi_dev) { + /* frequency might get limited later, initialize limit with max_freq */ + pmi_frequency_limit = max_freq; + cpufreq_register_notifier(&pmi_notifier_block, CPUFREQ_POLICY_NOTIFIER); + } + /* this ensures that policy->cpuinfo_min and policy->cpuinfo_max are set correctly */ return cpufreq_frequency_table_cpuinfo(policy, cbe_freqs); } static int cbe_cpufreq_cpu_exit(struct cpufreq_policy *policy) { + if (pmi_dev) + cpufreq_unregister_notifier(&pmi_notifier_block, CPUFREQ_POLICY_NOTIFIER); + cpufreq_frequency_table_put_attr(policy->cpu); 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
[POWERPC] scc_sio: Fix link failure
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6dcbf164dcf4042bcbe9f56d94f65acd10b0e1f6 Commit: 6dcbf164dcf4042bcbe9f56d94f65acd10b0e1f6 Parent: 1552cb923efcd0f5499104256010d2ace437581d Author: Christoph Hellwig <[EMAIL PROTECTED]> AuthorDate: Tue Jun 5 04:14:41 2007 +1000 Committer: Paul Mackerras <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 11:44:40 2007 +1000 [POWERPC] scc_sio: Fix link failure scc_sio.o should only be built if the txx9 serial driver is actually built into the kernel. Signed-off-by: Christoph Hellwig <[EMAIL PROTECTED]> Signed-off-by: Arnd Bergmann <[EMAIL PROTECTED]> -- Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]> --- arch/powerpc/platforms/celleb/Makefile |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/platforms/celleb/Makefile b/arch/powerpc/platforms/celleb/Makefile index f4f8252..5240046 100644 --- a/arch/powerpc/platforms/celleb/Makefile +++ b/arch/powerpc/platforms/celleb/Makefile @@ -4,5 +4,5 @@ obj-y += interrupt.o iommu.o setup.o \ obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_PPC_UDBG_BEAT)+= udbg_beat.o -obj-$(CONFIG_HAS_TXX9_SERIAL) += scc_sio.o +obj-$(CONFIG_SERIAL_TXX9) += scc_sio.o obj-$(CONFIG_SPU_BASE) += spu_priv1.o - 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
[POWERPC] Fix typo in booting-without-of-txt section numbering
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d30ac1242bf842fe28501a78a460a43910ef2dba Commit: d30ac1242bf842fe28501a78a460a43910ef2dba Parent: 6dcbf164dcf4042bcbe9f56d94f65acd10b0e1f6 Author: Stuart Yoder <[EMAIL PROTECTED]> AuthorDate: Tue Jun 5 07:16:15 2007 +1000 Committer: Paul Mackerras <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 11:44:40 2007 +1000 [POWERPC] Fix typo in booting-without-of-txt section numbering Fix typo in section numbering. Signed-off-by: Stuart Yoder <[EMAIL PROTECTED]> Acked-by: David Gibson <[EMAIL PROTECTED]> Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]> --- Documentation/powerpc/booting-without-of.txt |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt index b49ce16..258a279 100644 --- a/Documentation/powerpc/booting-without-of.txt +++ b/Documentation/powerpc/booting-without-of.txt @@ -1687,7 +1687,7 @@ platforms are moved over to use the flattened-device-tree model. }; }; -g) Flash chip nodes +j) Flash chip nodes Flash chips (Memory Technology Devices) are often used for solid state file systems on embedded devices. - 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
[POWERPC] spufs: Don't yield nosched context
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e5c0b9ec538a86433ddd725f675e0a5a2117b9ed Commit: e5c0b9ec538a86433ddd725f675e0a5a2117b9ed Parent: d30ac1242bf842fe28501a78a460a43910ef2dba Author: Christoph Hellwig <[EMAIL PROTECTED]> AuthorDate: Tue Jun 5 11:25:59 2007 +1000 Committer: Paul Mackerras <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 11:44:40 2007 +1000 [POWERPC] spufs: Don't yield nosched context Nosched context sould never be scheduled out, thus we must not deactivate them in spu_yield ever. Signed-off-by: Christoph Hellwig <[EMAIL PROTECTED]> Signed-off-by: Jeremy Kerr <[EMAIL PROTECTED]> Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]> --- arch/powerpc/platforms/cell/spufs/sched.c |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c index 68fcdc4..3b831e0 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c @@ -430,9 +430,11 @@ void spu_deactivate(struct spu_context *ctx) */ void spu_yield(struct spu_context *ctx) { - mutex_lock(&ctx->state_mutex); - __spu_deactivate(ctx, 0, MAX_PRIO); - mutex_unlock(&ctx->state_mutex); + if (!(ctx->flags & SPU_CREATE_NOSCHED)) { + mutex_lock(&ctx->state_mutex); + __spu_deactivate(ctx, 0, MAX_PRIO); + mutex_unlock(&ctx->state_mutex); + } } void spu_sched_tick(struct work_struct *work) - 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
[POWERPC] Add table of contents to booting-without-of.txt
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5e1e9ba690a2e2135a8f997242f9c46d2b8ac033 Commit: 5e1e9ba690a2e2135a8f997242f9c46d2b8ac033 Parent: e5c0b9ec538a86433ddd725f675e0a5a2117b9ed Author: Stuart Yoder <[EMAIL PROTECTED]> AuthorDate: Wed Jun 6 04:29:14 2007 +1000 Committer: Paul Mackerras <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 11:44:40 2007 +1000 [POWERPC] Add table of contents to booting-without-of.txt Add table of contents. Signed-off-by: Stuart Yoder <[EMAIL PROTECTED]> Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]> --- Documentation/powerpc/booting-without-of.txt | 57 +- 1 files changed, 56 insertions(+), 1 deletions(-) diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt index 258a279..d42d981 100644 --- a/Documentation/powerpc/booting-without-of.txt +++ b/Documentation/powerpc/booting-without-of.txt @@ -1,7 +1,6 @@ Booting the Linux/ppc kernel without Open Firmware -- - (c) 2005 Benjamin Herrenschmidt , IBM Corp. (c) 2005 Becky Bruce , @@ -9,6 +8,62 @@ (c) 2006 MontaVista Software, Inc. Flash chip node definition +Table of Contents += + + I - Introduction +1) Entry point for arch/powerpc +2) Board support + + II - The DT block format +1) Header +2) Device tree generalities +3) Device tree "structure" block +4) Device tree "strings" block + + III - Required content of the device tree +1) Note about cells and address representation +2) Note about "compatible" properties +3) Note about "name" properties +4) Note about node and property names and character set +5) Required nodes and properties + a) The root node + b) The /cpus node + c) The /cpus/* nodes + d) the /memory node(s) + e) The /chosen node + f) the /soc node + + IV - "dtc", the device tree compiler + + V - Recommendations for a bootloader + + VI - System-on-a-chip devices and nodes +1) Defining child nodes of an SOC +2) Representing devices without a current OF specification + a) MDIO IO device + c) PHY nodes + b) Gianfar-compatible ethernet nodes + d) Interrupt controllers + e) I2C + f) Freescale SOC USB controllers + g) Freescale SOC SEC Security Engines + h) Board Control and Status (BCSR) + i) Freescale QUICC Engine module (QE) + g) Flash chip nodes + + VII - Specifying interrupt information for devices +1) interrupts property +2) interrupt-parent property +3) OpenPIC Interrupt Controllers +4) ISA Interrupt Controllers + + Appendix A - Sample SOC node for MPC8540 + + +Revision Information + + May 18, 2005: Rev 0.1 - Initial draft, no chapter III yet. May 19, 2005: Rev 0.2 - Add chapter III and bits & pieces here or - 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
[POWERPC] spufs: Fix error handling in spufs_fill_dir()
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=87873c86802ba7ff9d9550d06459a6e99d72c5eb Commit: 87873c86802ba7ff9d9550d06459a6e99d72c5eb Parent: 5e1e9ba690a2e2135a8f997242f9c46d2b8ac033 Author: Sebastian Siewior <[EMAIL PROTECTED]> AuthorDate: Wed Jun 6 14:03:58 2007 +1000 Committer: Paul Mackerras <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 11:44:40 2007 +1000 [POWERPC] spufs: Fix error handling in spufs_fill_dir() The error path in spufs_fill_dir() is broken. If d_alloc_name() or spufs_new_file() fails, spufs_prune_dir() is getting called. At this time dir->inode is not set and a NULL pointer is dereferenced by mutex_lock(). This bugfix replaces spufs_prune_dir() with a shorter version that does not touch dir->inode but simply removes all children. Signed-off-by: Sebastian Siewior <[EMAIL PROTECTED]> Signed-off-by: Jeremy Kerr <[EMAIL PROTECTED]> Acked-by: Arnd Bergmann <[EMAIL PROTECTED]> Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]> --- arch/powerpc/platforms/cell/spufs/inode.c | 17 +++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 0835681..9807206 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c @@ -177,7 +177,7 @@ static int spufs_rmdir(struct inode *parent, struct dentry *dir) static int spufs_fill_dir(struct dentry *dir, struct tree_descr *files, int mode, struct spu_context *ctx) { - struct dentry *dentry; + struct dentry *dentry, *tmp; int ret; while (files->name && files->name[0]) { @@ -193,7 +193,20 @@ static int spufs_fill_dir(struct dentry *dir, struct tree_descr *files, } return 0; out: - spufs_prune_dir(dir); + /* +* remove all children from dir. dir->inode is not set so don't +* just simply use spufs_prune_dir() and panic afterwards :) +* dput() looks like it will do the right thing: +* - dec parent's ref counter +* - remove child from parent's child list +* - free child's inode if possible +* - free child +*/ + list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_u.d_child) { + dput(dentry); + } + + shrink_dcache_parent(dir); return ret; } - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[POWERPC] Fix building of COFF zImages
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f40e524eaec9697d1515564fd5b961d839d2dc4f Commit: f40e524eaec9697d1515564fd5b961d839d2dc4f Parent: 87873c86802ba7ff9d9550d06459a6e99d72c5eb Author: Paul Mackerras <[EMAIL PROTECTED]> AuthorDate: Thu Jun 7 22:21:31 2007 +1000 Committer: Paul Mackerras <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 22:21:31 2007 +1000 [POWERPC] Fix building of COFF zImages The COFF zImage (for booting oldworld powermacs) wasn't being built correctly because the procedure descriptor in crt0.S for the zImage entry point wasn't declared as .globl, and therefore wasn't getting pulled in from wrapper.a by the linker. This adds the necessary .globl statement. Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]> --- arch/powerpc/boot/crt0.S |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/boot/crt0.S b/arch/powerpc/boot/crt0.S index 5a4215c..f1c4dfc 100644 --- a/arch/powerpc/boot/crt0.S +++ b/arch/powerpc/boot/crt0.S @@ -13,6 +13,7 @@ .text /* a procedure descriptor used when booting this as a COFF file */ + .globl _zimage_start_opd _zimage_start_opd: .long _zimage_start, 0, 0, 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
[SPARC64]: Move topology init code into new file, sysfs.c
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=eff3414b7277c4792debfa227f5408238d925f16 Commit: eff3414b7277c4792debfa227f5408238d925f16 Parent: 5ecd3100e695228ac5e0ce0e325e252c0f11806f Author: David S. Miller <[EMAIL PROTECTED]> AuthorDate: Sat Jun 2 14:41:44 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Mon Jun 4 21:49:50 2007 -0700 [SPARC64]: Move topology init code into new file, sysfs.c Also, use per-cpu data for struct cpu. Calling kmalloc for each cpu in topology_init() is just plain clumsy. Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- arch/sparc64/kernel/Makefile |4 ++-- arch/sparc64/kernel/setup.c | 19 --- arch/sparc64/kernel/sysfs.c | 26 ++ 3 files changed, 28 insertions(+), 21 deletions(-) diff --git a/arch/sparc64/kernel/Makefile b/arch/sparc64/kernel/Makefile index d8d1909..f964bf2 100644 --- a/arch/sparc64/kernel/Makefile +++ b/arch/sparc64/kernel/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.70 2002/02/09 19:49:30 davem Exp $ +# # Makefile for the linux kernel. # @@ -8,7 +8,7 @@ EXTRA_CFLAGS := -Werror extra-y:= head.o init_task.o vmlinux.lds obj-y := process.o setup.o cpu.o idprom.o \ - traps.o auxio.o una_asm.o \ + traps.o auxio.o una_asm.o sysfs.o \ irq.o ptrace.o time.o sys_sparc.o signal.o \ unaligned.o central.o pci.o starfire.o semaphore.o \ power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o \ diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c index de9b4c1..7490cc6 100644 --- a/arch/sparc64/kernel/setup.c +++ b/arch/sparc64/kernel/setup.c @@ -513,22 +513,3 @@ void sun_do_break(void) int serial_console = -1; int stop_a_enabled = 1; - -static int __init topology_init(void) -{ - int i, err; - - err = -ENOMEM; - - for_each_possible_cpu(i) { - struct cpu *p = kzalloc(sizeof(*p), GFP_KERNEL); - if (p) { - register_cpu(p, i); - err = 0; - } - } - - return err; -} - -subsys_initcall(topology_init); diff --git a/arch/sparc64/kernel/sysfs.c b/arch/sparc64/kernel/sysfs.c new file mode 100644 index 000..0808c21 --- /dev/null +++ b/arch/sparc64/kernel/sysfs.c @@ -0,0 +1,26 @@ +/* sysfs.c: Toplogy sysfs support code for sparc64. + * + * Copyright (C) 2007 David S. Miller <[EMAIL PROTECTED]> + */ +#include +#include +#include +#include +#include + +static DEFINE_PER_CPU(struct cpu, cpu_devices); + +static int __init topology_init(void) +{ + int cpu; + + for_each_possible_cpu(cpu) { + struct cpu *c = &per_cpu(cpu_devices, cpu); + + register_cpu(c, cpu); + } + + return 0; +} + +subsys_initcall(topology_init); - 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
[SPARC64]: Export basic cpu properties via sysfs.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d1f253e60aefe4d3a3e708b3c2a082f3ec1be6f4 Commit: d1f253e60aefe4d3a3e708b3c2a082f3ec1be6f4 Parent: eff3414b7277c4792debfa227f5408238d925f16 Author: David S. Miller <[EMAIL PROTECTED]> AuthorDate: Sat Jun 2 20:46:36 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Mon Jun 4 21:49:51 2007 -0700 [SPARC64]: Export basic cpu properties via sysfs. Cache sizes, udelay_val, and clock_tick. Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- arch/sparc64/kernel/sysfs.c | 86 +++ 1 files changed, 86 insertions(+), 0 deletions(-) diff --git a/arch/sparc64/kernel/sysfs.c b/arch/sparc64/kernel/sysfs.c index 0808c21..a684a79 100644 --- a/arch/sparc64/kernel/sysfs.c +++ b/arch/sparc64/kernel/sysfs.c @@ -10,14 +10,100 @@ static DEFINE_PER_CPU(struct cpu, cpu_devices); +#define SHOW_ULONG_NAME(NAME, MEMBER) \ +static ssize_t show_##NAME(struct sys_device *dev, char *buf) \ +{ \ + struct cpu *cpu = container_of(dev, struct cpu, sysdev); \ + cpuinfo_sparc *c = &cpu_data(cpu->sysdev.id); \ + return sprintf(buf, "%lu\n", c->MEMBER); \ +} + +#define SHOW_UINT_NAME(NAME, MEMBER) \ +static ssize_t show_##NAME(struct sys_device *dev, char *buf) \ +{ \ + struct cpu *cpu = container_of(dev, struct cpu, sysdev); \ + cpuinfo_sparc *c = &cpu_data(cpu->sysdev.id); \ + return sprintf(buf, "%u\n", c->MEMBER); \ +} + +SHOW_ULONG_NAME(clock_tick, clock_tick); +SHOW_ULONG_NAME(udelay_val, udelay_val); +SHOW_UINT_NAME(l1_dcache_size, dcache_size); +SHOW_UINT_NAME(l1_dcache_line_size, dcache_line_size); +SHOW_UINT_NAME(l1_icache_size, icache_size); +SHOW_UINT_NAME(l1_icache_line_size, icache_line_size); +SHOW_UINT_NAME(l2_cache_size, ecache_size); +SHOW_UINT_NAME(l2_cache_line_size, ecache_line_size); + +static struct sysdev_attribute cpu_core_attrs[] = { + _SYSDEV_ATTR(clock_tick, 0444, show_clock_tick, NULL), + _SYSDEV_ATTR(udelay_val, 0444, show_udelay_val, NULL), + _SYSDEV_ATTR(l1_dcache_size, 0444, show_l1_dcache_size, NULL), + _SYSDEV_ATTR(l1_dcache_line_size, 0444, show_l1_dcache_line_size, NULL), + _SYSDEV_ATTR(l1_icache_size, 0444, show_l1_icache_size, NULL), + _SYSDEV_ATTR(l1_icache_line_size, 0444, show_l1_icache_line_size, NULL), + _SYSDEV_ATTR(l2_cache_size, 0444, show_l2_cache_size, NULL), + _SYSDEV_ATTR(l2_cache_line_size, 0444, show_l2_cache_line_size, NULL), +}; + +static void register_cpu_online(unsigned int cpu) +{ + struct cpu *c = &per_cpu(cpu_devices, cpu); + struct sys_device *s = &c->sysdev; + int i; + + for (i = 0; i < ARRAY_SIZE(cpu_core_attrs); i++) + sysdev_create_file(s, &cpu_core_attrs[i]); +} + +#ifdef CONFIG_HOTPLUG_CPU +static void unregister_cpu_online(unsigned int cpu) +{ + struct cpu *c = &per_cpu(cpu_devices, cpu); + struct sys_device *s = &c->sysdev; + int i; + + for (i = 0; i < ARRAY_SIZE(cpu_core_attrs); i++) + sysdev_remove_file(s, &cpu_core_attrs[i]); +} +#endif + +static int __cpuinit sysfs_cpu_notify(struct notifier_block *self, + unsigned long action, void *hcpu) +{ + unsigned int cpu = (unsigned int)(long)hcpu; + + switch (action) { + case CPU_ONLINE: + case CPU_ONLINE_FROZEN: + register_cpu_online(cpu); + break; +#ifdef CONFIG_HOTPLUG_CPU + case CPU_DEAD: + case CPU_DEAD_FROZEN: + unregister_cpu_online(cpu); + break; +#endif + } + return NOTIFY_OK; +} + +static struct notifier_block __cpuinitdata sysfs_cpu_nb = { + .notifier_call = sysfs_cpu_notify, +}; + static int __init topology_init(void) { int cpu; + register_cpu_notifier(&sysfs_cpu_nb); + for_each_possible_cpu(cpu) { struct cpu *c = &per_cpu(cpu_devices, cpu); register_cpu(c, cpu); + if (cpu_online(cpu)) + register_cpu_online(cpu); } 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
[SPARC64]: Fix service channel hypervisor function names.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=48b67356400dd7866c035024aeaa2f804de7cead Commit: 48b67356400dd7866c035024aeaa2f804de7cead Parent: d1f253e60aefe4d3a3e708b3c2a082f3ec1be6f4 Author: David Miller <[EMAIL PROTECTED]> AuthorDate: Sun Jun 3 19:07:32 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Mon Jun 4 21:49:54 2007 -0700 [SPARC64]: Fix service channel hypervisor function names. sed 's/scv/svc/' Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- arch/sparc64/kernel/entry.S | 40 1 files changed, 20 insertions(+), 20 deletions(-) diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S index ed712e0..5b28315 100644 --- a/arch/sparc64/kernel/entry.S +++ b/arch/sparc64/kernel/entry.S @@ -2514,9 +2514,9 @@ sun4v_ncs_request: nop .size sun4v_ncs_request, .-sun4v_ncs_request - .globl sun4v_scv_send - .type sun4v_scv_send,#function -sun4v_scv_send: + .globl sun4v_svc_send + .type sun4v_svc_send,#function +sun4v_svc_send: save%sp, -192, %sp mov %i0, %o0 mov %i1, %o1 @@ -2526,11 +2526,11 @@ sun4v_scv_send: stx %o1, [%i3] ret restore - .size sun4v_scv_send, .-sun4v_scv_send + .size sun4v_svc_send, .-sun4v_svc_send - .globl sun4v_scv_recv - .type sun4v_scv_recv,#function -sun4v_scv_recv: + .globl sun4v_svc_recv + .type sun4v_svc_recv,#function +sun4v_svc_recv: save%sp, -192, %sp mov %i0, %o0 mov %i1, %o1 @@ -2540,33 +2540,33 @@ sun4v_scv_recv: stx %o1, [%i3] ret restore - .size sun4v_scv_recv, .-sun4v_scv_recv + .size sun4v_svc_recv, .-sun4v_svc_recv - .globl sun4v_scv_getstatus - .type sun4v_scv_getstatus,#function -sun4v_scv_getstatus: + .globl sun4v_svc_getstatus + .type sun4v_svc_getstatus,#function +sun4v_svc_getstatus: mov HV_FAST_SVC_GETSTATUS, %o5 mov %o1, %o4 ta HV_FAST_TRAP stx %o1, [%o4] retl nop - .size sun4v_scv_getstatus, .-sun4v_scv_getstatus + .size sun4v_svc_getstatus, .-sun4v_svc_getstatus - .globl sun4v_scv_setstatus - .type sun4v_scv_setstatus,#function -sun4v_scv_setstatus: + .globl sun4v_svc_setstatus + .type sun4v_svc_setstatus,#function +sun4v_svc_setstatus: mov HV_FAST_SVC_SETSTATUS, %o5 ta HV_FAST_TRAP retl nop - .size sun4v_scv_setstatus, .-sun4v_scv_setstatus + .size sun4v_svc_setstatus, .-sun4v_svc_setstatus - .globl sun4v_scv_clrstatus - .type sun4v_scv_clrstatus,#function -sun4v_scv_clrstatus: + .globl sun4v_svc_clrstatus + .type sun4v_svc_clrstatus,#function +sun4v_svc_clrstatus: mov HV_FAST_SVC_CLRSTATUS, %o5 ta HV_FAST_TRAP retl nop - .size sun4v_scv_clrstatus, .-sun4v_scv_clrstatus + .size sun4v_svc_clrstatus, .-sun4v_svc_clrstatus - 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
[SPARC64]: Provide mmu statistics via sysfs.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d887ab3a9b1899f88b8cfba531e726b5fb2ebd14 Commit: d887ab3a9b1899f88b8cfba531e726b5fb2ebd14 Parent: 48b67356400dd7866c035024aeaa2f804de7cead Author: David Miller <[EMAIL PROTECTED]> AuthorDate: Sun Jun 3 23:38:09 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Mon Jun 4 21:49:57 2007 -0700 [SPARC64]: Provide mmu statistics via sysfs. If the system supports hypervisor based statistics, allow them to be fetched, enabled, and disabled via sysfs. Enable and disable via the boolean: /sys/devices/systems/cpu/cpuN/mmustat_enable Statistic values are provided under: /sys/devices/systems/cpu/cpuN/mmu_status/ Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- arch/sparc64/kernel/entry.S | 22 arch/sparc64/kernel/sysfs.c | 215 +++--- include/asm-sparc64/hypervisor.h |5 + 3 files changed, 227 insertions(+), 15 deletions(-) diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S index 5b28315..7d1a118 100644 --- a/arch/sparc64/kernel/entry.S +++ b/arch/sparc64/kernel/entry.S @@ -2570,3 +2570,25 @@ sun4v_svc_clrstatus: retl nop .size sun4v_svc_clrstatus, .-sun4v_svc_clrstatus + + .globl sun4v_mmustat_conf + .type sun4v_mmustat_conf,#function +sun4v_mmustat_conf: + mov %o1, %o4 + mov HV_FAST_MMUSTAT_CONF, %o5 + ta HV_FAST_TRAP + stx %o1, [%o4] + retl +nop + .size sun4v_mmustat_conf, .-sun4v_mmustat_conf + + .globl sun4v_mmustat_info + .type sun4v_mmustat_info,#function +sun4v_mmustat_info: + mov %o0, %o4 + mov HV_FAST_MMUSTAT_INFO, %o5 + ta HV_FAST_TRAP + stx %o1, [%o4] + retl +nop + .size sun4v_mmustat_info, .-sun4v_mmustat_info diff --git a/arch/sparc64/kernel/sysfs.c b/arch/sparc64/kernel/sysfs.c index a684a79..cdb1477 100644 --- a/arch/sparc64/kernel/sysfs.c +++ b/arch/sparc64/kernel/sysfs.c @@ -8,32 +8,198 @@ #include #include -static DEFINE_PER_CPU(struct cpu, cpu_devices); +#include +#include + +static DEFINE_PER_CPU(struct hv_mmu_statistics, mmu_stats) __attribute__((aligned(64))); -#define SHOW_ULONG_NAME(NAME, MEMBER) \ +#define SHOW_MMUSTAT_ULONG(NAME) \ static ssize_t show_##NAME(struct sys_device *dev, char *buf) \ { \ - struct cpu *cpu = container_of(dev, struct cpu, sysdev); \ - cpuinfo_sparc *c = &cpu_data(cpu->sysdev.id); \ + struct hv_mmu_statistics *p = &per_cpu(mmu_stats, dev->id); \ + return sprintf(buf, "%lu\n", p->NAME); \ +} \ +static SYSDEV_ATTR(NAME, 0444, show_##NAME, NULL) + +SHOW_MMUSTAT_ULONG(immu_tsb_hits_ctx0_8k_tte); +SHOW_MMUSTAT_ULONG(immu_tsb_ticks_ctx0_8k_tte); +SHOW_MMUSTAT_ULONG(immu_tsb_hits_ctx0_64k_tte); +SHOW_MMUSTAT_ULONG(immu_tsb_ticks_ctx0_64k_tte); +SHOW_MMUSTAT_ULONG(immu_tsb_hits_ctx0_4mb_tte); +SHOW_MMUSTAT_ULONG(immu_tsb_ticks_ctx0_4mb_tte); +SHOW_MMUSTAT_ULONG(immu_tsb_hits_ctx0_256mb_tte); +SHOW_MMUSTAT_ULONG(immu_tsb_ticks_ctx0_256mb_tte); +SHOW_MMUSTAT_ULONG(immu_tsb_hits_ctxnon0_8k_tte); +SHOW_MMUSTAT_ULONG(immu_tsb_ticks_ctxnon0_8k_tte); +SHOW_MMUSTAT_ULONG(immu_tsb_hits_ctxnon0_64k_tte); +SHOW_MMUSTAT_ULONG(immu_tsb_ticks_ctxnon0_64k_tte); +SHOW_MMUSTAT_ULONG(immu_tsb_hits_ctxnon0_4mb_tte); +SHOW_MMUSTAT_ULONG(immu_tsb_ticks_ctxnon0_4mb_tte); +SHOW_MMUSTAT_ULONG(immu_tsb_hits_ctxnon0_256mb_tte); +SHOW_MMUSTAT_ULONG(immu_tsb_ticks_ctxnon0_256mb_tte); +SHOW_MMUSTAT_ULONG(dmmu_tsb_hits_ctx0_8k_tte); +SHOW_MMUSTAT_ULONG(dmmu_tsb_ticks_ctx0_8k_tte); +SHOW_MMUSTAT_ULONG(dmmu_tsb_hits_ctx0_64k_tte); +SHOW_MMUSTAT_ULONG(dmmu_tsb_ticks_ctx0_64k_tte); +SHOW_MMUSTAT_ULONG(dmmu_tsb_hits_ctx0_4mb_tte); +SHOW_MMUSTAT_ULONG(dmmu_tsb_ticks_ctx0_4mb_tte); +SHOW_MMUSTAT_ULONG(dmmu_tsb_hits_ctx0_256mb_tte); +SHOW_MMUSTAT_ULONG(dmmu_tsb_ticks_ctx0_256mb_tte); +SHOW_MMUSTAT_ULONG(dmmu_tsb_hits_ctxnon0_8k_tte); +SHOW_MMUSTAT_ULONG(dmmu_tsb_ticks_ctxnon0_8k_tte); +SHOW_MMUSTAT_ULONG(dmmu_tsb_hits_ctxnon0_64k_tte); +SHOW_MMUSTAT_ULONG(dmmu_tsb_ticks_ctxnon0_64k_tte); +SHOW_MMUSTAT_ULONG(dmmu_tsb_hits_ctxnon0_4mb_tte); +SHOW_MMUSTAT_ULONG(dmmu_tsb_ticks_ctxnon0_4mb_tte); +SHOW_MMUSTAT_ULONG(dmmu_tsb_hits_ctxnon0_256mb_tte); +SHOW_MMUSTAT_ULONG(dmmu_tsb_ticks_ctxnon0_256mb_tte); + +static struct attribute *mmu_stat_attrs[] = { + &attr_immu_tsb_hits_ctx0_8k_tte.attr, + &attr_immu_tsb_ticks_ctx0_8k_tte.attr, + &attr_immu_tsb_hits_ctx0_64k_tte.attr, + &attr_immu_tsb_ticks_ctx0_64k_tte.attr, + &attr_immu_tsb_hits_ctx0_4mb_tte.attr, + &attr_immu_tsb_ticks_ctx0_4mb_tte.attr, + &attr_immu_tsb_hits_ctx0_256mb_tte.attr, + &attr_immu_tsb_ticks_ctx0_256mb_tte.attr, + &attr_immu_tsb_hits_ctxnon0_8k_tte.attr, + &attr_immu_tsb_ticks_ctxnon0_8k_tte.attr, + &attr_
[SPARC64]: Proper multi-core scheduling support.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f78eae2e6f5d1eb05f76a45486286445b916bd92 Commit: f78eae2e6f5d1eb05f76a45486286445b916bd92 Parent: d887ab3a9b1899f88b8cfba531e726b5fb2ebd14 Author: David S. Miller <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 17:01:39 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Mon Jun 4 21:50:00 2007 -0700 [SPARC64]: Proper multi-core scheduling support. The scheduling domain hierarchy is: all cpus --> cpus that share an instruction cache --> cpus that share an integer execution unit Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- arch/sparc64/Kconfig |9 +++ arch/sparc64/kernel/mdesc.c| 49 arch/sparc64/kernel/prom.c |1 + arch/sparc64/kernel/smp.c | 19 ++- include/asm-sparc64/cpudata.h |2 +- include/asm-sparc64/smp.h |1 + include/asm-sparc64/topology.h | 13 -- 7 files changed, 89 insertions(+), 5 deletions(-) diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig index bd00f89..89a1b46 100644 --- a/arch/sparc64/Kconfig +++ b/arch/sparc64/Kconfig @@ -396,6 +396,15 @@ config SCHED_SMT when dealing with UltraSPARC cpus at a cost of slightly increased overhead in some places. If unsure say N here. +config SCHED_MC + bool "Multi-core scheduler support" + depends on SMP + default y + help + Multi-core scheduler support improves the CPU scheduler's decision + making when dealing with multi-core CPU chips at a cost of slightly + increased overhead in some places. If unsure say N here. + source "kernel/Kconfig.preempt" config CMDLINE_BOOL diff --git a/arch/sparc64/kernel/mdesc.c b/arch/sparc64/kernel/mdesc.c index 9246c2c..1b5db4b 100644 --- a/arch/sparc64/kernel/mdesc.c +++ b/arch/sparc64/kernel/mdesc.c @@ -473,6 +473,53 @@ static void __init set_core_ids(void) } } +static void __init mark_proc_ids(struct mdesc_node *mp, int proc_id) +{ + int i; + + for (i = 0; i < mp->num_arcs; i++) { + struct mdesc_node *t = mp->arcs[i].arc; + const u64 *id; + + if (strcmp(mp->arcs[i].name, "back")) + continue; + + if (strcmp(t->name, "cpu")) + continue; + + id = md_get_property(t, "id", NULL); + if (*id < NR_CPUS) + cpu_data(*id).proc_id = proc_id; + } +} + +static void __init __set_proc_ids(const char *exec_unit_name) +{ + struct mdesc_node *mp; + int idx; + + idx = 0; + md_for_each_node_by_name(mp, exec_unit_name) { + const char *type; + int len; + + type = md_get_property(mp, "type", &len); + if (!find_in_proplist(type, "int", len) && + !find_in_proplist(type, "integer", len)) + continue; + + mark_proc_ids(mp, idx); + + idx++; + } +} + +static void __init set_proc_ids(void) +{ + __set_proc_ids("exec_unit"); + __set_proc_ids("exec-unit"); +} + static void __init get_one_mondo_bits(const u64 *p, unsigned int *mask, unsigned char def) { u64 val; @@ -574,9 +621,11 @@ static void __init mdesc_fill_in_cpu_data(void) #endif c->core_id = 0; + c->proc_id = -1; } set_core_ids(); + set_proc_ids(); smp_fill_in_sib_core_maps(); } diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c index dad4b3b..928aba3 100644 --- a/arch/sparc64/kernel/prom.c +++ b/arch/sparc64/kernel/prom.c @@ -1800,6 +1800,7 @@ static void __init of_fill_in_cpu_data(void) cpu_data(cpuid).core_id = 0; } + cpu_data(cpuid).proc_id = -1; #ifdef CONFIG_SMP cpu_set(cpuid, cpu_present_map); diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c index c550bba..68a45ac 100644 --- a/arch/sparc64/kernel/smp.c +++ b/arch/sparc64/kernel/smp.c @@ -51,6 +51,8 @@ cpumask_t cpu_online_map __read_mostly = CPU_MASK_NONE; cpumask_t phys_cpu_present_map __read_mostly = CPU_MASK_NONE; cpumask_t cpu_sibling_map[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = CPU_MASK_NONE }; +cpumask_t cpu_core_map[NR_CPUS] __read_mostly = + { [0 ... NR_CPUS-1] = CPU_MASK_NONE }; static cpumask_t smp_commenced_mask; static cpumask_t cpu_callout_map; @@ -1217,13 +1219,28 @@ void __devinit smp_fill_in_sib_core_maps(void) unsigned int j; if (cpu_data(i).core_id == 0) { - cpu_set(i, cpu_sibling_map[i]); + cpu_set(i, cpu_core_map[i]); continue; } for_each_possible_cpu(j) {
[SPARC64]: Make core and sibling groups equal on UltraSPARC-IV.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5cd342df96e911fb8135fb3d58f33c2c5af9ffab Commit: 5cd342df96e911fb8135fb3d58f33c2c5af9ffab Parent: f78eae2e6f5d1eb05f76a45486286445b916bd92 Author: David S. Miller <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 21:35:18 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Mon Jun 4 21:50:02 2007 -0700 [SPARC64]: Make core and sibling groups equal on UltraSPARC-IV. Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- arch/sparc64/kernel/prom.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c index 928aba3..172387d 100644 --- a/arch/sparc64/kernel/prom.c +++ b/arch/sparc64/kernel/prom.c @@ -1781,6 +1781,7 @@ static void __init of_fill_in_cpu_data(void) } cpu_data(cpuid).core_id = portid + 1; + cpu_data(cpuid).proc_id = portid; } else { cpu_data(cpuid).dcache_size = of_getintprop_default(dp, "dcache-size", 16 * 1024); @@ -1799,8 +1800,8 @@ static void __init of_fill_in_cpu_data(void) of_getintprop_default(dp, "ecache-line-size", 64); cpu_data(cpuid).core_id = 0; + cpu_data(cpuid).proc_id = -1; } - cpu_data(cpuid).proc_id = -1; #ifdef CONFIG_SMP cpu_set(cpuid, cpu_present_map); - 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
[SPARC64]: Fix {mc,smt}_capable().
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a2f9f6bbb30e60ee9f9f83cede960123a65876a2 Commit: a2f9f6bbb30e60ee9f9f83cede960123a65876a2 Parent: 5cd342df96e911fb8135fb3d58f33c2c5af9ffab Author: David S. Miller <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 21:48:33 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Mon Jun 4 21:50:05 2007 -0700 [SPARC64]: Fix {mc,smt}_capable(). It's not just sun4v hypervisor platforms that should return true for this, sun4u with UltraSPARC-IV should return true too. Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- arch/sparc64/kernel/mdesc.c|4 arch/sparc64/kernel/prom.c |3 +++ arch/sparc64/kernel/smp.c |2 ++ include/asm-sparc64/smp.h |1 + include/asm-sparc64/topology.h |6 ++ 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/arch/sparc64/kernel/mdesc.c b/arch/sparc64/kernel/mdesc.c index 1b5db4b..f0e1604 100644 --- a/arch/sparc64/kernel/mdesc.c +++ b/arch/sparc64/kernel/mdesc.c @@ -624,6 +624,10 @@ static void __init mdesc_fill_in_cpu_data(void) c->proc_id = -1; } +#ifdef CONFIG_SMP + sparc64_multi_core = 1; +#endif + set_core_ids(); set_proc_ids(); diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c index 172387d..6f4a528 100644 --- a/arch/sparc64/kernel/prom.c +++ b/arch/sparc64/kernel/prom.c @@ -1782,6 +1782,9 @@ static void __init of_fill_in_cpu_data(void) cpu_data(cpuid).core_id = portid + 1; cpu_data(cpuid).proc_id = portid; +#ifdef CONFIG_SMP + sparc64_multi_core = 1; +#endif } else { cpu_data(cpuid).dcache_size = of_getintprop_default(dp, "dcache-size", 16 * 1024); diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c index 68a45ac..4dcd7d0 100644 --- a/arch/sparc64/kernel/smp.c +++ b/arch/sparc64/kernel/smp.c @@ -44,6 +44,8 @@ extern void calibrate_delay(void); +int sparc64_multi_core __read_mostly; + /* Please don't make this stuff initdata!!! --DaveM */ unsigned char boot_cpu_id; diff --git a/include/asm-sparc64/smp.h b/include/asm-sparc64/smp.h index 5400212..4fb8c4b 100644 --- a/include/asm-sparc64/smp.h +++ b/include/asm-sparc64/smp.h @@ -34,6 +34,7 @@ extern cpumask_t phys_cpu_present_map; extern cpumask_t cpu_sibling_map[NR_CPUS]; extern cpumask_t cpu_core_map[NR_CPUS]; +extern int sparc64_multi_core; /* * General functions that each host system must provide. diff --git a/include/asm-sparc64/topology.h b/include/asm-sparc64/topology.h index 4880f7c..290ac75 100644 --- a/include/asm-sparc64/topology.h +++ b/include/asm-sparc64/topology.h @@ -2,14 +2,12 @@ #define _ASM_SPARC64_TOPOLOGY_H #ifdef CONFIG_SMP -#include - #define topology_physical_package_id(cpu) (cpu_data(cpu).proc_id) #define topology_core_id(cpu) (cpu_data(cpu).core_id) #define topology_core_siblings(cpu)(cpu_core_map[cpu]) #define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) -#define mc_capable() (tlb_type == hypervisor) -#define smt_capable() (tlb_type == hypervisor) +#define mc_capable() (sparc64_multi_core) +#define smt_capable() (sparc64_multi_core) #endif /* CONFIG_SMP */ #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
[SPARC64]: Fill in gaps in non-PCI dma_*() NOP implementation.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f04dbac2623439e8e15abf55742769af0280c919 Commit: f04dbac2623439e8e15abf55742769af0280c919 Parent: a2f9f6bbb30e60ee9f9f83cede960123a65876a2 Author: David S. Miller <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 23:32:23 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Mon Jun 4 23:32:23 2007 -0700 [SPARC64]: Fill in gaps in non-PCI dma_*() NOP implementation. Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- include/asm-sparc64/dma-mapping.h | 83 + 1 files changed, 83 insertions(+), 0 deletions(-) diff --git a/include/asm-sparc64/dma-mapping.h b/include/asm-sparc64/dma-mapping.h index 9329429..4e21c2f 100644 --- a/include/asm-sparc64/dma-mapping.h +++ b/include/asm-sparc64/dma-mapping.h @@ -162,6 +162,22 @@ dma_mapping_error(dma_addr_t dma_addr) #else struct device; +struct page; +struct scatterlist; + +static inline int +dma_supported(struct device *dev, u64 mask) +{ + BUG(); + return 0; +} + +static inline int +dma_set_mask(struct device *dev, u64 dma_mask) +{ + BUG(); + return 0; +} static inline void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag) @@ -176,6 +192,52 @@ static inline void dma_free_coherent(struct device *dev, size_t size, BUG(); } +static inline dma_addr_t +dma_map_single(struct device *dev, void *cpu_addr, size_t size, + enum dma_data_direction direction) +{ + BUG(); + return 0; +} + +static inline void +dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, +enum dma_data_direction direction) +{ + BUG(); +} + +static inline dma_addr_t +dma_map_page(struct device *dev, struct page *page, +unsigned long offset, size_t size, +enum dma_data_direction direction) +{ + BUG(); + return 0; +} + +static inline void +dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, + enum dma_data_direction direction) +{ + BUG(); +} + +static inline int +dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, + enum dma_data_direction direction) +{ + BUG(); + return 0; +} + +static inline void +dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, +enum dma_data_direction direction) +{ + BUG(); +} + static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction direction) @@ -190,6 +252,27 @@ dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t siz BUG(); } +static inline void +dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, + enum dma_data_direction direction) +{ + BUG(); +} + +static inline void +dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, + enum dma_data_direction direction) +{ + BUG(); +} + +static inline int +dma_mapping_error(dma_addr_t dma_addr) +{ + BUG(); + return 0; +} + #endif /* PCI */ - 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
[ATA]: Back out bogus (SPARC64 && !PCI) Kconfig depends.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=65d8bac3df9516adb17ce9df94a955d3c2c85a51 Commit: 65d8bac3df9516adb17ce9df94a955d3c2c85a51 Parent: f04dbac2623439e8e15abf55742769af0280c919 Author: David S. Miller <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 23:33:04 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Mon Jun 4 23:33:04 2007 -0700 [ATA]: Back out bogus (SPARC64 && !PCI) Kconfig depends. Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- drivers/ata/Kconfig |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig index 7d893a6..b4a8d60 100644 --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig @@ -8,7 +8,6 @@ menuconfig ATA depends on BLOCK depends on !(M32R || M68K) || BROKEN depends on !SUN4 || BROKEN - depends on !(SPARC64 && !PCI) select SCSI ---help--- If you want to use a ATA hard disk, ATA tape drive, ATA CD-ROM or - 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
[VIDEO]: Fix section mismatch warning in promcon.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=353076fee81318d056c7a853b1bf6ad1f81d050d Commit: 353076fee81318d056c7a853b1bf6ad1f81d050d Parent: 65d8bac3df9516adb17ce9df94a955d3c2c85a51 Author: Sam Ravnborg <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 23:52:45 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Mon Jun 4 23:52:45 2007 -0700 [VIDEO]: Fix section mismatch warning in promcon. Fix the following warnings in promcon: WARNING: o-sparc64/drivers/video/console/built-in.o(.text+0x480): Section mismatch: reference to .init.data:promfont_unitable (between 'promcon_init_unimap' and 'promcon_init') WARNING: o-sparc64/drivers/video/console/built-in.o(.text+0x488): Section mismatch: reference to .init.data:promfont_unitable (between 'promcon_init_unimap' and 'promcon_init') WARNING: o-sparc64/drivers/video/console/built-in.o(.text+0x48c): Section mismatch: reference to .init.data:promfont_unicount (between 'promcon_init_unimap' and 'promcon_init') WARNING: o-sparc64/drivers/video/console/built-in.o(.text+0x490): Section mismatch: reference to .init.data:promfont_unicount (between 'promcon_init_unimap' and 'promcon_init') The warnings happens because the function: promcon_init_unimap() references promfont_unitable and promfont_unicount which are marked __initdata by the conmakehash command in the drivers/video/console/Makefile Fix the warning by removing the __initdata marker on the two variables. Signed-off-by: Sam Ravnborg <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- drivers/video/console/Makefile |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/video/console/Makefile b/drivers/video/console/Makefile index 9b26dda..ac46cc3 100644 --- a/drivers/video/console/Makefile +++ b/drivers/video/console/Makefile @@ -47,7 +47,7 @@ targets := promcon_tbl.c quiet_cmd_conmakehash = CNMKHSH $@ cmd_conmakehash = scripts/conmakehash $< | \ sed -e '/\#include <[^>]*>/p' -e 's/types/init/' \ - -e 's/dfont\(_uni.*\]\)/promfont\1 __initdata/' > $@ + -e 's/dfont\(_uni.*\]\)/promfont\1 /' > $@ $(obj)/promcon_tbl.c: $(src)/prom.uni $(call cmd,conmakehash) - 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
[VIDEO] ffb: The pseudo_palette is only 16 elements long
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d2fa9e05e3876198d8ab31624fe84512a0a44b45 Commit: d2fa9e05e3876198d8ab31624fe84512a0a44b45 Parent: 353076fee81318d056c7a853b1bf6ad1f81d050d Author: Antonino Daplas <[EMAIL PROTECTED]> AuthorDate: Tue Jun 5 13:14:33 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Tue Jun 5 13:14:33 2007 -0700 [VIDEO] ffb: The pseudo_palette is only 16 elements long The pseudo_palette is only 16 elements long. Signed-off-by: Antonino Daplas <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- drivers/video/ffb.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/ffb.c b/drivers/video/ffb.c index 1d4e835..3f6c98f 100644 --- a/drivers/video/ffb.c +++ b/drivers/video/ffb.c @@ -656,7 +656,7 @@ static int ffb_setcolreg(unsigned regno, { u32 value; - if (regno >= 256) + if (regno >= 16) return 1; red >>= 8; @@ -903,7 +903,7 @@ ffb_init_fix(struct fb_info *info) struct all_info { struct fb_info info; struct ffb_par par; - u32 pseudo_palette[256]; + u32 pseudo_palette[16]; }; static int ffb_init_one(struct of_device *op) - 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
[VIDEO] sunxvr2500fb: Fix pseudo_palette array size
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f2c138638687a7ffbf0d2a0e7addfec7bab9a765 Commit: f2c138638687a7ffbf0d2a0e7addfec7bab9a765 Parent: d2fa9e05e3876198d8ab31624fe84512a0a44b45 Author: Antonino Daplas <[EMAIL PROTECTED]> AuthorDate: Tue Jun 5 13:15:01 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Tue Jun 5 13:15:01 2007 -0700 [VIDEO] sunxvr2500fb: Fix pseudo_palette array size - the pseudo_palette is only 16 elements long. - the pseudo_palette has only 16 elements. Do not write if regno (the array index) is more than 15. Signed-off-by: Antonino Daplas <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- drivers/video/sunxvr2500.c | 17 - 1 files changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/video/sunxvr2500.c b/drivers/video/sunxvr2500.c index 4316c7f..c3869a9 100644 --- a/drivers/video/sunxvr2500.c +++ b/drivers/video/sunxvr2500.c @@ -28,7 +28,7 @@ struct s3d_info { unsigned intdepth; unsigned intfb_size; - u32 pseudo_palette[256]; + u32 pseudo_palette[16]; }; static int __devinit s3d_get_props(struct s3d_info *sp) @@ -52,15 +52,14 @@ static int s3d_setcolreg(unsigned regno, { u32 value; - if (regno >= 256) - return 1; + if (regno < 16) { + red >>= 8; + green >>= 8; + blue >>= 8; - red >>= 8; - green >>= 8; - blue >>= 8; - - value = (blue << 24) | (green << 16) | (red << 8); - ((u32 *)info->pseudo_palette)[regno] = value; + value = (blue << 24) | (green << 16) | (red << 8); + ((u32 *)info->pseudo_palette)[regno] = value; + } 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
[VIDEO] sunxvr500fb: Fix pseudo_palette array size
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e7e8cc5ae63c39d5f14c5120bdf2d931fac9 Commit: e7e8cc5ae63c39d5f14c5120bdf2d931fac9 Parent: f2c138638687a7ffbf0d2a0e7addfec7bab9a765 Author: Antonino Daplas <[EMAIL PROTECTED]> AuthorDate: Tue Jun 5 13:15:26 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Tue Jun 5 13:15:26 2007 -0700 [VIDEO] sunxvr500fb: Fix pseudo_palette array size - the pseudo_palette is only 16 elements long. - the pseudo_palette has only 16 elements. Do not write if regno (the array index) is more than 15. Signed-off-by: Antonino Daplas <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- drivers/video/sunxvr500.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/video/sunxvr500.c b/drivers/video/sunxvr500.c index 08880a6..71bf3f1 100644 --- a/drivers/video/sunxvr500.c +++ b/drivers/video/sunxvr500.c @@ -50,7 +50,7 @@ struct e3d_info { u32 fb8_0_off; u32 fb8_1_off; - u32 pseudo_palette[256]; + u32 pseudo_palette[16]; }; static int __devinit e3d_get_props(struct e3d_info *ep) @@ -126,7 +126,9 @@ static int e3d_setcolreg(unsigned regno, blue_8 = blue >> 8; value = (blue_8 << 24) | (green_8 << 16) | (red_8 << 8); - ((u32 *)info->pseudo_palette)[regno] = value; + + if (info->fix.visual == FB_VISUAL_TRUECOLOR && regno < 16) + ((u32 *)info->pseudo_palette)[regno] = value; red_10 = red >> 6; - 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
Xtensa: use asm-generic/fcntl.h
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=df5e38703d647b160d7ba300b3d2fcb64a48549a Commit: df5e38703d647b160d7ba300b3d2fcb64a48549a Parent: 29c4dfd92edc26c2cd2c0c64c9201d5b91d6418e Author: Stephen Rothwell <[EMAIL PROTECTED]> AuthorDate: Thu May 31 20:18:25 2007 -0700 Committer: Chris Zankel <[EMAIL PROTECTED]> CommitDate: Thu May 31 20:18:25 2007 -0700 Xtensa: use asm-generic/fcntl.h Commit fc4fb2adf944d45a7f3d4d38df991c79ffdb6a43 "fixed" the Xtensa asm/fcntl.h and in doing so ignored asm-generic/fcntl.h completely. It turns out that it is now exactly the same as asm-generic/fcntl.h. Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]> Signed-off-by: Chris Zankel <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> --- include/asm-xtensa/fcntl.h | 100 +--- 1 files changed, 1 insertions(+), 99 deletions(-) diff --git a/include/asm-xtensa/fcntl.h b/include/asm-xtensa/fcntl.h index 0609fc6..46ab12d 100644 --- a/include/asm-xtensa/fcntl.h +++ b/include/asm-xtensa/fcntl.h @@ -1,99 +1 @@ -/* - * include/asm-xtensa/fcntl.h - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1995, 1996, 1997, 1998 by Ralf Baechle - * Copyright (C) 2001 - 2005 Tensilica Inc. - */ - -#ifndef _XTENSA_FCNTL_H -#define _XTENSA_FCNTL_H - -/* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ -#define O_ACCMODE 0003 -#define O_RDONLY00 -#define O_WRONLY01 -#define O_RDWR 02 -#define O_CREAT 0100 /* not fcntl */ -#define O_EXCL0200 /* not fcntl */ -#define O_NOCTTY 0400 /* not fcntl */ -#define O_TRUNC 01000 /* not fcntl */ -#define O_APPEND 02000 -#define O_NONBLOCK 04000 -#define O_NDELAY O_NONBLOCK -#define O_SYNC 01 -#define FASYNC 02 /* fcntl, for BSD compatibility */ -#define O_DIRECT04 /* direct disk access hint */ -#define O_LARGEFILE010 -#define O_DIRECTORY020 /* must be a directory */ -#define O_NOFOLLOW 040 /* don't follow links */ -#define O_NOATIME 0100 - -#define F_DUPFD0 /* dup */ -#define F_GETFD1 /* get close_on_exec */ -#define F_SETFD2 /* set/clear close_on_exec */ -#define F_GETFL3 /* get file->f_flags */ -#define F_SETFL4 /* set file->f_flags */ -#define F_GETLK5 -#define F_SETLK6 -#define F_SETLKW 7 - -#define F_SETOWN 8 /* for sockets. */ -#define F_GETOWN 9 /* for sockets. */ -#define F_SETSIG 10 /* for sockets. */ -#define F_GETSIG 11 /* for sockets. */ - -#define F_GETLK64 12 /* using 'struct flock64' */ -#define F_SETLK64 13 -#define F_SETLKW64 14 - -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - -/* for posix fcntl() and lockf() */ -#define F_RDLCK0 -#define F_WRLCK1 -#define F_UNLCK2 - -/* for old implementation of bsd flock () */ -#define F_EXLCK4 /* or 3 */ -#define F_SHLCK8 /* or 4 */ - -/* for leases */ -#define F_INPROGRESS 16 - -/* operations for bsd flock(), also used by the kernel implementation */ -#define LOCK_SH1 /* shared lock */ -#define LOCK_EX2 /* exclusive lock */ -#define LOCK_NB4 /* or'd with one of the above to prevent - blocking */ -#define LOCK_UN8 /* remove lock */ - -#define LOCK_MAND 32 /* This is a mandatory flock */ -#define LOCK_READ 64 /* ... Which allows concurrent read operations */ -#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ -#define LOCK_RW192 /* ... Which allows concurrent read & write ops */ - -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - -struct flock64 { - short l_type; - short l_whence; - loff_t l_start; - loff_t l_len; - pid_t l_pid; -}; - -#define F_LINUX_SPECIFIC_BASE 1024 - -#endif /* _XTENSA_FCNTL_H */ +#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
RAMFS NOMMU: missed POSIX UID/GID inode attribute checking
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=85f6038f2170e3335dda09c3dfb0f83110e87019 Commit: 85f6038f2170e3335dda09c3dfb0f83110e87019 Parent: c8d8170feb824875baf68f8aaecb181a6500ce81 Author: Bryan Wu <[EMAIL PROTECTED]> AuthorDate: Tue Jun 5 11:02:01 2007 +0800 Committer: Linus Torvalds <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 17:11:13 2007 -0700 RAMFS NOMMU: missed POSIX UID/GID inode attribute checking This bug was caught by LTP testcase fchmod06 on Blackfin platform. In the manpage of fchmod, "EPERM: The effective UID does not match the owner of the file, and the process is not privileged (Linux: it does not have the CAP_FOWNER capability)." But the ramfs nommu code missed the inode_change_ok POSIX UID/GID verification. This patch fixed this. Signed-off-by: Bryan Wu <[EMAIL PROTECTED]> Cc: David Howells <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> --- fs/ramfs/file-nommu.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c index 9345a46..5d258c4 100644 --- a/fs/ramfs/file-nommu.c +++ b/fs/ramfs/file-nommu.c @@ -195,6 +195,11 @@ static int ramfs_nommu_setattr(struct dentry *dentry, struct iattr *ia) unsigned int old_ia_valid = ia->ia_valid; int ret = 0; + /* POSIX UID/GID verification for setting inode attributes */ + ret = inode_change_ok(inode, ia); + if (ret) + return ret; + /* by providing our own setattr() method, we skip this quotaism */ if ((old_ia_valid & ATTR_UID && ia->ia_uid != inode->i_uid) || (old_ia_valid & ATTR_GID && ia->ia_gid != inode->i_gid)) - 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
[XTENSA] Remove non-rt signal handling
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=29c4dfd92edc26c2cd2c0c64c9201d5b91d6418e Commit: 29c4dfd92edc26c2cd2c0c64c9201d5b91d6418e Parent: adba09f01577ea441a761a85aacb1e43b58d35c4 Author: Chris Zankel <[EMAIL PROTECTED]> AuthorDate: Thu May 31 17:49:32 2007 -0700 Committer: Chris Zankel <[EMAIL PROTECTED]> CommitDate: Thu May 31 17:49:32 2007 -0700 [XTENSA] Remove non-rt signal handling The non-rt signal handling was never really used, so we don't break anything. This patch also cleans up the signal stack-frame to make it independent from the processor configuration. It also improves the method used for controlling single-stepping. We now save and restore the 'icountlevel' register that controls single stepping and set or clear the saved state to enable or disable it. Signed-off-by: Chris Zankel <[EMAIL PROTECTED]> --- arch/xtensa/kernel/asm-offsets.c |1 + arch/xtensa/kernel/entry.S | 36 +- arch/xtensa/kernel/signal.c | 795 +++--- include/asm-xtensa/coprocessor.h |8 +- include/asm-xtensa/elf.h |3 +- include/asm-xtensa/ptrace.h |3 +- include/asm-xtensa/sigcontext.h | 24 +- include/asm-xtensa/unistd.h |4 +- 8 files changed, 350 insertions(+), 524 deletions(-) diff --git a/arch/xtensa/kernel/asm-offsets.c b/arch/xtensa/kernel/asm-offsets.c index 698079b..d0323cd 100644 --- a/arch/xtensa/kernel/asm-offsets.c +++ b/arch/xtensa/kernel/asm-offsets.c @@ -39,6 +39,7 @@ int main(void) DEFINE(PT_LEND, offsetof (struct pt_regs, lend)); DEFINE(PT_LCOUNT, offsetof (struct pt_regs, lcount)); DEFINE(PT_SAR, offsetof (struct pt_regs, sar)); + DEFINE(PT_ICOUNTLEVEL, offsetof (struct pt_regs, icountlevel)); DEFINE(PT_SYSCALL, offsetof (struct pt_regs, syscall)); DEFINE(PT_AREG, offsetof (struct pt_regs, areg[0])); DEFINE(PT_AREG0, offsetof (struct pt_regs, areg[0])); diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S index 9e271ba..8dc7a2c 100644 --- a/arch/xtensa/kernel/entry.S +++ b/arch/xtensa/kernel/entry.S @@ -125,8 +125,9 @@ _user_exception: movia2, 0 rsr a3, SAR - wsr a2, ICOUNTLEVEL + xsr a2, ICOUNTLEVEL s32ia3, a1, PT_SAR + s32ia2, a1, PT_ICOUNTLEVEL /* Rotate ws so that the current windowbase is at bit0. */ /* Assume ws = xxwww1. Rotate ws right, so that a2 = xxwww1 */ @@ -276,8 +277,9 @@ _kernel_exception: movia2, 0 rsr a3, SAR - wsr a2, ICOUNTLEVEL + xsr a2, ICOUNTLEVEL s32ia3, a1, PT_SAR + s32ia2, a1, PT_ICOUNTLEVEL /* Rotate ws so that the current windowbase is at bit0. */ /* Assume ws = xxwww1. Rotate ws right, so that a2 = xxwww1 */ @@ -330,14 +332,16 @@ _kernel_exception: common_exception: - /* Save EXCVADDR, DEBUGCAUSE, and PC, and clear LCOUNT */ + /* Save some registers, disable loops and clear the syscall flag. */ rsr a2, DEBUGCAUSE rsr a3, EPC_1 s32ia2, a1, PT_DEBUGCAUSE s32ia3, a1, PT_PC + movia2, -1 rsr a3, EXCVADDR + s32ia2, a1, PT_SYSCALL movia2, 0 s32ia3, a1, PT_EXCVADDR xsr a2, LCOUNT @@ -450,27 +454,8 @@ common_exception_return: /* Restore the state of the task and return from the exception. */ - - /* If we are returning from a user exception, and the process -* to run next has PT_SINGLESTEP set, we want to setup -* ICOUNT and ICOUNTLEVEL to step one instruction. -* PT_SINGLESTEP is set by sys_ptrace (ptrace.c) -*/ - 4: /* a2 holds GET_CURRENT(a2,a1) */ - l32ia3, a2, TI_TASK - l32ia3, a3, TASK_PTRACE - bbci.l a3, PT_SINGLESTEP_BIT, 1f # jump if single-step flag is not set - - movia3, -2 # PT_SINGLESTEP flag is set, - movia4, 1 # icountlevel of 1 means it won't - wsr a3, ICOUNT # start counting until after rfe - wsr a4, ICOUNTLEVEL # so setup icount & icountlevel. - isync - -1: - #if XCHAL_EXTRA_SA_SIZE /* For user exceptions, restore the extra state from the user's TCB. */ @@ -665,6 +650,13 @@ common_exception_exit: wsr a3, LEND wsr a2, LCOUNT + /* We control single stepping through the ICOUNTLEVEL register. */ + + l32ia2, a1, PT_ICOUNTLEVEL + movia3, -2 + wsr a2, ICOUNTLEVEL + wsr a3, ICOUNT + /* Check if it was double exception. */ l32ia0, a1, PT_DEPC diff --git a/arch/xtensa/kernel/signal.c b/arch/xtensa/kernel/signal.c index 5810767..033aae0 100644 --- a/arch/xtensa/kernel/signal.c +++ b/arch/xtensa/kernel/signal.c
[XTENSA] Move common sections into bss sections
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=adba09f01577ea441a761a85aacb1e43b58d35c4 Commit: adba09f01577ea441a761a85aacb1e43b58d35c4 Parent: de4f6e5b41bef50fc981410ae8380f27f4e93bf8 Author: Chris Zankel <[EMAIL PROTECTED]> AuthorDate: Thu May 31 17:48:07 2007 -0700 Committer: Chris Zankel <[EMAIL PROTECTED]> CommitDate: Thu May 31 17:48:07 2007 -0700 [XTENSA] Move common sections into bss sections Move the fields of the COMMON sections 'swapper_pg_dir' and 'empty_zero_page' to the BSS section. Remove the unused COMMON sections 'emtpy_bad_page_table' and 'empty_bad_page'. Signed-off-by: Chris Zankel <[EMAIL PROTECTED]> --- arch/xtensa/kernel/head.S | 19 +++ 1 files changed, 11 insertions(+), 8 deletions(-) diff --git a/arch/xtensa/kernel/head.S b/arch/xtensa/kernel/head.S index ea89910..67e6913 100644 --- a/arch/xtensa/kernel/head.S +++ b/arch/xtensa/kernel/head.S @@ -19,6 +19,8 @@ #include #include +#include + /* * This module contains the entry code for kernel images. It performs the * minimal setup needed to call the generic C routines. @@ -227,13 +229,14 @@ _startup: should_never_return: j should_never_return - /* Define some common data structures here. We define them -* here in this assembly file due to their unusual alignment -* requirements. -*/ - .comm swapper_pg_dir,PAGE_SIZE,PAGE_SIZE - .comm empty_bad_page_table,PAGE_SIZE,PAGE_SIZE - .comm empty_bad_page,PAGE_SIZE,PAGE_SIZE - .comm empty_zero_page,PAGE_SIZE,PAGE_SIZE +/* + * BSS section + */ + +.section ".bss.page_aligned", "w" +ENTRY(swapper_pg_dir) + .fill PAGE_SIZE, 1, 0 +ENTRY(empty_zero_page) + .fill PAGE_SIZE, 1, 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
[XTENSA] clean-up header files
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=de4f6e5b41bef50fc981410ae8380f27f4e93bf8 Commit: de4f6e5b41bef50fc981410ae8380f27f4e93bf8 Parent: 176fd6c96dcbc263eb1c61eae9fe2a33f23a876d Author: Chris Zankel <[EMAIL PROTECTED]> AuthorDate: Thu May 31 17:47:01 2007 -0700 Committer: Chris Zankel <[EMAIL PROTECTED]> CommitDate: Thu May 31 17:47:01 2007 -0700 [XTENSA] clean-up header files The header files in the asm-xtensa directory are not clean and 'make headers_check' fails. This is a first patch to fix most of the header files. It removes unnecessary include statements and adds some that are required for building the kernel. The linker script required some updates or the linking stage would fail. Signed-off-by: Chris Zankel <[EMAIL PROTECTED]> --- arch/xtensa/kernel/setup.c |1 + arch/xtensa/kernel/vmlinux.lds.S | 78 +++--- include/asm-xtensa/bitops.h | 15 --- include/asm-xtensa/byteorder.h |3 +- include/asm-xtensa/mmu_context.h |1 + include/asm-xtensa/page.h|2 +- include/asm-xtensa/param.h |4 +- include/asm-xtensa/ptrace.h |5 +- include/asm-xtensa/shmparam.h|2 - include/asm-xtensa/thread_info.h |2 + 10 files changed, 50 insertions(+), 63 deletions(-) diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c index 1ecf671..2e8d398 100644 --- a/arch/xtensa/kernel/setup.c +++ b/arch/xtensa/kernel/setup.c @@ -41,6 +41,7 @@ #include #include #include +#include #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE) struct screen_info screen_info = { 0, 24, 0, 0, 0, 80, 0, 0, 0, 24, 1, 16}; diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S index 4b7b4ff..b0582c3 100644 --- a/arch/xtensa/kernel/vmlinux.lds.S +++ b/arch/xtensa/kernel/vmlinux.lds.S @@ -84,9 +84,7 @@ SECTIONS { /* The .head.text section must be the first section! */ *(.head.text) -*(.literal) -TEXT_TEXT -*(.srom.text) +*(.literal .text) VMLINUX_SYMBOL(__sched_text_start) = .; *(.sched.literal .sched.text) VMLINUX_SYMBOL(__sched_text_end) = .; @@ -96,6 +94,7 @@ SECTIONS } _etext = .; + PROVIDE (etext = .); . = ALIGN(16); @@ -103,32 +102,6 @@ SECTIONS /* Relocation table */ - . = ALIGN(16); - __boot_reloc_table_start = ABSOLUTE(.); - - __relocate : { - -RELOCATE_ENTRY(_WindowVectors_text, - .WindowVectors.text); -#if 0 -RELOCATE_ENTRY(_KernelExceptionVector_literal, - .KernelExceptionVector.literal); -#endif -RELOCATE_ENTRY(_KernelExceptionVector_text, - .KernelExceptionVector.text); -#if 0 -RELOCATE_ENTRY(_UserExceptionVector_literal, - .UserExceptionVector.literal); -#endif -RELOCATE_ENTRY(_UserExceptionVector_text, - .UserExceptionVector.text); -RELOCATE_ENTRY(_DoubleExceptionVector_literal, - .DoubleExceptionVector.literal); -RELOCATE_ENTRY(_DoubleExceptionVector_text, - .DoubleExceptionVector.text); - } - __boot_reloc_table_end = ABSOLUTE(.) ; - .fixup : { *(.fixup) } . = ALIGN(16); @@ -145,8 +118,7 @@ SECTIONS _fdata = .; .data : { -DATA_DATA -CONSTRUCTORS +*(.data) CONSTRUCTORS . = ALIGN(XCHAL_ICACHE_LINESIZE); *(.data.cacheline_aligned) } @@ -174,6 +146,22 @@ SECTIONS __tagtable_begin = .; *(.taglist) __tagtable_end = .; + +. = ALIGN(16); +__boot_reloc_table_start = ABSOLUTE(.); + +RELOCATE_ENTRY(_WindowVectors_text, + .WindowVectors.text); +RELOCATE_ENTRY(_KernelExceptionVector_text, + .KernelExceptionVector.text); +RELOCATE_ENTRY(_UserExceptionVector_text, + .UserExceptionVector.text); +RELOCATE_ENTRY(_DoubleExceptionVector_literal, + .DoubleExceptionVector.literal); +RELOCATE_ENTRY(_DoubleExceptionVector_text, + .DoubleExceptionVector.text); + +__boot_reloc_table_end = ABSOLUTE(.) ; } . = ALIGN(XCHAL_ICACHE_LINESIZE); @@ -194,16 +182,6 @@ SECTIONS SECURITY_INIT - . = ALIGN(4); - - __start___ftr_fixup = .; - __ftr_fixup : { *(__ftr_fixup) } - __stop___ftr_fixup = .; - - . = ALIGN(4096); - __per_cpu_start = .; - .data.percpu : { *(.data.percpu) } - __per_cpu_end = .; #ifdef CONFIG_BLK_DEV_INITRD . = ALIGN(4096); @@ -212,6 +190,12 @@ SECTIONS __initramfs_end = .; #endif + . = ALIGN(4096); + __per_cpu_start = .; + .data.percpu : { *(.data.percpu) } + __per_cpu_end = .; + + /* We need this dummy segment here */ . = ALIGN(4); @@ -273,9 +257,9 @@ SECTIONS /* BSS section */ _bss_start = .; - .sbss : { *(.sbss) *(.scommon) } - .bss : { *(COMMON) *(.bss) } + .bss : { *(.bss.page_aligned) *(.bss) } _bss_end = .; + _end =
[XTENSA] Use generic 64-bit division
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=176fd6c96dcbc263eb1c61eae9fe2a33f23a876d Commit: 176fd6c96dcbc263eb1c61eae9fe2a33f23a876d Parent: 54213baf643dd14d3bc06ca7575a817d79a350c2 Author: Chris Zankel <[EMAIL PROTECTED]> AuthorDate: Thu May 31 17:46:09 2007 -0700 Committer: Chris Zankel <[EMAIL PROTECTED]> CommitDate: Thu May 31 17:46:09 2007 -0700 [XTENSA] Use generic 64-bit division Use generic 64-bit division algorithm from the asm-generic directory.\ Signed-off-by: Chris Zankel <[EMAIL PROTECTED]> --- include/asm-xtensa/div64.h | 15 +++ 1 files changed, 3 insertions(+), 12 deletions(-) diff --git a/include/asm-xtensa/div64.h b/include/asm-xtensa/div64.h index 20965e3..f35678c 100644 --- a/include/asm-xtensa/div64.h +++ b/include/asm-xtensa/div64.h @@ -5,21 +5,12 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2001 - 2005 Tensilica Inc. + * Copyright (C) 2001 - 2007 Tensilica Inc. */ #ifndef _XTENSA_DIV64_H #define _XTENSA_DIV64_H -#include +#include -#define do_div(n,base) ({ \ - int __res = n % ((unsigned int) base); \ - n /= (unsigned int) base; \ - __res; }) - -static inline uint64_t div64_64(uint64_t dividend, uint64_t divisor) -{ - return dividend / divisor; -} -#endif +#endif /* _XTENSA_DIV64_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
[XTENSA] Spelling fixes in arch/xtensa
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4af410a868fc6aa9b19379599feac7e79d95 Commit: 4af410a868fc6aa9b19379599feac7e79d95 Parent: ef6051a90e2ad1af636e99d1d4603fdcf2adfcbe Author: Chris Zankel <[EMAIL PROTECTED]> AuthorDate: Thu May 31 17:43:40 2007 -0700 Committer: Chris Zankel <[EMAIL PROTECTED]> CommitDate: Thu May 31 17:43:40 2007 -0700 [XTENSA] Spelling fixes in arch/xtensa Spelling fixes in arch/xtensa/. Signed-off-by: Simon Arlott <[EMAIL PROTECTED]> Signed-off-by: Chris Zankel <[EMAIL PROTECTED]> --- arch/xtensa/kernel/pci.c |2 +- arch/xtensa/mm/init.c |2 +- arch/xtensa/platform-iss/network.c |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/xtensa/kernel/pci.c b/arch/xtensa/kernel/pci.c index 45571cc..77deae5 100644 --- a/arch/xtensa/kernel/pci.c +++ b/arch/xtensa/kernel/pci.c @@ -401,7 +401,7 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, * Also, think for a moment about likes of floppy.c that * include architecture specific parts. They may want to redefine ins/outs. * - * We do not use horroble macroses here because we want to + * We do not use horrible macros here because we want to * advance pointer by sizeof(size). */ void outsb(unsigned long addr, const void *src, unsigned long count) { diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c index e1ec2d1..8415c76 100644 --- a/arch/xtensa/mm/init.c +++ b/arch/xtensa/mm/init.c @@ -205,7 +205,7 @@ void __init init_mmu (void) /* Writing zeros to the TLBCFG special registers ensure * that valid values exist in the register. For existing * PGSZID fields, zero selects the first element of the -* page-size array. For nonexistant PGSZID fields, zero is +* page-size array. For nonexistent PGSZID fields, zero is * the best value to write. Also, when changing PGSZID * fields, the corresponding TLB must be flushed. */ diff --git a/arch/xtensa/platform-iss/network.c b/arch/xtensa/platform-iss/network.c index 4bfe333..f09962f 100644 --- a/arch/xtensa/platform-iss/network.c +++ b/arch/xtensa/platform-iss/network.c @@ -473,7 +473,7 @@ static int iss_net_open(struct net_device *dev) netif_start_queue(dev); /* clear buffer - it can happen that the host side of the interface -* is full when we gethere. In this case, new data is never queued, +* is full when we get here. In this case, new data is never queued, * SIGIOs never arrive, and the net never works. */ while ((err = iss_net_rx(dev)) > 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
[XTENSA] fix bit operations in bitops.h
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ef6051a90e2ad1af636e99d1d4603fdcf2adfcbe Commit: ef6051a90e2ad1af636e99d1d4603fdcf2adfcbe Parent: 3f0a6766e0cc5a577805732e5adb50a585c58175 Author: Chris Zankel <[EMAIL PROTECTED]> AuthorDate: Thu May 31 17:41:14 2007 -0700 Committer: Chris Zankel <[EMAIL PROTECTED]> CommitDate: Thu May 31 17:41:14 2007 -0700 [XTENSA] fix bit operations in bitops.h A macro used internally in the bitops.h file to identify the number of leading zeros (__cntlz) was implemented incorrectly for Xtensa processors that don't provide the 'nsa/nsau' instructions. As a result, the dependent functions and macros (ffs, ffz, fls) were broken. Signed-off-by: Chris Zankel <[EMAIL PROTECTED]> --- include/asm-xtensa/bitops.h | 60 ++ 1 files changed, 26 insertions(+), 34 deletions(-) diff --git a/include/asm-xtensa/bitops.h b/include/asm-xtensa/bitops.h index d815649..96303df 100644 --- a/include/asm-xtensa/bitops.h +++ b/include/asm-xtensa/bitops.h @@ -7,7 +7,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2001 - 2005 Tensilica Inc. + * Copyright (C) 2001 - 2007 Tensilica Inc. */ #ifndef _XTENSA_BITOPS_H @@ -31,64 +31,44 @@ #if XCHAL_HAVE_NSA -static __inline__ int __cntlz (unsigned long x) +static inline unsigned long __cntlz (unsigned long x) { int lz; asm ("nsau %0, %1" : "=r" (lz) : "r" (x)); - return 31 - lz; + return lz; } -#else - -static __inline__ int __cntlz (unsigned long x) -{ - unsigned long sum, x1, x2, x4, x8, x16; - x1 = x & 0x; - x2 = x & 0x; - x4 = x & 0xF0F0F0F0; - x8 = x & 0xFF00FF00; - x16 = x & 0x; - sum = x2 ? 2 : 0; - sum += (x16 != 0) * 16; - sum += (x8 != 0) * 8; - sum += (x4 != 0) * 4; - sum += (x1 != 0); - - return sum; -} - -#endif - /* * ffz: Find first zero in word. Undefined if no zero exists. * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1). */ -static __inline__ int ffz(unsigned long x) +static inline int ffz(unsigned long x) { - if ((x = ~x) == 0) - return 32; - return __cntlz(x & -x); + return 31 - __cntlz(~x & -~x); } /* * __ffs: Find first bit set in word. Return 0 for bit 0 */ -static __inline__ int __ffs(unsigned long x) +static inline int __ffs(unsigned long x) { - return __cntlz(x & -x); + return 31 - __cntlz(x & -x); } + +#ifdef __KERNEL__ + /* * ffs: Find first bit set in word. This is defined the same way as * the libc and compiler builtin ffs routines, therefore * differs in spirit from the above ffz (man ffs). */ -static __inline__ int ffs(unsigned long x) +static inline int ffs(unsigned long x) { - return __cntlz(x & -x) + 1; + return 32 - __cntlz(x & -x); } /* @@ -96,10 +76,22 @@ static __inline__ int ffs(unsigned long x) * Note fls(0) = 0, fls(1) = 1, fls(0x8000) = 32. */ -static __inline__ int fls (unsigned int x) +static inline int fls (unsigned int x) { - return __cntlz(x); + return 32 - __cntlz(x); } + +#else + +/* Use the generic implementation if we don't have the nsa/nsau instructions. */ + +# include +# include +# include +# include + +#endif + #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
xfrm: Add security check before flushing SAD/SPD
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4aa2e62c45b5ca08be2d0d3c0744d7585b56e860 Commit: 4aa2e62c45b5ca08be2d0d3c0744d7585b56e860 Parent: b00b4bf94edb42852d55619af453588b2de2dc5e Author: Joy Latten <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 19:05:57 2007 -0400 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 13:42:46 2007 -0700 xfrm: Add security check before flushing SAD/SPD Currently we check for permission before deleting entries from SAD and SPD, (see security_xfrm_policy_delete() security_xfrm_state_delete()) However we are not checking for authorization when flushing the SPD and the SAD completely. It was perhaps missed in the original security hooks patch. This patch adds a security check when flushing entries from the SAD and SPD. It runs the entire database and checks each entry for a denial. If the process attempting the flush is unable to remove all of the entries a denial is logged the the flush function returns an error without removing anything. This is particularly useful when a process may need to create or delete its own xfrm entries used for things like labeled networking but that same process should not be able to delete other entries or flush the entire database. Signed-off-by: Joy Latten<[EMAIL PROTECTED]> Signed-off-by: Eric Paris <[EMAIL PROTECTED]> Signed-off-by: James Morris <[EMAIL PROTECTED]> --- include/net/xfrm.h |6 ++-- net/key/af_key.c | 10 ++- net/xfrm/xfrm_policy.c | 63 +-- net/xfrm/xfrm_state.c | 46 -- net/xfrm/xfrm_user.c |9 +- 5 files changed, 121 insertions(+), 13 deletions(-) diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 90185e8..311f25a 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -964,7 +964,7 @@ struct xfrmk_spdinfo { extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq); extern int xfrm_state_delete(struct xfrm_state *x); -extern void xfrm_state_flush(u8 proto, struct xfrm_audit *audit_info); +extern int xfrm_state_flush(u8 proto, struct xfrm_audit *audit_info); extern void xfrm_sad_getinfo(struct xfrmk_sadinfo *si); extern void xfrm_spd_getinfo(struct xfrmk_spdinfo *si); extern int xfrm_replay_check(struct xfrm_state *x, __be32 seq); @@ -1020,13 +1020,13 @@ struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir, struct xfrm_sec_ctx *ctx, int delete, int *err); struct xfrm_policy *xfrm_policy_byid(u8, int dir, u32 id, int delete, int *err); -void xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); +int xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); u32 xfrm_get_acqseq(void); void xfrm_alloc_spi(struct xfrm_state *x, __be32 minspi, __be32 maxspi); struct xfrm_state * xfrm_find_acq(u8 mode, u32 reqid, u8 proto, xfrm_address_t *daddr, xfrm_address_t *saddr, int create, unsigned short family); -extern void xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); +extern int xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); extern int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *xdst, struct flowi *fl, int family, int strict); diff --git a/net/key/af_key.c b/net/key/af_key.c index d302dda..0f8304b 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c @@ -1682,6 +1682,7 @@ static int pfkey_flush(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hd unsigned proto; struct km_event c; struct xfrm_audit audit_info; + int err; proto = pfkey_satype2proto(hdr->sadb_msg_satype); if (proto == 0) @@ -1689,7 +1690,9 @@ static int pfkey_flush(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hd audit_info.loginuid = audit_get_loginuid(current->audit_context); audit_info.secid = 0; - xfrm_state_flush(proto, &audit_info); + err = xfrm_state_flush(proto, &audit_info); + if (err) + return err; c.data.proto = proto; c.seq = hdr->sadb_msg_seq; c.pid = hdr->sadb_msg_pid; @@ -2683,10 +2686,13 @@ static int pfkey_spdflush(struct sock *sk, struct sk_buff *skb, struct sadb_msg { struct km_event c; struct xfrm_audit audit_info; + int err; audit_info.loginuid = audit_get_loginuid(current->audit_context); audit_info.secid = 0; - xfrm_policy_flush(XFRM_POLICY_TYPE_MAIN, &audit_info); + err = xfrm_policy_flush(XFRM_POLICY_TYPE_MAIN, &audit_info); + if (err) + return err; c.data.type = XFRM_POLICY_TYPE_MAIN; c.event = XFRM_MSG_FLUSHPOLICY;
[NET]: Avoid duplicate netlink notification when changing link state
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7c355f532dd43036622e1880c114773463bafd23 Commit: 7c355f532dd43036622e1880c114773463bafd23 Parent: df2bc459a3ad71f8b44c358bf7169acf9caf4acd Author: Thomas Graf <[EMAIL PROTECTED]> AuthorDate: Tue Jun 5 16:03:03 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 13:40:56 2007 -0700 [NET]: Avoid duplicate netlink notification when changing link state When changing the link state from userspace not affecting any other flags. Two duplicate notification are being sent, once as action in the NETDEV_UP/NETDEV_DOWN notification chain and a second time when comparing old and new device flags after the change has been completed. Although harmless, the duplicates should be avoided. Signed-off-by: Thomas Graf <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- net/core/dev.c |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index 5a7f20f..2609062 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2577,7 +2577,7 @@ unsigned dev_get_flags(const struct net_device *dev) int dev_change_flags(struct net_device *dev, unsigned flags) { - int ret; + int ret, changes; int old_flags = dev->flags; /* @@ -2632,8 +2632,10 @@ int dev_change_flags(struct net_device *dev, unsigned flags) dev_set_allmulti(dev, inc); } - if (old_flags ^ dev->flags) - rtmsg_ifinfo(RTM_NEWLINK, dev, old_flags ^ dev->flags); + /* Exclude state transition flags, already notified */ + changes = (old_flags ^ dev->flags) & ~(IFF_UP | IFF_RUNNING); + if (changes) + rtmsg_ifinfo(RTM_NEWLINK, dev, changes); return ret; } - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[UDP]: Revert 2-pass hashing changes.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=df2bc459a3ad71f8b44c358bf7169acf9caf4acd Commit: df2bc459a3ad71f8b44c358bf7169acf9caf4acd Parent: 3c0d2f3780fc94746c4842e965bd2570e2119bb6 Author: David S. Miller <[EMAIL PROTECTED]> AuthorDate: Tue Jun 5 15:18:43 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 13:40:50 2007 -0700 [UDP]: Revert 2-pass hashing changes. This reverts changesets: 6aaf47fa48d3c44280810b1b470261d340e4ed87 b7b5f487ab39bc10ed0694af35651a03d9cb97ff de34ed91c4ffa4727964a832c46e624dd1495cf5 fc038410b4b1643766f8033f4940bcdb1dace633 There are still some correctness issues recently discovered which do not have a known fix that doesn't involve doing a full hash table scan on port bind. So revert for now. Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- include/net/udp.h |9 +-- include/net/udplite.h |2 +- net/ipv4/udp.c| 241 ++--- net/ipv4/udp_impl.h |6 +- net/ipv4/udplite.c|7 +- net/ipv6/udp.c| 21 + net/ipv6/udp_impl.h |2 - net/ipv6/udplite.c|2 +- 8 files changed, 78 insertions(+), 212 deletions(-) diff --git a/include/net/udp.h b/include/net/udp.h index 496f89d..98755eb 100644 --- a/include/net/udp.h +++ b/include/net/udp.h @@ -119,16 +119,9 @@ static inline void udp_lib_close(struct sock *sk, long timeout) } -struct udp_get_port_ops { - int (*saddr_cmp)(const struct sock *sk1, const struct sock *sk2); - int (*saddr_any)(const struct sock *sk); - unsigned int (*hash_port_and_rcv_saddr)(__u16 port, - const struct sock *sk); -}; - /* net/ipv4/udp.c */ extern int udp_get_port(struct sock *sk, unsigned short snum, -const struct udp_get_port_ops *ops); +int (*saddr_cmp)(const struct sock *, const struct sock *)); extern voidudp_err(struct sk_buff *, u32); extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk, diff --git a/include/net/udplite.h b/include/net/udplite.h index 50b4b42..635b0ea 100644 --- a/include/net/udplite.h +++ b/include/net/udplite.h @@ -120,5 +120,5 @@ static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb) extern voidudplite4_register(void); extern int udplite_get_port(struct sock *sk, unsigned short snum, -const struct udp_get_port_ops *ops); + int (*scmp)(const struct sock *, const struct sock *)); #endif /* _UDPLITE_H */ diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 5da703e..facb7e2 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -114,36 +114,14 @@ DEFINE_RWLOCK(udp_hash_lock); static int udp_port_rover; -/* - * Note about this hash function : - * Typical use is probably daddr = 0, only dport is going to vary hash - */ -static inline unsigned int udp_hash_port(__u16 port) -{ - return port; -} - -static inline int __udp_lib_port_inuse(unsigned int hash, int port, - const struct sock *this_sk, - struct hlist_head udptable[], - const struct udp_get_port_ops *ops) +static inline int __udp_lib_lport_inuse(__u16 num, struct hlist_head udptable[]) { struct sock *sk; struct hlist_node *node; - struct inet_sock *inet; - sk_for_each(sk, node, &udptable[hash & (UDP_HTABLE_SIZE - 1)]) { - if (sk->sk_hash != hash) - continue; - inet = inet_sk(sk); - if (inet->num != port) - continue; - if (this_sk) { - if (ops->saddr_cmp(sk, this_sk)) - return 1; - } else if (ops->saddr_any(sk)) + sk_for_each(sk, node, &udptable[num & (UDP_HTABLE_SIZE - 1)]) + if (sk->sk_hash == num) return 1; - } return 0; } @@ -154,16 +132,16 @@ static inline int __udp_lib_port_inuse(unsigned int hash, int port, * @snum:port number to look up * @udptable:hash list table, must be of UDP_HTABLE_SIZE * @port_rover: pointer to record of last unallocated port - * @ops: AF-dependent address operations + * @saddr_comp: AF-dependent comparison of bound local IP addresses */ int __udp_lib_get_port(struct sock *sk, unsigned short snum, struct hlist_head udptable[], int *port_rover, - const struct udp_get_port_ops *ops) + int (*saddr_comp)(const struct sock *sk1, +const struct sock *sk2 )) { struct hlist_node *node; struct hlist_head *head; struct sock *sk2; -
[AF_UNIX]: Fix stream recvmsg() race.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3c0d2f3780fc94746c4842e965bd2570e2119bb6 Commit: 3c0d2f3780fc94746c4842e965bd2570e2119bb6 Parent: c764c9ade6d9b710bad2b9c631ede9864333b98c Author: Miklos Szeredi <[EMAIL PROTECTED]> AuthorDate: Tue Jun 5 13:10:29 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 13:40:44 2007 -0700 [AF_UNIX]: Fix stream recvmsg() race. A recv() on an AF_UNIX, SOCK_STREAM socket can race with a send()+close() on the peer, causing recv() to return zero, even though the sent data should be received. This happens if the send() and the close() is performed between skb_dequeue() and checking sk->sk_shutdown in unix_stream_recvmsg(): process A skb_dequeue() returns NULL, there's no data in the socket queue process B new data is inserted onto the queue by unix_stream_sendmsg() process B sk->sk_shutdown is set to SHUTDOWN_MASK by unix_release_sock() process A sk->sk_shutdown is checked, unix_release_sock() returns zero I'm surprised nobody noticed this, it's not hard to trigger. Maybe it's just (un)luck with the timing. It's possible to work around this bug in userspace, by retrying the recv() once in case of a zero return value. Signed-off-by: Miklos Szeredi <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- net/unix/af_unix.c | 13 ++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 87c794d..d70fa30 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -1744,20 +1744,23 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, int chunk; struct sk_buff *skb; + unix_state_lock(sk); skb = skb_dequeue(&sk->sk_receive_queue); if (skb==NULL) { if (copied >= target) - break; + goto unlock; /* * POSIX 1003.1g mandates this order. */ if ((err = sock_error(sk)) != 0) - break; + goto unlock; if (sk->sk_shutdown & RCV_SHUTDOWN) - break; + goto unlock; + + unix_state_unlock(sk); err = -EAGAIN; if (!timeo) break; @@ -1771,7 +1774,11 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, } mutex_lock(&u->readlock); continue; + unlock: + unix_state_unlock(sk); + break; } + unix_state_unlock(sk); if (check_creds) { /* Never glue messages from different writers */ - 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
[NETFILTER]: nf_conntrack_amanda: fix textsearch_prepare() error check
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c764c9ade6d9b710bad2b9c631ede9864333b98c Commit: c764c9ade6d9b710bad2b9c631ede9864333b98c Parent: 4c1b52bc7a2f5ee01ea3fc248a8748a1c6843f7c Author: Akinobu Mita <[EMAIL PROTECTED]> AuthorDate: Tue Jun 5 12:56:53 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 13:40:38 2007 -0700 [NETFILTER]: nf_conntrack_amanda: fix textsearch_prepare() error check The return value from textsearch_prepare() needs to be checked by IS_ERR(). Because it returns error code as a pointer. Cc: "Brian J. Murrell" <[EMAIL PROTECTED]> Signed-off-by: Akinobu Mita <[EMAIL PROTECTED]> Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- net/netfilter/nf_conntrack_amanda.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/net/netfilter/nf_conntrack_amanda.c b/net/netfilter/nf_conntrack_amanda.c index b8869ea..0568f2e 100644 --- a/net/netfilter/nf_conntrack_amanda.c +++ b/net/netfilter/nf_conntrack_amanda.c @@ -208,13 +208,14 @@ static int __init nf_conntrack_amanda_init(void) { int ret, i; - ret = -ENOMEM; for (i = 0; i < ARRAY_SIZE(search); i++) { search[i].ts = textsearch_prepare(ts_algo, search[i].string, search[i].len, GFP_KERNEL, TS_AUTOLOAD); - if (search[i].ts == NULL) + if (IS_ERR(search[i].ts)) { + ret = PTR_ERR(search[i].ts); goto err1; + } } ret = nf_conntrack_helper_register(&amanda_helper[0]); if (ret < 0) @@ -227,10 +228,9 @@ static int __init nf_conntrack_amanda_init(void) err2: nf_conntrack_helper_unregister(&amanda_helper[0]); err1: - for (; i >= 0; i--) { - if (search[i].ts) - textsearch_destroy(search[i].ts); - } + while (--i >= 0) + textsearch_destroy(search[i].ts); + return ret; } - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[NETFILTER]: ip_tables: fix compat related crash
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4c1b52bc7a2f5ee01ea3fc248a8748a1c6843f7c Commit: 4c1b52bc7a2f5ee01ea3fc248a8748a1c6843f7c Parent: 3c158f7f57601bc27eab82f0dc4fd3fad314d845 Author: Dmitry Mishin <[EMAIL PROTECTED]> AuthorDate: Tue Jun 5 12:56:09 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 13:40:32 2007 -0700 [NETFILTER]: ip_tables: fix compat related crash check_compat_entry_size_and_hooks iterates over the matches and calls compat_check_calc_match, which loads the match and calculates the compat offsets, but unlike the non-compat version, doesn't call ->checkentry yet. On error however it calls cleanup_matches, which in turn calls ->destroy, which can result in crashes if the destroy function (validly) expects to only get called after the checkentry function. Add a compat_release_match function that only drops the module reference on error and rename compat_check_calc_match to compat_find_calc_match to reflect the fact that it doesn't call the checkentry function. Reported by Jan Engelhardt <[EMAIL PROTECTED]> Signed-off-by: Dmitry Mishin <[EMAIL PROTECTED]> Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- include/linux/netfilter_ipv4/ip_tables.h | 20 +++ net/ipv4/netfilter/ip_tables.c | 81 +++--- 2 files changed, 83 insertions(+), 18 deletions(-) diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index 2f46dd7..e992cd6 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h @@ -264,6 +264,26 @@ ipt_get_target(struct ipt_entry *e) __ret; \ }) +/* fn returns 0 to continue iteration */ +#define IPT_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \ +({ \ + unsigned int __i, __n; \ + int __ret = 0; \ + struct ipt_entry *__entry; \ + \ + for (__i = 0, __n = 0; __i < (size);\ +__i += __entry->next_offset, __n++) { \ + __entry = (void *)(entries) + __i; \ + if (__n < n)\ + continue; \ + \ + __ret = fn(__entry , ## args); \ + if (__ret != 0) \ + break; \ + } \ + __ret; \ +}) + /* * Main firewall chains definitions and global var's definitions. */ diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index e3f83bf..9bacf1a 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c @@ -499,7 +499,8 @@ check_entry(struct ipt_entry *e, const char *name) } static inline int check_match(struct ipt_entry_match *m, const char *name, - const struct ipt_ip *ip, unsigned int hookmask) + const struct ipt_ip *ip, unsigned int hookmask, + unsigned int *i) { struct xt_match *match; int ret; @@ -515,6 +516,8 @@ static inline int check_match(struct ipt_entry_match *m, const char *name, m->u.kernel.match->name); ret = -EINVAL; } + if (!ret) + (*i)++; return ret; } @@ -537,11 +540,10 @@ find_check_match(struct ipt_entry_match *m, } m->u.kernel.match = match; - ret = check_match(m, name, ip, hookmask); + ret = check_match(m, name, ip, hookmask, i); if (ret) goto err; - (*i)++; return 0; err: module_put(m->u.kernel.match->me); @@ -1425,7 +1427,7 @@ out: } static inline int -compat_check_calc_match(struct ipt_entry_match *m, +compat_find_calc_match(struct ipt_entry_match *m, const char *name, const struct ipt_ip *ip, unsigned int hookmask, @@ -1449,6 +1451,31 @@ compat_check_calc_match(struct ipt_entry_match *m, } static inline int +compat_release_match(struct ipt_entry_match *m, unsigned int *i) +{ + if (i && (*i)-- == 0) + return 1; + + module_put(m->u.kernel.match->me); + return 0; +} + +static inline int +compat_release_entry(struct ipt_entry *e, unsigned int *i) +{ + stru
[NETLINK]: Mark netlink policies const
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ef7c79ed645f52bcbdd88f8d54a9702c4d3fd15d Commit: ef7c79ed645f52bcbdd88f8d54a9702c4d3fd15d Parent: 14a49e1fd2bb91ba2bf0e1f06711b6dbc21de02d Author: Patrick McHardy <[EMAIL PROTECTED]> AuthorDate: Tue Jun 5 12:38:30 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 13:40:10 2007 -0700 [NETLINK]: Mark netlink policies const Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- include/net/fib_rules.h |2 +- include/net/genetlink.h |2 +- include/net/ip_fib.h |2 +- include/net/netlink.h | 12 ++-- net/core/neighbour.c |4 ++-- net/core/rtnetlink.c |2 +- net/decnet/dn_dev.c |2 +- net/decnet/dn_rules.c |2 +- net/ipv4/devinet.c|2 +- net/ipv4/fib_frontend.c |2 +- net/ipv4/fib_rules.c |2 +- net/ipv6/addrconf.c |2 +- net/ipv6/fib6_rules.c |2 +- net/ipv6/route.c |2 +- net/netlabel/netlabel_cipso_v4.c |2 +- net/netlabel/netlabel_mgmt.c |2 +- net/netlabel/netlabel_unlabeled.c |2 +- net/netlink/attr.c|8 net/netlink/genetlink.c |2 +- 19 files changed, 28 insertions(+), 28 deletions(-) diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h index ed3a887..83e41dd 100644 --- a/include/net/fib_rules.h +++ b/include/net/fib_rules.h @@ -64,7 +64,7 @@ struct fib_rules_ops void(*flush_cache)(void); int nlgroup; - struct nla_policy *policy; + const struct nla_policy *policy; struct list_head*rules_list; struct module *owner; }; diff --git a/include/net/genetlink.h b/include/net/genetlink.h index adff4c8..b6eaca1 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h @@ -60,7 +60,7 @@ struct genl_ops { u8 cmd; unsigned intflags; - struct nla_policy *policy; + const struct nla_policy *policy; int(*doit)(struct sk_buff *skb, struct genl_info *info); int(*dumpit)(struct sk_buff *skb, diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index 5a4a036..69252cb 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h @@ -213,7 +213,7 @@ extern void fib_select_default(const struct flowi *flp, struct fib_result *res); #endif /* CONFIG_IP_MULTIPLE_TABLES */ /* Exported by fib_frontend.c */ -extern struct nla_policy rtm_ipv4_policy[]; +extern const struct nla_policy rtm_ipv4_policy[]; extern voidip_fib_init(void); extern int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif, struct net_device *dev, __be32 *spec_dst, u32 *itag); diff --git a/include/net/netlink.h b/include/net/netlink.h index 0bf325c..7b510a9 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h @@ -222,10 +222,10 @@ extern intnlmsg_notify(struct sock *sk, struct sk_buff *skb, gfp_t flags); extern int nla_validate(struct nlattr *head, int len, int maxtype, -struct nla_policy *policy); +const struct nla_policy *policy); extern int nla_parse(struct nlattr *tb[], int maxtype, struct nlattr *head, int len, - struct nla_policy *policy); + const struct nla_policy *policy); extern struct nlattr * nla_find(struct nlattr *head, int len, int attrtype); extern size_t nla_strlcpy(char *dst, const struct nlattr *nla, size_t dstsize); @@ -360,7 +360,7 @@ static inline struct nlmsghdr *nlmsg_next(struct nlmsghdr *nlh, int *remaining) */ static inline int nlmsg_parse(struct nlmsghdr *nlh, int hdrlen, struct nlattr *tb[], int maxtype, - struct nla_policy *policy) + const struct nla_policy *policy) { if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) return -EINVAL; @@ -392,7 +392,7 @@ static inline struct nlattr *nlmsg_find_attr(struct nlmsghdr *nlh, * @policy: validation policy */ static inline int nlmsg_validate(struct nlmsghdr *nlh, int hdrlen, int maxtype, -struct nla_policy *policy) +const struct nla_policy *policy) { if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) return -EINVAL; @@ -729,7 +729,7 @@ static inline st
[RFKILL]: Make rfkill->name const
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c36befb52350fa76bf3cb03d13ba2e17dbe8a508 Commit: c36befb52350fa76bf3cb03d13ba2e17dbe8a508 Parent: 71e27da9618b5f4d525ec821def83991da20429f Author: Ivo van Doorn <[EMAIL PROTECTED]> AuthorDate: Tue Jun 5 00:04:46 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 13:39:34 2007 -0700 [RFKILL]: Make rfkill->name const The rfkill name can be made const safely, this makes the compiler happy when drivers make it point to some const string used elsewhere. Signed-off-by: Ivo van Doorn <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- include/linux/rfkill.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h index 7c1ffba..a8a6ea8 100644 --- a/include/linux/rfkill.h +++ b/include/linux/rfkill.h @@ -63,7 +63,7 @@ enum rfkill_state { * This structure represents a RF switch located on a network device. */ struct rfkill { - char *name; + const char *name; enum rfkill_type type; enum rfkill_state state; - 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
[IPV4]: Convert IPv4 devconf to an array
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=42f811b8bcdf6695bf74de580b1daf53445e8949 Commit: 42f811b8bcdf6695bf74de580b1daf53445e8949 Parent: 8d76527e728d00d1cf9d5dd663caffb2dcf05ae6 Author: Herbert Xu <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 23:34:44 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 13:39:13 2007 -0700 [IPV4]: Convert IPv4 devconf to an array This patch converts the ipv4_devconf config members (everything except sysctl) to an array. This allows easier manipulation which will be needed later on to provide better management of default config values. Signed-off-by: Herbert Xu <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- drivers/infiniband/hw/amso1100/c2.c |2 +- include/linux/inetdevice.h | 94 +++-- net/ipv4/arp.c | 11 +- net/ipv4/devinet.c | 264 ++- net/ipv4/igmp.c | 18 ++- net/ipv4/ipmr.c | 12 +- net/ipv4/proc.c |2 +- net/ipv4/route.c| 14 +- net/ipv4/sysctl_net_ipv4.c |6 +- 9 files changed, 163 insertions(+), 260 deletions(-) diff --git a/drivers/infiniband/hw/amso1100/c2.c b/drivers/infiniband/hw/amso1100/c2.c index 58bc272..0aecea6 100644 --- a/drivers/infiniband/hw/amso1100/c2.c +++ b/drivers/infiniband/hw/amso1100/c2.c @@ -672,7 +672,7 @@ static int c2_up(struct net_device *netdev) * rdma interface. */ in_dev = in_dev_get(netdev); - in_dev->cnf.arp_ignore = 1; + IN_DEV_CONF_SET(in_dev, ARP_IGNORE, 1); in_dev_put(in_dev); return 0; diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index c0f7aec..1ef174d 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h @@ -10,28 +10,8 @@ struct ipv4_devconf { - int accept_redirects; - int send_redirects; - int secure_redirects; - int shared_media; - int accept_source_route; - int rp_filter; - int proxy_arp; - int bootp_relay; - int log_martians; - int forwarding; - int mc_forwarding; - int tag; - int arp_filter; - int arp_announce; - int arp_ignore; - int arp_accept; - int medium_id; - int no_xfrm; - int no_policy; - int force_igmp_version; - int promote_secondaries; void*sysctl; + int data[__NET_IPV4_CONF_MAX - 1]; }; extern struct ipv4_devconf ipv4_devconf; @@ -60,30 +40,64 @@ struct in_device struct rcu_head rcu_head; }; -#define IN_DEV_FORWARD(in_dev) ((in_dev)->cnf.forwarding) -#define IN_DEV_MFORWARD(in_dev)(ipv4_devconf.mc_forwarding && (in_dev)->cnf.mc_forwarding) -#define IN_DEV_RPFILTER(in_dev)(ipv4_devconf.rp_filter && (in_dev)->cnf.rp_filter) -#define IN_DEV_SOURCE_ROUTE(in_dev)(ipv4_devconf.accept_source_route && (in_dev)->cnf.accept_source_route) -#define IN_DEV_BOOTP_RELAY(in_dev) (ipv4_devconf.bootp_relay && (in_dev)->cnf.bootp_relay) - -#define IN_DEV_LOG_MARTIANS(in_dev)(ipv4_devconf.log_martians || (in_dev)->cnf.log_martians) -#define IN_DEV_PROXY_ARP(in_dev) (ipv4_devconf.proxy_arp || (in_dev)->cnf.proxy_arp) -#define IN_DEV_SHARED_MEDIA(in_dev)(ipv4_devconf.shared_media || (in_dev)->cnf.shared_media) -#define IN_DEV_TX_REDIRECTS(in_dev)(ipv4_devconf.send_redirects || (in_dev)->cnf.send_redirects) -#define IN_DEV_SEC_REDIRECTS(in_dev) (ipv4_devconf.secure_redirects || (in_dev)->cnf.secure_redirects) -#define IN_DEV_IDTAG(in_dev) ((in_dev)->cnf.tag) -#define IN_DEV_MEDIUM_ID(in_dev) ((in_dev)->cnf.medium_id) -#define IN_DEV_PROMOTE_SECONDARIES(in_dev) (ipv4_devconf.promote_secondaries || (in_dev)->cnf.promote_secondaries) +#define IPV4_DEVCONF(cnf, attr) ((cnf).data[NET_IPV4_CONF_ ## attr - 1]) +#define IPV4_DEVCONF_ALL(attr) IPV4_DEVCONF(ipv4_devconf, attr) + +static inline int ipv4_devconf_get(struct in_device *in_dev, int index) +{ + index--; + return in_dev->cnf.data[index]; +} + +static inline void ipv4_devconf_set(struct in_device *in_dev, int index, + int val) +{ + index--; + in_dev->cnf.data[index] = val; +} + +#define IN_DEV_CONF_GET(in_dev, attr) \ + ipv4_devconf_get((in_dev), NET_IPV4_CONF_ ## attr) +#define IN_DEV_CONF_SET(in_dev, attr, val) \ + ipv4_devconf_set((in_dev), NET_IPV4_CONF_ ## attr, (val)) + +#define IN_DEV_ANDCONF(in_dev, attr) \ + (IPV4_DEVCONF_ALL(attr) && IN_DEV_CONF_GET((in_dev), attr)) +#define IN_DEV_ORCONF(in_dev, attr) \ + (IPV4_DEVCONF_ALL(attr) || IN_DEV_CONF_GET((in_dev), attr)) +#define IN_DEV_MAXCONF(in_dev,
[IPV4]: Only panic if inetdev_init fails for loopback
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8d76527e728d00d1cf9d5dd663caffb2dcf05ae6 Commit: 8d76527e728d00d1cf9d5dd663caffb2dcf05ae6 Parent: f0e48dbfc5c74e967fea4c0fd0c5ad07557ae0c8 Author: Herbert Xu <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 23:34:08 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 13:39:03 2007 -0700 [IPV4]: Only panic if inetdev_init fails for loopback When I made the inetdev_init call work on all devices I incorrectly left in the panic call as well. It is obviously undesirable to panic on an allocation failure for a normal network device. This patch moves the panic call under the loopback if clause. Signed-off-by: Herbert Xu <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- net/ipv4/devinet.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 7f95e6e..88a22d2 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -1057,9 +1057,10 @@ static int inetdev_event(struct notifier_block *this, unsigned long event, if (!in_dev) { if (event == NETDEV_REGISTER) { in_dev = inetdev_init(dev); - if (!in_dev) - panic("devinet: Failed to create loopback\n"); if (dev == &loopback_dev) { + if (!in_dev) + panic("devinet: " + "Failed to create loopback\n"); in_dev->cnf.no_xfrm = 1; in_dev->cnf.no_policy = 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
[TCP]: Honour sk_bound_dev_if in tcp_v4_send_ack
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f0e48dbfc5c74e967fea4c0fd0c5ad07557ae0c8 Commit: f0e48dbfc5c74e967fea4c0fd0c5ad07557ae0c8 Parent: b91b9fd11210a7023f37eaee1e977ad9ce532095 Author: Patrick McHardy <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 21:32:46 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 13:38:51 2007 -0700 [TCP]: Honour sk_bound_dev_if in tcp_v4_send_ack A time_wait socket inherits sk_bound_dev_if from the original socket, but it is not used when sending ACK packets using ip_send_reply. Fix by passing the oif to ip_send_reply in struct ip_reply_arg and use it for output routing. Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- include/net/ip.h |1 + net/ipv4/ip_output.c |4 +++- net/ipv4/tcp_ipv4.c |2 ++ 3 files changed, 6 insertions(+), 1 deletions(-) diff --git a/include/net/ip.h b/include/net/ip.h index bb207db..abf2820 100644 --- a/include/net/ip.h +++ b/include/net/ip.h @@ -143,6 +143,7 @@ struct ip_reply_arg { __wsum csum; int csumoffset; /* u16 offset of csum in iov[0].iov_base */ /* -1 if not needed */ + int bound_dev_if; }; void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg, diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index d6427d9..34ea454 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -1352,7 +1352,8 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar } { - struct flowi fl = { .nl_u = { .ip4_u = + struct flowi fl = { .oif = arg->bound_dev_if, + .nl_u = { .ip4_u = { .daddr = daddr, .saddr = rt->rt_spec_dst, .tos = RT_TOS(ip_hdr(skb)->tos) } }, @@ -1376,6 +1377,7 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar inet->tos = ip_hdr(skb)->tos; sk->sk_priority = skb->priority; sk->sk_protocol = ip_hdr(skb)->protocol; + sk->sk_bound_dev_if = arg->bound_dev_if; ip_append_data(sk, ip_reply_glue_bits, arg->iov->iov_base, len, 0, &ipc, rt, MSG_DONTWAIT); if ((skb = skb_peek(&sk->sk_write_queue)) != NULL) { diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 47c6105..97e294e 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -705,6 +705,8 @@ static void tcp_v4_send_ack(struct tcp_timewait_sock *twsk, ip_hdr(skb)->saddr, /* XXX */ arg.iov[0].iov_len, IPPROTO_TCP, 0); arg.csumoffset = offsetof(struct tcphdr, check) / 2; + if (twsk) + arg.bound_dev_if = twsk->tw_sk.tw_bound_dev_if; ip_send_reply(tcp_socket->sk, skb, &arg, arg.iov[0].iov_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
[BNX2]: Update version and reldate.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b91b9fd11210a7023f37eaee1e977ad9ce532095 Commit: b91b9fd11210a7023f37eaee1e977ad9ce532095 Parent: 02537b0676930b1bd9aff2139e0e645c79986931 Author: Michael Chan <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 21:24:42 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 13:38:40 2007 -0700 [BNX2]: Update version and reldate. Update to version 1.5.11. Signed-off-by: Michael Chan <[EMAIL PROTECTED]> Acked-by: Jeff Garzik <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- drivers/net/bnx2.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 5046b0f..ce3ed67 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c @@ -54,8 +54,8 @@ #define DRV_MODULE_NAME"bnx2" #define PFX DRV_MODULE_NAME": " -#define DRV_MODULE_VERSION "1.5.10" -#define DRV_MODULE_RELDATE "May 1, 2007" +#define DRV_MODULE_VERSION "1.5.11" +#define DRV_MODULE_RELDATE "June 4, 2007" #define RUN_AT(x) (jiffies + (x)) - 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
[BNX2]: Fix occasional counter corruption on 5708.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=02537b0676930b1bd9aff2139e0e645c79986931 Commit: 02537b0676930b1bd9aff2139e0e645c79986931 Parent: 0aa38df7cd5b6c5b89f5146f4a2286434bc4a8f3 Author: Michael Chan <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 21:24:07 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 13:38:39 2007 -0700 [BNX2]: Fix occasional counter corruption on 5708. The statistics block DMA on 5708 can be messed up occasionally on the average of about once per hour. If the user is reading the counters within one second after the corruption, the counters will be all messed up. One second later, the counters will be ok again until the next corruption occurs. The workaround is to disable the periodic statistics DMA. Instead, we manually trigger the DMA once a second in bnx2_timer(). This manual trigger of the DMA avoids the problem. As a consequence, we can only allow 0 or 1 second settings for ethtool -C statistics block. Thanks to Jean-Daniel Pauget <[EMAIL PROTECTED]> and CaT <[EMAIL PROTECTED]> for reporting this rare problem. Signed-off-by: Michael Chan <[EMAIL PROTECTED]> Acked-by: Jeff Garzik <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- drivers/net/bnx2.c | 14 +- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 3b7ca2a..5046b0f 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c @@ -3788,7 +3788,10 @@ bnx2_init_chip(struct bnx2 *bp) REG_WR(bp, BNX2_HC_CMD_TICKS, (bp->cmd_ticks_int << 16) | bp->cmd_ticks); - REG_WR(bp, BNX2_HC_STATS_TICKS, bp->stats_ticks & 0x00); + if (CHIP_NUM(bp) == CHIP_NUM_5708) + REG_WR(bp, BNX2_HC_STATS_TICKS, 0); + else + REG_WR(bp, BNX2_HC_STATS_TICKS, bp->stats_ticks & 0x00); REG_WR(bp, BNX2_HC_STAT_COLLECT_TICKS, 0xbb8); /* 3ms */ if (CHIP_ID(bp) == CHIP_ID_5706_A1) @@ -4641,6 +4644,11 @@ bnx2_timer(unsigned long data) bp->stats_blk->stat_FwRxDrop = REG_RD_IND(bp, BNX2_FW_RX_DROP_COUNT); + /* workaround occasional corrupted counters */ + if (CHIP_NUM(bp) == CHIP_NUM_5708 && bp->stats_ticks) + REG_WR(bp, BNX2_HC_COMMAND, bp->hc_cmd | + BNX2_HC_COMMAND_STATS_NOW); + if (bp->phy_flags & PHY_SERDES_FLAG) { if (CHIP_NUM(bp) == CHIP_NUM_5706) bnx2_5706_serdes_timer(bp); @@ -5438,6 +5446,10 @@ bnx2_set_coalesce(struct net_device *dev, struct ethtool_coalesce *coal) 0xff; bp->stats_ticks = coal->stats_block_coalesce_usecs; + if (CHIP_NUM(bp) == CHIP_NUM_5708) { + if (bp->stats_ticks != 0 && bp->stats_ticks != USEC_PER_SEC) + bp->stats_ticks = USEC_PER_SEC; + } if (bp->stats_ticks > 0x00) bp->stats_ticks = 0x00; bp->stats_ticks &= 0x00; - 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
[BNX2]: Add missing wait in bnx2_init_5709_context().
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=641bdcd56c8bb2110a31da846b2752b11a644050 Commit: 641bdcd56c8bb2110a31da846b2752b11a644050 Parent: 7947b20ebae785ba25154aa1a9a00a98a22de75a Author: Michael Chan <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 21:22:24 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 13:38:37 2007 -0700 [BNX2]: Add missing wait in bnx2_init_5709_context(). For correctness, we need to wait for the MEM_INIT bit to be cleared in the BNX2_CTX_COMMAND register before proceeding. [Added return -EBUSY when the MEM_INIT bit doesn't clear, suggested by Jeff Garzik.] Signed-off-by: Michael Chan <[EMAIL PROTECTED]> Acked-by: Jeff Garzik <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- drivers/net/bnx2.c | 17 ++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 9789f05..9eba7a2 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c @@ -1778,6 +1778,15 @@ bnx2_init_5709_context(struct bnx2 *bp) val = BNX2_CTX_COMMAND_ENABLED | BNX2_CTX_COMMAND_MEM_INIT | (1 << 12); val |= (BCM_PAGE_BITS - 8) << 16; REG_WR(bp, BNX2_CTX_COMMAND, val); + for (i = 0; i < 10; i++) { + val = REG_RD(bp, BNX2_CTX_COMMAND); + if (!(val & BNX2_CTX_COMMAND_MEM_INIT)) + break; + udelay(2); + } + if (val & BNX2_CTX_COMMAND_MEM_INIT) + return -EBUSY; + for (i = 0; i < bp->ctx_pages; i++) { int j; @@ -3696,9 +3705,11 @@ bnx2_init_chip(struct bnx2 *bp) /* Initialize context mapping and zero out the quick contexts. The * context block must have already been enabled. */ - if (CHIP_NUM(bp) == CHIP_NUM_5709) - bnx2_init_5709_context(bp); - else + if (CHIP_NUM(bp) == CHIP_NUM_5709) { + rc = bnx2_init_5709_context(bp); + if (rc) + return rc; + } else bnx2_init_context(bp); if ((rc = bnx2_init_cpus(bp)) != 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
[BNX2]: Fix netdev watchdog on 5708.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7947b20ebae785ba25154aa1a9a00a98a22de75a Commit: 7947b20ebae785ba25154aa1a9a00a98a22de75a Parent: 7244d545c123ff33a3a5bff7fcb96a07778c32d1 Author: Michael Chan <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 21:17:10 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 13:38:36 2007 -0700 [BNX2]: Fix netdev watchdog on 5708. There's a bug in the driver that only initializes half of the context memory on the 5708. Surprisingly, this works most of the time except for some occasional netdev watchdogs when sending a lot of 64-byte packets. The fix is to add the missing code to initialize the 2nd halves of all context memory. Signed-off-by: Michael Chan <[EMAIL PROTECTED]> Acked-by: Jeff Garzik <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- drivers/net/bnx2.c | 21 + 1 files changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index da7c3b0..9789f05 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c @@ -1811,6 +1811,7 @@ bnx2_init_context(struct bnx2 *bp) vcid = 96; while (vcid) { u32 vcid_addr, pcid_addr, offset; + int i; vcid--; @@ -1831,16 +1832,20 @@ bnx2_init_context(struct bnx2 *bp) pcid_addr = vcid_addr; } - REG_WR(bp, BNX2_CTX_VIRT_ADDR, 0x00); - REG_WR(bp, BNX2_CTX_PAGE_TBL, pcid_addr); + for (i = 0; i < (CTX_SIZE / PHY_CTX_SIZE); i++) { + vcid_addr += (i << PHY_CTX_SHIFT); + pcid_addr += (i << PHY_CTX_SHIFT); - /* Zero out the context. */ - for (offset = 0; offset < PHY_CTX_SIZE; offset += 4) { - CTX_WR(bp, 0x00, offset, 0); - } + REG_WR(bp, BNX2_CTX_VIRT_ADDR, 0x00); + REG_WR(bp, BNX2_CTX_PAGE_TBL, pcid_addr); - REG_WR(bp, BNX2_CTX_VIRT_ADDR, vcid_addr); - REG_WR(bp, BNX2_CTX_PAGE_TBL, pcid_addr); + /* Zero out the context. */ + for (offset = 0; offset < PHY_CTX_SIZE; offset += 4) + CTX_WR(bp, 0x00, offset, 0); + + REG_WR(bp, BNX2_CTX_VIRT_ADDR, vcid_addr); + REG_WR(bp, BNX2_CTX_PAGE_TBL, pcid_addr); + } } } - 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] 4421/1: AT91: Value of _KEY fields.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0e5f82dda5e60a21cf8ba4f77334d60290277d2c Commit: 0e5f82dda5e60a21cf8ba4f77334d60290277d2c Parent: f72267c30f5a08f9a77c97417ec120e6943195f8 Author: Andrew Victor <[EMAIL PROTECTED]> AuthorDate: Thu May 31 10:16:00 2007 +0100 Committer: Russell King <[EMAIL PROTECTED]> CommitDate: Sun Jun 3 17:52:35 2007 +0100 [ARM] 4421/1: AT91: Value of _KEY fields. Use the actual value (0xA5) for the AT91_SHDW_KEY and AT91_WDT_KEY register fields instead of a bitmask. This is consistent with how AT91_RSTC_KEY is defined, and is easier to use in code. Signed-off-by: Andrew Victor <[EMAIL PROTECTED]> Signed-off-by: Russell King <[EMAIL PROTECTED]> --- include/asm-arm/arch-at91/at91_shdwc.h |4 ++-- include/asm-arm/arch-at91/at91_wdt.h |2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/asm-arm/arch-at91/at91_shdwc.h b/include/asm-arm/arch-at91/at91_shdwc.h index 795fcc2..01b433d 100644 --- a/include/asm-arm/arch-at91/at91_shdwc.h +++ b/include/asm-arm/arch-at91/at91_shdwc.h @@ -14,8 +14,8 @@ #define AT91_SHDWC_H #define AT91_SHDW_CR (AT91_SHDWC + 0x00) /* Shut Down Control Register */ -#defineAT91_SHDW_SHDW (1<< 0) /* Processor Reset */ -#defineAT91_SHDW_KEY (0xff << 24)/* KEY Password */ +#defineAT91_SHDW_SHDW (1<< 0) /* Shut Down command */ +#defineAT91_SHDW_KEY (0xa5 << 24)/* KEY Password */ #define AT91_SHDW_MR (AT91_SHDWC + 0x04) /* Shut Down Mode Register */ #defineAT91_SHDW_WKMODE0 (3 << 0)/* Wake-up 0 Mode Selection */ diff --git a/include/asm-arm/arch-at91/at91_wdt.h b/include/asm-arm/arch-at91/at91_wdt.h index 7251a34..1014e9b 100644 --- a/include/asm-arm/arch-at91/at91_wdt.h +++ b/include/asm-arm/arch-at91/at91_wdt.h @@ -15,7 +15,7 @@ #define AT91_WDT_CR(AT91_WDT + 0x00) /* Watchdog Control Register */ #defineAT91_WDT_WDRSTT (1<< 0) /* Restart */ -#defineAT91_WDT_KEY(0xff << 24)/* KEY Password */ +#defineAT91_WDT_KEY(0xa5 << 24)/* KEY Password */ #define AT91_WDT_MR(AT91_WDT + 0x04) /* Watchdog Mode Register */ #defineAT91_WDT_WDV(0xfff << 0)/* Counter Value */ - 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] 4419/1: AT91: SAM9 USB clocks check for suspending
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b6b27ae5e85fb193c08448157943b187958b8ca2 Commit: b6b27ae5e85fb193c08448157943b187958b8ca2 Parent: 1f4b49a4293ea7b0adeaeae37207b9c9fd2dd7c2 Author: Andrew Victor <[EMAIL PROTECTED]> AuthorDate: Thu May 31 09:34:53 2007 +0100 Committer: Russell King <[EMAIL PROTECTED]> CommitDate: Sat Jun 2 21:31:48 2007 +0100 [ARM] 4419/1: AT91: SAM9 USB clocks check for suspending When suspending to slow-clock mode, at91_pm_verify_clocks() is called to ensure that all the clocks are disabled or in the correct state. This patch replaces the "#warning TODO" messages for the SAM9 processors with the correct code. Signed-off-by: Andrew Victor <[EMAIL PROTECTED]> Signed-off-by: Russell King <[EMAIL PROTECTED]> --- arch/arm/mach-at91/pm.c | 11 +-- 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index ff8db29..47ff676 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c @@ -76,12 +76,11 @@ static int at91_pm_verify_clocks(void) pr_debug("AT91: PM - Suspend-to-RAM with USB still active\n"); return 0; } - } else if (cpu_is_at91sam9260()) { -#warning "Check SAM9260 USB clocks" - } else if (cpu_is_at91sam9261()) { -#warning "Check SAM9261 USB clocks" - } else if (cpu_is_at91sam9263()) { -#warning "Check SAM9263 USB clocks" + } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || cpu_is_at91sam9263()) { + if ((scsr & (AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP)) != 0) { + pr_debug("AT91: PM - Suspend-to-RAM with USB still active\n"); + return 0; + } } #ifdef CONFIG_AT91_PROGRAMMABLE_CLOCKS - 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] 4418/1: AT91: Number of programmable clocks differs
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1f4b49a4293ea7b0adeaeae37207b9c9fd2dd7c2 Commit: 1f4b49a4293ea7b0adeaeae37207b9c9fd2dd7c2 Parent: c7341d436a7a89dc26706386de0a301fc9dbe49a Author: Andrew Victor <[EMAIL PROTECTED]> AuthorDate: Thu May 31 09:29:33 2007 +0100 Committer: Russell King <[EMAIL PROTECTED]> CommitDate: Sat Jun 2 21:31:43 2007 +0100 [ARM] 4418/1: AT91: Number of programmable clocks differs The number of programmable clocks available on the AT91 processors can differ, therefore do not always display the contents of the PMC_PCKR(0) .. PMC_PCKR(3) registers (ie, assume there are 4 clocks). If CONFIG_AT91_PROGRAMMABLE_CLOCKS is enabled, the programmable clocks will be registered like the other system/peripheral clocks, and the state of the programmable clocks will be displayed like with the other clocks. Signed-off-by: Andrew Victor <[EMAIL PROTECTED]> Signed-off-by: Russell King <[EMAIL PROTECTED]> --- arch/arm/mach-at91/clock.c |5 - 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c index 06c9a05..848efb2 100644 --- a/arch/arm/mach-at91/clock.c +++ b/arch/arm/mach-at91/clock.c @@ -364,19 +364,14 @@ static int at91_clk_show(struct seq_file *s, void *unused) { u32 scsr, pcsr, sr; struct clk *clk; - unsignedi; seq_printf(s, "SCSR = %8x\n", scsr = at91_sys_read(AT91_PMC_SCSR)); seq_printf(s, "PCSR = %8x\n", pcsr = at91_sys_read(AT91_PMC_PCSR)); - seq_printf(s, "MOR = %8x\n", at91_sys_read(AT91_CKGR_MOR)); seq_printf(s, "MCFR = %8x\n", at91_sys_read(AT91_CKGR_MCFR)); seq_printf(s, "PLLA = %8x\n", at91_sys_read(AT91_CKGR_PLLAR)); seq_printf(s, "PLLB = %8x\n", at91_sys_read(AT91_CKGR_PLLBR)); - seq_printf(s, "MCKR = %8x\n", at91_sys_read(AT91_PMC_MCKR)); - for (i = 0; i < 4; i++) - seq_printf(s, "PCK%d = %8x\n", i, at91_sys_read(AT91_PMC_PCKR(i))); seq_printf(s, "SR = %8x\n", sr = at91_sys_read(AT91_PMC_SR)); seq_printf(s, "\n"); - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[ARM] 4392/2: Do not corrupt the SP register in compressed/head.S
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c7341d436a7a89dc26706386de0a301fc9dbe49a Commit: c7341d436a7a89dc26706386de0a301fc9dbe49a Parent: f285e3d329ce68cc355fadf4ab2c8f34d7f264cb Author: Catalin Marinas <[EMAIL PROTECTED]> AuthorDate: Fri Jun 1 17:13:59 2007 +0100 Committer: Russell King <[EMAIL PROTECTED]> CommitDate: Sat Jun 2 21:31:43 2007 +0100 [ARM] 4392/2: Do not corrupt the SP register in compressed/head.S ARMv7 support code requires a valid stack for saving/restoring registers as the whole D-cache flushing function is more complex. This patch ensures that the SP register is not corrupted. Signed-off-by: Catalin Marinas <[EMAIL PROTECTED]> Signed-off-by: Russell King <[EMAIL PROTECTED]> --- arch/arm/boot/compressed/head.S |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index 2568d31..23348e9 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -247,7 +247,7 @@ not_relocated: mov r0, #0 mov r3, r7 bl decompress_kernel - add r0, r0, #127 + add r0, r0, #127 + 128 @ alignment + stack bic r0, r0, #127@ align the kernel length /* * r0 = decompressed kernel length @@ -269,6 +269,7 @@ not_relocated: mov r0, #0 stmia r1!, {r9 - r14} cmp r2, r3 blo 1b + add sp, r1, #128@ relocate the stack bl cache_clean_flush add pc, r5, r0 @ call relocation code @@ -476,6 +477,7 @@ __common_mmu_cache_on: */ .align 5 reloc_start: add r9, r5, r0 + sub r9, r9, #128@ do not copy the stack debug_reloc_start mov r1, r4 1: @@ -486,6 +488,7 @@ reloc_start:add r9, r5, r0 cmp r5, r9 blo 1b + add sp, r1, #128@ relocate the stack debug_reloc_end call_kernel: bl cache_clean_flush - 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
[MIPS] Fix warning by moving do_default_vi into CONFIG_CPU_MIPSR2_SRS
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6ba07e590d1f841a5d0539978399b852a015ab53 Commit: 6ba07e590d1f841a5d0539978399b852a015ab53 Parent: 490dcc4d309141b622107ad5ad82674a01e089bc Author: Atsushi Nemoto <[EMAIL PROTECTED]> AuthorDate: Mon May 21 23:45:38 2007 +0900 Committer: Ralf Baechle <[EMAIL PROTECTED]> CommitDate: Wed Jun 6 19:34:33 2007 +0100 [MIPS] Fix warning by moving do_default_vi into CONFIG_CPU_MIPSR2_SRS This fixes the warning: arch/mips/kernel/traps.c:931: warning: 'do_default_vi' defined but not used Signed-off-by: Atsushi Nemoto <[EMAIL PROTECTED]> Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]> --- arch/mips/kernel/traps.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 200de02..3f58b6a 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -927,12 +927,6 @@ asmlinkage void do_reserved(struct pt_regs *regs) (regs->cp0_cause & 0x7f) >> 2); } -static asmlinkage void do_default_vi(void) -{ - show_regs(get_irq_regs()); - panic("Caught unexpected vectored interrupt."); -} - /* * Some MIPS CPUs can enable/disable for cache parity detection, but do * it different ways. @@ -1128,6 +1122,12 @@ void mips_srs_free(int set) clear_bit(set, &sr->sr_allocated); } +static asmlinkage void do_default_vi(void) +{ + show_regs(get_irq_regs()); + panic("Caught unexpected vectored interrupt."); +} + static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs) { unsigned long handler; - 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
[MIPS] Remove prototype for deleted function qemu_handle_int
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cc8f0b827fdd616a3358fc939a2811bc0d6c3f79 Commit: cc8f0b827fdd616a3358fc939a2811bc0d6c3f79 Parent: 8676d2e0244cbef294c7d9ad6e50048f9dfba9e0 Author: Ralf Baechle <[EMAIL PROTECTED]> AuthorDate: Sun May 20 22:29:01 2007 +0200 Committer: Ralf Baechle <[EMAIL PROTECTED]> CommitDate: Wed Jun 6 19:34:33 2007 +0100 [MIPS] Remove prototype for deleted function qemu_handle_int Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]> --- arch/mips/qemu/q-irq.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/arch/mips/qemu/q-irq.c b/arch/mips/qemu/q-irq.c index f5ea2fe..89891e9 100644 --- a/arch/mips/qemu/q-irq.c +++ b/arch/mips/qemu/q-irq.c @@ -7,8 +7,6 @@ #include #include -extern asmlinkage void qemu_handle_int(void); - asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_status() & read_c0_cause(); - 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
[MIPS] Fix some system calls with long long arguments
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8676d2e0244cbef294c7d9ad6e50048f9dfba9e0 Commit: 8676d2e0244cbef294c7d9ad6e50048f9dfba9e0 Parent: fbd5604d56c4543457aeae6dda69c9b8a1405474 Author: Atsushi Nemoto <[EMAIL PROTECTED]> AuthorDate: Fri May 18 00:46:13 2007 +0900 Committer: Ralf Baechle <[EMAIL PROTECTED]> CommitDate: Wed Jun 6 19:34:32 2007 +0100 [MIPS] Fix some system calls with long long arguments * O32 fadvise64() pass long long arguments by register pairs. Add sys32 version for 64 bit kernel. * N32 readahead() can pass a long long argument by one register. No need to use sys32_readahead. Signed-off-by: Atsushi Nemoto <[EMAIL PROTECTED]> Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]> --- arch/mips/kernel/linux32.c | 10 ++ arch/mips/kernel/scall64-n32.S |2 +- arch/mips/kernel/scall64-o32.S |2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c index 37849ed..06e04da 100644 --- a/arch/mips/kernel/linux32.c +++ b/arch/mips/kernel/linux32.c @@ -556,6 +556,16 @@ asmlinkage long sys32_sync_file_range(int fd, int __pad, flags); } +asmlinkage long sys32_fadvise64_64(int fd, int __pad, + unsigned long a2, unsigned long a3, + unsigned long a4, unsigned long a5, + int flags) +{ + return sys_fadvise64_64(fd, + merge_64(a2, a3), merge_64(a4, a5), + flags); +} + save_static_function(sys32_clone); __attribute_used__ noinline static int _sys32_clone(nabi_no_regargs struct pt_regs regs) diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index 6eac283..1631035 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S @@ -299,7 +299,7 @@ EXPORT(sysn32_call_table) PTR sys_ni_syscall /* res. for afs_syscall */ PTR sys_ni_syscall /* res. for security */ PTR sys_gettid - PTR sys32_readahead + PTR sys_readahead PTR sys_setxattr/* 6180 */ PTR sys_lsetxattr PTR sys_fsetxattr diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 7e74b41..2aa9942 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S @@ -459,7 +459,7 @@ sys_call_table: PTR sys_remap_file_pages PTR sys_set_tid_address PTR sys_restart_syscall - PTR sys_fadvise64_64 + PTR sys32_fadvise64_64 PTR compat_sys_statfs64 /* 4255 */ PTR compat_sys_fstatfs64 PTR compat_sys_timer_create - 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
[MIPS] Make dma_map_sg handle sg elements which are longer than one page
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fbd5604d56c4543457aeae6dda69c9b8a1405474 Commit: fbd5604d56c4543457aeae6dda69c9b8a1405474 Parent: 1fe5f2c4503cf45806a47c608706fc7892649d4b Author: Thomas Bogendoerfer <[EMAIL PROTECTED]> AuthorDate: Fri May 18 14:32:36 2007 +0200 Committer: Ralf Baechle <[EMAIL PROTECTED]> CommitDate: Wed Jun 6 19:34:32 2007 +0100 [MIPS] Make dma_map_sg handle sg elements which are longer than one page Signed-off-by: Thomas Bogendoerfer <[EMAIL PROTECTED]> Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]> --- arch/mips/mm/dma-default.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c index f0eb299..76903c7 100644 --- a/arch/mips/mm/dma-default.c +++ b/arch/mips/mm/dma-default.c @@ -168,8 +168,9 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, addr = (unsigned long) page_address(sg->page); if (!plat_device_is_coherent(dev) && addr) __dma_sync(addr + sg->offset, sg->length, direction); - sg->dma_address = plat_map_dma_mem_page(dev, sg->page) + - sg->offset; + sg->dma_address = plat_map_dma_mem(dev, + (void *)(addr + sg->offset), + sg->length); } return nents; - 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
[MIPS] RM300: Fix MMIO problems by marking the PCI INT ACK region busy
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0c2bf745f9bdef7243ef5f04e6b05f592abead06 Commit: 0c2bf745f9bdef7243ef5f04e6b05f592abead06 Parent: d73d420708f456a63d7db2c504c62cd713381d7d Author: Thomas Bogendoerfer <[EMAIL PROTECTED]> AuthorDate: Thu May 17 14:51:47 2007 +0200 Committer: Ralf Baechle <[EMAIL PROTECTED]> CommitDate: Wed Jun 6 19:34:31 2007 +0100 [MIPS] RM300: Fix MMIO problems by marking the PCI INT ACK region busy Signed-off-by: Thomas Bogendoerfer <[EMAIL PROTECTED]> Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]> --- arch/mips/sni/pcimt.c | 18 +- 1 files changed, 17 insertions(+), 1 deletions(-) diff --git a/arch/mips/sni/pcimt.c b/arch/mips/sni/pcimt.c index 9ee208d..97b2343 100644 --- a/arch/mips/sni/pcimt.c +++ b/arch/mips/sni/pcimt.c @@ -6,7 +6,7 @@ * for more details. * * Copyright (C) 1996, 97, 98, 2000, 03, 04, 06 Ralf Baechle ([EMAIL PROTECTED]) - * Copyright (C) 2006 Thomas Bogendoerfer ([EMAIL PROTECTED]) + * Copyright (C) 2006,2007 Thomas Bogendoerfer ([EMAIL PROTECTED]) */ #include @@ -131,6 +131,19 @@ static struct resource pcimt_io_resources[] = { } }; +static struct resource pcimt_mem_resources[] = { + { + /* +* this region should only be 4 bytes long, +* but it's 16MB on all RM300C I've checked +*/ + .start = 0x1a00, + .end= 0x1aff, + .name = "PCI INT ACK", + .flags = IORESOURCE_BUSY + } +}; + static struct resource sni_mem_resource = { .start = 0x1800UL, .end= 0x1fbfUL, @@ -145,6 +158,9 @@ static void __init sni_pcimt_resource_init(void) /* request I/O space for devices used on all i[345]86 PCs */ for (i = 0; i < ARRAY_SIZE(pcimt_io_resources); i++) request_resource(&sni_io_resource, pcimt_io_resources + i); + /* request MEM space for devices used on all i[345]86 PCs */ + for (i = 0; i < ARRAY_SIZE(pcimt_mem_resources); i++) + request_resource(&sni_mem_resource, pcimt_mem_resources + i); } extern struct pci_ops sni_pcimt_ops; - 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
[MIPS] Atlas, Malta, SEAD: Remove scroll from interrupt handler.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=79894c7b47f78decaa3511f1d6646aa06e2c6bed Commit: 79894c7b47f78decaa3511f1d6646aa06e2c6bed Parent: 5ecd3100e695228ac5e0ce0e325e252c0f11806f Author: Ralf Baechle <[EMAIL PROTECTED]> AuthorDate: Wed May 16 17:54:08 2007 +0200 Committer: Ralf Baechle <[EMAIL PROTECTED]> CommitDate: Wed Jun 6 19:34:30 2007 +0100 [MIPS] Atlas, Malta, SEAD: Remove scroll from interrupt handler. Aside of being handy for debugging this has never been a particularly good idea but is now getting in the way of dyntick / tickless kernels and general cleanups. Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]> --- arch/mips/mips-boards/atlas/atlas_setup.c |2 + arch/mips/mips-boards/generic/display.c | 24 ++ arch/mips/mips-boards/generic/time.c | 31 +--- arch/mips/mips-boards/malta/malta_setup.c |6 + arch/mips/mips-boards/sead/sead_setup.c |2 + include/asm-mips/mips-boards/prom.h |1 + 6 files changed, 37 insertions(+), 29 deletions(-) diff --git a/arch/mips/mips-boards/atlas/atlas_setup.c b/arch/mips/mips-boards/atlas/atlas_setup.c index 0c6b0ce..1cc6ebb 100644 --- a/arch/mips/mips-boards/atlas/atlas_setup.c +++ b/arch/mips/mips-boards/atlas/atlas_setup.c @@ -48,6 +48,8 @@ const char *get_system_type(void) return "MIPS Atlas"; } +const char display_string[] = "LINUX ON ATLAS "; + void __init plat_mem_setup(void) { mips_pcibios_init(); diff --git a/arch/mips/mips-boards/generic/display.c b/arch/mips/mips-boards/generic/display.c index 548dbe5..5d60005 100644 --- a/arch/mips/mips-boards/generic/display.c +++ b/arch/mips/mips-boards/generic/display.c @@ -19,9 +19,14 @@ */ #include +#include #include #include +extern const char display_string[]; +static unsigned int display_count; +static unsigned int max_display_count; + void mips_display_message(const char *str) { static unsigned int __iomem *display = NULL; @@ -37,3 +42,22 @@ void mips_display_message(const char *str) writel(' ', display + i); } } + +static void scroll_display_message(unsigned long data); +static DEFINE_TIMER(mips_scroll_timer, scroll_display_message, HZ, 0); + +static void scroll_display_message(unsigned long data) +{ + mips_display_message(&display_string[display_count++]); + if (display_count == max_display_count) + display_count = 0; + + mod_timer(&mips_scroll_timer, jiffies + HZ); +} + +void mips_scroll_message(void) +{ + del_timer_sync(&mips_scroll_timer); + max_display_count = strlen(display_string) + 1 - 8; + mod_timer(&mips_scroll_timer, jiffies + 1); +} diff --git a/arch/mips/mips-boards/generic/time.c b/arch/mips/mips-boards/generic/time.c index df2a2bd..37735bf 100644 --- a/arch/mips/mips-boards/generic/time.c +++ b/arch/mips/mips-boards/generic/time.c @@ -53,37 +53,11 @@ unsigned long cpu_khz; -#if defined(CONFIG_MIPS_ATLAS) -static char display_string[] = "LINUX ON ATLAS "; -#endif -#if defined(CONFIG_MIPS_MALTA) -#if defined(CONFIG_MIPS_MT_SMTC) -static char display_string[] = " SMTC LINUX ON MALTA "; -#else -static char display_string[] = "LINUX ON MALTA "; -#endif /* CONFIG_MIPS_MT_SMTC */ -#endif -#if defined(CONFIG_MIPS_SEAD) -static char display_string[] = "LINUX ON SEAD "; -#endif -static unsigned int display_count; -#define MAX_DISPLAY_COUNT (sizeof(display_string) - 8) - #define CPUCTR_IMASKBIT (0x100 << MIPSCPU_INT_CPUCTR) -static unsigned int timer_tick_count; static int mips_cpu_timer_irq; extern void smtc_timer_broadcast(int); -static inline void scroll_display_message(void) -{ - if ((timer_tick_count++ % HZ) == 0) { - mips_display_message(&display_string[display_count++]); - if (display_count == MAX_DISPLAY_COUNT) - display_count = 0; - } -} - static void mips_timer_dispatch(void) { do_IRQ(mips_cpu_timer_irq); @@ -143,7 +117,6 @@ irqreturn_t mips_timer_interrupt(int irq, void *dev_id) if (cpu_data[cpu].vpe_id == 0) { timer_interrupt(irq, NULL); smtc_timer_broadcast(cpu_data[cpu].vpe_id); - scroll_display_message(); } else { write_c0_compare(read_c0_count() + (mips_hpt_frequency/HZ)); @@ -167,8 +140,6 @@ irqreturn_t mips_timer_interrupt(int irq, void *dev_id) /* we keep interrupt disabled all the time */ if (!r2 || (read_c0_cause() & (1 << 30))) timer_interrupt(irq, NULL); - - scroll_display_message(); } else { /* Everyone else needs to reset the timer int here as
frv: build fix
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2c750edd39a45402e355459194fe8804366bedd2 Commit: 2c750edd39a45402e355459194fe8804366bedd2 Parent: 8a2e21038df74c4401f422346b9371a959c21438 Author: Peter Zijlstra <[EMAIL PROTECTED]> AuthorDate: Wed Jun 6 11:39:40 2007 +0200 Committer: Linus Torvalds <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 17:00:25 2007 -0700 frv: build fix In file included from /usr/src/linux-2.6-2/net/ipv4/ip_input.c:118: include2/asm/system.h:245: error: parse error before "__cmpxchg_32" include2/asm/system.h:245: error: parse error before '*' token include2/asm/system.h:245: warning: type defaults to `int' in declaration of `__cmpxchg_32' include2/asm/system.h:245: warning: function declaration isn't a prototype include2/asm/system.h:245: warning: data definition has no type or storage class Signed-off-by: Peter Zijlstra <[EMAIL PROTECTED]> Acked-by: David Howells <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> --- include/asm-frv/system.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/asm-frv/system.h b/include/asm-frv/system.h index be303b3..6931af5 100644 --- a/include/asm-frv/system.h +++ b/include/asm-frv/system.h @@ -12,6 +12,7 @@ #ifndef _ASM_SYSTEM_H #define _ASM_SYSTEM_H +#include #include struct thread_struct; - 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
sh: Fix SH4-202 clock fwk set_rate() mismatch.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=907c9d70042e38efc6a981d425a3d8d98b089cba Commit: 907c9d70042e38efc6a981d425a3d8d98b089cba Parent: 8b19a7ce566007a8c45f9ba9d2b4a31bba20d62d Author: Paul Mundt <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 10:51:59 2007 +0900 Committer: Paul Mundt <[EMAIL PROTECTED]> CommitDate: Mon Jun 4 10:51:59 2007 +0900 sh: Fix SH4-202 clock fwk set_rate() mismatch. With the SH7722 changes, ->set_rate() also takes an algo_id, SH4-202 was overlooked when this change went in. Signed-off-by: Paul Mundt <[EMAIL PROTECTED]> --- arch/sh/kernel/cpu/sh4/clock-sh4-202.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/sh/kernel/cpu/sh4/clock-sh4-202.c b/arch/sh/kernel/cpu/sh4/clock-sh4-202.c index fcb2c41..a334294 100644 --- a/arch/sh/kernel/cpu/sh4/clock-sh4-202.c +++ b/arch/sh/kernel/cpu/sh4/clock-sh4-202.c @@ -111,7 +111,7 @@ static int shoc_clk_verify_rate(struct clk *clk, unsigned long rate) return 0; } -static int shoc_clk_set_rate(struct clk *clk, unsigned long rate) +static int shoc_clk_set_rate(struct clk *clk, unsigned long rate, int algo_id) { unsigned long frqcr3; unsigned int tmp; - 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
sh: voyagergx: Fix build warnings.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=63dfc3c77b6a99cc618e0a11b7532a56e2699320 Commit: 63dfc3c77b6a99cc618e0a11b7532a56e2699320 Parent: 907c9d70042e38efc6a981d425a3d8d98b089cba Author: Paul Mundt <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 10:53:00 2007 +0900 Committer: Paul Mundt <[EMAIL PROTECTED]> CommitDate: Mon Jun 4 10:53:00 2007 +0900 sh: voyagergx: Fix build warnings. pr_debug() was using a %x on an unsigned long, which was making the build a bit noisy. Signed-off-by: Paul Mundt <[EMAIL PROTECTED]> --- arch/sh/cchips/voyagergx/irq.c | 13 +++-- 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/sh/cchips/voyagergx/irq.c b/arch/sh/cchips/voyagergx/irq.c index 70f1290..d70e5c8 100644 --- a/arch/sh/cchips/voyagergx/irq.c +++ b/arch/sh/cchips/voyagergx/irq.c @@ -28,7 +28,7 @@ static void disable_voyagergx_irq(unsigned int irq) unsigned long val; unsigned long mask = 1 << (irq - VOYAGER_IRQ_BASE); - pr_debug("disable_voyagergx_irq(%d): mask=%x\n", irq, mask); + pr_debug("disable_voyagergx_irq(%d): mask=%lx\n", irq, mask); val = readl((void __iomem *)VOYAGER_INT_MASK); val &= ~mask; writel(val, (void __iomem *)VOYAGER_INT_MASK); @@ -39,7 +39,7 @@ static void enable_voyagergx_irq(unsigned int irq) unsigned long val; unsigned long mask = 1 << (irq - VOYAGER_IRQ_BASE); - pr_debug("disable_voyagergx_irq(%d): mask=%x\n", irq, mask); + pr_debug("disable_voyagergx_irq(%d): mask=%lx\n", irq, mask); val = readl((void __iomem *)VOYAGER_INT_MASK); val |= mask; writel(val, (void __iomem *)VOYAGER_INT_MASK); @@ -125,11 +125,12 @@ int voyagergx_irq_demux(int irq) i = 17; else printk("Unexpected IRQ irq = %d status = 0x%08lx\n", irq, val); - pr_debug("voyagergx_irq_demux %d \n", i); - if (i < VOYAGER_IRQ_NUM) { + pr_debug("voyagergx_irq_demux %ld \n", i); + if (i < VOYAGER_IRQ_NUM) { irq = VOYAGER_IRQ_BASE + i; - if (voyagergx_demux[i].func != 0) - irq = voyagergx_demux[i].func(irq, voyagergx_demux[i].dev); + if (voyagergx_demux[i].func != 0) + irq = voyagergx_demux[i].func(irq, + voyagergx_demux[i].dev); } } return 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
sh: Fix in_nmi symbol build error.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c596b1a38085a041464b9b2c0c200e81ff695634 Commit: c596b1a38085a041464b9b2c0c200e81ff695634 Parent: c1a13ff57ab1ce52a0aae9984594dbfcfbaf68c0 Author: Paul Mundt <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 10:39:50 2007 +0900 Committer: Paul Mundt <[EMAIL PROTECTED]> CommitDate: Mon Jun 4 10:39:50 2007 +0900 sh: Fix in_nmi symbol build error. If CONFIG_KGDB_NMI is disabled, we're left with a stray in_nmi reference that can't be resolved. Move the symbol under the ifdef, too. Signed-off-by: Paul Mundt <[EMAIL PROTECTED]> --- arch/sh/kernel/cpu/sh3/entry.S |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/sh/kernel/cpu/sh3/entry.S b/arch/sh/kernel/cpu/sh3/entry.S index 659cc08..b0b59d4 100644 --- a/arch/sh/kernel/cpu/sh3/entry.S +++ b/arch/sh/kernel/cpu/sh3/entry.S @@ -320,7 +320,9 @@ skip_restore: .align 2 5: .long 0x1000 ! DSP +#ifdef CONFIG_KGDB_NMI 6: .long in_nmi +#endif 7: .long 0x3000 ! common exception handler - 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
sh: microdev: Fix compile warnings.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8b19a7ce566007a8c45f9ba9d2b4a31bba20d62d Commit: 8b19a7ce566007a8c45f9ba9d2b4a31bba20d62d Parent: c596b1a38085a041464b9b2c0c200e81ff695634 Author: Paul Mundt <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 10:50:42 2007 +0900 Committer: Paul Mundt <[EMAIL PROTECTED]> CommitDate: Mon Jun 4 10:50:42 2007 +0900 sh: microdev: Fix compile warnings. irq.c needs linux/interrupt.h. Signed-off-by: Paul Mundt <[EMAIL PROTECTED]> --- arch/sh/boards/superh/microdev/irq.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/sh/boards/superh/microdev/irq.c b/arch/sh/boards/superh/microdev/irq.c index cc1cb04..4d33507 100644 --- a/arch/sh/boards/superh/microdev/irq.c +++ b/arch/sh/boards/superh/microdev/irq.c @@ -11,6 +11,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
sh: ioremap() through PMB needs asm/mmu.h.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0fd14754141e3604529579232d34fcffd89c24b9 Commit: 0fd14754141e3604529579232d34fcffd89c24b9 Parent: 63dfc3c77b6a99cc618e0a11b7532a56e2699320 Author: Paul Mundt <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 10:58:23 2007 +0900 Committer: Paul Mundt <[EMAIL PROTECTED]> CommitDate: Mon Jun 4 10:58:23 2007 +0900 sh: ioremap() through PMB needs asm/mmu.h. Signed-off-by: Paul Mundt <[EMAIL PROTECTED]> --- arch/sh/mm/ioremap.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/sh/mm/ioremap.c b/arch/sh/mm/ioremap.c index be03d74..0c7b7e3 100644 --- a/arch/sh/mm/ioremap.c +++ b/arch/sh/mm/ioremap.c @@ -22,6 +22,7 @@ #include #include #include +#include /* * Remap an arbitrary physical address space into the kernel virtual - 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
sh: Fix se73180 platform device registration.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9a412847fbe396563acf2a78d5830c9c6c5a5d43 Commit: 9a412847fbe396563acf2a78d5830c9c6c5a5d43 Parent: 0fd14754141e3604529579232d34fcffd89c24b9 Author: Paul Mundt <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 11:07:23 2007 +0900 Committer: Paul Mundt <[EMAIL PROTECTED]> CommitDate: Mon Jun 4 11:07:23 2007 +0900 sh: Fix se73180 platform device registration. Copy and paste error from se7343, fix it up. Signed-off-by: Paul Mundt <[EMAIL PROTECTED]> --- arch/sh/boards/se/73180/setup.c |4 ++-- include/asm-sh/se73180.h| 11 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/arch/sh/boards/se/73180/setup.c b/arch/sh/boards/se/73180/setup.c index 911ce1c..e143017 100644 --- a/arch/sh/boards/se/73180/setup.c +++ b/arch/sh/boards/se/73180/setup.c @@ -38,8 +38,8 @@ static struct platform_device *se73180_devices[] __initdata = { static int __init se73180_devices_setup(void) { - return platform_add_devices(sh7343se_platform_devices, - ARRAY_SIZE(sh7343se_platform_devices)); + return platform_add_devices(se73180_devices, + ARRAY_SIZE(se73180_devices)); } __initcall(se73180_devices_setup); diff --git a/include/asm-sh/se73180.h b/include/asm-sh/se73180.h index 3a4acb3..907c062 100644 --- a/include/asm-sh/se73180.h +++ b/include/asm-sh/se73180.h @@ -1,9 +1,7 @@ -#ifndef __ASM_SH_HITACHI_SE73180_H -#define __ASM_SH_HITACHI_SE73180_H +#ifndef __ASM_SH_SE73180_H +#define __ASM_SH_SE73180_H /* - * include/asm-sh/se/se73180.h - * * Copyright (C) 2003 Takashi Kusuda <[EMAIL PROTECTED]> * * SH-Mobile SolutionEngine 73180 support @@ -62,4 +60,7 @@ #define __IO_PREFIXsh73180se #include -#endif /* __ASM_SH_HITACHI_SE73180_H */ +/* arch/sh/boards/se/73180/irq.c */ +int shmse_irq_demux(int irq); + +#endif /* __ASM_SH_SE73180_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
[MIPS] Remove duplicate fpu enable hazard code.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f9509c84d8d9451ecd1731e922e7094b38ee336a Commit: f9509c84d8d9451ecd1731e922e7094b38ee336a Parent: 79894c7b47f78decaa3511f1d6646aa06e2c6bed Author: Chris Dearman <[EMAIL PROTECTED]> AuthorDate: Thu May 17 21:36:55 2007 +0100 Committer: Ralf Baechle <[EMAIL PROTECTED]> CommitDate: Wed Jun 6 19:34:31 2007 +0100 [MIPS] Remove duplicate fpu enable hazard code. Use common code from hazards.h instead. Signed-off-by: Chris Dearman <[EMAIL PROTECTED]> Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]> --- arch/mips/kernel/r4k_switch.S |2 +- include/asm-mips/asmmacro.h | 15 --- 2 files changed, 1 insertions(+), 16 deletions(-) diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S index cc566cf..0672959 100644 --- a/arch/mips/kernel/r4k_switch.S +++ b/arch/mips/kernel/r4k_switch.S @@ -174,7 +174,7 @@ LEAF(_init_fpu) or t0, t1 mtc0t0, CP0_STATUS #endif /* CONFIG_MIPS_MT_SMTC */ - fpu_enable_hazard + enable_fpu_hazard li t1, FPU_DEFAULT ctc1t1, fcr31 diff --git a/include/asm-mips/asmmacro.h b/include/asm-mips/asmmacro.h index 92e62ef..c5f20df 100644 --- a/include/asm-mips/asmmacro.h +++ b/include/asm-mips/asmmacro.h @@ -52,21 +52,6 @@ .endm #endif /* CONFIG_MIPS_MT_SMTC */ -#ifdef CONFIG_CPU_SB1 - .macro fpu_enable_hazard - .setpush - .setnoreorder - .setmips2 - SSNOP - bnezl $0, .+4 -SSNOP - .setpop - .endm -#else - .macro fpu_enable_hazard - .endm -#endif - /* * Temporary until all gas have MT ASE support */ - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[MIPS] EMMA2RH: remove dead KGDB code
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d73d420708f456a63d7db2c504c62cd713381d7d Commit: d73d420708f456a63d7db2c504c62cd713381d7d Parent: f9509c84d8d9451ecd1731e922e7094b38ee336a Author: Sergei Shtylyov <[EMAIL PROTECTED]> AuthorDate: Wed May 16 20:35:13 2007 +0400 Committer: Ralf Baechle <[EMAIL PROTECTED]> CommitDate: Wed Jun 6 19:34:31 2007 +0100 [MIPS] EMMA2RH: remove dead KGDB code Get rid of the cross-arch KGDB specific code which shouldn't have been there in the first place... Signed-off-by: Sergey Shtylyov <[EMAIL PROTECTED]> Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]> --- arch/mips/emma2rh/markeins/setup.c | 24 1 files changed, 0 insertions(+), 24 deletions(-) diff --git a/arch/mips/emma2rh/markeins/setup.c b/arch/mips/emma2rh/markeins/setup.c index b29a447..2f060e1 100644 --- a/arch/mips/emma2rh/markeins/setup.c +++ b/arch/mips/emma2rh/markeins/setup.c @@ -115,30 +115,6 @@ extern void markeins_irq_setup(void); static void inline __init markeins_sio_setup(void) { -#ifdef CONFIG_KGDB_8250 - struct uart_port emma_port; - - memset(&emma_port, 0, sizeof(emma_port)); - - emma_port.flags = - UPF_BOOT_AUTOCONF | UPF_SKIP_TEST; - emma_port.iotype = UPIO_MEM; - emma_port.regshift = 4; /* I/O addresses are every 8 bytes */ - emma_port.uartclk = 18544000; /* Clock rate of the chip */ - - emma_port.line = 0; - emma_port.mapbase = KSEG1ADDR(EMMA2RH_PFUR0_BASE + 3); - emma_port.membase = (u8*)emma_port.mapbase; - early_serial_setup(&emma_port); - - emma_port.line = 1; - emma_port.mapbase = KSEG1ADDR(EMMA2RH_PFUR1_BASE + 3); - emma_port.membase = (u8*)emma_port.mapbase; - early_serial_setup(&emma_port); - - emma_port.irq = EMMA2RH_IRQ_PFUR1; - kgdb8250_add_port(1, &emma_port); -#endif } void __init plat_mem_setup(void) - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[MIPS] Drop __ARCH_WANT_SYS_FADVISE64
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1fe5f2c4503cf45806a47c608706fc7892649d4b Commit: 1fe5f2c4503cf45806a47c608706fc7892649d4b Parent: 22df5bc591ea2d0dbe8240fe8af0816b8a6533b9 Author: Atsushi Nemoto <[EMAIL PROTECTED]> AuthorDate: Fri May 18 00:53:47 2007 +0900 Committer: Ralf Baechle <[EMAIL PROTECTED]> CommitDate: Wed Jun 6 19:34:32 2007 +0100 [MIPS] Drop __ARCH_WANT_SYS_FADVISE64 sys_fadvise64() is not used on MIPS. The libc can implement both posix_fadvise() and posix_fadvise64() using sys_fadvise64_64(). Signed-off-by: Atsushi Nemoto <[EMAIL PROTECTED]> Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]> --- include/asm-mips/unistd.h |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h index 2f1087b..91c306f 100644 --- a/include/asm-mips/unistd.h +++ b/include/asm-mips/unistd.h @@ -949,7 +949,6 @@ #define __ARCH_WANT_SYS_UTIME #define __ARCH_WANT_SYS_WAITPID #define __ARCH_WANT_SYS_SOCKETCALL -#define __ARCH_WANT_SYS_FADVISE64 #define __ARCH_WANT_SYS_GETPGRP #define __ARCH_WANT_SYS_LLSEEK #define __ARCH_WANT_SYS_NICE - 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
[MIPS] Fix VGA corruption on RM300C
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=22df5bc591ea2d0dbe8240fe8af0816b8a6533b9 Commit: 22df5bc591ea2d0dbe8240fe8af0816b8a6533b9 Parent: 0c2bf745f9bdef7243ef5f04e6b05f592abead06 Author: Thomas Bogendoerfer <[EMAIL PROTECTED]> AuthorDate: Thu May 17 14:53:12 2007 +0200 Committer: Ralf Baechle <[EMAIL PROTECTED]> CommitDate: Wed Jun 6 19:34:31 2007 +0100 [MIPS] Fix VGA corruption on RM300C ... by setting DRAM config to 2MB (SNI always used that size). This also fixes video dram size detection in cirrusfb. Signed-off-by: Thomas Bogendoerfer <[EMAIL PROTECTED]> Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]> --- arch/mips/sni/setup.c | 33 - 1 files changed, 32 insertions(+), 1 deletions(-) diff --git a/arch/mips/sni/setup.c b/arch/mips/sni/setup.c index 68d7cf6..4fedfbd 100644 --- a/arch/mips/sni/setup.c +++ b/arch/mips/sni/setup.c @@ -6,7 +6,7 @@ * for more details. * * Copyright (C) 1996, 97, 98, 2000, 03, 04, 06 Ralf Baechle ([EMAIL PROTECTED]) - * Copyright (C) 2006 Thomas Bogendoerfer ([EMAIL PROTECTED]) + * Copyright (C) 2006,2007 Thomas Bogendoerfer ([EMAIL PROTECTED]) */ #include #include @@ -92,3 +92,34 @@ void __init plat_mem_setup(void) sni_display_setup(); } + +#if CONFIG_PCI + +#include +#include +#include + +static void __devinit quirk_cirrus_ram_size(struct pci_dev *dev) +{ + u16 cmd; + + /* +* firmware doesn't set the ram size correct, so we +* need to do it here, otherwise we get screen corruption +* on older Cirrus chips +*/ + pci_read_config_word (dev, PCI_COMMAND, &cmd); + if ((cmd & (PCI_COMMAND_IO|PCI_COMMAND_MEMORY)) + == (PCI_COMMAND_IO|PCI_COMMAND_MEMORY)) { + vga_wseq (NULL, CL_SEQR6, 0x12);/* unlock all extension registers */ + vga_wseq (NULL, CL_SEQRF, 0x18); + } +} + +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5434_8, +quirk_cirrus_ram_size); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5436, +quirk_cirrus_ram_size); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5446, +quirk_cirrus_ram_size); +#endif - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[MIPS] Fix some minor typoes in arch/mips/Kconfig.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=490dcc4d309141b622107ad5ad82674a01e089bc Commit: 490dcc4d309141b622107ad5ad82674a01e089bc Parent: cc8f0b827fdd616a3358fc939a2811bc0d6c3f79 Author: Robert P. J. Day <[EMAIL PROTECTED]> AuthorDate: Sun May 20 12:11:07 2007 -0400 Committer: Ralf Baechle <[EMAIL PROTECTED]> CommitDate: Wed Jun 6 19:34:33 2007 +0100 [MIPS] Fix some minor typoes in arch/mips/Kconfig. Signed-off-by: Robert P. J. Day <[EMAIL PROTECTED]> Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]> --- arch/mips/Kconfig |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 0f09412..9528ee9 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -747,9 +747,9 @@ config EARLY_PRINTK to print messages very early in the bootup process. This is useful for kernel debugging when your machine crashes very - early before the console code is initialized. For normal operation - it is not recommended because it looks on some machines ugly and - oesn't cooperate with an X server. You should normally N here, + early before the console code is initialized. For normal operation, + it is not recommended because it looks ugly on some machines and + doesn't cooperate with an X server. You should normally say N here, unless you want to debug such a crash. config SYS_HAS_EARLY_PRINTK - 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] 4422/1: Fix default value handling in gpio_direction_output (PXA)
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=29c349d22ccda5678a7dfb732093dbd3befcefa3 Commit: 29c349d22ccda5678a7dfb732093dbd3befcefa3 Parent: b6b27ae5e85fb193c08448157943b187958b8ca2 Author: Bill Gatliff <[EMAIL PROTECTED]> AuthorDate: Thu May 31 16:17:16 2007 +0100 Committer: Russell King <[EMAIL PROTECTED]> CommitDate: Sat Jun 2 21:31:48 2007 +0100 [ARM] 4422/1: Fix default value handling in gpio_direction_output (PXA) The default value passed through to pxa_gpio_mode() is lost due to a missing GPIO_DFLT_HIGH mask for nonzero values. The enclosed patch fixes this programming error. Signed-off-by: Bill Gatliff <[EMAIL PROTECTED]> Signed-off-by: Russell King <[EMAIL PROTECTED]> --- include/asm-arm/arch-pxa/gpio.h |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/include/asm-arm/arch-pxa/gpio.h b/include/asm-arm/arch-pxa/gpio.h index aeba243..9e99241 100644 --- a/include/asm-arm/arch-pxa/gpio.h +++ b/include/asm-arm/arch-pxa/gpio.h @@ -45,7 +45,8 @@ static inline int gpio_direction_input(unsigned gpio) static inline int gpio_direction_output(unsigned gpio, int value) { - return pxa_gpio_mode(gpio | GPIO_OUT | (value ? 0 : GPIO_DFLT_LOW)); + return pxa_gpio_mode(gpio | GPIO_OUT | + (value ? GPIO_DFLT_HIGH : GPIO_DFLT_LOW)); } static inline int __gpio_get_value(unsigned gpio) - 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] Solve buggy smp_processor_id() usage
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f72267c30f5a08f9a77c97417ec120e6943195f8 Commit: f72267c30f5a08f9a77c97417ec120e6943195f8 Parent: 29c349d22ccda5678a7dfb732093dbd3befcefa3 Author: Russell King <[EMAIL PROTECTED]> AuthorDate: Sat Jun 2 15:36:37 2007 +0100 Committer: Russell King <[EMAIL PROTECTED]> CommitDate: Sat Jun 2 21:31:49 2007 +0100 [ARM] Solve buggy smp_processor_id() usage BUG: using smp_processor_id() in preemptible [0001] code: opcontrol/427 Resolve this bug by ensuring that we're not using smp_processor_id() in a preemptable context (by disabling preemption.) Signed-off-by: Russell King <[EMAIL PROTECTED]> --- arch/arm/oprofile/op_model_mpcore.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/arm/oprofile/op_model_mpcore.c b/arch/arm/oprofile/op_model_mpcore.c index 7791da7..75bae06 100644 --- a/arch/arm/oprofile/op_model_mpcore.c +++ b/arch/arm/oprofile/op_model_mpcore.c @@ -200,8 +200,10 @@ static int em_call_function(int (*fn)(void)) data.fn = fn; data.ret = 0; + preempt_disable(); smp_call_function(em_func, &data, 1, 1); em_func(&data); + preempt_enable(); return data.ret; } - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[ARM] Fix 4417/1: Serial: Fix AMBA drivers locking
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=db002b8597df84643e949cce793d0f696f100c9e Commit: db002b8597df84643e949cce793d0f696f100c9e Parent: 0e5f82dda5e60a21cf8ba4f77334d60290277d2c Author: Russell King <[EMAIL PROTECTED]> AuthorDate: Tue Jun 5 19:39:49 2007 +0100 Committer: Russell King <[EMAIL PROTECTED]> CommitDate: Tue Jun 5 19:39:49 2007 +0100 [ARM] Fix 4417/1: Serial: Fix AMBA drivers locking 2389b272168ceec056ca1d8a870a97fa9c26e11a contains a merge bug; fix it. Signed-off-by: Russell King <[EMAIL PROTECTED]> --- drivers/serial/amba-pl010.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c index 00d1255..e88da72 100644 --- a/drivers/serial/amba-pl010.c +++ b/drivers/serial/amba-pl010.c @@ -167,9 +167,9 @@ static void pl010_rx_chars(struct uart_amba_port *uap) ignore_char: status = readb(uap->port.membase + UART01x_FR); } - spin_unlock(&port->lock); + spin_unlock(&uap->port.lock); tty_flip_buffer_push(tty); - spin_lock(&port->lock); + spin_lock(&uap->port.lock); } static void pl010_tx_chars(struct uart_amba_port *uap) - 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] pxa: fix pxa27x keyboard driver
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c0f85a82484c25d23b44a87a35daddb2b276b4aa Commit: c0f85a82484c25d23b44a87a35daddb2b276b4aa Parent: db002b8597df84643e949cce793d0f696f100c9e Author: Russell King <[EMAIL PROTECTED]> AuthorDate: Tue Jun 5 21:14:40 2007 +0100 Committer: Russell King <[EMAIL PROTECTED]> CommitDate: Tue Jun 5 21:14:40 2007 +0100 [ARM] pxa: fix pxa27x keyboard driver CKEN macro definitions no longer contains the bit number; remove it from usages in the pxa27x keyboard driver. Signed-off-by: Russell King <[EMAIL PROTECTED]> --- drivers/input/keyboard/pxa27x_keyboard.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/input/keyboard/pxa27x_keyboard.c b/drivers/input/keyboard/pxa27x_keyboard.c index 06eaf76..f9e82c9 100644 --- a/drivers/input/keyboard/pxa27x_keyboard.c +++ b/drivers/input/keyboard/pxa27x_keyboard.c @@ -104,7 +104,7 @@ static int pxakbd_open(struct input_dev *dev) KPREC = 0x7F; /* Enable unit clock */ - pxa_set_cken(CKEN19_KEYPAD, 1); + pxa_set_cken(CKEN_KEYPAD, 1); return 0; } @@ -112,7 +112,7 @@ static int pxakbd_open(struct input_dev *dev) static void pxakbd_close(struct input_dev *dev) { /* Disable clock unit */ - pxa_set_cken(CKEN19_KEYPAD, 0); + pxa_set_cken(CKEN_KEYPAD, 0); } #ifdef CONFIG_PM @@ -185,7 +185,7 @@ static int __devinit pxakbd_probe(struct platform_device *pdev) DRIVER_NAME, pdev); if (error) { printk(KERN_ERR "Cannot request keypad IRQ\n"); - pxa_set_cken(CKEN19_KEYPAD, 0); + pxa_set_cken(CKEN_KEYPAD, 0); goto err_free_dev; } - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
enable interrupts in user path of page fault.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e5e3c84b70e58fc605635fd340fb8dba3cc59058 Commit: e5e3c84b70e58fc605635fd340fb8dba3cc59058 Parent: c52ecdab06ff3b4d0f8914951eb74dc8b049f51c Author: Steven Rostedt <[EMAIL PROTECTED]> AuthorDate: Wed Jun 6 23:34:04 2007 -0400 Committer: Linus Torvalds <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 17:05:03 2007 -0700 enable interrupts in user path of page fault. This is a minor fix, but what is currently there is essentially wrong. In do_page_fault, if the faulting address from user code happens to be in kernel address space (int *p = (int*)-1; p = 0xbed;) then the do_page_fault handler will jump over the local_irq_enable with the goto bad_area_nosemaphore; But the first line there sees this is user code and goes through the process of sending a signal to send SIGSEGV to the user task. This whole time interrupts are disabled and the task can not be preempted by a higher priority task. This patch always enables interrupts in the user path of the bad_area_nosemaphore. Signed-off-by: Steven Rostedt <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> --- arch/i386/mm/fault.c |5 + arch/x86_64/mm/fault.c |6 ++ 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/arch/i386/mm/fault.c b/arch/i386/mm/fault.c index 29d7d61..1ecb3e4 100644 --- a/arch/i386/mm/fault.c +++ b/arch/i386/mm/fault.c @@ -458,6 +458,11 @@ bad_area: bad_area_nosemaphore: /* User mode accesses just cause a SIGSEGV */ if (error_code & 4) { + /* +* It's possible to have interrupts off here. +*/ + local_irq_enable(); + /* * Valid to do another page fault here because this one came * from user space. diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c index bfb62a1..635e58d 100644 --- a/arch/x86_64/mm/fault.c +++ b/arch/x86_64/mm/fault.c @@ -476,6 +476,12 @@ bad_area: bad_area_nosemaphore: /* User mode accesses just cause a SIGSEGV */ if (error_code & PF_USER) { + + /* +* It's possible to have interrupts off here. +*/ + local_irq_enable(); + if (is_prefetch(regs, address, error_code)) return; - 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
[BNX2]: Enable DMA on 5709.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0aa38df7cd5b6c5b89f5146f4a2286434bc4a8f3 Commit: 0aa38df7cd5b6c5b89f5146f4a2286434bc4a8f3 Parent: 641bdcd56c8bb2110a31da846b2752b11a644050 Author: Michael Chan <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 21:23:06 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 13:38:38 2007 -0700 [BNX2]: Enable DMA on 5709. Add missing code to enable DMA on 5709 A1. The bit is a no-op on A0 and therefore can be set on all 5709 chips. Signed-off-by: Michael Chan <[EMAIL PROTECTED]> Acked-by: Jeff Garzik <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- drivers/net/bnx2.c |5 + drivers/net/bnx2.h |1 + 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 9eba7a2..3b7ca2a 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c @@ -3815,6 +3815,11 @@ bnx2_init_chip(struct bnx2 *bp) /* Initialize the receive filter. */ bnx2_set_rx_mode(bp->dev); + if (CHIP_NUM(bp) == CHIP_NUM_5709) { + val = REG_RD(bp, BNX2_MISC_NEW_CORE_CTL); + val |= BNX2_MISC_NEW_CORE_CTL_DMA_ENABLE; + REG_WR(bp, BNX2_MISC_NEW_CORE_CTL, val); + } rc = bnx2_fw_sync(bp, BNX2_DRV_MSG_DATA_WAIT2 | BNX2_DRV_MSG_CODE_RESET, 0); diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index bd6288d..49a5de2 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h @@ -1373,6 +1373,7 @@ struct l2_fhdr { #define BNX2_MISC_NEW_CORE_CTL 0x08c8 #define BNX2_MISC_NEW_CORE_CTL_LINK_HOLDOFF_SUCCESS (1L<<0) #define BNX2_MISC_NEW_CORE_CTL_LINK_HOLDOFF_REQ (1L<<1) +#define BNX2_MISC_NEW_CORE_CTL_DMA_ENABLE (1L<<16) #define BNX2_MISC_NEW_CORE_CTL_RESERVED_CMN (0x3fffL<<2) #define BNX2_MISC_NEW_CORE_CTL_RESERVED_TC (0xL<<16) - 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
[IPV4]: Add default config support after inetdev_init
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=31be308541e990592a2d0a3e77e8e51bd0cea0e0 Commit: 31be308541e990592a2d0a3e77e8e51bd0cea0e0 Parent: 42f811b8bcdf6695bf74de580b1daf53445e8949 Author: Herbert Xu <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 23:35:37 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 13:39:19 2007 -0700 [IPV4]: Add default config support after inetdev_init Previously once inetdev_init has been called on a device any changes made to ipv4_devconf_dflt would have no effect on that device's configuration. This creates a problem since we have moved the point where inetdev_init is called from when an address is added to where the device is registered. This patch is the first half of a set that tries to mimic the old behaviour while still calling inetdev_init. It propagates any changes to ipv4_devconf_dflt to those devices that have not had the corresponding attribute set. The next patch will forcibly set all values at the point where inetdev_init was previously called. Signed-off-by: Herbert Xu <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- include/linux/inetdevice.h |3 + net/ipv4/devinet.c | 133 2 files changed, 101 insertions(+), 35 deletions(-) diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 1ef174d..40adefd 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h @@ -3,6 +3,7 @@ #ifdef __KERNEL__ +#include #include #include #include @@ -12,6 +13,7 @@ struct ipv4_devconf { void*sysctl; int data[__NET_IPV4_CONF_MAX - 1]; + DECLARE_BITMAP(state, __NET_IPV4_CONF_MAX - 1); }; extern struct ipv4_devconf ipv4_devconf; @@ -53,6 +55,7 @@ static inline void ipv4_devconf_set(struct in_device *in_dev, int index, int val) { index--; + set_bit(index, in_dev->cnf.state); in_dev->cnf.data[index] = val; } diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 0094066..e197347 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -1244,6 +1244,91 @@ errout: #ifdef CONFIG_SYSCTL +static void devinet_copy_dflt_conf(int i) +{ + struct net_device *dev; + + read_lock(&dev_base_lock); + for_each_netdev(dev) { + struct in_device *in_dev; + rcu_read_lock(); + in_dev = __in_dev_get_rcu(dev); + if (in_dev && !test_bit(i, in_dev->cnf.state)) + in_dev->cnf.data[i] = ipv4_devconf_dflt.data[i]; + rcu_read_unlock(); + } + read_unlock(&dev_base_lock); +} + +static int devinet_conf_proc(ctl_table *ctl, int write, +struct file* filp, void __user *buffer, +size_t *lenp, loff_t *ppos) +{ + int ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos); + + if (write) { + struct ipv4_devconf *cnf = ctl->extra1; + int i = (int *)ctl->data - cnf->data; + + set_bit(i, cnf->state); + + if (cnf == &ipv4_devconf_dflt) + devinet_copy_dflt_conf(i); + } + + return ret; +} + +static int devinet_conf_sysctl(ctl_table *table, int __user *name, int nlen, + void __user *oldval, size_t __user *oldlenp, + void __user *newval, size_t newlen) +{ + struct ipv4_devconf *cnf; + int *valp = table->data; + int new; + int i; + + if (!newval || !newlen) + return 0; + + if (newlen != sizeof(int)) + return -EINVAL; + + if (get_user(new, (int __user *)newval)) + return -EFAULT; + + if (new == *valp) + return 0; + + if (oldval && oldlenp) { + size_t len; + + if (get_user(len, oldlenp)) + return -EFAULT; + + if (len) { + if (len > table->maxlen) + len = table->maxlen; + if (copy_to_user(oldval, valp, len)) + return -EFAULT; + if (put_user(len, oldlenp)) + return -EFAULT; + } + } + + *valp = new; + + cnf = table->extra1; + i = (int *)table->data - cnf->data; + + set_bit(i, cnf->state); + + if (cnf == &ipv4_devconf_dflt) + devinet_copy_dflt_conf(i); + + return 1; +} + void inet_forward_change(void) { struct net_device *dev; @@ -1302,40 +1387,13 @@ int ipv4_doint_and_flush_strategy(ctl_table *table, int __user *name, int nlen, void __user *oldval, size_t __user
[IPV4]: Restore old behaviour of default config values
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=71e27da9618b5f4d525ec821def83991da20429f Commit: 71e27da9618b5f4d525ec821def83991da20429f Parent: 31be308541e990592a2d0a3e77e8e51bd0cea0e0 Author: Herbert Xu <[EMAIL PROTECTED]> AuthorDate: Mon Jun 4 23:36:06 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 13:39:26 2007 -0700 [IPV4]: Restore old behaviour of default config values Previously inet devices were only constructed when addresses are added (or rarely in ipmr). Therefore the default config values they get are the ones at the time of these operations. Now that we're creating inet devices earlier, this changes the behaviour of default config values in an incompatible way (see bug #8519). This patch creates a compromise by setting the default values at the same point as before but only for those that have not been explicitly set by the user since the inet device's creation. Signed-off-by: Herbert Xu <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- include/linux/inetdevice.h |6 +- net/ipv4/devinet.c | 19 --- net/ipv4/ipmr.c| 15 +++ 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 40adefd..ae04901 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h @@ -59,6 +59,11 @@ static inline void ipv4_devconf_set(struct in_device *in_dev, int index, in_dev->cnf.data[index] = val; } +static inline void ipv4_devconf_setall(struct in_device *in_dev) +{ + bitmap_fill(in_dev->cnf.state, __NET_IPV4_CONF_MAX - 1); +} + #define IN_DEV_CONF_GET(in_dev, attr) \ ipv4_devconf_get((in_dev), NET_IPV4_CONF_ ## attr) #define IN_DEV_CONF_SET(in_dev, attr, val) \ @@ -125,7 +130,6 @@ extern struct net_device*ip_dev_find(__be32 addr); extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b); extern int devinet_ioctl(unsigned int cmd, void __user *); extern voiddevinet_init(void); -extern struct in_device *inetdev_init(struct net_device *dev); extern struct in_device*inetdev_by_index(int); extern __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope); extern __be32 inet_confirm_addr(const struct net_device *dev, __be32 dst, __be32 local, int scope); diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index e197347..354e800 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -147,7 +147,7 @@ void in_dev_finish_destroy(struct in_device *idev) } } -struct in_device *inetdev_init(struct net_device *dev) +static struct in_device *inetdev_init(struct net_device *dev) { struct in_device *in_dev; @@ -405,12 +405,10 @@ static int inet_set_ifa(struct net_device *dev, struct in_ifaddr *ifa) ASSERT_RTNL(); if (!in_dev) { - in_dev = inetdev_init(dev); - if (!in_dev) { - inet_free_ifa(ifa); - return -ENOBUFS; - } + inet_free_ifa(ifa); + return -ENOBUFS; } + ipv4_devconf_setall(in_dev); if (ifa->ifa_dev != in_dev) { BUG_TRAP(!ifa->ifa_dev); in_dev_hold(in_dev); @@ -520,13 +518,12 @@ static struct in_ifaddr *rtm_to_ifaddr(struct nlmsghdr *nlh) in_dev = __in_dev_get_rtnl(dev); if (in_dev == NULL) { - in_dev = inetdev_init(dev); - if (in_dev == NULL) { - err = -ENOBUFS; - goto errout; - } + err = -ENOBUFS; + goto errout; } + ipv4_devconf_setall(in_dev); + ifa = inet_alloc_ifa(); if (ifa == NULL) { /* diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index d570d3a..d96582a 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c @@ -152,9 +152,11 @@ struct net_device *ipmr_new_tunnel(struct vifctl *v) dev->flags |= IFF_MULTICAST; in_dev = __in_dev_get_rtnl(dev); - if (in_dev == NULL && (in_dev = inetdev_init(dev)) == NULL) + if (in_dev == NULL) goto failure; - IN_DEV_CONF_SET(in_dev, RP_FILTER, 0); + + ipv4_devconf_setall(in_dev); + IPV4_DEVCONF(in_dev->cnf, RP_FILTER) = 0; if (dev_open(dev)) goto failure; @@ -218,10 +220,15 @@ static struct net_device *ipmr_reg_vif(void) } dev->iflink = 0; - if ((in_dev = inetdev_init(dev)) == NULL) + rcu_read_lock(); + if ((in_dev = __in_dev_get_rcu(dev)) == NULL) { +
[NET]: Merge dst_discard_in and dst_discard_out.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c4b1010f406d7c3f819c22a6323c46776d5b148c Commit: c4b1010f406d7c3f819c22a6323c46776d5b148c Parent: c36befb52350fa76bf3cb03d13ba2e17dbe8a508 Author: Denis Cheng <[EMAIL PROTECTED]> AuthorDate: Tue Jun 5 00:06:57 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 13:39:46 2007 -0700 [NET]: Merge dst_discard_in and dst_discard_out. Signed-off-by: Denis Cheng <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- net/core/dst.c | 17 - 1 files changed, 4 insertions(+), 13 deletions(-) diff --git a/net/core/dst.c b/net/core/dst.c index 764bccb..c6a0587 100644 --- a/net/core/dst.c +++ b/net/core/dst.c @@ -111,13 +111,7 @@ out: spin_unlock(&dst_lock); } -static int dst_discard_in(struct sk_buff *skb) -{ - kfree_skb(skb); - return 0; -} - -static int dst_discard_out(struct sk_buff *skb) +static int dst_discard(struct sk_buff *skb) { kfree_skb(skb); return 0; @@ -138,8 +132,7 @@ void * dst_alloc(struct dst_ops * ops) dst->ops = ops; dst->lastuse = jiffies; dst->path = dst; - dst->input = dst_discard_in; - dst->output = dst_discard_out; + dst->input = dst->output = dst_discard; #if RT_CACHE_DEBUG >= 2 atomic_inc(&dst_total); #endif @@ -153,8 +146,7 @@ static void ___dst_free(struct dst_entry * dst) protocol module is unloaded. */ if (dst->dev == NULL || !(dst->dev->flags&IFF_UP)) { - dst->input = dst_discard_in; - dst->output = dst_discard_out; + dst->input = dst->output = dst_discard; } dst->obsolete = 2; } @@ -242,8 +234,7 @@ static inline void dst_ifdown(struct dst_entry *dst, struct net_device *dev, return; if (!unregister) { - dst->input = dst_discard_in; - dst->output = dst_discard_out; + dst->input = dst->output = dst_discard; } else { dst->dev = &loopback_dev; dev_hold(&loopback_dev); - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[TCP]: Use LIMIT_NETDEBUG in tcp_retransmit_timer().
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=274707cff9810b784c548ed169298617a1bc3528 Commit: 274707cff9810b784c548ed169298617a1bc3528 Parent: c4b1010f406d7c3f819c22a6323c46776d5b148c Author: Eric Dumazet <[EMAIL PROTECTED]> AuthorDate: Tue Jun 5 00:16:12 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 13:40:08 2007 -0700 [TCP]: Use LIMIT_NETDEBUG in tcp_retransmit_timer(). LIMIT_NETDEBUG allows the admin to disable some warning messages (echo 0 >/proc/sys/net/core/warnings). The "TCP: Treason uncloaked!" message can use this facility. Signed-off-by: Eric Dumazet <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- net/ipv4/tcp_timer.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index e613401..e9b151b 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c @@ -292,9 +292,9 @@ static void tcp_retransmit_timer(struct sock *sk) * we cannot allow such beasts to hang infinitely. */ #ifdef TCP_DEBUG - if (net_ratelimit()) { + if (1) { struct inet_sock *inet = inet_sk(sk); - printk(KERN_DEBUG "TCP: Treason uncloaked! Peer %u.%u.%u.%u:%u/%u shrinks window %u:%u. Repaired.\n", + LIMIT_NETDEBUG(KERN_DEBUG "TCP: Treason uncloaked! Peer %u.%u.%u.%u:%u/%u shrinks window %u:%u. Repaired.\n", NIPQUAD(inet->daddr), ntohs(inet->dport), inet->num, tp->snd_una, tp->snd_nxt); } - 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
[TCP] tcp_probe: Attach printf attribute properly to printl().
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=14a49e1fd2bb91ba2bf0e1f06711b6dbc21de02d Commit: 14a49e1fd2bb91ba2bf0e1f06711b6dbc21de02d Parent: 274707cff9810b784c548ed169298617a1bc3528 Author: David S. Miller <[EMAIL PROTECTED]> AuthorDate: Tue Jun 5 00:19:24 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 13:40:09 2007 -0700 [TCP] tcp_probe: Attach printf attribute properly to printl(). GCC doesn't like the way Stephen initially did it: net/ipv4/tcp_probe.c:83: warning: empty declaration Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- net/ipv4/tcp_probe.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c index 760165a..d9323df 100644 --- a/net/ipv4/tcp_probe.c +++ b/net/ipv4/tcp_probe.c @@ -63,6 +63,9 @@ struct { * FIXME: causes an extra copy */ static void printl(const char *fmt, ...) + __attribute__ ((format (printf, 1, 2))); + +static void printl(const char *fmt, ...) { va_list args; int len; @@ -80,8 +83,7 @@ static void printl(const char *fmt, ...) kfifo_put(tcpw.fifo, tbuf, len); wake_up(&tcpw.wait); -} __attribute__ ((format (printf, 1, 2))); - +} /* * Hook inserted to be called before each receive packet. - 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
[RTNETLINK]: ifindex 0 does not exist
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=51055be81c3cb14d0165a7432b787098b817fd35 Commit: 51055be81c3cb14d0165a7432b787098b817fd35 Parent: ef7c79ed645f52bcbdd88f8d54a9702c4d3fd15d Author: Patrick McHardy <[EMAIL PROTECTED]> AuthorDate: Tue Jun 5 12:40:01 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 13:40:11 2007 -0700 [RTNETLINK]: ifindex 0 does not exist ifindex == 0 does not exist and implies we should do a lookup by name if one was given. Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- net/core/rtnetlink.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index a8a5093..02e8bf0 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -580,7 +580,7 @@ static int rtnl_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) err = -EINVAL; ifm = nlmsg_data(nlh); - if (ifm->ifi_index >= 0) + if (ifm->ifi_index > 0) dev = dev_get_by_index(ifm->ifi_index); else if (tb[IFLA_IFNAME]) dev = dev_get_by_name(ifname); @@ -672,7 +672,7 @@ static int rtnl_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) * name provided implies that a name change has been * requested. */ - if (ifm->ifi_index >= 0 && ifname[0]) { + if (ifm->ifi_index > 0 && ifname[0]) { err = dev_change_name(dev, ifname); if (err < 0) goto errout_dev; @@ -740,7 +740,7 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) return err; ifm = nlmsg_data(nlh); - if (ifm->ifi_index >= 0) { + if (ifm->ifi_index > 0) { dev = dev_get_by_index(ifm->ifi_index); if (dev == NULL) return -ENODEV; - 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
[NETFILTER]: nf_conntrack: fix helper module unload races
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3c158f7f57601bc27eab82f0dc4fd3fad314d845 Commit: 3c158f7f57601bc27eab82f0dc4fd3fad314d845 Parent: 51055be81c3cb14d0165a7432b787098b817fd35 Author: Patrick McHarrdy <[EMAIL PROTECTED]> AuthorDate: Tue Jun 5 12:55:27 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 13:40:26 2007 -0700 [NETFILTER]: nf_conntrack: fix helper module unload races When a helper module is unloaded all conntracks refering to it have their helper pointer NULLed out, leading to lots of races. In most places this can be fixed by proper use of RCU (they do already check for != NULL, but in a racy way), additionally nf_conntrack_expect_related needs to bail out when no helper is present. Also remove two paranoid BUG_ONs in nf_conntrack_proto_gre that are racy and not worth fixing. Signed-off-by: Patrick McHarrdy <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c | 13 +--- net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c |9 +- net/netfilter/nf_conntrack_core.c | 26 - net/netfilter/nf_conntrack_expect.c|4 +++ net/netfilter/nf_conntrack_helper.c|2 +- net/netfilter/nf_conntrack_netlink.c | 34 --- net/netfilter/nf_conntrack_proto_gre.c |2 - 7 files changed, 61 insertions(+), 29 deletions(-) diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c index fd62a41..6dc72a8 100644 --- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c +++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c @@ -133,6 +133,7 @@ static unsigned int ipv4_conntrack_help(unsigned int hooknum, struct nf_conn *ct; enum ip_conntrack_info ctinfo; struct nf_conn_help *help; + struct nf_conntrack_helper *helper; /* This is where we call the helper: as the packet goes out. */ ct = nf_ct_get(*pskb, &ctinfo); @@ -140,12 +141,14 @@ static unsigned int ipv4_conntrack_help(unsigned int hooknum, return NF_ACCEPT; help = nfct_help(ct); - if (!help || !help->helper) + if (!help) return NF_ACCEPT; - - return help->helper->help(pskb, - skb_network_offset(*pskb) + ip_hdrlen(*pskb), - ct, ctinfo); + /* rcu_read_lock()ed by nf_hook_slow */ + helper = rcu_dereference(help->helper); + if (!helper) + return NF_ACCEPT; + return helper->help(pskb, skb_network_offset(*pskb) + ip_hdrlen(*pskb), + ct, ctinfo); } static unsigned int ipv4_conntrack_defrag(unsigned int hooknum, diff --git a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c index dc442fb..1b1797f 100644 --- a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c +++ b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c @@ -160,6 +160,7 @@ static unsigned int ipv6_confirm(unsigned int hooknum, { struct nf_conn *ct; struct nf_conn_help *help; + struct nf_conntrack_helper *helper; enum ip_conntrack_info ctinfo; unsigned int ret, protoff; unsigned int extoff = (u8 *)(ipv6_hdr(*pskb) + 1) - (*pskb)->data; @@ -172,7 +173,11 @@ static unsigned int ipv6_confirm(unsigned int hooknum, goto out; help = nfct_help(ct); - if (!help || !help->helper) + if (!help) + goto out; + /* rcu_read_lock()ed by nf_hook_slow */ + helper = rcu_dereference(help->helper); + if (!helper) goto out; protoff = nf_ct_ipv6_skip_exthdr(*pskb, extoff, &pnum, @@ -182,7 +187,7 @@ static unsigned int ipv6_confirm(unsigned int hooknum, return NF_ACCEPT; } - ret = help->helper->help(pskb, protoff, ct, ctinfo); + ret = helper->help(pskb, protoff, ct, ctinfo); if (ret != NF_ACCEPT) return ret; out: diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index 483e927..7a15e30 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c @@ -350,9 +350,15 @@ static void death_by_timeout(unsigned long ul_conntrack) { struct nf_conn *ct = (void *)ul_conntrack; struct nf_conn_help *help = nfct_help(ct); + struct nf_conntrack_helper *helper; - if (help && help->helper && help->helper->destroy) - help->helper->destroy(ct); + if (help) { + rcu_read_lock(); + helper = rcu_dereference(help->helper); + if (helper && helper->destroy) + helper->destroy(ct); + rcu_read_unlock(); + } write_loc
[NET_SCHED]: Fix filter double free
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b00b4bf94edb42852d55619af453588b2de2dc5e Commit: b00b4bf94edb42852d55619af453588b2de2dc5e Parent: 7c355f532dd43036622e1880c114773463bafd23 Author: Patrick McHardy <[EMAIL PROTECTED]> AuthorDate: Tue Jun 5 16:06:59 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 13:41:05 2007 -0700 [NET_SCHED]: Fix filter double free cbq and atm destroy their filters twice when destroying inner classes during qdisc destruction. Reported-and-tested-by: Strobl Anton <[EMAIL PROTECTED]> Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- net/sched/sch_atm.c |1 + net/sched/sch_cbq.c |8 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c index be7d299..d1c383f 100644 --- a/net/sched/sch_atm.c +++ b/net/sched/sch_atm.c @@ -599,6 +599,7 @@ static void atm_tc_destroy(struct Qdisc *sch) /* races ? */ while ((flow = p->flows)) { tcf_destroy_chain(flow->filter_list); + flow->filter_list = NULL; if (flow->ref > 1) printk(KERN_ERR "atm_destroy: %p->ref = %d\n",flow, flow->ref); diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index a294542..ee2d596 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c @@ -1748,10 +1748,12 @@ cbq_destroy(struct Qdisc* sch) * classes from root to leafs which means that filters can still * be bound to classes which have been destroyed already. --TGR '04 */ - for (h = 0; h < 16; h++) - for (cl = q->classes[h]; cl; cl = cl->next) + for (h = 0; h < 16; h++) { + for (cl = q->classes[h]; cl; cl = cl->next) { tcf_destroy_chain(cl->filter_list); - + cl->filter_list = NULL; + } + } for (h = 0; h < 16; h++) { struct cbq_class *next; - 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
[SPARC64]: Fix 2 bugs in PCI Sabre bus scanning.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=321566c2504445160b18e1508a73081579923a6b Commit: 321566c2504445160b18e1508a73081579923a6b Parent: 7244d545c123ff33a3a5bff7fcb96a07778c32d1 Author: David S. Miller <[EMAIL PROTECTED]> AuthorDate: Wed Jun 6 14:03:08 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 16:59:46 2007 -0700 [SPARC64]: Fix 2 bugs in PCI Sabre bus scanning. If we are on hummingbird, bus runs at 66MHZ. pbm->pci_bus should be setup with the result of pci_scan_one_pbm() or else we deref NULL pointers in the error interrupt handlers. Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- arch/sparc64/kernel/pci_sabre.c | 17 +++-- 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/arch/sparc64/kernel/pci_sabre.c b/arch/sparc64/kernel/pci_sabre.c index 323d6c2..22e1be5 100644 --- a/arch/sparc64/kernel/pci_sabre.c +++ b/arch/sparc64/kernel/pci_sabre.c @@ -636,13 +636,18 @@ static void apb_init(struct pci_bus *sabre_bus) static void sabre_scan_bus(struct pci_pbm_info *pbm) { static int once; - struct pci_bus *pbus; /* The APB bridge speaks to the Sabre host PCI bridge * at 66Mhz, but the front side of APB runs at 33Mhz * for both segments. +* +* Hummingbird systems do not use APB, so they run +* at 66MHZ. */ - pbm->is_66mhz_capable = 0; + if (hummingbird_p) + pbm->is_66mhz_capable = 1; + else + pbm->is_66mhz_capable = 0; /* This driver has not been verified to handle * multiple SABREs yet, so trap this. @@ -656,13 +661,13 @@ static void sabre_scan_bus(struct pci_pbm_info *pbm) } once++; - pbus = pci_scan_one_pbm(pbm); - if (!pbus) + pbm->pci_bus = pci_scan_one_pbm(pbm); + if (!pbm->pci_bus) return; - sabre_root_bus = pbus; + sabre_root_bus = pbm->pci_bus; - apb_init(pbus); + apb_init(pbm->pci_bus); sabre_register_error_handlers(pbm); } - 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
[SPARC64]: Fix SBUS IRQ regression caused by PCI-E driver.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ec4d18f219e71ef682fe2d7b9a6d121617fef6d5 Commit: ec4d18f219e71ef682fe2d7b9a6d121617fef6d5 Parent: 321566c2504445160b18e1508a73081579923a6b Author: David S. Miller <[EMAIL PROTECTED]> AuthorDate: Thu Jun 7 16:58:22 2007 -0700 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Thu Jun 7 16:59:51 2007 -0700 [SPARC64]: Fix SBUS IRQ regression caused by PCI-E driver. We used to access the 64-bit IRQ IMAP and ICLR registers of bus controllers 4-bytes in and as a 32-bit register word, since only the low 32-bits were relevant. This seemed like a good idea at the time. But the PCI-E controller requires full 8-byte 64-bit access to these registers, so we switched over to accessing them fully. SBUS was not adjusted properly, which broke interrupts completely. Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- arch/sparc64/kernel/prom.c | 54 ++-- arch/sparc64/kernel/sbus.c | 54 ++-- 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c index 6f4a528..61036b3 100644 --- a/arch/sparc64/kernel/prom.c +++ b/arch/sparc64/kernel/prom.c @@ -933,29 +933,29 @@ static void __init fire_irq_trans_init(struct device_node *dp) * This should conform to both Sunfire/Wildfire server and Fusion * desktop designs. */ -#define SYSIO_IMAP_SLOT0 0x2c04UL -#define SYSIO_IMAP_SLOT1 0x2c0cUL -#define SYSIO_IMAP_SLOT2 0x2c14UL -#define SYSIO_IMAP_SLOT3 0x2c1cUL -#define SYSIO_IMAP_SCSI0x3004UL -#define SYSIO_IMAP_ETH 0x300cUL -#define SYSIO_IMAP_BPP 0x3014UL -#define SYSIO_IMAP_AUDIO 0x301cUL -#define SYSIO_IMAP_PFAIL 0x3024UL -#define SYSIO_IMAP_KMS 0x302cUL -#define SYSIO_IMAP_FLPY0x3034UL -#define SYSIO_IMAP_SHW 0x303cUL -#define SYSIO_IMAP_KBD 0x3044UL -#define SYSIO_IMAP_MS 0x304cUL -#define SYSIO_IMAP_SER 0x3054UL -#define SYSIO_IMAP_TIM00x3064UL -#define SYSIO_IMAP_TIM10x306cUL -#define SYSIO_IMAP_UE 0x3074UL -#define SYSIO_IMAP_CE 0x307cUL -#define SYSIO_IMAP_SBERR 0x3084UL -#define SYSIO_IMAP_PMGMT 0x308cUL -#define SYSIO_IMAP_GFX 0x3094UL -#define SYSIO_IMAP_EUPA0x309cUL +#define SYSIO_IMAP_SLOT0 0x2c00UL +#define SYSIO_IMAP_SLOT1 0x2c08UL +#define SYSIO_IMAP_SLOT2 0x2c10UL +#define SYSIO_IMAP_SLOT3 0x2c18UL +#define SYSIO_IMAP_SCSI0x3000UL +#define SYSIO_IMAP_ETH 0x3008UL +#define SYSIO_IMAP_BPP 0x3010UL +#define SYSIO_IMAP_AUDIO 0x3018UL +#define SYSIO_IMAP_PFAIL 0x3020UL +#define SYSIO_IMAP_KMS 0x3028UL +#define SYSIO_IMAP_FLPY0x3030UL +#define SYSIO_IMAP_SHW 0x3038UL +#define SYSIO_IMAP_KBD 0x3040UL +#define SYSIO_IMAP_MS 0x3048UL +#define SYSIO_IMAP_SER 0x3050UL +#define SYSIO_IMAP_TIM00x3060UL +#define SYSIO_IMAP_TIM10x3068UL +#define SYSIO_IMAP_UE 0x3070UL +#define SYSIO_IMAP_CE 0x3078UL +#define SYSIO_IMAP_SBERR 0x3080UL +#define SYSIO_IMAP_PMGMT 0x3088UL +#define SYSIO_IMAP_GFX 0x3090UL +#define SYSIO_IMAP_EUPA0x3098UL #define bogon ((unsigned long) -1) static unsigned long sysio_irq_offsets[] = { @@ -1006,10 +1006,10 @@ static unsigned long sysio_irq_offsets[] = { * Interrupt Clear register pointer, SYSIO specific version. */ #define SYSIO_ICLR_UNUSED0 0x3400UL -#define SYSIO_ICLR_SLOT0 0x340cUL -#define SYSIO_ICLR_SLOT1 0x344cUL -#define SYSIO_ICLR_SLOT2 0x348cUL -#define SYSIO_ICLR_SLOT3 0x34ccUL +#define SYSIO_ICLR_SLOT0 0x3408UL +#define SYSIO_ICLR_SLOT1 0x3448UL +#define SYSIO_ICLR_SLOT2 0x3488UL +#define SYSIO_ICLR_SLOT3 0x34c8UL static unsigned long sysio_imap_to_iclr(unsigned long imap) { unsigned long diff = SYSIO_ICLR_UNUSED0 - SYSIO_IMAP_SLOT0; diff --git a/arch/sparc64/kernel/sbus.c b/arch/sparc64/kernel/sbus.c index 91f6e2a..a1fd9bc 100644 --- a/arch/sparc64/kernel/sbus.c +++ b/arch/sparc64/kernel/sbus.c @@ -629,29 +629,29 @@ void sbus_set_sbus64(struct sbus_dev *sdev, int bursts) * This should conform to both Sunfire/Wildfire server and Fusion * desktop designs. */ -#define SYSIO_IMAP_SLOT0 0x2c04UL -#define SYSIO_IMAP_SLOT1 0x2c0cUL -#define SYSIO_IMAP_SLOT2 0x2c14UL -#define SYSIO_IMAP_SLOT3 0x2c1cUL -#define SYSIO_IMAP_SCSI0x3004UL -#define SYSIO_IMAP_ETH 0x300cUL -#define SYSIO_IMAP_BPP 0x3014UL -#define SYSIO_IMAP_AUDIO 0x301cUL -#define SYSIO_IMAP_PFAIL 0x3024UL -#define SYSIO_IMAP_KMS 0x302cUL -#define SYSIO_
[XTENSA] fix sources using deprecated assembler directive
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a0bb46ba074d2442e96f55c997293767340f4ce9 Commit: a0bb46ba074d2442e96f55c997293767340f4ce9 Parent: 4af410a868fc6aa9b19379599feac7e79d95 Author: Chris Zankel <[EMAIL PROTECTED]> AuthorDate: Thu May 31 17:44:31 2007 -0700 Committer: Chris Zankel <[EMAIL PROTECTED]> CommitDate: Thu May 31 17:44:31 2007 -0700 [XTENSA] fix sources using deprecated assembler directive The assembler directive '.begin literal' is deprecated in the newer versions of the binutils (strncopy_user.S and strnlen_user.S). Signed-off-by: Chris Zankel <[EMAIL PROTECTED]> --- arch/xtensa/lib/strncpy_user.S | 33 + arch/xtensa/lib/strnlen_user.S | 33 + 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/arch/xtensa/lib/strncpy_user.S b/arch/xtensa/lib/strncpy_user.S index a834057..b2655d9 100644 --- a/arch/xtensa/lib/strncpy_user.S +++ b/arch/xtensa/lib/strncpy_user.S @@ -25,18 +25,18 @@ /* * char *__strncpy_user(char *dst, const char *src, size_t len) */ -.text -.begin literal -.align 4 -.Lmask0: - .byte 0xff, 0x00, 0x00, 0x00 -.Lmask1: - .byte 0x00, 0xff, 0x00, 0x00 -.Lmask2: - .byte 0x00, 0x00, 0xff, 0x00 -.Lmask3: - .byte 0x00, 0x00, 0x00, 0xff -.end literal + +#ifdef __XTENSA_EB__ +# define MASK0 0xff00 +# define MASK1 0x00ff +# define MASK2 0xff00 +# define MASK3 0x00ff +#else +# define MASK0 0x00ff +# define MASK1 0xff00 +# define MASK2 0x00ff +# define MASK3 0xff00 +#endif # Register use # a0/ return address @@ -53,6 +53,7 @@ # a11/ dst # a12/ tmp +.text .align 4 .global__strncpy_user .type __strncpy_user,@function @@ -61,10 +62,10 @@ __strncpy_user: # a2/ dst, a3/ src, a4/ len mov a11, a2 # leave dst in return value register beqza4, .Lret # if len is zero - l32ra5, .Lmask0 # mask for byte 0 - l32ra6, .Lmask1 # mask for byte 1 - l32ra7, .Lmask2 # mask for byte 2 - l32ra8, .Lmask3 # mask for byte 3 + movia5, MASK0 # mask for byte 0 + movia6, MASK1 # mask for byte 1 + movia7, MASK2 # mask for byte 2 + movia8, MASK3 # mask for byte 3 bbsi.l a3, 0, .Lsrc1mod2 # if only 8-bit aligned bbsi.l a3, 1, .Lsrc2mod4 # if only 16-bit aligned .Lsrcaligned: # return here when src is word-aligned diff --git a/arch/xtensa/lib/strnlen_user.S b/arch/xtensa/lib/strnlen_user.S index 5e9c1e7..ad3f616 100644 --- a/arch/xtensa/lib/strnlen_user.S +++ b/arch/xtensa/lib/strnlen_user.S @@ -24,18 +24,18 @@ /* * size_t __strnlen_user(const char *s, size_t len) */ -.text -.begin literal -.align 4 -.Lmask0: - .byte 0xff, 0x00, 0x00, 0x00 -.Lmask1: - .byte 0x00, 0xff, 0x00, 0x00 -.Lmask2: - .byte 0x00, 0x00, 0xff, 0x00 -.Lmask3: - .byte 0x00, 0x00, 0x00, 0xff -.end literal + +#ifdef __XTENSA_EB__ +# define MASK0 0xff00 +# define MASK1 0x00ff +# define MASK2 0xff00 +# define MASK3 0x00ff +#else +# define MASK0 0x00ff +# define MASK1 0xff00 +# define MASK2 0x00ff +# define MASK3 0xff00 +#endif # Register use: # a2/ src @@ -48,6 +48,7 @@ # a9/ tmp # a10/ tmp +.text .align 4 .global__strnlen_user .type __strnlen_user,@function @@ -56,10 +57,10 @@ __strnlen_user: # a2/ s, a3/ len addia4, a2, -4 # because we overincrement at the end; # we compensate with load offsets of 4 - l32ra5, .Lmask0 # mask for byte 0 - l32ra6, .Lmask1 # mask for byte 1 - l32ra7, .Lmask2 # mask for byte 2 - l32ra8, .Lmask3 # mask for byte 3 + movia5, MASK0 # mask for byte 0 + movia6, MASK1 # mask for byte 1 + movia7, MASK2 # mask for byte 2 + movia8, MASK3 # mask for byte 3 bbsi.l a2, 0, .L1mod2 # if only 8-bit aligned bbsi.l a2, 1, .L2mod4 # if only 16-bit aligned - 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
[XTENSA] Remove multi-exported symbols from xtensa_ksyms.c
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=54213baf643dd14d3bc06ca7575a817d79a350c2 Commit: 54213baf643dd14d3bc06ca7575a817d79a350c2 Parent: a0bb46ba074d2442e96f55c997293767340f4ce9 Author: Chris Zankel <[EMAIL PROTECTED]> AuthorDate: Thu May 31 17:45:23 2007 -0700 Committer: Chris Zankel <[EMAIL PROTECTED]> CommitDate: Thu May 31 17:45:23 2007 -0700 [XTENSA] Remove multi-exported symbols from xtensa_ksyms.c This patch removes the following symbols from arch/xtensa/kernel/xtensa_ksyms.c that were already exported: memcmp, memchr, strcat, strchr, strlen, stncat, strnlen, strrchr, strstr, enable_irq, and disable_irq Signed-off-by: Chris Zankel <[EMAIL PROTECTED]> --- arch/xtensa/kernel/xtensa_ksyms.c | 11 --- 1 files changed, 0 insertions(+), 11 deletions(-) diff --git a/arch/xtensa/kernel/xtensa_ksyms.c b/arch/xtensa/kernel/xtensa_ksyms.c index cd7e6a0..60dbdb4 100644 --- a/arch/xtensa/kernel/xtensa_ksyms.c +++ b/arch/xtensa/kernel/xtensa_ksyms.c @@ -38,21 +38,10 @@ /* * String functions */ -EXPORT_SYMBOL(memcmp); EXPORT_SYMBOL(memset); EXPORT_SYMBOL(memcpy); EXPORT_SYMBOL(memmove); -EXPORT_SYMBOL(memchr); -EXPORT_SYMBOL(strcat); -EXPORT_SYMBOL(strchr); -EXPORT_SYMBOL(strlen); -EXPORT_SYMBOL(strncat); -EXPORT_SYMBOL(strnlen); -EXPORT_SYMBOL(strrchr); -EXPORT_SYMBOL(strstr); -EXPORT_SYMBOL(enable_irq); -EXPORT_SYMBOL(disable_irq); EXPORT_SYMBOL(kernel_thread); /* - 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