sdhci: make sure to clear the error interrupt

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=964f9ce2ff42dc47cf40fbd2f5c81cd60689e384
Commit: 964f9ce2ff42dc47cf40fbd2f5c81cd60689e384
Parent: 63b66438860f246f25f5563cde4978cf255cb810
Author: Pierre Ossman [EMAIL PROTECTED]
AuthorDate: Fri Jul 20 18:20:36 2007 +0200
Committer:  Pierre Ossman [EMAIL PROTECTED]
CommitDate: Fri Jul 20 18:51:44 2007 +0200

sdhci: make sure to clear the error interrupt

The controller has a bit indicating that one of the higher bits (the
error bits) are set. A previous bug caused this bit to be masked, but
since that bug has been fixed we have to clear it explicictly.

Signed-off-by: Pierre Ossman [EMAIL PROTECTED]
---
 drivers/mmc/host/sdhci.c |2 ++
 drivers/mmc/host/sdhci.h |1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 10d15c3..4a24db0 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1024,6 +1024,8 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id)
 
intmask = ~(SDHCI_INT_CMD_MASK | SDHCI_INT_DATA_MASK);
 
+   intmask = ~SDHCI_INT_ERROR;
+
if (intmask  SDHCI_INT_BUS_POWER) {
printk(KERN_ERR %s: Card is consuming too much power!\n,
mmc_hostname(host-mmc));
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 7400f4b..a6c8704 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -107,6 +107,7 @@
 #define  SDHCI_INT_CARD_INSERT 0x0040
 #define  SDHCI_INT_CARD_REMOVE 0x0080
 #define  SDHCI_INT_CARD_INT0x0100
+#define  SDHCI_INT_ERROR   0x8000
 #define  SDHCI_INT_TIMEOUT 0x0001
 #define  SDHCI_INT_CRC 0x0002
 #define  SDHCI_INT_END_BIT 0x0004
-
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


mmc: add maintainer for at91

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=81764fa9a472dd72b93385f30f718ed4f98ec129
Commit: 81764fa9a472dd72b93385f30f718ed4f98ec129
Parent: 9a79b2274186fade17134929d4f85b70d59a3840
Author: Pierre Ossman [EMAIL PROTECTED]
AuthorDate: Sun Jul 15 18:47:38 2007 +0200
Committer:  Pierre Ossman [EMAIL PROTECTED]
CommitDate: Fri Jul 20 18:51:18 2007 +0200

mmc: add maintainer for at91

Nicolas Ferre has taken it upon himself to look after the AT91
MMC host driver.

Signed-off-by: Pierre Ossman [EMAIL PROTECTED]
---
 MAINTAINERS |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index fbe0dca..c9fab2b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -645,7 +645,12 @@ W: http://linux-atm.sourceforge.net
 S: Maintained
 
 ATMEL AT91 MCI DRIVER
-S: Orphan
+P: Nicolas Ferre
+M: [EMAIL PROTECTED]
+L: [EMAIL PROTECTED] (subscribers-only)
+W: http://www.atmel.com/products/AT91/
+W: http://www.at91.com/
+S: Maintained
 
 ATMEL MACB ETHERNET DRIVER
 P: Haavard Skinnemoen
-
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


mmc: at91_mci: wakeup on card insertion (or removal)

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=63b66438860f246f25f5563cde4978cf255cb810
Commit: 63b66438860f246f25f5563cde4978cf255cb810
Parent: 81764fa9a472dd72b93385f30f718ed4f98ec129
Author: Marc Pignat [EMAIL PROTECTED]
AuthorDate: Mon Jul 16 11:07:02 2007 +0200
Committer:  Pierre Ossman [EMAIL PROTECTED]
CommitDate: Fri Jul 20 18:51:30 2007 +0200

mmc: at91_mci: wakeup on card insertion (or removal)

This piece of code enable the system to be wake-up by a card insertion or 
removal.

Signed-off-by: Marc Pignat [EMAIL PROTECTED]
Signed-off-by: Nicolas Ferre [EMAIL PROTECTED]
Signed-off-by: Pierre Ossman [EMAIL PROTECTED]
---
 drivers/mmc/host/at91_mci.c |   13 -
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/at91_mci.c b/drivers/mmc/host/at91_mci.c
index 28c8818..15aab37 100644
--- a/drivers/mmc/host/at91_mci.c
+++ b/drivers/mmc/host/at91_mci.c
@@ -903,8 +903,10 @@ static int __init at91_mci_probe(struct platform_device 
*pdev)
/*
 * Add host to MMC layer
 */
-   if (host-board-det_pin)
+   if (host-board-det_pin) {
host-present = !at91_get_gpio_value(host-board-det_pin);
+   device_init_wakeup(pdev-dev, 1);
+   }
else
host-present = -1;
 
@@ -940,6 +942,7 @@ static int __exit at91_mci_remove(struct platform_device 
*pdev)
host = mmc_priv(mmc);
 
if (host-present != -1) {
+   device_init_wakeup(pdev-dev, 0);
free_irq(host-board-det_pin, host);
cancel_delayed_work(host-mmc-detect);
}
@@ -966,8 +969,12 @@ static int __exit at91_mci_remove(struct platform_device 
*pdev)
 static int at91_mci_suspend(struct platform_device *pdev, pm_message_t state)
 {
struct mmc_host *mmc = platform_get_drvdata(pdev);
+   struct at91mci_host *host = mmc_priv(mmc);
int ret = 0;
 
+   if (device_may_wakeup(pdev-dev))
+   enable_irq_wake(host-board-det_pin);
+
if (mmc)
ret = mmc_suspend_host(mmc, state);
 
@@ -977,8 +984,12 @@ static int at91_mci_suspend(struct platform_device *pdev, 
pm_message_t state)
 static int at91_mci_resume(struct platform_device *pdev)
 {
struct mmc_host *mmc = platform_get_drvdata(pdev);
+   struct at91mci_host *host = mmc_priv(mmc);
int ret = 0;
 
+   if (device_may_wakeup(pdev-dev))
+   disable_irq_wake(host-board-det_pin);
+
if (mmc)
ret = mmc_resume_host(mmc);
 
-
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


KVM: MMU: Fix cleaning up the shadow page allocation cache

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c4d198d5183ec7bbf8b53216cfc5ded7ebb0ec0c
Commit: c4d198d5183ec7bbf8b53216cfc5ded7ebb0ec0c
Parent: 5c4c1489b93c9dc51cc6e97fd73e325ce94983c0
Author: Avi Kivity [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 09:06:46 2007 +0300
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Fri Jul 20 23:48:47 2007 -0700

KVM: MMU: Fix cleaning up the shadow page allocation cache

__free_page() wants a struct page, not a virtual address.

Signed-off-by: Avi Kivity [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/kvm/mmu.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c
index d99d2fe..1a87ba9 100644
--- a/drivers/kvm/mmu.c
+++ b/drivers/kvm/mmu.c
@@ -244,7 +244,7 @@ static int mmu_topup_memory_cache_page(struct 
kvm_mmu_memory_cache *cache,
 static void mmu_free_memory_cache_page(struct kvm_mmu_memory_cache *mc)
 {
while (mc-nobjs)
-   __free_page(mc-objects[--mc-nobjs]);
+   free_page((unsigned long)mc-objects[--mc-nobjs]);
 }
 
 static int __mmu_topup_memory_caches(struct kvm_vcpu *vcpu, gfp_t gfp_flags)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86_64: wbinvd macro fix

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=71133027febfabd501fde7583b30008224f4d799
Commit: 71133027febfabd501fde7583b30008224f4d799
Parent: c4d198d5183ec7bbf8b53216cfc5ded7ebb0ec0c
Author: Nick Piggin [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:17 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:13 2007 -0700

x86_64: wbinvd macro fix

Too many semicolons in this macro.

Signed-off-by: Nick Piggin [EMAIL PROTECTED]
Cc: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/asm-x86_64/system.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h
index e4f246d..6313d33 100644
--- a/include/asm-x86_64/system.h
+++ b/include/asm-x86_64/system.h
@@ -109,7 +109,7 @@ static inline void write_cr4(unsigned long val)
 #define stts() write_cr0(8 | read_cr0())
 
 #define wbinvd() \
-   __asm__ __volatile__ (wbinvd: : :memory);
+   __asm__ __volatile__ (wbinvd: : :memory)
 
 #endif /* __KERNEL__ */
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


nommu: vmalloc_32_user()/vm_insert_page() and symbol exports.

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b50731732f926d6c49fd0724616a7344c31cd5cf
Commit: b50731732f926d6c49fd0724616a7344c31cd5cf
Parent: df336d1c7b6fd510fa6d3a028f999e7586c7026e
Author: Paul Mundt [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:25 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:14 2007 -0700

nommu: vmalloc_32_user()/vm_insert_page() and symbol exports.

Trying to survive an allmodconfig on a nommu platform results in many
screen lengths of module unhappiness.  Many of the mmap related things that
binfmt_flat hooks in to are never exported despite being global, and there
are also missing definitions for vmalloc_32_user() and vm_insert_page().

I've implemented vmalloc_32_user() trying to stick as close to the
mm/vmalloc.c implementation as possible, though we don't have any need for
VM_USERMAP, so groveling for the VMA can be skipped.  vm_insert_page() has
been stubbed for now in order to keep the build happy.

Signed-off-by: Paul Mundt [EMAIL PROTECTED]
Cc: David Howells [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 mm/nommu.c |   45 +
 1 files changed, 33 insertions(+), 12 deletions(-)

diff --git a/mm/nommu.c b/mm/nommu.c
index 1b105d2..9eef6a3 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -54,12 +54,6 @@ DECLARE_RWSEM(nommu_vma_sem);
 struct vm_operations_struct generic_file_vm_ops = {
 };
 
-EXPORT_SYMBOL(vfree);
-EXPORT_SYMBOL(vmalloc_to_page);
-EXPORT_SYMBOL(vmalloc_32);
-EXPORT_SYMBOL(vmap);
-EXPORT_SYMBOL(vunmap);
-
 /*
  * Handle all mappings that got truncated by a truncate()
  * system call.
@@ -168,7 +162,6 @@ int get_user_pages(struct task_struct *tsk, struct 
mm_struct *mm,
 finish_or_fault:
return i ? : -EFAULT;
 }
-
 EXPORT_SYMBOL(get_user_pages);
 
 DEFINE_RWLOCK(vmlist_lock);
@@ -178,6 +171,7 @@ void vfree(void *addr)
 {
kfree(addr);
 }
+EXPORT_SYMBOL(vfree);
 
 void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot)
 {
@@ -186,17 +180,19 @@ void *__vmalloc(unsigned long size, gfp_t gfp_mask, 
pgprot_t prot)
 */
return kmalloc(size, (gfp_mask | __GFP_COMP)  ~__GFP_HIGHMEM);
 }
+EXPORT_SYMBOL(__vmalloc);
 
 struct page * vmalloc_to_page(void *addr)
 {
return virt_to_page(addr);
 }
+EXPORT_SYMBOL(vmalloc_to_page);
 
 unsigned long vmalloc_to_pfn(void *addr)
 {
return page_to_pfn(virt_to_page(addr));
 }
-
+EXPORT_SYMBOL(vmalloc_to_pfn);
 
 long vread(char *buf, char *addr, unsigned long count)
 {
@@ -237,9 +233,8 @@ void *vmalloc_node(unsigned long size, int node)
 }
 EXPORT_SYMBOL(vmalloc_node);
 
-/*
- * vmalloc_32  -  allocate virtually continguos memory (32bit addressable)
- *
+/**
+ * vmalloc_32  -  allocate virtually contiguous memory (32bit addressable)
  * @size:  allocation size
  *
  * Allocate enough 32bit PA addressable pages to cover @size from the
@@ -249,17 +244,33 @@ void *vmalloc_32(unsigned long size)
 {
return __vmalloc(size, GFP_KERNEL, PAGE_KERNEL);
 }
+EXPORT_SYMBOL(vmalloc_32);
+
+/**
+ * vmalloc_32_user - allocate zeroed virtually contiguous 32bit memory
+ * @size:  allocation size
+ *
+ * The resulting memory area is 32bit addressable and zeroed so it can be
+ * mapped to userspace without leaking data.
+ */
+void *vmalloc_32_user(unsigned long size)
+{
+   return __vmalloc(size, GFP_KERNEL | __GFP_ZERO, PAGE_KERNEL);
+}
+EXPORT_SYMBOL(vmalloc_32_user);
 
 void *vmap(struct page **pages, unsigned int count, unsigned long flags, 
pgprot_t prot)
 {
BUG();
return NULL;
 }
+EXPORT_SYMBOL(vmap);
 
 void vunmap(void *addr)
 {
BUG();
 }
+EXPORT_SYMBOL(vunmap);
 
 /*
  * Implement a stub for vmalloc_sync_all() if the architecture chose not to
@@ -269,6 +280,13 @@ void  __attribute__((weak)) vmalloc_sync_all(void)
 {
 }
 
+int vm_insert_page(struct vm_area_struct *vma, unsigned long addr,
+  struct page *page)
+{
+   return -EINVAL;
+}
+EXPORT_SYMBOL(vm_insert_page);
+
 /*
  *  sys_brk() for the most part doesn't need the global kernel
  *  lock, except when an application is doing something nasty
@@ -994,6 +1012,7 @@ unsigned long do_mmap_pgoff(struct file *file,
show_free_areas();
return -ENOMEM;
 }
+EXPORT_SYMBOL(do_mmap_pgoff);
 
 /*
  * handle mapping disposal for uClinux
@@ -1074,6 +1093,7 @@ int do_munmap(struct mm_struct *mm, unsigned long addr, 
size_t len)
 
return 0;
 }
+EXPORT_SYMBOL(do_munmap);
 
 asmlinkage long sys_munmap(unsigned long addr, size_t len)
 {
@@ -1164,6 +1184,7 @@ unsigned long do_mremap(unsigned long addr,
 
return vma-vm_start;
 }
+EXPORT_SYMBOL(do_mremap);
 
 asmlinkage unsigned long sys_mremap(unsigned long addr,
unsigned long old_len, unsigned long new_len,
@@ 

coda: remove CODA_STORE/CODA_RELEASE upcalls

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d3fec424b23c47686efcf3f2004c3f1c1cee4d9c
Commit: d3fec424b23c47686efcf3f2004c3f1c1cee4d9c
Parent: b50731732f926d6c49fd0724616a7344c31cd5cf
Author: Jan Harkes [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:26 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:14 2007 -0700

coda: remove CODA_STORE/CODA_RELEASE upcalls

This is an variation on the patch sent by Christoph Hellwig which kills
file_count abuse by the Coda kernel module by moving the coda_flush
functionality into coda_release.  However part of reason we were using the
coda_flush callback was to allow Coda to pass errors that occur during
writeback from the userspace cache manager back to close().

As Al Viro explained on linux-fsdevel, it is impossible to guarantee that
such errors can in fact be returned back to the caller.  There are many
cases where the last reference to a file is not released by the close
system call and it is also impossible to pick some close as a 'last-close'
and delay it until all other references have been destroyed.

The CODA_STORE/CODA_RELEASE upcall combination is clearly a broken design,
and it is better to remove it completely.

Signed-off-by: Jan Harkes [EMAIL PROTECTED]
Cc: Christoph Hellwig [EMAIL PROTECTED]
Cc: Al Viro [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/coda/dir.c  |1 -
 fs/coda/file.c |   65 ---
 fs/coda/upcall.c   |   49 +
 include/linux/coda_linux.h |1 -
 include/linux/coda_psdev.h |3 --
 5 files changed, 7 insertions(+), 112 deletions(-)

diff --git a/fs/coda/dir.c b/fs/coda/dir.c
index 8e61236..f89ff08 100644
--- a/fs/coda/dir.c
+++ b/fs/coda/dir.c
@@ -86,7 +86,6 @@ const struct file_operations coda_dir_operations = {
.read   = generic_read_dir,
.readdir= coda_readdir,
.open   = coda_open,
-   .flush  = coda_flush,
.release= coda_release,
.fsync  = coda_fsync,
 };
diff --git a/fs/coda/file.c b/fs/coda/file.c
index 7594962..29137ff 100644
--- a/fs/coda/file.c
+++ b/fs/coda/file.c
@@ -25,10 +25,6 @@
 
 #include coda_int.h
 
-/* if CODA_STORE fails with EOPNOTSUPP, venus clearly doesn't support
- * CODA_STORE/CODA_RELEASE and we fall back on using the CODA_CLOSE upcall */
-static int use_coda_close;
-
 static ssize_t
 coda_file_read(struct file *coda_file, char __user *buf, size_t count, loff_t 
*ppos)
 {
@@ -163,47 +159,6 @@ int coda_open(struct inode *coda_inode, struct file 
*coda_file)
return 0;
 }
 
-int coda_flush(struct file *coda_file, fl_owner_t id)
-{
-   unsigned short flags = coda_file-f_flags  ~O_EXCL;
-   unsigned short coda_flags = coda_flags_to_cflags(flags);
-   struct coda_file_info *cfi;
-   struct inode *coda_inode;
-   int err = 0, fcnt;
-
-   lock_kernel();
-
-   /* last close semantics */
-   fcnt = file_count(coda_file);
-   if (fcnt  1)
-   goto out;
-
-   /* No need to make an upcall when we have not made any modifications
-* to the file */
-   if ((coda_file-f_flags  O_ACCMODE) == O_RDONLY)
-   goto out;
-
-   if (use_coda_close)
-   goto out;
-
-   cfi = CODA_FTOC(coda_file);
-   BUG_ON(!cfi || cfi-cfi_magic != CODA_MAGIC);
-
-   coda_inode = coda_file-f_path.dentry-d_inode;
-
-   err = venus_store(coda_inode-i_sb, coda_i2f(coda_inode), coda_flags,
- coda_file-f_uid);
-
-   if (err == -EOPNOTSUPP) {
-   use_coda_close = 1;
-   err = 0;
-   }
-
-out:
-   unlock_kernel();
-   return err;
-}
-
 int coda_release(struct inode *coda_inode, struct file *coda_file)
 {
unsigned short flags = (coda_file-f_flags)  (~O_EXCL);
@@ -215,21 +170,11 @@ int coda_release(struct inode *coda_inode, struct file 
*coda_file)
 
lock_kernel();
 
-   if (!use_coda_close) {
-   err = venus_release(coda_inode-i_sb, coda_i2f(coda_inode),
-   coda_flags);
-   if (err == -EOPNOTSUPP) {
-   use_coda_close = 1;
-   err = 0;
-   }
-   }
-
cfi = CODA_FTOC(coda_file);
BUG_ON(!cfi || cfi-cfi_magic != CODA_MAGIC);
 
-   if (use_coda_close)
-   err = venus_close(coda_inode-i_sb, coda_i2f(coda_inode),
- coda_flags, coda_file-f_uid);
+   err = venus_close(coda_inode-i_sb, coda_i2f(coda_inode),
+ coda_flags, coda_file-f_uid);
 
host_inode = cfi-cfi_container-f_path.dentry-d_inode;
cii = 

dm io: fix panic on large request

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=80b16c192e469541263d6bfd9177662ceb632ecc
Commit: 80b16c192e469541263d6bfd9177662ceb632ecc
Parent: d3fec424b23c47686efcf3f2004c3f1c1cee4d9c
Author: Milan Broz [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:27 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:14 2007 -0700

dm io: fix panic on large request

Flush workqueue before releasing bioset and mopools in dm-crypt.  There can
be finished but not yet released request.

Call chain causing oops:
  run workqueue
dec_pending
  bio_endio(...);
remove device request - remove mempool
  mempool_free(io, cc-io_pool);

This usually happens when cryptsetup create temporary
luks mapping in the beggining of crypt device activation.

When dm-core calls destructor crypt_dtr, no new request
are possible.

Signed-off-by: Milan Broz [EMAIL PROTECTED]
Cc: Chuck Ebbert [EMAIL PROTECTED]
Cc: Patrick McHardy [EMAIL PROTECTED]
Acked-by: Alasdair G Kergon [EMAIL PROTECTED]
Cc: Christophe Saout [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/md/dm-crypt.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index ba952a0..bdc52d6 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -920,6 +920,8 @@ static void crypt_dtr(struct dm_target *ti)
 {
struct crypt_config *cc = (struct crypt_config *) ti-private;
 
+   flush_workqueue(_kcryptd_workqueue);
+
bioset_free(cc-bs);
mempool_destroy(cc-page_pool);
mempool_destroy(cc-io_pool);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i386: touch_nmi_watchdog() in print_trace_address()

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=601e625587bf92c9f370d74a15c4e43bc6468f9f
Commit: 601e625587bf92c9f370d74a15c4e43bc6468f9f
Parent: 80b16c192e469541263d6bfd9177662ceb632ecc
Author: Konrad Rzeszutek [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:29 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:14 2007 -0700

i386: touch_nmi_watchdog() in print_trace_address()

Prevent NMI watchdog triggering during long sysrq-T outputs.

Cc: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/traps.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index 3e7753c..e6b5309 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -211,6 +211,7 @@ static void print_trace_address(void *data, unsigned long 
addr)
 {
printk(%s [%08lx] , (char *)data, addr);
print_symbol(%s\n, addr);
+   touch_nmi_watchdog();
 }
 
 static struct stacktrace_ops print_trace_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


knfsd: fix typo in export display, print uid and gid as unsigned

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3e63516c826454c964eefdd24d33e188064c6679
Commit: 3e63516c826454c964eefdd24d33e188064c6679
Parent: 601e625587bf92c9f370d74a15c4e43bc6468f9f
Author: J. Bruce Fields [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:30 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:14 2007 -0700

knfsd: fix typo in export display, print uid and gid as unsigned

For display purposes, treat uid's and gid's as unsigned ints for now.
Also fix a typo.

Signed-off-by: J. Bruce Fields [EMAIL PROTECTED]
Cc: Neil Brown [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/nfsd/export.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 6ab8de4..2d295dd 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -1503,9 +1503,9 @@ static void exp_flags(struct seq_file *m, int flag, int 
fsid,
if (flag  NFSEXP_FSID)
seq_printf(m, ,fsid=%d, fsid);
if (anonu != (uid_t)-2  anonu != (0x1-2))
-   seq_printf(m, ,sanonuid=%d, anonu);
+   seq_printf(m, ,anonuid=%u, anonu);
if (anong != (gid_t)-2  anong != (0x1-2))
-   seq_printf(m, ,sanongid=%d, anong);
+   seq_printf(m, ,anongid=%u, anong);
if (fsloc  fsloc-locations_count  0) {
char *loctype = (fsloc-migrated) ? refer : replicas;
int i;
-
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


console: fix section mismatch warning in vgacon.c

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=80e27982a66ea8306a704ba8bdf634ed480d4b46
Commit: 80e27982a66ea8306a704ba8bdf634ed480d4b46
Parent: 3e63516c826454c964eefdd24d33e188064c6679
Author: Sam Ravnborg [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:31 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:14 2007 -0700

console: fix section mismatch warning in vgacon.c

Fix following section mismatch warning:
WARNING: vmlinux.o(.text+0x121e62): Section mismatch: reference to 
.init.text:__alloc_bootmem (between 'vgacon_startup' and 'vgacon_scrolldelta')

Browsing the code it seems that vgacon_scrollback_startup() is only called
during the init phase so the reference to the .init.text section is OK.

Teach modpost not to warn using ___init_refok.

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
Acked-by: Antonino A. Daplas [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/video/console/vgacon.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index f46fe95..d18b73a 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -187,7 +187,11 @@ static void vgacon_scrollback_init(int pitch)
}
 }
 
-static void vgacon_scrollback_startup(void)
+/*
+ * Called only duing init so call of alloc_bootmen is ok.
+ * Marked __init_refok to silence modpost.
+ */
+static void __init_refok vgacon_scrollback_startup(void)
 {
vgacon_scrollback = alloc_bootmem(CONFIG_VGACON_SOFT_SCROLLBACK_SIZE
  * 1024);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


revert PIE randomization

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d4e3cc387ea1b74c3ad2ef2f6f5c05fd6fc314b8
Commit: d4e3cc387ea1b74c3ad2ef2f6f5c05fd6fc314b8
Parent: 80e27982a66ea8306a704ba8bdf634ed480d4b46
Author: Andrew Morton [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:32 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:14 2007 -0700

revert PIE randomization

There are reports of this causing userspace failures
(http://lkml.org/lkml/2007/7/20/421).

Revert.

Cc: Jan Kratochvil [EMAIL PROTECTED]
Cc: Jiri Kosina [EMAIL PROTECTED]
Cc: Ingo Molnar [EMAIL PROTECTED]
Cc: Roland McGrath [EMAIL PROTECTED]
Cc: Jakub Jelinek [EMAIL PROTECTED]
Cc: Ulrich Kunitz [EMAIL PROTECTED]
Cc: H. Peter Anvin [EMAIL PROTECTED]
Cc: Bret Towe [EMAIL PROTECTED]
Cc: Luck, Tony [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/ia64/ia32/binfmt_elf32.c |2 +-
 fs/binfmt_elf.c   |  109 +
 2 files changed, 24 insertions(+), 87 deletions(-)

diff --git a/arch/ia64/ia32/binfmt_elf32.c b/arch/ia64/ia32/binfmt_elf32.c
index e1189ba..1cfab32 100644
--- a/arch/ia64/ia32/binfmt_elf32.c
+++ b/arch/ia64/ia32/binfmt_elf32.c
@@ -226,7 +226,7 @@ elf32_set_personality (void)
 }
 
 static unsigned long
-elf32_map (struct file *filep, unsigned long addr, struct elf_phdr *eppnt, int 
prot, int type, unsigned long unused)
+elf32_map (struct file *filep, unsigned long addr, struct elf_phdr *eppnt, int 
prot, int type)
 {
unsigned long pgoff = (eppnt-p_vaddr)  ~IA32_PAGE_MASK;
 
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index ba24cb2..4482a06 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -45,7 +45,7 @@
 
 static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs);
 static int load_elf_library(struct file *);
-static unsigned long elf_map (struct file *, unsigned long, struct elf_phdr *, 
int, int, unsigned long);
+static unsigned long elf_map (struct file *, unsigned long, struct elf_phdr *, 
int, int);
 
 /*
  * If we don't support core dumping, then supply a NULL so we
@@ -80,7 +80,7 @@ static struct linux_binfmt elf_format = {
.hasvdso= 1
 };
 
-#define BAD_ADDR(x) IS_ERR_VALUE(x)
+#define BAD_ADDR(x) ((unsigned long)(x) = TASK_SIZE)
 
 static int set_brk(unsigned long start, unsigned long end)
 {
@@ -295,70 +295,33 @@ create_elf_tables(struct linux_binprm *bprm, struct 
elfhdr *exec,
 #ifndef elf_map
 
 static unsigned long elf_map(struct file *filep, unsigned long addr,
-   struct elf_phdr *eppnt, int prot, int type,
-   unsigned long total_size)
+   struct elf_phdr *eppnt, int prot, int type)
 {
unsigned long map_addr;
-   unsigned long size = eppnt-p_filesz + ELF_PAGEOFFSET(eppnt-p_vaddr);
-   unsigned long off = eppnt-p_offset - ELF_PAGEOFFSET(eppnt-p_vaddr);
-   addr = ELF_PAGESTART(addr);
-   size = ELF_PAGEALIGN(size);
+   unsigned long pageoffset = ELF_PAGEOFFSET(eppnt-p_vaddr);
 
+   down_write(current-mm-mmap_sem);
/* mmap() will return -EINVAL if given a zero size, but a
 * segment with zero filesize is perfectly valid */
-   if (!size)
-   return addr;
-
-   down_write(current-mm-mmap_sem);
-   /*
-   * total_size is the size of the ELF (interpreter) image.
-   * The _first_ mmap needs to know the full size, otherwise
-   * randomization might put this image into an overlapping
-   * position with the ELF binary image. (since size  total_size)
-   * So we first map the 'big' image - and unmap the remainder at
-   * the end. (which unmap is needed for ELF images with holes.)
-   */
-   if (total_size) {
-   total_size = ELF_PAGEALIGN(total_size);
-   map_addr = do_mmap(filep, addr, total_size, prot, type, off);
-   if (!BAD_ADDR(map_addr))
-   do_munmap(current-mm, map_addr+size, total_size-size);
-   } else
-   map_addr = do_mmap(filep, addr, size, prot, type, off);
-
+   if (eppnt-p_filesz + pageoffset)
+   map_addr = do_mmap(filep, ELF_PAGESTART(addr),
+  eppnt-p_filesz + pageoffset, prot, type,
+  eppnt-p_offset - pageoffset);
+   else
+   map_addr = ELF_PAGESTART(addr);
up_write(current-mm-mmap_sem);
return(map_addr);
 }
 
 #endif /* !elf_map */
 
-static unsigned long total_mapping_size(struct elf_phdr *cmds, int nr)
-{
-   int i, first_idx = -1, last_idx = -1;
-
-   for (i = 0; i  nr; i++) {
-   if (cmds[i].p_type == PT_LOAD) {
-   last_idx = i;
-   if (first_idx == -1)
-   first_idx = i;
-

clockevents: remove prototypes of removed functions

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=93da56efcf8c6a111f0349f6b7651172d4745ca0
Commit: 93da56efcf8c6a111f0349f6b7651172d4745ca0
Parent: d4e3cc387ea1b74c3ad2ef2f6f5c05fd6fc314b8
Author: Thomas Gleixner [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:33 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:14 2007 -0700

clockevents: remove prototypes of removed functions

Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
Cc: john stultz [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/linux/clockchips.h |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index 8486e78..8d7a390 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -119,10 +119,6 @@ extern void clockevents_register_device(struct 
clock_event_device *dev);
 
 extern void clockevents_exchange_device(struct clock_event_device *old,
struct clock_event_device *new);
-extern
-struct clock_event_device *clockevents_request_device(unsigned int features,
- cpumask_t cpumask);
-extern void clockevents_release_device(struct clock_event_device *dev);
 extern void clockevents_set_mode(struct clock_event_device *dev,
 enum clock_event_mode mode);
 extern int clockevents_register_notifier(struct notifier_block *nb);
-
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


clockevents: fix resume logic

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=18de5bc4c1f1f1fa5e14f354a7603bd6e9d4e3b6
Commit: 18de5bc4c1f1f1fa5e14f354a7603bd6e9d4e3b6
Parent: 93da56efcf8c6a111f0349f6b7651172d4745ca0
Author: Thomas Gleixner [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:34 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:15 2007 -0700

clockevents: fix resume logic

We need to make sure, that the clockevent devices are resumed, before
the tick is resumed. The current resume logic does not guarantee this.

Add CLOCK_EVT_MODE_RESUME and call the set mode functions of the clock
event devices before resuming the tick / oneshot functionality.

Fixup the existing users.

Thanks to Nigel Cunningham for tracking down a long standing thinko,
which affected the jinxed VAIO.

[EMAIL PROTECTED]: xen build fix]
Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
Cc: john stultz [EMAIL PROTECTED]
Cc: Rusty Russell [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/arm/mach-davinci/time.c  |2 +
 arch/arm/mach-imx/time.c  |1 +
 arch/arm/mach-ixp4xx/common.c |2 +
 arch/arm/mach-omap1/time.c|1 +
 arch/arm/plat-omap/timer32k.c |2 +
 arch/i386/kernel/apic.c   |3 ++
 arch/i386/kernel/hpet.c   |   71 +++--
 arch/i386/kernel/i8253.c  |   26 ++---
 arch/i386/kernel/vmiclock.c   |1 +
 arch/i386/xen/time.c  |3 ++
 arch/sh/kernel/timers/timer-tmu.c |1 +
 arch/sparc64/kernel/time.c|1 +
 drivers/lguest/lguest.c   |2 +
 include/linux/clockchips.h|1 +
 kernel/time/tick-broadcast.c  |6 ++-
 kernel/time/tick-common.c |   16 +---
 16 files changed, 51 insertions(+), 88 deletions(-)

diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c
index 4d8425d..e96a3dc 100644
--- a/arch/arm/mach-davinci/time.c
+++ b/arch/arm/mach-davinci/time.c
@@ -285,6 +285,8 @@ static void davinci_set_mode(enum clock_event_mode mode,
case CLOCK_EVT_MODE_SHUTDOWN:
t-opts = TIMER_OPTS_DISABLED;
break;
+   case CLOCK_EVT_MODE_RESUME:
+   break;
}
 }
 
diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
index 010f6fa..d86d124 100644
--- a/arch/arm/mach-imx/time.c
+++ b/arch/arm/mach-imx/time.c
@@ -159,6 +159,7 @@ static void imx_set_mode(enum clock_event_mode mode, struct 
clock_event_device *
break;
case CLOCK_EVT_MODE_SHUTDOWN:
case CLOCK_EVT_MODE_UNUSED:
+   case CLOCK_EVT_MODE_RESUME:
/* Left event sources disabled, no more interrupts appears */
break;
}
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 8112f72..23e7fba 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -459,6 +459,8 @@ static void ixp4xx_set_mode(enum clock_event_mode mode,
default:
osrt = opts = 0;
break;
+   case CLOCK_EVT_MODE_RESUME:
+   break;
}
 
*IXP4XX_OSRT1 = osrt | opts;
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c
index 3705d20..237651e 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -156,6 +156,7 @@ static void omap_mpu_set_mode(enum clock_event_mode mode,
break;
case CLOCK_EVT_MODE_UNUSED:
case CLOCK_EVT_MODE_SHUTDOWN:
+   case CLOCK_EVT_MODE_RESUME:
break;
}
 }
diff --git a/arch/arm/plat-omap/timer32k.c b/arch/arm/plat-omap/timer32k.c
index 2feceec..b0af014 100644
--- a/arch/arm/plat-omap/timer32k.c
+++ b/arch/arm/plat-omap/timer32k.c
@@ -156,6 +156,8 @@ static void omap_32k_timer_set_mode(enum clock_event_mode 
mode,
case CLOCK_EVT_MODE_SHUTDOWN:
omap_32k_timer_stop();
break;
+   case CLOCK_EVT_MODE_RESUME:
+   break;
}
 }
 
diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c
index 67824f3..610f44b 100644
--- a/arch/i386/kernel/apic.c
+++ b/arch/i386/kernel/apic.c
@@ -263,6 +263,9 @@ static void lapic_timer_setup(enum clock_event_mode mode,
v |= (APIC_LVT_MASKED | LOCAL_TIMER_VECTOR);
apic_write_around(APIC_LVTT, v);
break;
+   case CLOCK_EVT_MODE_RESUME:
+   /* Nothing to do here */
+   break;
}
 
local_irq_restore(flags);
diff --git a/arch/i386/kernel/hpet.c b/arch/i386/kernel/hpet.c
index 17d7345..cfbf792 100644
--- a/arch/i386/kernel/hpet.c
+++ b/arch/i386/kernel/hpet.c
@@ -187,6 +187,10 @@ static void hpet_set_mode(enum clock_event_mode mode,
cfg = ~HPET_TN_ENABLE;
 

clockevents: fix device replacement

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5590a536c0bc403fc73908c66c1c88cbed735ecb
Commit: 5590a536c0bc403fc73908c66c1c88cbed735ecb
Parent: 18de5bc4c1f1f1fa5e14f354a7603bd6e9d4e3b6
Author: Thomas Gleixner [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:35 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:15 2007 -0700

clockevents: fix device replacement

When a device is replaced by a better rated device, then the broadcast
mode needs to be evaluated again. When the new device has no requirement
for broadcasting, then the broadcast bits for the CPU must be cleared.

Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
Cc: john stultz [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 kernel/time/tick-broadcast.c |   29 -
 1 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index 8339af2..db8e0f3 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -31,6 +31,12 @@ struct tick_device tick_broadcast_device;
 static cpumask_t tick_broadcast_mask;
 static DEFINE_SPINLOCK(tick_broadcast_lock);
 
+#ifdef CONFIG_TICK_ONESHOT
+static void tick_broadcast_clear_oneshot(int cpu);
+#else
+static inline void tick_broadcast_clear_oneshot(int cpu) { }
+#endif
+
 /*
  * Debugging: see timer_list.c
  */
@@ -99,8 +105,19 @@ int tick_device_uses_broadcast(struct clock_event_device 
*dev, int cpu)
cpu_set(cpu, tick_broadcast_mask);
tick_broadcast_start_periodic(tick_broadcast_device.evtdev);
ret = 1;
-   }
+   } else {
+   /*
+* When the new device is not affected by the stop
+* feature and the cpu is marked in the broadcast mask
+* then clear the broadcast bit.
+*/
+   if (!(dev-features  CLOCK_EVT_FEAT_C3STOP)) {
+   int cpu = smp_processor_id();
 
+   cpu_clear(cpu, tick_broadcast_mask);
+   tick_broadcast_clear_oneshot(cpu);
+   }
+   }
spin_unlock_irqrestore(tick_broadcast_lock, flags);
return ret;
 }
@@ -487,6 +504,16 @@ out:
spin_unlock_irqrestore(tick_broadcast_lock, flags);
 }
 
+/*
+ * Reset the one shot broadcast for a cpu
+ *
+ * Called with tick_broadcast_lock held
+ */
+static void tick_broadcast_clear_oneshot(int cpu)
+{
+   cpu_clear(cpu, tick_broadcast_oneshot_mask);
+}
+
 /**
  * tick_broadcast_setup_highres - setup the broadcast device for highres
  */
-
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


tick management: spread timer interrupt

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3704540b48295253bd9c87a5e7ff545f9d47a3b8
Commit: 3704540b48295253bd9c87a5e7ff545f9d47a3b8
Parent: 5590a536c0bc403fc73908c66c1c88cbed735ecb
Author: john stultz [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:35 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:15 2007 -0700

tick management: spread timer interrupt

After discussing w/ Thomas over IRC, it seems the issue is the sched tick
fires on every cpu at the same time, causing extra lock contention.

This smaller change, adds an extra offset per cpu so the ticks don't line 
up.
This patch also drops the idle latency from 40us down to under 20us.

Signed-off-by: john stultz [EMAIL PROTECTED]
Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
Cc: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 kernel/time/tick-sched.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 52db9e3..b416995 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -546,6 +546,7 @@ void tick_setup_sched_timer(void)
 {
struct tick_sched *ts = __get_cpu_var(tick_cpu_sched);
ktime_t now = ktime_get();
+   u64 offset;
 
/*
 * Emulate tick processing via per-CPU hrtimers:
@@ -554,8 +555,12 @@ void tick_setup_sched_timer(void)
ts-sched_timer.function = tick_sched_timer;
ts-sched_timer.cb_mode = HRTIMER_CB_IRQSAFE_NO_SOFTIRQ;
 
-   /* Get the next period */
+   /* Get the next period (per cpu) */
ts-sched_timer.expires = tick_init_jiffy_update();
+   offset = ktime_to_ns(tick_period)  1;
+   do_div(offset, NR_CPUS);
+   offset *= smp_processor_id();
+   ts-sched_timer.expires = ktime_add_ns(ts-sched_timer.expires, offset);
 
for (;;) {
hrtimer_forward(ts-sched_timer, now, tick_period);
-
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


highres: improve debug output

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=820de5c39ef7f6866d2c9e6c7d208bcd2a6e1942
Commit: 820de5c39ef7f6866d2c9e6c7d208bcd2a6e1942
Parent: 3704540b48295253bd9c87a5e7ff545f9d47a3b8
Author: Ingo Molnar [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:36 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:15 2007 -0700

highres: improve debug output

Add some more debug information to the hrtimer and clock events code.

Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
Cc: john stultz [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/apic.c|3 +++
 kernel/hrtimer.c   |5 -
 kernel/time/tick-oneshot.c |   15 ++-
 3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c
index 610f44b..83988c3 100644
--- a/arch/i386/kernel/apic.c
+++ b/arch/i386/kernel/apic.c
@@ -524,6 +524,9 @@ void __init setup_boot_APIC_clock(void)
 */
if (nmi_watchdog != NMI_IO_APIC)
lapic_clockevent.features = ~CLOCK_EVT_FEAT_DUMMY;
+   else
+   printk(KERN_WARNING APIC timer registered as dummy,
+   due to nmi_watchdog=1!\n);
}
 
/* Setup the lapic or request the broadcast */
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 72d0342..065a897 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -558,7 +558,8 @@ static inline int hrtimer_enqueue_reprogram(struct hrtimer 
*timer,
  */
 static int hrtimer_switch_to_hres(void)
 {
-   struct hrtimer_cpu_base *base = __get_cpu_var(hrtimer_bases);
+   int cpu = smp_processor_id();
+   struct hrtimer_cpu_base *base = per_cpu(hrtimer_bases, cpu);
unsigned long flags;
 
if (base-hres_active)
@@ -568,6 +569,8 @@ static int hrtimer_switch_to_hres(void)
 
if (tick_init_highres()) {
local_irq_restore(flags);
+   printk(KERN_WARNING Could not switch to high resolution 
+   mode on CPU %d\n, cpu);
return 0;
}
base-hres_active = 1;
diff --git a/kernel/time/tick-oneshot.c b/kernel/time/tick-oneshot.c
index f6997ab..0258d31 100644
--- a/kernel/time/tick-oneshot.c
+++ b/kernel/time/tick-oneshot.c
@@ -73,8 +73,21 @@ int tick_switch_to_oneshot(void (*handler)(struct 
clock_event_device *))
struct clock_event_device *dev = td-evtdev;
 
if (!dev || !(dev-features  CLOCK_EVT_FEAT_ONESHOT) ||
-   !tick_device_is_functional(dev))
+   !tick_device_is_functional(dev)) {
+
+   printk(KERN_INFO Clockevents: 
+  could not switch to one-shot mode:);
+   if (!dev) {
+   printk( no tick device\n);
+   } else {
+   if (!tick_device_is_functional(dev))
+   printk( %s is not functional.\n, dev-name);
+   else
+   printk( %s does not support one-shot mode.\n,
+  dev-name);
+   }
return -EINVAL;
+   }
 
td-mode = TICKDEV_MODE_ONESHOT;
dev-event_handler = 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


hrtimer: speedup hrtimer_enqueue

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=99bc2fcb283852931fb6bbef40f3df8316b59000
Commit: 99bc2fcb283852931fb6bbef40f3df8316b59000
Parent: 820de5c39ef7f6866d2c9e6c7d208bcd2a6e1942
Author: Ingo Molnar [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:36 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:15 2007 -0700

hrtimer: speedup hrtimer_enqueue

Speedup hrtimer_enqueue by evaluating the rbtree insertion result.

Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
Cc: john stultz [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 kernel/hrtimer.c |   10 ++
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 065a897..eb1ddeb 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -686,6 +686,7 @@ static void enqueue_hrtimer(struct hrtimer *timer,
struct rb_node **link = base-active.rb_node;
struct rb_node *parent = NULL;
struct hrtimer *entry;
+   int leftmost = 1;
 
/*
 * Find the right place in the rbtree:
@@ -697,18 +698,19 @@ static void enqueue_hrtimer(struct hrtimer *timer,
 * We dont care about collisions. Nodes with
 * the same expiry time stay together.
 */
-   if (timer-expires.tv64  entry-expires.tv64)
+   if (timer-expires.tv64  entry-expires.tv64) {
link = (*link)-rb_left;
-   else
+   } else {
link = (*link)-rb_right;
+   leftmost = 0;
+   }
}
 
/*
 * Insert the timer to the rbtree and check whether it
 * replaces the first pending timer
 */
-   if (!base-first || timer-expires.tv64 
-   rb_entry(base-first, struct hrtimer, node)-expires.tv64) {
+   if (leftmost) {
/*
 * Reprogram the clock event device. When the timer is already
 * expired hrtimer_enqueue_reprogram has either called the
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


NTP: move the cmos update code into ntp.c

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=82644459c592a28a3eab682f9b88d81019ddfe8b
Commit: 82644459c592a28a3eab682f9b88d81019ddfe8b
Parent: 99bc2fcb283852931fb6bbef40f3df8316b59000
Author: Thomas Gleixner [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:37 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:15 2007 -0700

NTP: move the cmos update code into ntp.c

i386 and sparc64 have the identical code to update the cmos clock.  Move it
into kernel/time/ntp.c as there are other architectures coming along with 
the
same requirements.

[EMAIL PROTECTED]: build fixes]
Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
Cc: Chris Wright [EMAIL PROTECTED]
Cc: Ingo Molnar [EMAIL PROTECTED]
Cc: john stultz [EMAIL PROTECTED]
Cc: David Miller [EMAIL PROTECTED]
Cc: Roman Zippel [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/Kconfig  |4 +++
 arch/i386/kernel/time.c|   50 +---
 arch/sparc64/Kconfig   |4 +++
 arch/sparc64/kernel/time.c |   53 +--
 include/asm-i386/timer.h   |1 -
 include/linux/time.h   |3 ++
 kernel/time/ntp.c  |   59 +--
 7 files changed, 71 insertions(+), 103 deletions(-)

diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index 7a11b90..361aca8 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -18,6 +18,10 @@ config GENERIC_TIME
bool
default y
 
+config GENERIC_CMOS_UPDATE
+   bool
+   default y
+
 config CLOCKSOURCE_WATCHDOG
bool
default y
diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c
index a665df6..19a6c67 100644
--- a/arch/i386/kernel/time.c
+++ b/arch/i386/kernel/time.c
@@ -207,55 +207,9 @@ unsigned long read_persistent_clock(void)
return retval;
 }
 
-static void sync_cmos_clock(unsigned long dummy);
-
-static DEFINE_TIMER(sync_cmos_timer, sync_cmos_clock, 0, 0);
-int no_sync_cmos_clock;
-
-static void sync_cmos_clock(unsigned long dummy)
-{
-   struct timeval now, next;
-   int fail = 1;
-
-   /*
-* If we have an externally synchronized Linux clock, then update
-* CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
-* called as close as possible to 500 ms before the new second starts.
-* This code is run on a timer.  If the clock is set, that timer
-* may not expire at the correct time.  Thus, we adjust...
-*/
-   if (!ntp_synced())
-   /*
-* Not synced, exit, do not restart a timer (if one is
-* running, let it run out).
-*/
-   return;
-
-   do_gettimeofday(now);
-   if (now.tv_usec = USEC_AFTER - ((unsigned) TICK_SIZE) / 2 
-   now.tv_usec = USEC_BEFORE + ((unsigned) TICK_SIZE) / 2)
-   fail = set_rtc_mmss(now.tv_sec);
-
-   next.tv_usec = USEC_AFTER - now.tv_usec;
-   if (next.tv_usec = 0)
-   next.tv_usec += USEC_PER_SEC;
-
-   if (!fail)
-   next.tv_sec = 659;
-   else
-   next.tv_sec = 0;
-
-   if (next.tv_usec = USEC_PER_SEC) {
-   next.tv_sec++;
-   next.tv_usec -= USEC_PER_SEC;
-   }
-   mod_timer(sync_cmos_timer, jiffies + timeval_to_jiffies(next));
-}
-
-void notify_arch_cmos_timer(void)
+int update_persistent_clock(struct timespec now)
 {
-   if (!no_sync_cmos_clock)
-   mod_timer(sync_cmos_timer, jiffies + 1);
+   return set_rtc_mmss(now.tv_sec);
 }
 
 extern void (*late_time_init)(void);
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index f1cc556..33dabf5 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -23,6 +23,10 @@ config GENERIC_TIME
bool
default y
 
+config GENERIC_CMOS_UPDATE
+   bool
+   default y
+
 config GENERIC_CLOCKEVENTS
bool
default y
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c
index 87c10a7..49063ca 100644
--- a/arch/sparc64/kernel/time.c
+++ b/arch/sparc64/kernel/time.c
@@ -403,58 +403,9 @@ static struct sparc64_tick_ops hbtick_operations 
__read_mostly = {
 
 static unsigned long timer_ticks_per_nsec_quotient __read_mostly;
 
-#define TICK_SIZE (tick_nsec / 1000)
-
-#define USEC_AFTER 50
-#define USEC_BEFORE50
-
-static void sync_cmos_clock(unsigned long dummy);
-
-static DEFINE_TIMER(sync_cmos_timer, sync_cmos_clock, 0, 0);
-
-static void sync_cmos_clock(unsigned long dummy)
-{
-   struct timeval now, next;
-   int fail = 1;
-
-   /*
-* If we have an externally synchronized Linux clock, then update
-* CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
-* called as close 

i386: PIT stop only, when in periodic or oneshot mode

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7671988b9cd31daf53fd38f8e75c8b881324842b
Commit: 7671988b9cd31daf53fd38f8e75c8b881324842b
Parent: 82644459c592a28a3eab682f9b88d81019ddfe8b
Author: Thomas Gleixner [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:38 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:15 2007 -0700

i386: PIT stop only, when in periodic or oneshot mode

The patch is necessary on one of my boxen, where programming the stop
sequence twice leads to PIT malfunction.

Sigh !

Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
Cc: Andi Kleen [EMAIL PROTECTED]
Cc: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/i8253.c |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/i386/kernel/i8253.c b/arch/i386/kernel/i8253.c
index 931eabe..bde249d 100644
--- a/arch/i386/kernel/i8253.c
+++ b/arch/i386/kernel/i8253.c
@@ -47,9 +47,12 @@ static void init_pit_timer(enum clock_event_mode mode,
 
case CLOCK_EVT_MODE_SHUTDOWN:
case CLOCK_EVT_MODE_UNUSED:
-   outb_p(0x30, PIT_MODE);
-   outb_p(0, PIT_CH0); /* LSB */
-   outb_p(0, PIT_CH0); /* MSB */
+   if (evt-mode == CLOCK_EVT_MODE_PERIODIC ||
+   evt-mode == CLOCK_EVT_MODE_ONESHOT) {
+   outb_p(0x30, PIT_MODE);
+   outb_p(0, PIT_CH0);
+   outb_p(0, PIT_CH0);
+   }
break;
 
case CLOCK_EVT_MODE_ONESHOT:
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i386: intel_cacheinfo.c:find_num_cache_leaves() should be __cpuinit

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=61d488da9bad8d1511d18291006bd2dd728f173d
Commit: 61d488da9bad8d1511d18291006bd2dd728f173d
Parent: 7671988b9cd31daf53fd38f8e75c8b881324842b
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:39 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:15 2007 -0700

i386: intel_cacheinfo.c:find_num_cache_leaves() should be __cpuinit

WARNING: arch/i386/kernel/built-in.o(.text+0xb6a7): Section mismatch: 
reference to .init.text:find_num_cache_leaves (between 'init_intel_cacheinfo' 
and 'cache_shared_cpu_map_setup')

It could be __init_refok, but gcc = 4.0 anyway inlines it into the
__cpuinit init_intel_cacheinfo(), and IMHO it's too small for noinline
__init.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Cc: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/cpu/intel_cacheinfo.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/arch/i386/kernel/cpu/intel_cacheinfo.c 
b/arch/i386/kernel/cpu/intel_cacheinfo.c
index e5be819..25b4b7d 100644
--- a/arch/i386/kernel/cpu/intel_cacheinfo.c
+++ b/arch/i386/kernel/cpu/intel_cacheinfo.c
@@ -239,8 +239,7 @@ static int __cpuinit cpuid4_cache_lookup(int index, struct 
_cpuid4_info *this_le
return 0;
 }
 
-/* will only be called once; __init is safe here */
-static int __init find_num_cache_leaves(void)
+static int __cpuinit find_num_cache_leaves(void)
 {
unsigned inteax, ebx, ecx, edx;
union _cpuid4_leaf_eax  cache_eax;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


remove handle_mm_fault export

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=41f9dc5c871600f53c8912b2975971d2a11c1c25
Commit: 41f9dc5c871600f53c8912b2975971d2a11c1c25
Parent: 61d488da9bad8d1511d18291006bd2dd728f173d
Author: Christoph Hellwig [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:40 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:16 2007 -0700

remove handle_mm_fault export

Now that arch/powerpc/platforms/cell/spufs/fault.c is always built in
the kernel there is no need to export handle_mm_fault anymore.

Signed-off-by: Christoph Hellwig [EMAIL PROTECTED]
Cc: Nick Piggin [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 mm/memory.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/mm/memory.c b/mm/memory.c
index 8aace3d..ca8cac1 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2659,8 +2659,6 @@ int handle_mm_fault(struct mm_struct *mm, struct 
vm_area_struct *vma,
return handle_pte_fault(mm, vma, address, pte, pmd, write_access);
 }
 
-EXPORT_SYMBOL_GPL(handle_mm_fault);
-
 #ifndef __PAGETABLE_PUD_FOLDED
 /*
  * Allocate page upper directory.
-
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


slob: reduce list scanning

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d6269543ef24aa012aa228c27af3adb074f7b36b
Commit: d6269543ef24aa012aa228c27af3adb074f7b36b
Parent: 41f9dc5c871600f53c8912b2975971d2a11c1c25
Author: Matt Mackall [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:40 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:16 2007 -0700

slob: reduce list scanning

The version of SLOB in -mm always scans its free list from the beginning,
which results in small allocations and free segments clustering at the
beginning of the list over time.  This causes the average search to scan
over a large stretch at the beginning on each allocation.

By starting each page search where the last one left off, we evenly
distribute the allocations and greatly shorten the average search.

Without this patch, kernel compiles on a 1.5G machine take a large amount
of system time for list scanning.  With this patch, compiles are within a
few seconds of performance of a SLAB kernel with no notable change in
system time.

Signed-off-by: Matt Mackall [EMAIL PROTECTED]
Cc: Christoph Lameter [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 mm/slob.c |   21 -
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/mm/slob.c b/mm/slob.c
index d50920e..ec33fcd 100644
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -293,6 +293,7 @@ static void *slob_page_alloc(struct slob_page *sp, size_t 
size, int align)
 static void *slob_alloc(size_t size, gfp_t gfp, int align, int node)
 {
struct slob_page *sp;
+   struct list_head *prev;
slob_t *b = NULL;
unsigned long flags;
 
@@ -307,12 +308,22 @@ static void *slob_alloc(size_t size, gfp_t gfp, int 
align, int node)
if (node != -1  page_to_nid(sp-page) != node)
continue;
 #endif
+   /* Enough room on this page? */
+   if (sp-units  SLOB_UNITS(size))
+   continue;
 
-   if (sp-units = SLOB_UNITS(size)) {
-   b = slob_page_alloc(sp, size, align);
-   if (b)
-   break;
-   }
+   /* Attempt to alloc */
+   prev = sp-list.prev;
+   b = slob_page_alloc(sp, size, align);
+   if (!b)
+   continue;
+
+   /* Improve fragment distribution and reduce our average
+* search time by starting our next search here. (see
+* Knuth vol 1, sec 2.5, pg 449) */
+   if (free_slob_pages.next != prev-next)
+   list_move_tail(free_slob_pages, prev-next);
+   break;
}
spin_unlock_irqrestore(slob_lock, flags);
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Documentation:reference notifiers.txt in freezing-of-tasks.txt

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fccdb5ae7e453eb7de5592bc4ed17d10d4d90125
Commit: fccdb5ae7e453eb7de5592bc4ed17d10d4d90125
Parent: d6269543ef24aa012aa228c27af3adb074f7b36b
Author: Oliver Neukum [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:43 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:16 2007 -0700

Documentation:reference notifiers.txt in freezing-of-tasks.txt

freezing-of-tasks.txt mentions firmware issues without mentioning the use
of the new notifier API to overcome them.  Here's an update.

Signed-off-by: Oliver Neukum [EMAIL PROTECTED]
Acked-by: Rafael J. Wysocki [EMAIL PROTECTED]
Acked-by: Nigel Cunningham [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 Documentation/power/freezing-of-tasks.txt |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Documentation/power/freezing-of-tasks.txt 
b/Documentation/power/freezing-of-tasks.txt
index af1a282..04dc1cf 100644
--- a/Documentation/power/freezing-of-tasks.txt
+++ b/Documentation/power/freezing-of-tasks.txt
@@ -155,6 +155,8 @@ Suppose, however, that the firmware file is located on a 
filesystem accessible
 only through another device that hasn't been resumed yet.  In that case,
 request_firmware() will fail regardless of whether or not the freezing of tasks
 is used.  Consequently, the problem is not really related to the freezing of
-tasks, since it generally exists anyway.  [The solution to this particular
-problem is to keep the firmware in memory after it's loaded for the first time
-and upload if from memory to the device whenever necessary.]
+tasks, since it generally exists anyway.
+
+A driver must have all firmwares it may need in RAM before suspend() is called.
+If keeping them is not practical, for example due to their size, they must be
+requested early enough using the suspend notifier API described in 
notifiers.txt.
-
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: tlb_32.c build fix

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=97d22d26b4a5aefc5a18ac81ef4e7b46da451426
Commit: 97d22d26b4a5aefc5a18ac81ef4e7b46da451426
Parent: fccdb5ae7e453eb7de5592bc4ed17d10d4d90125
Author: Mariusz Kozlowski [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:44 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:16 2007 -0700

powerpc: tlb_32.c build fix

allnoconfig results in this:

 CC  arch/powerpc/mm/tlb_32.o
In file included from include/asm/tlb.h:60,
 from arch/powerpc/mm/tlb_32.c:30:
include/asm-generic/tlb.h: In function 'tlb_flush_mmu':
include/asm-generic/tlb.h:76: error: implicit declaration of function 
'release_pages'
include/asm-generic/tlb.h: In function 'tlb_remove_page':
include/asm-generic/tlb.h:105: error: implicit declaration of function 
'page_cache_release'

Signed-off-by: Mariusz Kozlowski [EMAIL PROTECTED]
Cc: Benjamin Herrenschmidt [EMAIL PROTECTED]
Cc: Paul Mackerras [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/powerpc/mm/tlb_32.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/mm/tlb_32.c b/arch/powerpc/mm/tlb_32.c
index 06c7e77..eb4b512 100644
--- a/arch/powerpc/mm/tlb_32.c
+++ b/arch/powerpc/mm/tlb_32.c
@@ -26,6 +26,8 @@
 #include linux/mm.h
 #include linux/init.h
 #include linux/highmem.h
+#include linux/pagemap.h
+
 #include asm/tlbflush.h
 #include asm/tlb.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


ps3: Disk Storage Driver

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c6131fa528c4fc57605c474bf8c83821aff164c0
Commit: c6131fa528c4fc57605c474bf8c83821aff164c0
Parent: 97d22d26b4a5aefc5a18ac81ef4e7b46da451426
Author: Geert Uytterhoeven [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:45 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:16 2007 -0700

ps3: Disk Storage Driver

Add a Disk Storage Driver for the PS3:
  - Implemented as a block device driver with a dynamic major
  - Disk names (and partitions) are of the format ps3d%c(%u)
  - Uses software scatter-gather with a 64 KiB bounce buffer as the 
hypervisor
doesn't support scatter-gather

Cc: Geoff Levand [EMAIL PROTECTED]
Signed-off-by: Geert Uytterhoeven [EMAIL PROTECTED]
Acked-by: Jens Axboe [EMAIL PROTECTED]
Cc: James Bottomley [EMAIL PROTECTED]
Cc: Paul Mackerras [EMAIL PROTECTED]
Cc: Benjamin Herrenschmidt [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/powerpc/platforms/ps3/Kconfig |   10 +
 drivers/block/Makefile |1 +
 drivers/block/ps3disk.c|  630 
 3 files changed, 641 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/ps3/Kconfig 
b/arch/powerpc/platforms/ps3/Kconfig
index a05079b..8da927c 100644
--- a/arch/powerpc/platforms/ps3/Kconfig
+++ b/arch/powerpc/platforms/ps3/Kconfig
@@ -102,4 +102,14 @@ config PS3_STORAGE
depends on PPC_PS3
tristate
 
+config PS3_DISK
+   tristate PS3 Disk Storage Driver
+   depends on PPC_PS3  BLOCK
+   select PS3_STORAGE
+   help
+ Include support for the PS3 Disk Storage.
+
+ This support is required to access the PS3 hard disk.
+ In general, all users will say Y or M.
+
 endmenu
diff --git a/drivers/block/Makefile b/drivers/block/Makefile
index 819c829..a7a0990 100644
--- a/drivers/block/Makefile
+++ b/drivers/block/Makefile
@@ -8,6 +8,7 @@
 obj-$(CONFIG_MAC_FLOPPY)   += swim3.o
 obj-$(CONFIG_BLK_DEV_FD)   += floppy.o
 obj-$(CONFIG_AMIGA_FLOPPY) += amiflop.o
+obj-$(CONFIG_PS3_DISK) += ps3disk.o
 obj-$(CONFIG_ATARI_FLOPPY) += ataflop.o
 obj-$(CONFIG_AMIGA_Z2RAM)  += z2ram.o
 obj-$(CONFIG_BLK_DEV_RAM)  += rd.o
diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c
new file mode 100644
index 000..170fb33
--- /dev/null
+++ b/drivers/block/ps3disk.c
@@ -0,0 +1,630 @@
+/*
+ * PS3 Disk Storage Driver
+ *
+ * Copyright (C) 2007 Sony Computer Entertainment Inc.
+ * Copyright 2007 Sony Corp.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include linux/ata.h
+#include linux/blkdev.h
+
+#include asm/lv1call.h
+#include asm/ps3stor.h
+#include asm/firmware.h
+
+
+#define DEVICE_NAMEps3disk
+
+#define BOUNCE_SIZE(64*1024)
+
+#define PS3DISK_MAX_DISKS  16
+#define PS3DISK_MINORS 16
+
+
+#define PS3DISK_NAME   ps3d%c
+
+
+struct ps3disk_private {
+   spinlock_t lock;/* Request queue spinlock */
+   struct request_queue *queue;
+   struct gendisk *gendisk;
+   unsigned int blocking_factor;
+   struct request *req;
+   u64 raw_capacity;
+   unsigned char model[ATA_ID_PROD_LEN+1];
+};
+
+
+#define LV1_STORAGE_SEND_ATA_COMMAND   (2)
+#define LV1_STORAGE_ATA_HDDOUT (0x23)
+
+struct lv1_ata_cmnd_block {
+   u16 features;
+   u16 sector_count;
+   u16 LBA_low;
+   u16 LBA_mid;
+   u16 LBA_high;
+   u8  device;
+   u8  command;
+   u32 is_ext;
+   u32 proto;
+   u32 in_out;
+   u32 size;
+   u64 buffer;
+   u32 arglen;
+};
+
+enum lv1_ata_proto {
+   NON_DATA_PROTO = 0,
+   PIO_DATA_IN_PROTO  = 1,
+   PIO_DATA_OUT_PROTO = 2,
+   DMA_PROTO = 3
+};
+
+enum lv1_ata_in_out {
+   DIR_WRITE = 0,  /* memory - device */
+   DIR_READ = 1/* device - memory */
+};
+
+static int ps3disk_major;
+
+
+static struct block_device_operations ps3disk_fops = {
+   .owner  = THIS_MODULE,
+};
+
+
+static void ps3disk_scatter_gather(struct ps3_storage_device *dev,
+ 

ps3: BD/DVD/CD-ROM Storage Driver

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9aea8cbf2866c5680e30ff473341b7c5e93f7442
Commit: 9aea8cbf2866c5680e30ff473341b7c5e93f7442
Parent: c6131fa528c4fc57605c474bf8c83821aff164c0
Author: Geert Uytterhoeven [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:47 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:16 2007 -0700

ps3: BD/DVD/CD-ROM Storage Driver

Add a BD/DVD/CD-ROM Storage Driver for the PS3:
  - Implemented as a SCSI device driver
  - Uses software scatter-gather with a 64 KiB bounce buffer as the 
hypervisor
doesn't support scatter-gather

Cc: Geoff Levand [EMAIL PROTECTED]
Signed-off-by: Geert Uytterhoeven [EMAIL PROTECTED]
Cc: Jens Axboe [EMAIL PROTECTED]
Cc: James Bottomley [EMAIL PROTECTED]
Cc: Paul Mackerras [EMAIL PROTECTED]
Cc: Benjamin Herrenschmidt [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/powerpc/platforms/ps3/Kconfig |   11 +
 drivers/scsi/Makefile  |1 +
 drivers/scsi/ps3rom.c  |  533 
 3 files changed, 545 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/ps3/Kconfig 
b/arch/powerpc/platforms/ps3/Kconfig
index 8da927c..f609291 100644
--- a/arch/powerpc/platforms/ps3/Kconfig
+++ b/arch/powerpc/platforms/ps3/Kconfig
@@ -112,4 +112,15 @@ config PS3_DISK
  This support is required to access the PS3 hard disk.
  In general, all users will say Y or M.
 
+config PS3_ROM
+   tristate PS3 BD/DVD/CD-ROM Storage Driver
+   depends on PPC_PS3  SCSI
+   select PS3_STORAGE
+   help
+ Include support for the PS3 ROM Storage.
+
+ This support is required to access the PS3 BD/DVD/CD-ROM drive.
+ In general, all users will say Y or M.
+ Also make sure to say Y or M to SCSI CDROM support later.
+
 endmenu
diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile
index 0f86895..86a7ba7 100644
--- a/drivers/scsi/Makefile
+++ b/drivers/scsi/Makefile
@@ -132,6 +132,7 @@ obj-$(CONFIG_SCSI_IBMVSCSI) += ibmvscsi/
 obj-$(CONFIG_SCSI_IBMVSCSIS)   += ibmvscsi/
 obj-$(CONFIG_SCSI_HPTIOP)  += hptiop.o
 obj-$(CONFIG_SCSI_STEX)+= stex.o
+obj-$(CONFIG_PS3_ROM)  += ps3rom.o
 
 obj-$(CONFIG_ARM)  += arm/
 
diff --git a/drivers/scsi/ps3rom.c b/drivers/scsi/ps3rom.c
new file mode 100644
index 000..b50f1e1
--- /dev/null
+++ b/drivers/scsi/ps3rom.c
@@ -0,0 +1,533 @@
+/*
+ * PS3 BD/DVD/CD-ROM Storage Driver
+ *
+ * Copyright (C) 2007 Sony Computer Entertainment Inc.
+ * Copyright 2007 Sony Corp.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include linux/cdrom.h
+#include linux/highmem.h
+
+#include scsi/scsi.h
+#include scsi/scsi_cmnd.h
+#include scsi/scsi_dbg.h
+#include scsi/scsi_device.h
+#include scsi/scsi_host.h
+
+#include asm/lv1call.h
+#include asm/ps3stor.h
+
+
+#define DEVICE_NAMEps3rom
+
+#define BOUNCE_SIZE(64*1024)
+
+#define PS3ROM_MAX_SECTORS (BOUNCE_SIZE / CD_FRAMESIZE)
+
+
+struct ps3rom_private {
+   struct ps3_storage_device *dev;
+   struct scsi_cmnd *curr_cmd;
+};
+
+
+#define LV1_STORAGE_SEND_ATAPI_COMMAND (1)
+
+struct lv1_atapi_cmnd_block {
+   u8  pkt[32];/* packet command block   */
+   u32 pktlen; /* should be 12 for ATAPI 8020*/
+   u32 blocks;
+   u32 block_size;
+   u32 proto;  /* transfer mode  */
+   u32 in_out; /* transfer direction */
+   u64 buffer; /* parameter except command block */
+   u32 arglen; /* length above   */
+};
+
+enum lv1_atapi_proto {
+   NON_DATA_PROTO = 0,
+   PIO_DATA_IN_PROTO  = 1,
+   PIO_DATA_OUT_PROTO = 2,
+   DMA_PROTO = 3
+};
+
+enum lv1_atapi_in_out {
+   DIR_WRITE = 0,  /* memory - device */
+   DIR_READ = 1/* device - memory */
+};
+
+
+static int ps3rom_slave_configure(struct scsi_device *scsi_dev)
+{
+   struct ps3rom_private *priv = shost_priv(scsi_dev-host);
+   struct ps3_storage_device *dev = priv-dev;
+
+   

ps3: FLASH ROM Storage Driver

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f96526354bb0824f3ce550a028606d2f94435b92
Commit: f96526354bb0824f3ce550a028606d2f94435b92
Parent: 9aea8cbf2866c5680e30ff473341b7c5e93f7442
Author: Geert Uytterhoeven [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:48 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:16 2007 -0700

ps3: FLASH ROM Storage Driver

Add a FLASH ROM Storage Driver for the PS3:
  - Implemented as a misc character device driver
  - Uses a fixed 256 KiB buffer allocated from boot memory as the hypervisor
requires the writing of aligned 256 KiB blocks

Cc: Geoff Levand [EMAIL PROTECTED]
Signed-off-by: Geert Uytterhoeven [EMAIL PROTECTED]
Cc: Jens Axboe [EMAIL PROTECTED]
Cc: James Bottomley [EMAIL PROTECTED]
Cc: Paul Mackerras [EMAIL PROTECTED]
Cc: Benjamin Herrenschmidt [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/powerpc/platforms/ps3/Kconfig |   15 ++
 drivers/char/Makefile  |2 +
 drivers/char/ps3flash.c|  440 
 3 files changed, 457 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/ps3/Kconfig 
b/arch/powerpc/platforms/ps3/Kconfig
index f609291..d4fc74f 100644
--- a/arch/powerpc/platforms/ps3/Kconfig
+++ b/arch/powerpc/platforms/ps3/Kconfig
@@ -123,4 +123,19 @@ config PS3_ROM
  In general, all users will say Y or M.
  Also make sure to say Y or M to SCSI CDROM support later.
 
+config PS3_FLASH
+   tristate PS3 FLASH ROM Storage Driver
+   depends on PPC_PS3
+   select PS3_STORAGE
+   help
+ Include support for the PS3 FLASH ROM Storage.
+
+ This support is required to access the PS3 FLASH ROM, which
+ contains the boot loader and some boot options.
+ In general, all users will say Y or M.
+
+ As this driver needs a fixed buffer of 256 KiB of memory, it can
+ be disabled on the kernel command line using ps3flash=off, to
+ not allocate this fixed buffer.
+
 endmenu
diff --git a/drivers/char/Makefile b/drivers/char/Makefile
index 4e6f387..8fecaf4 100644
--- a/drivers/char/Makefile
+++ b/drivers/char/Makefile
@@ -107,6 +107,8 @@ obj-$(CONFIG_IPMI_HANDLER)  += ipmi/
 obj-$(CONFIG_HANGCHECK_TIMER)  += hangcheck-timer.o
 obj-$(CONFIG_TCG_TPM)  += tpm/
 
+obj-$(CONFIG_PS3_FLASH)+= ps3flash.o
+
 # Files generated that shall be removed upon make clean
 clean-files := consolemap_deftbl.c defkeymap.c
 
diff --git a/drivers/char/ps3flash.c b/drivers/char/ps3flash.c
new file mode 100644
index 000..79b6f46
--- /dev/null
+++ b/drivers/char/ps3flash.c
@@ -0,0 +1,440 @@
+/*
+ * PS3 FLASH ROM Storage Driver
+ *
+ * Copyright (C) 2007 Sony Computer Entertainment Inc.
+ * Copyright 2007 Sony Corp.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include linux/fs.h
+#include linux/miscdevice.h
+#include linux/uaccess.h
+
+#include asm/lv1call.h
+#include asm/ps3stor.h
+
+
+#define DEVICE_NAMEps3flash
+
+#define FLASH_BLOCK_SIZE   (256*1024)
+
+
+struct ps3flash_private {
+   struct mutex mutex; /* Bounce buffer mutex */
+};
+
+static struct ps3_storage_device *ps3flash_dev;
+
+static ssize_t ps3flash_read_write_sectors(struct ps3_storage_device *dev,
+  u64 lpar, u64 start_sector,
+  u64 sectors, int write)
+{
+   u64 res = ps3stor_read_write_sectors(dev, lpar, start_sector, sectors,
+write);
+   if (res) {
+   dev_err(dev-sbd.core, %s:%u: %s failed 0x%lx\n, __func__,
+   __LINE__, write ? write : read, res);
+   return -EIO;
+   }
+   return sectors;
+}
+
+static ssize_t ps3flash_read_sectors(struct ps3_storage_device *dev,
+u64 start_sector, u64 sectors,
+unsigned int sector_offset)
+{
+   u64 max_sectors, lpar;
+
+   max_sectors = dev-bounce_size / dev-blk_size;
+   if (sectors  max_sectors) {
+   dev_dbg(dev-sbd.core, %s:%u Limiting sectors to 

ps3fb: Enable VT_HW_CONSOLE_BINDING for proper kexec

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=23e9c94caf134cb36a22b91043796057111f6ef3
Commit: 23e9c94caf134cb36a22b91043796057111f6ef3
Parent: 24ed8559c7e8205eb94088532b9dbdf2e290dfa2
Author: Geert Uytterhoeven [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:49 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:16 2007 -0700

ps3fb: Enable VT_HW_CONSOLE_BINDING for proper kexec

ps3fb: VT_HW_CONSOLE_BINDING must be enabled to make console unbinding work,
which is needed to give up all hypervisor resources before reboot or kexec.

Signed-off-by: Geert Uytterhoeven [EMAIL PROTECTED]
Cc: Geoff Levand [EMAIL PROTECTED]
Cc: Paul Mackerras [EMAIL PROTECTED]
Cc: Antonino A. Daplas [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/video/Kconfig |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 0c5644b..d9cb24d 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -1796,6 +1796,7 @@ config FB_PS3
select FB_SYS_COPYAREA
select FB_SYS_IMAGEBLIT
select FB_SYS_FOPS
+   select VT_HW_CONSOLE_BINDING if FRAMEBUFFER_CONSOLE
---help---
  Include support for the virtual frame buffer in the PS3 platform.
 
-
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


ps3fb: Shrink default virtual frame buffer size from 18 to 9 MiB

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=50b2529e38eb1f954bbadec93961aabe8c801904
Commit: 50b2529e38eb1f954bbadec93961aabe8c801904
Parent: 23e9c94caf134cb36a22b91043796057111f6ef3
Author: Geert Uytterhoeven [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:50 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:16 2007 -0700

ps3fb: Shrink default virtual frame buffer size from 18 to 9 MiB

ps3fb: Shrink the default virtual frame buffer size from 18 to 9 MiB, as
nobody really uses the double buffering feature and Linux can use an
additional 9 MiB.  It can still be overridden on the kernel command line 
using
`ps3fb=18M'.

Signed-off-by: Geert Uytterhoeven [EMAIL PROTECTED]
Cc: Geoff Levand [EMAIL PROTECTED]
Cc: Paul Mackerras [EMAIL PROTECTED]
Cc: Antonino A. Daplas [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/video/Kconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index d9cb24d..3c0ed93 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -1803,7 +1803,7 @@ config FB_PS3
 config FB_PS3_DEFAULT_SIZE_M
int PS3 default frame buffer size (in MiB)
depends on FB_PS3
-   default 18
+   default 9
---help---
  This is the default size (in MiB) of the virtual frame buffer in
  the PS3.
-
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


ps3fb: Set FBINFO_READS_FAST to speed up text console scrolling

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cfd13af6270c25e8089e9c5b59ffb55d39ae74a0
Commit: cfd13af6270c25e8089e9c5b59ffb55d39ae74a0
Parent: 50b2529e38eb1f954bbadec93961aabe8c801904
Author: Geert Uytterhoeven [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:51 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:16 2007 -0700

ps3fb: Set FBINFO_READS_FAST to speed up text console scrolling

ps3fb: Set FBINFO_READS_FAST to speed up text console scrolling (on average
50%, according to my tests)

Signed-off-by: Geert Uytterhoeven [EMAIL PROTECTED]
Cc: Geoff Levand [EMAIL PROTECTED]
Cc: Paul Mackerras [EMAIL PROTECTED]
Cc: Antonino A. Daplas [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/video/ps3fb.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c
index 3972aa8..646ec82 100644
--- a/drivers/video/ps3fb.c
+++ b/drivers/video/ps3fb.c
@@ -1067,7 +1067,7 @@ static int __devinit ps3fb_probe(struct 
ps3_system_bus_device *dev)
info-fix.smem_len = ps3fb_videomemory.size - offset;
info-pseudo_palette = info-par;
info-par = NULL;
-   info-flags = FBINFO_FLAG_DEFAULT;
+   info-flags = FBINFO_DEFAULT | FBINFO_READS_FAST;
 
retval = fb_alloc_cmap(info-cmap, 256, 0);
if (retval  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


spufs: make signal-notification files readonly for NOSCHED contexts

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8b6f50ef1d5cc86b278eb42bc91630fad455fb10
Commit: 8b6f50ef1d5cc86b278eb42bc91630fad455fb10
Parent: cfd13af6270c25e8089e9c5b59ffb55d39ae74a0
Author: Jeremy Kerr [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:51 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:16 2007 -0700

spufs: make signal-notification files readonly for NOSCHED contexts

Reading from the signal{1,2} files requires a spu_acquire_saved, so make 
these
files write-only for contexts created with SPU_CREATE_NOSCHED.

Signed-off-by: Jeremy Kerr [EMAIL PROTECTED]
Acked-by: Arnd Bergmann [EMAIL PROTECTED]
Cc: Paul Mackerras [EMAIL PROTECTED]
Cc: Benjamin Herrenschmidt [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/powerpc/platforms/cell/spufs/file.c |   18 --
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/cell/spufs/file.c 
b/arch/powerpc/platforms/cell/spufs/file.c
index 7de4e91..c2aaec5 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -941,6 +941,13 @@ static const struct file_operations 
spufs_signal1_nosched_fops = {
.mmap = spufs_signal1_mmap,
 };
 
+static const struct file_operations spufs_signal1_nosched_fops = {
+   .open = spufs_signal1_open,
+   .release = spufs_signal1_release,
+   .write = spufs_signal1_write,
+   .mmap = spufs_signal1_mmap,
+};
+
 static int spufs_signal2_open(struct inode *inode, struct file *file)
 {
struct spufs_inode_info *i = SPUFS_I(inode);
@@ -1076,6 +1083,13 @@ static const struct file_operations 
spufs_signal2_nosched_fops = {
.mmap = spufs_signal2_mmap,
 };
 
+static const struct file_operations spufs_signal2_nosched_fops = {
+   .open = spufs_signal2_open,
+   .release = spufs_signal2_release,
+   .write = spufs_signal2_write,
+   .mmap = spufs_signal2_mmap,
+};
+
 static void spufs_signal1_type_set(void *data, u64 val)
 {
struct spu_context *ctx = data;
@@ -2177,8 +2191,8 @@ struct tree_descr spufs_dir_contents[] = {
{ mbox_stat, spufs_mbox_stat_fops, 0444, },
{ ibox_stat, spufs_ibox_stat_fops, 0444, },
{ wbox_stat, spufs_wbox_stat_fops, 0444, },
-   { signal1, spufs_signal1_fops, 0666, },
-   { signal2, spufs_signal2_fops, 0666, },
+   { signal1, spufs_signal1_nosched_fops, 0222, },
+   { signal2, spufs_signal2_nosched_fops, 0222, },
{ signal1_type, spufs_signal1_type, 0666, },
{ signal2_type, spufs_signal2_type, 0666, },
{ cntl, spufs_cntl_fops,  0666, },
-
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


spi.c:scan_boardinfo() mustn't be __init_or_module

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=149a6501f90df457d75a1954dd5a29434a182e6a
Commit: 149a6501f90df457d75a1954dd5a29434a182e6a
Parent: 8b6f50ef1d5cc86b278eb42bc91630fad455fb10
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:52 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:16 2007 -0700

spi.c:scan_boardinfo() mustn't be __init_or_module

WARNING: drivers/built-in.o(.text+0x889735): Section mismatch: reference to 
.init.text:scan_boardinfo (between 'spi_register_master' and '__unregister')

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Acked-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/spi/spi.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 018884d..b05de30 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -303,8 +303,7 @@ spi_register_board_info(struct spi_board_info const *info, 
unsigned n)
  * creates board info from kernel command lines
  */
 
-static void __init_or_module
-scan_boardinfo(struct spi_master *master)
+static void scan_boardinfo(struct spi_master *master)
 {
struct boardinfo*bi;
struct device   *dev = master-cdev.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


Use menuconfig objects - CONFIG_ISDN_I4L

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5f67c5cc855d5a189fc542da3921868ca87fc274
Commit: 5f67c5cc855d5a189fc542da3921868ca87fc274
Parent: 149a6501f90df457d75a1954dd5a29434a182e6a
Author: Tilman Schmidt [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:53 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:17 2007 -0700

Use menuconfig objects - CONFIG_ISDN_I4L

Remove a menu statement and several dependencies from the Kconfig files in
the drivers/isdn tree as they have become unnecessary by the transformation
of CONFIG_ISDN from menu, config into menuconfig.
(Modified version of a patch originally proposed by Jan Engelhardt.)

Signed-off-by: Tilman Schmidt [EMAIL PROTECTED]
Cc: Jan Engelhardt [EMAIL PROTECTED]
Acked-by: Karsten Keil [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/isdn/Kconfig |8 +---
 drivers/isdn/act2000/Kconfig |2 +-
 drivers/isdn/gigaset/Kconfig |2 --
 drivers/isdn/hisax/Kconfig   |1 -
 drivers/isdn/i4l/Kconfig |3 ---
 drivers/isdn/icn/Kconfig |2 +-
 drivers/isdn/pcbit/Kconfig   |2 +-
 drivers/isdn/sc/Kconfig  |2 +-
 8 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/drivers/isdn/Kconfig b/drivers/isdn/Kconfig
index cf906c8..813ed4c 100644
--- a/drivers/isdn/Kconfig
+++ b/drivers/isdn/Kconfig
@@ -21,8 +21,6 @@ menuconfig ISDN
 
 if ISDN
 
-menu Old ISDN4Linux
-
 config ISDN_I4L
tristate Old ISDN4Linux (deprecated)
---help---
@@ -45,12 +43,8 @@ if ISDN_I4L
 source drivers/isdn/i4l/Kconfig
 endif
 
-endmenu
-
-comment CAPI subsystem
-
 config ISDN_CAPI
-   tristate CAPI2.0 support
+   tristate CAPI 2.0 subsystem
help
  This provides the CAPI (Common ISDN Application Programming
  Interface, a standard making it easy for programs to access ISDN
diff --git a/drivers/isdn/act2000/Kconfig b/drivers/isdn/act2000/Kconfig
index 78e6ad8..3fc1a54 100644
--- a/drivers/isdn/act2000/Kconfig
+++ b/drivers/isdn/act2000/Kconfig
@@ -3,7 +3,7 @@
 #
 config ISDN_DRV_ACT2000
tristate IBM Active 2000 support
-   depends on ISDN_I4L  ISA
+   depends on ISA
help
  Say Y here if you have an IBM Active 2000 ISDN card. In order to use
  this card, additional firmware is necessary, which has to be loaded
diff --git a/drivers/isdn/gigaset/Kconfig b/drivers/isdn/gigaset/Kconfig
index bcbb650..018b793 100644
--- a/drivers/isdn/gigaset/Kconfig
+++ b/drivers/isdn/gigaset/Kconfig
@@ -1,9 +1,7 @@
 menu Siemens Gigaset
-   depends on ISDN_I4L
 
 config ISDN_DRV_GIGASET
tristate Siemens Gigaset support (isdn)
-   depends on ISDN_I4L
select CRC_CCITT
select BITREVERSE
help
diff --git a/drivers/isdn/hisax/Kconfig b/drivers/isdn/hisax/Kconfig
index 12d91fb..a3b945a 100644
--- a/drivers/isdn/hisax/Kconfig
+++ b/drivers/isdn/hisax/Kconfig
@@ -1,6 +1,5 @@
 
 menu Passive cards
-   depends on ISDN_I4L
 
 config ISDN_DRV_HISAX
tristate HiSax SiemensChipSet driver support
diff --git a/drivers/isdn/i4l/Kconfig b/drivers/isdn/i4l/Kconfig
index e91c187..36778b2 100644
--- a/drivers/isdn/i4l/Kconfig
+++ b/drivers/isdn/i4l/Kconfig
@@ -99,7 +99,6 @@ config ISDN_DRV_LOOP
 
 config ISDN_DIVERSION
tristate Support isdn diversion services
-   depends on ISDN_I4L
help
  This option allows you to use some supplementary diversion
  services in conjunction with the HiSax driver on an EURO/DSS1
@@ -119,13 +118,11 @@ config ISDN_DIVERSION
 endmenu
 
 comment ISDN4Linux hardware drivers
-   depends on ISDN_I4L
 
 source drivers/isdn/hisax/Kconfig
 
 
 menu Active cards
-   depends on ISDN_I4L!=n
 
 source drivers/isdn/icn/Kconfig
 
diff --git a/drivers/isdn/icn/Kconfig b/drivers/isdn/icn/Kconfig
index fcb99f5..89d15ee 100644
--- a/drivers/isdn/icn/Kconfig
+++ b/drivers/isdn/icn/Kconfig
@@ -3,7 +3,7 @@
 #
 config ISDN_DRV_ICN
tristate ICN 2B and 4B support
-   depends on ISDN_I4L  ISA
+   depends on ISA
help
  This enables support for two kinds of ISDN-cards made by a German
  company called ICN.  2B is the standard version for a single ISDN
diff --git a/drivers/isdn/pcbit/Kconfig b/drivers/isdn/pcbit/Kconfig
index 0933881..ffba6ec 100644
--- a/drivers/isdn/pcbit/Kconfig
+++ b/drivers/isdn/pcbit/Kconfig
@@ -3,7 +3,7 @@
 #
 config ISDN_DRV_PCBIT
tristate PCBIT-D support
-   depends on ISDN_I4L  ISA  (BROKEN || X86)
+   depends on ISA  (BROKEN || X86)
help
  This enables support for the PCBIT ISDN-card.  This card is
  manufactured in Portugal by Octal.  For running this card,
diff --git a/drivers/isdn/sc/Kconfig b/drivers/isdn/sc/Kconfig
index 5346e33..e6510ca 100644
--- a/drivers/isdn/sc/Kconfig
+++ 

Use menuconfig objects: ISDN

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=857038d93adce6c1dfdb12c242d7fbee1ded370d
Commit: 857038d93adce6c1dfdb12c242d7fbee1ded370d
Parent: 5f67c5cc855d5a189fc542da3921868ca87fc274
Author: Jan Engelhardt [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:54 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:17 2007 -0700

Use menuconfig objects: ISDN

Unclutter the ISDN menu a tiny bit by moving ISDN4Linux and the CAPI2.0
layers into their own menu.

Signed-off-by: Jan Engelhardt [EMAIL PROTECTED]
Cc: Tilman Schmidt [EMAIL PROTECTED]
Acked-by: Karsten Keil [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/isdn/Kconfig |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/isdn/Kconfig b/drivers/isdn/Kconfig
index 813ed4c..66f946a 100644
--- a/drivers/isdn/Kconfig
+++ b/drivers/isdn/Kconfig
@@ -21,7 +21,7 @@ menuconfig ISDN
 
 if ISDN
 
-config ISDN_I4L
+menuconfig ISDN_I4L
tristate Old ISDN4Linux (deprecated)
---help---
  This driver allows you to use an ISDN adapter for networking
@@ -43,7 +43,7 @@ if ISDN_I4L
 source drivers/isdn/i4l/Kconfig
 endif
 
-config ISDN_CAPI
+menuconfig ISDN_CAPI
tristate CAPI 2.0 subsystem
help
  This provides the CAPI (Common ISDN Application Programming
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Use menuconfig objects: ISDN/Gigaset

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8214b0832cb3c0b74198e5b22c0e070aeaa3dd20
Commit: 8214b0832cb3c0b74198e5b22c0e070aeaa3dd20
Parent: 857038d93adce6c1dfdb12c242d7fbee1ded370d
Author: Jan Engelhardt [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:54 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:17 2007 -0700

Use menuconfig objects: ISDN/Gigaset

Change Kconfig objects from menu, config into menuconfig so that the 
user
can disable the whole feature without having to enter the menu first.

Signed-off-by: Jan Engelhardt [EMAIL PROTECTED]
Cc: Tilman Schmidt [EMAIL PROTECTED]
Acked-by: Karsten Keil [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/isdn/gigaset/Kconfig |8 ++--
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/isdn/gigaset/Kconfig b/drivers/isdn/gigaset/Kconfig
index 018b793..0017e50 100644
--- a/drivers/isdn/gigaset/Kconfig
+++ b/drivers/isdn/gigaset/Kconfig
@@ -1,6 +1,4 @@
-menu Siemens Gigaset
-
-config ISDN_DRV_GIGASET
+menuconfig ISDN_DRV_GIGASET
tristate Siemens Gigaset support (isdn)
select CRC_CCITT
select BITREVERSE
@@ -53,6 +51,4 @@ config GIGASET_UNDOCREQ
  features like configuration mode of M105, say yes. If you
  care about your device, say no.
 
-endif
-
-endmenu
+endif # ISDN_DRV_GIGASET != 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


rtc: do not return void value

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ef154ec69c45aa052b1fa71ee5eeaca7e7f920a3
Commit: ef154ec69c45aa052b1fa71ee5eeaca7e7f920a3
Parent: 8214b0832cb3c0b74198e5b22c0e070aeaa3dd20
Author: Atsushi Nemoto [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:55 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:17 2007 -0700

rtc: do not return void value

This patch fixes these sparse warnings:

drivers/rtc/rtc-ds1742.c:265:2: warning: returning void-valued expression
drivers/rtc/rtc-ds1553.c:409:2: warning: returning void-valued expression

Signed-off-by: Atsushi Nemoto [EMAIL PROTECTED]
Cc: David Brownell [EMAIL PROTECTED]
Cc: Alessandro Zummo [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/rtc/rtc-ds1553.c |2 +-
 drivers/rtc/rtc-ds1742.c |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-ds1553.c b/drivers/rtc/rtc-ds1553.c
index f98a83a..46da571 100644
--- a/drivers/rtc/rtc-ds1553.c
+++ b/drivers/rtc/rtc-ds1553.c
@@ -407,7 +407,7 @@ static __init int ds1553_init(void)
 
 static __exit void ds1553_exit(void)
 {
-   return platform_driver_unregister(ds1553_rtc_driver);
+   platform_driver_unregister(ds1553_rtc_driver);
 }
 
 module_init(ds1553_init);
diff --git a/drivers/rtc/rtc-ds1742.c b/drivers/rtc/rtc-ds1742.c
index d1778ae..b2e5481 100644
--- a/drivers/rtc/rtc-ds1742.c
+++ b/drivers/rtc/rtc-ds1742.c
@@ -263,7 +263,7 @@ static __init int ds1742_init(void)
 
 static __exit void ds1742_exit(void)
 {
-   return platform_driver_unregister(ds1742_rtc_driver);
+   platform_driver_unregister(ds1742_rtc_driver);
 }
 
 module_init(ds1742_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


rtc kconfig: point out need for static linkage

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=55ff1aba940ff46d4f6d4fd790ea3e1a47aaa84f
Commit: 55ff1aba940ff46d4f6d4fd790ea3e1a47aaa84f
Parent: ef154ec69c45aa052b1fa71ee5eeaca7e7f920a3
Author: David Brownell [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:56 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:17 2007 -0700

rtc kconfig: point out need for static linkage

Various people have expressed surprise that their modular RTC drivers don't
seem to work for initializing the system time at boot.  To help avoid such
unpleasantness, make the Kconfig text point out that the driver probably
needs to be statically linked.

Signed-off-by: David Brownell [EMAIL PROTECTED]
Acked-by: Alessandro Zummo [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/rtc/Kconfig |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 35f3466..505f512 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -38,6 +38,9 @@ config RTC_HCTOSYS_DEVICE
  clock, usually rtc0.  Initialization is done when the system
  starts up, and when it resumes from a low power state.
 
+ The driver for this RTC device must be loaded before late_initcall
+ functions run, so it must usually be statically linked.
+
  This clock should be battery-backed, so that it reads the correct
  time when the system boots from a power-off state.  Otherwise, your
  system will need an external clock source (like an NTP server).
-
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


rtc: update and use the MAX6900 century byte

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8a2601f6aa837903bfb385b138b50b1e305f3e04
Commit: 8a2601f6aa837903bfb385b138b50b1e305f3e04
Parent: 55ff1aba940ff46d4f6d4fd790ea3e1a47aaa84f
Author: Dale Farnsworth [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:57 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:17 2007 -0700

rtc: update and use the MAX6900 century byte

We now read and write the century byte in the max6900 chip.  We probably
don't need to do so on Linux-only system, but it's necessary when the chip
is shared by another OS that uses the century byte.

Signed-off-by: Dale Farnsworth [EMAIL PROTECTED]
Cc: Alessandro Zummo [EMAIL PROTECTED]
Cc: David Brownell [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/rtc/rtc-max6900.c |   96 +---
 1 files changed, 72 insertions(+), 24 deletions(-)

diff --git a/drivers/rtc/rtc-max6900.c b/drivers/rtc/rtc-max6900.c
index eee4ee5..a1cd448 100644
--- a/drivers/rtc/rtc-max6900.c
+++ b/drivers/rtc/rtc-max6900.c
@@ -31,17 +31,24 @@
 #define MAX6900_REG_DW 5   /* day of week   1-7  */
 #define MAX6900_REG_YR 6   /* year 00-99 */
 #define MAX6900_REG_CT 7   /* control */
-#define MAX6900_REG_LEN8
+   /* register 8 is undocumented */
+#define MAX6900_REG_CENTURY9   /* century */
+#define MAX6900_REG_LEN10
+
+#define MAX6900_BURST_LEN  8   /* can burst r/w first 8 regs */
 
 #define MAX6900_REG_CT_WP  (1  7)/* Write Protect */
 
+
 /*
  * register read/write commands
  */
 #define MAX6900_REG_CONTROL_WRITE  0x8e
-#define MAX6900_REG_BURST_READ 0xbf
-#define MAX6900_REG_BURST_WRITE0xbe
+#define MAX6900_REG_CENTURY_WRITE  0x92
+#define MAX6900_REG_CENTURY_READ   0x93
 #define MAX6900_REG_RESERVED_READ  0x96
+#define MAX6900_REG_BURST_WRITE0xbe
+#define MAX6900_REG_BURST_READ 0xbf
 
 #define MAX6900_IDLE_TIME_AFTER_WRITE  3   /* specification says 2.5 mS */
 
@@ -58,19 +65,32 @@ static int max6900_probe(struct i2c_adapter *adapter, int 
addr, int kind);
 
 static int max6900_i2c_read_regs(struct i2c_client *client, u8 *buf)
 {
-   u8 reg_addr[1] = { MAX6900_REG_BURST_READ };
-   struct i2c_msg msgs[2] = {
+   u8 reg_burst_read[1] = { MAX6900_REG_BURST_READ };
+   u8 reg_century_read[1] = { MAX6900_REG_CENTURY_READ };
+   struct i2c_msg msgs[4] = {
{
.addr   = client-addr,
.flags  = 0, /* write */
-   .len= sizeof(reg_addr),
-   .buf= reg_addr
+   .len= sizeof(reg_burst_read),
+   .buf= reg_burst_read
},
{
.addr   = client-addr,
.flags  = I2C_M_RD,
-   .len= MAX6900_REG_LEN,
+   .len= MAX6900_BURST_LEN,
.buf= buf
+   },
+   {
+   .addr   = client-addr,
+   .flags  = 0, /* write */
+   .len= sizeof(reg_century_read),
+   .buf= reg_century_read
+   },
+   {
+   .addr   = client-addr,
+   .flags  = I2C_M_RD,
+   .len= sizeof(buf[MAX6900_REG_CENTURY]),
+   .buf= buf[MAX6900_REG_CENTURY]
}
};
int rc;
@@ -86,33 +106,58 @@ static int max6900_i2c_read_regs(struct i2c_client 
*client, u8 *buf)
 
 static int max6900_i2c_write_regs(struct i2c_client *client, u8 const *buf)
 {
-   u8 i2c_buf[MAX6900_REG_LEN + 1] = { MAX6900_REG_BURST_WRITE };
-   struct i2c_msg msgs[1] = {
+   u8 i2c_century_buf[1 + 1] = { MAX6900_REG_CENTURY_WRITE };
+   struct i2c_msg century_msgs[1] = {
{
.addr   = client-addr,
.flags  = 0, /* write */
-   .len= MAX6900_REG_LEN + 1,
-   .buf= i2c_buf
+   .len= sizeof(i2c_century_buf),
+   .buf= i2c_century_buf
+   }
+   };
+   u8 i2c_burst_buf[MAX6900_BURST_LEN + 1] = { MAX6900_REG_BURST_WRITE };
+   struct i2c_msg burst_msgs[1] = {
+   {
+   .addr   = client-addr,
+   .flags  = 0, /* write */
+   .len= sizeof(i2c_burst_buf),
+   .buf= i2c_burst_buf
 

rtc: add support for STK17TA8 chip

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=029641151bfede0930a79ecabb2572dc27a3c86f
Commit: 029641151bfede0930a79ecabb2572dc27a3c86f
Parent: 8a2601f6aa837903bfb385b138b50b1e305f3e04
Author: Thomas Hommel [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:58 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:17 2007 -0700

rtc: add support for STK17TA8 chip

This patch adds support for the Simtek STK17TA8 timekeeping chip.

The STK17TA8 is quite similar to the DS1553, but differs in register layout
and in various control bits in the registers.  I chose to make this a new
driver to avoid confusion in the code and to not get lost in #ifdefs.

Signed-off-by: Thomas Hommel [EMAIL PROTECTED]
Cc: Alessandro Zummo [EMAIL PROTECTED]
Cc: David Brownell [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/rtc/Kconfig|   10 +
 drivers/rtc/Makefile   |1 +
 drivers/rtc/rtc-stk17ta8.c |  420 
 3 files changed, 431 insertions(+), 0 deletions(-)

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 505f512..9d8d40d 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -308,6 +308,16 @@ config RTC_DRV_DS1553
  This driver can also be built as a module. If so, the module
  will be called rtc-ds1553.
 
+config RTC_DRV_STK17TA8
+   tristate Simtek STK17TA8
+   depends on RTC_CLASS
+   help
+ If you say yes here you get support for the
+ Simtek STK17TA8 timekeeping chip.
+
+ This driver can also be built as a module. If so, the module
+ will be called rtc-stk17ta8.
+
 config RTC_DRV_DS1742
tristate Dallas DS1742/1743
depends on RTC_CLASS
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
index 3109af9..7ede9e7 100644
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@ -32,6 +32,7 @@ obj-$(CONFIG_RTC_DRV_RS5C348) += rtc-rs5c348.o
 obj-$(CONFIG_RTC_DRV_M41T80)   += rtc-m41t80.o
 obj-$(CONFIG_RTC_DRV_M48T86)   += rtc-m48t86.o
 obj-$(CONFIG_RTC_DRV_DS1553)   += rtc-ds1553.o
+obj-$(CONFIG_RTC_DRV_STK17TA8) += rtc-stk17ta8.o
 obj-$(CONFIG_RTC_DRV_RS5C313)  += rtc-rs5c313.o
 obj-$(CONFIG_RTC_DRV_EP93XX)   += rtc-ep93xx.o
 obj-$(CONFIG_RTC_DRV_SA1100)   += rtc-sa1100.o
diff --git a/drivers/rtc/rtc-stk17ta8.c b/drivers/rtc/rtc-stk17ta8.c
new file mode 100644
index 000..f10d3fa
--- /dev/null
+++ b/drivers/rtc/rtc-stk17ta8.c
@@ -0,0 +1,420 @@
+/*
+ * A RTC driver for the Simtek STK17TA8
+ *
+ * By Thomas Hommel [EMAIL PROTECTED]
+ *
+ * Based on the DS1553 driver from
+ * Atsushi Nemoto [EMAIL PROTECTED]
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include linux/bcd.h
+#include linux/init.h
+#include linux/kernel.h
+#include linux/delay.h
+#include linux/jiffies.h
+#include linux/interrupt.h
+#include linux/rtc.h
+#include linux/platform_device.h
+#include linux/io.h
+
+#define DRV_VERSION 0.1
+
+#define RTC_REG_SIZE   0x2
+#define RTC_OFFSET 0x1fff0
+
+#define RTC_FLAGS  (RTC_OFFSET + 0)
+#define RTC_CENTURY(RTC_OFFSET + 1)
+#define RTC_SECONDS_ALARM  (RTC_OFFSET + 2)
+#define RTC_MINUTES_ALARM  (RTC_OFFSET + 3)
+#define RTC_HOURS_ALARM(RTC_OFFSET + 4)
+#define RTC_DATE_ALARM (RTC_OFFSET + 5)
+#define RTC_INTERRUPTS (RTC_OFFSET + 6)
+#define RTC_WATCHDOG   (RTC_OFFSET + 7)
+#define RTC_CALIBRATION(RTC_OFFSET + 8)
+#define RTC_SECONDS(RTC_OFFSET + 9)
+#define RTC_MINUTES(RTC_OFFSET + 10)
+#define RTC_HOURS  (RTC_OFFSET + 11)
+#define RTC_DAY(RTC_OFFSET + 12)
+#define RTC_DATE   (RTC_OFFSET + 13)
+#define RTC_MONTH  (RTC_OFFSET + 14)
+#define RTC_YEAR   (RTC_OFFSET + 15)
+
+#define RTC_SECONDS_MASK   0x7f
+#define RTC_DAY_MASK   0x07
+#define RTC_CAL_MASK   0x3f
+
+/* Bits in the Calibration register */
+#define RTC_STOP   0x80
+
+/* Bits in the Flags register */
+#define RTC_FLAGS_AF   0x40
+#define RTC_FLAGS_PF   0x20
+#define RTC_WRITE  0x02
+#define RTC_READ   0x01
+
+/* Bits in the Interrupts register */
+#define RTC_INTS_AIE   0x40
+
+struct rtc_plat_data {
+   struct rtc_device *rtc;
+   void __iomem *ioaddr;
+   unsigned long baseaddr;
+   unsigned long last_jiffies;
+   int irq;
+   unsigned int irqen;
+   int alrm_sec;
+   int alrm_min;
+   int alrm_hour;
+   int alrm_mday;
+};
+
+static int stk17ta8_rtc_set_time(struct device *dev, struct rtc_time *tm)
+{
+   struct 

atmel_lcdfb: Fix STN LCD support

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=250a269da4e2afe815aeef97c3b115fbda4440ac
Commit: 250a269da4e2afe815aeef97c3b115fbda4440ac
Parent: 029641151bfede0930a79ecabb2572dc27a3c86f
Author: Nicolas Ferre [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:37:59 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:17 2007 -0700

atmel_lcdfb: Fix STN LCD support

Fixes STN LCD support for the atmel_lcdfb framebuffer driver.

This patch is the result of a work from Jan Altenberg and has
been tested on a Hitachi SP06Q002 on at91sam9261ek.

It adds a Kconfig switch that enables the proper LCD in the
board configuration file (STN or TFT). The switch is used
in arch/arm/mach-at91/at91sam9261_devices.c  board-sam9261ek.c
as an example.

This patch includes the Fix wrong line_length calculation
little one from Jan and Haavard (submitted earlier).

AT91 platform informations are directly submitted trough
the at91 maintainer, here :
http://article.gmane.org/gmane.linux.kernel/543158

Signed-off-by: Nicolas Ferre [EMAIL PROTECTED]
Cc: Antonino A. Daplas [EMAIL PROTECTED]
Cc: Jan Altenberg [EMAIL PROTECTED]
Cc: Patrice Vilchez [EMAIL PROTECTED]
Cc: Andrew Victor [EMAIL PROTECTED]
Cc: Haavard Skinnemoen [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/video/Kconfig   |   10 +++
 drivers/video/atmel_lcdfb.c |   62 +-
 2 files changed, 64 insertions(+), 8 deletions(-)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 3c0ed93..2a237f0 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -849,6 +849,16 @@ config FB_INTSRAM
  Say Y if you want to map Frame Buffer in internal SRAM. Say N if you 
want
  to let frame buffer in external SDRAM.
 
+config FB_ATMEL_STN
+   bool Use a STN display with AT91/AT32 LCD Controller
+   depends on FB_ATMEL  MACH_AT91SAM9261EK
+   default n
+   help
+ Say Y if you want to connect a STN LCD display to the AT91/AT32 LCD
+ Controller. Say N if you want to connect a TFT.
+
+ If unsure, say N.
+
 config FB_NVIDIA
tristate nVidia Framebuffer Support
depends on FB  PCI
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index e1d5bd0..69ec93c 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -79,6 +79,29 @@ static struct fb_fix_screeninfo atmel_lcdfb_fix __initdata = 
{
.accel  = FB_ACCEL_NONE,
 };
 
+static unsigned long compute_hozval(unsigned long xres, unsigned long lcdcon2)
+{
+   unsigned long value;
+
+   if (!(cpu_is_at91sam9261() || cpu_is_at32ap7000()))
+   return xres;
+
+   value = xres;
+   if ((lcdcon2  ATMEL_LCDC_DISTYPE) != ATMEL_LCDC_DISTYPE_TFT) {
+   /* STN display */
+   if ((lcdcon2  ATMEL_LCDC_DISTYPE) == 
ATMEL_LCDC_DISTYPE_STNCOLOR) {
+   value *= 3;
+   }
+   if ( (lcdcon2  ATMEL_LCDC_IFWIDTH) == ATMEL_LCDC_IFWIDTH_4
+  || ( (lcdcon2  ATMEL_LCDC_IFWIDTH) == ATMEL_LCDC_IFWIDTH_8
+  (lcdcon2  ATMEL_LCDC_SCANMOD) == 
ATMEL_LCDC_SCANMOD_DUAL ))
+   value = DIV_ROUND_UP(value, 4);
+   else
+   value = DIV_ROUND_UP(value, 8);
+   }
+
+   return value;
+}
 
 static void atmel_lcdfb_update_dma(struct fb_info *info,
   struct fb_var_screeninfo *var)
@@ -181,6 +204,7 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo 
*var,
var-xoffset = var-yoffset = 0;
 
switch (var-bits_per_pixel) {
+   case 1:
case 2:
case 4:
case 8:
@@ -228,8 +252,10 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo 
*var,
 static int atmel_lcdfb_set_par(struct fb_info *info)
 {
struct atmel_lcdfb_info *sinfo = info-par;
+   unsigned long hozval_linesz;
unsigned long value;
unsigned long clk_value_khz;
+   unsigned long bits_per_line;
 
dev_dbg(info-device, %s:\n, __func__);
dev_dbg(info-device,   * resolution: %ux%u (%ux%u virtual)\n,
@@ -241,12 +267,15 @@ static int atmel_lcdfb_set_par(struct fb_info *info)
 
lcdc_writel(sinfo, ATMEL_LCDC_DMACON, 0);
 
-   if (info-var.bits_per_pixel = 8)
+   if (info-var.bits_per_pixel == 1)
+   info-fix.visual = FB_VISUAL_MONO01;
+   else if (info-var.bits_per_pixel = 8)
info-fix.visual = FB_VISUAL_PSEUDOCOLOR;
else
info-fix.visual = FB_VISUAL_TRUECOLOR;
 
-   info-fix.line_length = info-var.xres_virtual * 
(info-var.bits_per_pixel / 8);
+   bits_per_line = info-var.xres_virtual * 

rivafb_setup() must be __devinit

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7cc90249ff0e21c526532ce5b5ba35c07c8b8389
Commit: 7cc90249ff0e21c526532ce5b5ba35c07c8b8389
Parent: 250a269da4e2afe815aeef97c3b115fbda4440ac
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:38:01 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:17 2007 -0700

rivafb_setup() must be __devinit

WARNING: drivers/built-in.o(.text+0x57106): Section mismatch: reference to 
.init.text:rivafb_setup (between 'rivafb_init' and 'nv3Busy')

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Cc: Antonino A. Daplas [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/video/riva/fbdev.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index 0fe5478..41381e6 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -2146,7 +2146,7 @@ static void __devexit rivafb_remove(struct pci_dev *pd)
  * - */
 
 #ifndef MODULE
-static int __init rivafb_setup(char *options)
+static int __devinit rivafb_setup(char *options)
 {
char *this_opt;
 
-
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


atmel_lcdfb: use spare bits in 32bpp mode as alpha channel

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4440e0e11d2e9eb13e6edf44f89019e4f8a4dd58
Commit: 4440e0e11d2e9eb13e6edf44f89019e4f8a4dd58
Parent: 7cc90249ff0e21c526532ce5b5ba35c07c8b8389
Author: Haavard Skinnemoen [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 04:38:02 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 17:49:17 2007 -0700

atmel_lcdfb: use spare bits in 32bpp mode as alpha channel

Set var-transp.offset and var-transp.length in 32bpp mode to indicate
that the 8 otherwise unused bits can be used for transparency.

Signed-off-by: Haavard Skinnemoen [EMAIL PROTECTED]
Signed-off-by: Nicolas Ferre [EMAIL PROTECTED]
Cc: Antonino A. Daplas [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/video/atmel_lcdfb.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 69ec93c..235b618 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -219,8 +219,11 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo 
*var,
var-blue.offset = 10;
var-red.length = var-green.length = var-blue.length = 5;
break;
-   case 24:
case 32:
+   var-transp.offset = 24;
+   var-transp.length = 8;
+   /* fall through */
+   case 24:
var-red.offset = 0;
var-green.offset = 8;
var-blue.offset = 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


x86_64: Update defconfig

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=56525597619ab93abc60a22a4ee53e51a0853749
Commit: 56525597619ab93abc60a22a4ee53e51a0853749
Parent: 4440e0e11d2e9eb13e6edf44f89019e4f8a4dd58
Author: Andi Kleen [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:09:49 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:07 2007 -0700

x86_64: Update defconfig

Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/defconfig |  288 +
 1 files changed, 49 insertions(+), 239 deletions(-)

diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig
index 40178e5..b7c4cd0 100644
--- a/arch/x86_64/defconfig
+++ b/arch/x86_64/defconfig
@@ -1,19 +1,22 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.22-rc2
-# Mon May 21 13:23:40 2007
+# Linux kernel version: 2.6.22-git14
+# Fri Jul 20 09:53:15 2007
 #
 CONFIG_X86_64=y
 CONFIG_64BIT=y
 CONFIG_X86=y
 CONFIG_GENERIC_TIME=y
 CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CMOS_UPDATE=y
 CONFIG_ZONE_DMA32=y
 CONFIG_LOCKDEP_SUPPORT=y
 CONFIG_STACKTRACE_SUPPORT=y
 CONFIG_SEMAPHORE_SLEEPERS=y
 CONFIG_MMU=y
 CONFIG_ZONE_DMA=y
+CONFIG_QUICKLIST=y
+CONFIG_NR_QUICK=2
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
@@ -44,19 +47,18 @@ CONFIG_LOCALVERSION=
 CONFIG_LOCALVERSION_AUTO=y
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
-# CONFIG_IPC_NS is not set
 CONFIG_SYSVIPC_SYSCTL=y
 CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_UTS_NS is not set
+# CONFIG_USER_NS is not set
 # CONFIG_AUDIT is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=18
 # CONFIG_CPUSETS is not set
 CONFIG_SYSFS_DEPRECATED=y
-# CONFIG_RELAY is not set
+CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_INITRAMFS_SOURCE=
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
@@ -86,10 +88,6 @@ CONFIG_SLAB=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
-
-#
-# Loadable module support
-#
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
@@ -97,12 +95,9 @@ CONFIG_MODULE_FORCE_UNLOAD=y
 # CONFIG_MODULE_SRCVERSION_ALL is not set
 # CONFIG_KMOD is not set
 CONFIG_STOP_MACHINE=y
-
-#
-# Block layer
-#
 CONFIG_BLOCK=y
 # CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_BLK_DEV_BSG is not set
 
 #
 # IO Schedulers
@@ -165,9 +160,12 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_MIGRATION=y
 CONFIG_RESOURCES_64BIT=y
 CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
 CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y
 CONFIG_OUT_OF_LINE_PFN_TO_PAGE=y
 CONFIG_NR_CPUS=32
+CONFIG_PHYSICAL_ALIGN=0x20
 CONFIG_HOTPLUG_CPU=y
 CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 CONFIG_HPET_TIMER=y
@@ -180,7 +178,7 @@ CONFIG_X86_MCE_INTEL=y
 CONFIG_X86_MCE_AMD=y
 # CONFIG_KEXEC is not set
 # CONFIG_CRASH_DUMP is not set
-CONFIG_RELOCATABLE=y
+# CONFIG_RELOCATABLE is not set
 CONFIG_PHYSICAL_START=0x20
 CONFIG_SECCOMP=y
 # CONFIG_CC_STACKPROTECTOR is not set
@@ -201,7 +199,6 @@ CONFIG_GENERIC_PENDING_IRQ=y
 CONFIG_PM=y
 # CONFIG_PM_LEGACY is not set
 # CONFIG_PM_DEBUG is not set
-# CONFIG_PM_SYSFS_DEPRECATED is not set
 CONFIG_SOFTWARE_SUSPEND=y
 CONFIG_PM_STD_PARTITION=
 CONFIG_SUSPEND_SMP=y
@@ -248,7 +245,7 @@ CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
 # CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
 CONFIG_CPU_FREQ_GOV_USERSPACE=y
 CONFIG_CPU_FREQ_GOV_ONDEMAND=y
-# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
 
 #
 # CPUFreq processor drivers
@@ -351,20 +348,8 @@ CONFIG_IPV6_SIT=y
 # CONFIG_IPV6_MULTIPLE_TABLES is not set
 # CONFIG_NETWORK_SECMARK is not set
 # CONFIG_NETFILTER is not set
-
-#
-# DCCP Configuration (EXPERIMENTAL)
-#
 # CONFIG_IP_DCCP is not set
-
-#
-# SCTP Configuration (EXPERIMENTAL)
-#
 # CONFIG_IP_SCTP is not set
-
-#
-# TIPC Configuration (EXPERIMENTAL)
-#
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
@@ -401,6 +386,7 @@ CONFIG_IPV6_SIT=y
 # CONFIG_MAC80211 is not set
 # CONFIG_IEEE80211 is not set
 # CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
 
 #
 # Device Drivers
@@ -415,21 +401,9 @@ CONFIG_FW_LOADER=y
 # CONFIG_DEBUG_DRIVER is not set
 # CONFIG_DEBUG_DEVRES is not set
 # CONFIG_SYS_HYPERVISOR is not set
-
-#
-# Connector - unified userspace - kernelspace linker
-#
 # CONFIG_CONNECTOR is not set
 # CONFIG_MTD is not set
-
-#
-# Parallel port support
-#
 # CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
 CONFIG_PNP=y
 # CONFIG_PNP_DEBUG is not set
 
@@ -437,10 +411,7 @@ CONFIG_PNP=y
 # Protocols
 #
 CONFIG_PNPACPI=y
-
-#
-# Block devices
-#
+CONFIG_BLK_DEV=y
 CONFIG_BLK_DEV_FD=y
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
@@ -458,17 +429,14 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH 

i386: Update defconfig

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ad386589676403eca4e8f52c944995db56e445c3
Commit: ad386589676403eca4e8f52c944995db56e445c3
Parent: 56525597619ab93abc60a22a4ee53e51a0853749
Author: Andi Kleen [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:09:50 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:07 2007 -0700

i386: Update defconfig

Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/defconfig |  264 +++
 1 files changed, 119 insertions(+), 145 deletions(-)

diff --git a/arch/i386/defconfig b/arch/i386/defconfig
index 0ac62cd..54ee176 100644
--- a/arch/i386/defconfig
+++ b/arch/i386/defconfig
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.22-rc2
-# Mon May 21 13:23:44 2007
+# Linux kernel version: 2.6.22-git14
+# Fri Jul 20 09:53:15 2007
 #
 CONFIG_X86_32=y
 CONFIG_GENERIC_TIME=y
@@ -37,19 +37,18 @@ CONFIG_LOCALVERSION=
 CONFIG_LOCALVERSION_AUTO=y
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
-# CONFIG_IPC_NS is not set
 CONFIG_SYSVIPC_SYSCTL=y
 CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_UTS_NS is not set
+# CONFIG_USER_NS is not set
 # CONFIG_AUDIT is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=18
 # CONFIG_CPUSETS is not set
 CONFIG_SYSFS_DEPRECATED=y
-# CONFIG_RELAY is not set
+CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_INITRAMFS_SOURCE=
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
@@ -73,16 +72,13 @@ CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 CONFIG_VM_EVENT_COUNTERS=y
-CONFIG_SLAB=y
-# CONFIG_SLUB is not set
+CONFIG_SLUB_DEBUG=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
 # CONFIG_SLOB is not set
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
-
-#
-# Loadable module support
-#
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
@@ -90,14 +86,11 @@ CONFIG_MODULE_FORCE_UNLOAD=y
 # CONFIG_MODULE_SRCVERSION_ALL is not set
 # CONFIG_KMOD is not set
 CONFIG_STOP_MACHINE=y
-
-#
-# Block layer
-#
 CONFIG_BLOCK=y
 CONFIG_LBD=y
 # CONFIG_BLK_DEV_IO_TRACE is not set
 # CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
 
 #
 # IO Schedulers
@@ -201,6 +194,7 @@ CONFIG_X86_CPUID=y
 # CONFIG_EDD is not set
 # CONFIG_DELL_RBU is not set
 # CONFIG_DCDBAS is not set
+CONFIG_DMIID=y
 # CONFIG_NOHIGHMEM is not set
 CONFIG_HIGHMEM4G=y
 # CONFIG_HIGHMEM64G is not set
@@ -217,7 +211,9 @@ CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_RESOURCES_64BIT=y
 CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
 CONFIG_NR_QUICK=1
+CONFIG_VIRT_TO_BUS=y
 # CONFIG_HIGHPTE is not set
 # CONFIG_MATH_EMULATION is not set
 CONFIG_MTRR=y
@@ -244,7 +240,6 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 CONFIG_PM=y
 CONFIG_PM_LEGACY=y
 # CONFIG_PM_DEBUG is not set
-# CONFIG_PM_SYSFS_DEPRECATED is not set
 
 #
 # ACPI (Advanced Configuration and Power Interface) Support
@@ -284,7 +279,7 @@ CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
 # CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
 CONFIG_CPU_FREQ_GOV_USERSPACE=y
 CONFIG_CPU_FREQ_GOV_ONDEMAND=y
-# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
 
 #
 # CPUFreq processor drivers
@@ -325,7 +320,7 @@ CONFIG_PCI_MMCONFIG=y
 CONFIG_ARCH_SUPPORTS_MSI=y
 CONFIG_PCI_MSI=y
 # CONFIG_PCI_DEBUG is not set
-CONFIG_HT_IRQ=y
+# CONFIG_HT_IRQ is not set
 CONFIG_ISA_DMA_API=y
 # CONFIG_ISA is not set
 # CONFIG_MCA is not set
@@ -381,7 +376,7 @@ CONFIG_IP_PNP_DHCP=y
 CONFIG_INET_TUNNEL=y
 CONFIG_INET_XFRM_MODE_TRANSPORT=y
 CONFIG_INET_XFRM_MODE_TUNNEL=y
-CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_XFRM_MODE_BEET is not set
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
@@ -400,27 +395,15 @@ CONFIG_IPV6=y
 # CONFIG_INET6_TUNNEL is not set
 CONFIG_INET6_XFRM_MODE_TRANSPORT=y
 CONFIG_INET6_XFRM_MODE_TUNNEL=y
-CONFIG_INET6_XFRM_MODE_BEET=y
+# CONFIG_INET6_XFRM_MODE_BEET is not set
 # CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
 CONFIG_IPV6_SIT=y
 # CONFIG_IPV6_TUNNEL is not set
 # CONFIG_IPV6_MULTIPLE_TABLES is not set
 # CONFIG_NETWORK_SECMARK is not set
 # CONFIG_NETFILTER is not set
-
-#
-# DCCP Configuration (EXPERIMENTAL)
-#
 # CONFIG_IP_DCCP is not set
-
-#
-# SCTP Configuration (EXPERIMENTAL)
-#
 # CONFIG_IP_SCTP is not set
-
-#
-# TIPC Configuration (EXPERIMENTAL)
-#
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
@@ -457,6 +440,7 @@ CONFIG_IPV6_SIT=y
 # CONFIG_MAC80211 is not set
 # CONFIG_IEEE80211 is not set
 # CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
 
 #
 # Device Drivers
@@ -471,21 +455,9 @@ CONFIG_FW_LOADER=y
 # CONFIG_DEBUG_DRIVER is not set
 # CONFIG_DEBUG_DEVRES is not set
 # CONFIG_SYS_HYPERVISOR is not set
-
-#
-# Connector - unified userspace - kernelspace linker
-#
 # CONFIG_CONNECTOR is not set
 # 

x86_64: asm/ptrace.h needs linux/compiler.h

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9d531cc1193693f2d2e5ef2532a877481b118be6
Commit: 9d531cc1193693f2d2e5ef2532a877481b118be6
Parent: 65d2f0bc65b0249a22a6c1f49ec29ee5e2980c7b
Author: Jean Delvare [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:09:52 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:07 2007 -0700

x86_64: asm/ptrace.h needs linux/compiler.h

On x86_64, asm/ptrace.h uses __user but doesn't include
linux/compiler.h.  This could lead to build failures.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/asm-x86_64/ptrace.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86_64/ptrace.h b/include/asm-x86_64/ptrace.h
index 5ea84db..7f166cc 100644
--- a/include/asm-x86_64/ptrace.h
+++ b/include/asm-x86_64/ptrace.h
@@ -1,6 +1,7 @@
 #ifndef _X86_64_PTRACE_H
 #define _X86_64_PTRACE_H
 
+#include linux/compiler.h/* For __user */
 #include asm/ptrace-abi.h
 
 #ifndef __ASSEMBLY__
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86: Always flush pages in change_page_attr

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=65d2f0bc65b0249a22a6c1f49ec29ee5e2980c7b
Commit: 65d2f0bc65b0249a22a6c1f49ec29ee5e2980c7b
Parent: ad386589676403eca4e8f52c944995db56e445c3
Author: Andi Kleen [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:09:51 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:07 2007 -0700

x86: Always flush pages in change_page_attr

Fix a bug introduced with the CLFLUSH changes: we must always flush pages
changed in cpa(), not just when they are reverted.

Reenable CLFLUSH usage with that now (it was temporarily disabled
for .22)

Add some BUG_ONs

Contains fixes from  Mathieu Desnoyers [EMAIL PROTECTED]

Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/mm/pageattr.c   |   20 +---
 arch/x86_64/mm/pageattr.c |   23 ++-
 2 files changed, 31 insertions(+), 12 deletions(-)

diff --git a/arch/i386/mm/pageattr.c b/arch/i386/mm/pageattr.c
index 37992ff..8927222 100644
--- a/arch/i386/mm/pageattr.c
+++ b/arch/i386/mm/pageattr.c
@@ -82,7 +82,7 @@ static void flush_kernel_map(void *arg)
struct page *p;
 
/* High level code is not ready for clflush yet */
-   if (0  cpu_has_clflush) {
+   if (cpu_has_clflush) {
list_for_each_entry (p, lh, lru)
cache_flush_page(p);
} else if (boot_cpu_data.x86_model = 4)
@@ -136,6 +136,12 @@ static inline void revert_page(struct page *kpte_page, 
unsigned long address)
ref_prot));
 }
 
+static inline void save_page(struct page *kpte_page)
+{
+   if (!test_and_set_bit(PG_arch_1, kpte_page-flags))
+   list_add(kpte_page-lru, df_list);
+}
+
 static int
 __change_page_attr(struct page *page, pgprot_t prot)
 { 
@@ -150,6 +156,9 @@ __change_page_attr(struct page *page, pgprot_t prot)
if (!kpte)
return -EINVAL;
kpte_page = virt_to_page(kpte);
+   BUG_ON(PageLRU(kpte_page));
+   BUG_ON(PageCompound(kpte_page));
+
if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL)) { 
if (!pte_huge(*kpte)) {
set_pte_atomic(kpte, mk_pte(page, prot)); 
@@ -179,11 +188,11 @@ __change_page_attr(struct page *page, pgprot_t prot)
 * time (not via split_large_page) and in turn we must not
 * replace it with a largepage.
 */
+
+   save_page(kpte_page);
if (!PageReserved(kpte_page)) {
if (cpu_has_pse  (page_private(kpte_page) == 0)) {
-   ClearPagePrivate(kpte_page);
paravirt_release_pt(page_to_pfn(kpte_page));
-   list_add(kpte_page-lru, df_list);
revert_page(kpte_page, address);
}
}
@@ -236,6 +245,11 @@ void global_flush_tlb(void)
spin_unlock_irq(cpa_lock);
flush_map(l);
list_for_each_entry_safe(pg, next, l, lru) {
+   list_del(pg-lru);
+   clear_bit(PG_arch_1, pg-flags);
+   if (PageReserved(pg) || !cpu_has_pse || page_private(pg) != 0)
+   continue;
+   ClearPagePrivate(pg);
__free_page(pg);
}
 }
diff --git a/arch/x86_64/mm/pageattr.c b/arch/x86_64/mm/pageattr.c
index 9148f4a..36377b6 100644
--- a/arch/x86_64/mm/pageattr.c
+++ b/arch/x86_64/mm/pageattr.c
@@ -74,14 +74,12 @@ static void flush_kernel_map(void *arg)
struct page *pg;
 
/* When clflush is available always use it because it is
-  much cheaper than WBINVD. Disable clflush for now because
-  the high level code is not ready yet */
-   if (1 || !cpu_has_clflush)
+  much cheaper than WBINVD. */
+   if (!cpu_has_clflush)
asm volatile(wbinvd ::: memory);
else list_for_each_entry(pg, l, lru) {
void *adr = page_address(pg);
-   if (cpu_has_clflush)
-   cache_flush_page(adr);
+   cache_flush_page(adr);
}
__flush_tlb_all();
 }
@@ -95,7 +93,8 @@ static LIST_HEAD(deferred_pages); /* protected by 
init_mm.mmap_sem */
 
 static inline void save_page(struct page *fpage)
 {
-   list_add(fpage-lru, deferred_pages);
+   if (!test_and_set_bit(PG_arch_1, fpage-flags))
+   list_add(fpage-lru, deferred_pages);
 }
 
 /* 
@@ -129,9 +128,12 @@ __change_page_attr(unsigned long address, unsigned long 
pfn, pgprot_t prot,
pte_t *kpte; 
struct page *kpte_page;
pgprot_t ref_prot2;
+
kpte = lookup_address(address);
if (!kpte) return 0;
kpte_page = virt_to_page(((unsigned long)kpte)  PAGE_MASK);
+   BUG_ON(PageLRU(kpte_page));
+   BUG_ON(PageCompound(kpte_page));
if (pgprot_val(prot) != pgprot_val(ref_prot)) { 
   

x86_64: Report the pending irq if available in smp_affinity

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=42ee2b74140b69fa24da1c671b03c9f8019e6f62
Commit: 42ee2b74140b69fa24da1c671b03c9f8019e6f62
Parent: 78b599aed61a1098444558e74c93745f22eda6cb
Author: Andi Kleen [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:09:54 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:07 2007 -0700

x86_64: Report the pending irq if available in smp_affinity

Otherwise smp_affinity would only update after the next interrupt
on x86 systems.

Cc: Thomas Gleixner [EMAIL PROTECTED]
Cc: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 kernel/irq/proc.c |   10 +-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index b4f1674..50b81b9 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -19,7 +19,15 @@ static struct proc_dir_entry *root_irq_dir;
 static int irq_affinity_read_proc(char *page, char **start, off_t off,
  int count, int *eof, void *data)
 {
-   int len = cpumask_scnprintf(page, count, irq_desc[(long)data].affinity);
+   struct irq_desc *desc = irq_desc + (long)data;
+   cpumask_t *mask = desc-affinity;
+   int len;
+
+#ifdef CONFIG_GENERIC_PENDING_IRQ
+   if (desc-status  IRQ_MOVE_PENDING)
+   mask = desc-pending_mask;
+#endif
+   len = cpumask_scnprintf(page, count, *mask);
 
if (count - len  2)
return -EINVAL;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86_64: various cleanups in NUMA scan node

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ae2c6dcf90c5a9ff9bd9a176cafd43a255fcc64b
Commit: ae2c6dcf90c5a9ff9bd9a176cafd43a255fcc64b
Parent: a2e212dae57071d4a4a6cbbc12d70c628fd47ad2
Author: David Rientjes [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:09:56 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:08 2007 -0700

x86_64: various cleanups in NUMA scan node

In acpi_scan_nodes(), we immediately return -1 if acpi_numa = 0, meaning
we haven't detected any underlying ACPI topology or we have explicitly
disabled its use from the command-line with numa=noacpi.

acpi_table_print_srat_entry() and acpi_table_parse_srat() are only
referenced within drivers/acpi/numa.c, so we can mark them as static and
remove their prototypes from the header file.

Likewise, pxm_to_node_map[] and node_to_pxm_map[] are only used within
drivers/acpi/numa.c, so we mark them as static and remove their externs
from the header file.

The automatic 'result' variable is unused in acpi_numa_init(), so it's
removed.

Signed-off-by: David Rientjes [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/mm/srat.c |6 +++---
 drivers/acpi/numa.c   |   20 ++--
 include/linux/acpi.h  |2 --
 3 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/arch/x86_64/mm/srat.c b/arch/x86_64/mm/srat.c
index a126cb7..0e0725d 100644
--- a/arch/x86_64/mm/srat.c
+++ b/arch/x86_64/mm/srat.c
@@ -394,6 +394,9 @@ int __init acpi_scan_nodes(unsigned long start, unsigned 
long end)
 {
int i;
 
+   if (acpi_numa = 0)
+   return -1;
+
/* First clean up the node list */
for (i = 0; i  MAX_NUMNODES; i++) {
cutoff_node(i, start, end);
@@ -403,9 +406,6 @@ int __init acpi_scan_nodes(unsigned long start, unsigned 
long end)
}
}
 
-   if (acpi_numa = 0)
-   return -1;
-
if (!nodes_cover_memory()) {
bad_srat();
return -1;
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
index 0c9f15c..6c44b52 100644
--- a/drivers/acpi/numa.c
+++ b/drivers/acpi/numa.c
@@ -40,9 +40,9 @@ static nodemask_t nodes_found_map = NODE_MASK_NONE;
 #define NID_INVAL  -1
 
 /* maps to convert between proximity domain and logical node ID */
-static int pxm_to_node_map[MAX_PXM_DOMAINS]
+static int __cpuinitdata pxm_to_node_map[MAX_PXM_DOMAINS]
= { [0 ... MAX_PXM_DOMAINS - 1] = NID_INVAL };
-static int node_to_pxm_map[MAX_NUMNODES]
+static int __cpuinitdata node_to_pxm_map[MAX_NUMNODES]
= { [0 ... MAX_NUMNODES - 1] = PXM_INVAL };
 
 int pxm_to_node(int pxm)
@@ -83,7 +83,8 @@ void __cpuinit acpi_unmap_pxm_to_node(int node)
node_clear(node, nodes_found_map);
 }
 
-void __init acpi_table_print_srat_entry(struct acpi_subtable_header * header)
+static void __init
+acpi_table_print_srat_entry(struct acpi_subtable_header *header)
 {
 
ACPI_FUNCTION_NAME(acpi_table_print_srat_entry);
@@ -200,7 +201,7 @@ static int __init acpi_parse_srat(struct acpi_table_header 
*table)
return 0;
 }
 
-int __init
+static int __init
 acpi_table_parse_srat(enum acpi_srat_type id,
  acpi_table_entry_handler handler, unsigned int 
max_entries)
 {
@@ -211,14 +212,13 @@ acpi_table_parse_srat(enum acpi_srat_type id,
 
 int __init acpi_numa_init(void)
 {
-   int result;
-
/* SRAT: Static Resource Affinity Table */
if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) {
-   result = acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY,
-  acpi_parse_processor_affinity,
-  NR_CPUS);
-   result = acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY, 
acpi_parse_memory_affinity, NR_NODE_MEMBLKS);// IA64 specific
+   acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY,
+ acpi_parse_processor_affinity, NR_CPUS);
+   acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY,
+ acpi_parse_memory_affinity,
+ NR_NODE_MEMBLKS);
}
 
/* SLIT: System Locality Information Table */
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index dc234c5..e88b62e 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -88,10 +88,8 @@ int acpi_table_parse (char *id, acpi_table_handler handler);
 int __init acpi_table_parse_entries(char *id, unsigned long table_size,
int entry_id, acpi_table_entry_handler handler, unsigned int 
max_entries);
 int acpi_table_parse_madt (enum acpi_madt_type id, acpi_table_entry_handler 
handler, unsigned int 

x86_64: Don't rely on a unique IO-APIC ID

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=78b599aed61a1098444558e74c93745f22eda6cb
Commit: 78b599aed61a1098444558e74c93745f22eda6cb
Parent: 9d531cc1193693f2d2e5ef2532a877481b118be6
Author: Andi Kleen [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:09:53 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:07 2007 -0700

x86_64: Don't rely on a unique IO-APIC ID

Linux 64bit only uses the IO-APIC ID as an internal cookie. In the future
there could be some cases where the IO-APIC IDs are not unique because
they share an 8 bit space with CPUs and if there are enough CPUs
it is difficult to get them that. But Linux needs the io apic ID
internally for its data structures. Assign unique IO APIC ids on
table parsing.

TBD do for 32bit too

Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/kernel/mpparse.c |   20 ++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c
index 61ae57e..0ec8490 100644
--- a/arch/x86_64/kernel/mpparse.c
+++ b/arch/x86_64/kernel/mpparse.c
@@ -649,6 +649,20 @@ static int mp_find_ioapic(int gsi)
return -1;
 }
 
+static u8 uniq_ioapic_id(u8 id)
+{
+   int i;
+   DECLARE_BITMAP(used, 256);
+   bitmap_zero(used, 256);
+   for (i = 0; i  nr_ioapics; i++) {
+   struct mpc_config_ioapic *ia = mp_ioapics[i];
+   __set_bit(ia-mpc_apicid, used);
+   }
+   if (!test_bit(id, used))
+   return id;
+   return find_first_zero_bit(used, 256);
+}
+
 void __init mp_register_ioapic(u8 id, u32 address, u32 gsi_base)
 {
int idx = 0;
@@ -656,14 +670,14 @@ void __init mp_register_ioapic(u8 id, u32 address, u32 
gsi_base)
if (bad_ioapic(address))
return;
 
-   idx = nr_ioapics++;
+   idx = nr_ioapics;
 
mp_ioapics[idx].mpc_type = MP_IOAPIC;
mp_ioapics[idx].mpc_flags = MPC_APIC_USABLE;
mp_ioapics[idx].mpc_apicaddr = address;
 
set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address);
-   mp_ioapics[idx].mpc_apicid = id;
+   mp_ioapics[idx].mpc_apicid = uniq_ioapic_id(id);
mp_ioapics[idx].mpc_apicver = 0;

/* 
@@ -680,6 +694,8 @@ void __init mp_register_ioapic(u8 id, u32 address, u32 
gsi_base)
mp_ioapics[idx].mpc_apicaddr,
mp_ioapic_routing[idx].gsi_start,
mp_ioapic_routing[idx].gsi_end);
+
+   nr_ioapics++;
 }
 
 void __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


x86_64: Use string instruction memcpy/memset on AMD Fam10

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5b74e3abb3e9bd8a2f52a7b653941e3686c5df1a
Commit: 5b74e3abb3e9bd8a2f52a7b653941e3686c5df1a
Parent: ae2c6dcf90c5a9ff9bd9a176cafd43a255fcc64b
Author: Andi Kleen [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:09:57 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:08 2007 -0700

x86_64: Use string instruction memcpy/memset on AMD Fam10

Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/kernel/setup.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
index 33ef718..675b3d6 100644
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86_64/kernel/setup.c
@@ -575,6 +575,8 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
level = cpuid_eax(1);
if (c-x86 == 15  ((level = 0x0f48  level  0x0f50) || level = 
0x0f58))
set_bit(X86_FEATURE_REP_GOOD, c-x86_capability);
+   if (c-x86 == 0x10)
+   set_bit(X86_FEATURE_REP_GOOD, c-x86_capability);
 
/* Enable workaround for FXSAVE leak */
if (c-x86 = 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


x86_64: Always use builtin memcpy on gcc 4.3

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=aac57f81eb16d56afb5bd5a31ff325b5d1615580
Commit: aac57f81eb16d56afb5bd5a31ff325b5d1615580
Parent: 5b74e3abb3e9bd8a2f52a7b653941e3686c5df1a
Author: Andi Kleen [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:09:58 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:08 2007 -0700

x86_64: Always use builtin memcpy on gcc 4.3

Jan asked to always use the builtin memcpy on gcc 4.3 mainline because
it should generate better code than the old macro. Let's try it.

Cc: Jan Hubicka [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/asm-x86_64/string.h |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/include/asm-x86_64/string.h b/include/asm-x86_64/string.h
index 9505d9f..e583da7 100644
--- a/include/asm-x86_64/string.h
+++ b/include/asm-x86_64/string.h
@@ -29,6 +29,9 @@ return (to);
function. */
 
 #define __HAVE_ARCH_MEMCPY 1
+#if (__GNUC__ == 4  __GNUC_MINOR__ = 3) || __GNUC__  4
+extern void *memcpy(void *to, const void *from, size_t len);
+#else
 extern void *__memcpy(void *to, const void *from, size_t len); 
 #define memcpy(dst,src,len) \
({ size_t __len = (len);\
@@ -38,7 +41,7 @@ extern void *__memcpy(void *to, const void *from, size_t len);
   else \
 __ret = __builtin_memcpy((dst),(src),__len);   \
   __ret; }) 
-
+#endif
 
 #define __HAVE_ARCH_MEMSET
 void *memset(void *s, int c, size_t n);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86_64: Use LOCAL_DISTANCE and REMOTE_DISTANCE in x86_64 ACPI code

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a2e212dae57071d4a4a6cbbc12d70c628fd47ad2
Commit: a2e212dae57071d4a4a6cbbc12d70c628fd47ad2
Parent: 42ee2b74140b69fa24da1c671b03c9f8019e6f62
Author: David Rientjes [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:09:55 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:07 2007 -0700

x86_64: Use LOCAL_DISTANCE and REMOTE_DISTANCE in x86_64 ACPI code

Use LOCAL_DISTANCE and  REMOTE_DISTANCE in x86_64 ACPI code

Signed-off-by: David Rientjes [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/mm/srat.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86_64/mm/srat.c b/arch/x86_64/mm/srat.c
index 1e76bb0..a126cb7 100644
--- a/arch/x86_64/mm/srat.c
+++ b/arch/x86_64/mm/srat.c
@@ -106,9 +106,9 @@ static __init int slit_valid(struct acpi_table_slit *slit)
for (j = 0; j  d; j++)  {
u8 val = slit-entry[d*i + j];
if (i == j) {
-   if (val != 10)
+   if (val != LOCAL_DISTANCE)
return 0;
-   } else if (val = 10)
+   } else if (val = LOCAL_DISTANCE)
return 0;
}
}
@@ -464,7 +464,7 @@ int __node_distance(int a, int b)
int index;
 
if (!acpi_slit)
-   return a == b ? 10 : 20;
+   return a == b ? LOCAL_DISTANCE : REMOTE_DISTANCE;
index = acpi_slit-locality_count * node_to_pxm(a);
return acpi_slit-entry[index + node_to_pxm(b)];
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i386: Move all simple string operations out of line

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b520b85a963bf7b14b9614579aff14558d7ee264
Commit: b520b85a963bf7b14b9614579aff14558d7ee264
Parent: aac57f81eb16d56afb5bd5a31ff325b5d1615580
Author: Andi Kleen [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:09:59 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:08 2007 -0700

i386: Move all simple string operations out of line

The compiler generally generates reasonable inline code for the simple
cases and for the rest it's better for code size for them to be out of line.
Also there they can be potentially optimized more in the future.

In fact they probably should be in a .S file because they're all pure
assembly, but that's for another day.

Also some code style cleanup on them while I was on it (this seems
to be the last untouched really early Linux code)

This saves ~12k text for a defconfig kernel with gcc 4.1.

Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/lib/Makefile|2 +-
 arch/i386/lib/string.c|  257 +
 include/asm-i386/string.h |  243 +++
 3 files changed, 271 insertions(+), 231 deletions(-)

diff --git a/arch/i386/lib/Makefile b/arch/i386/lib/Makefile
index 22d8ac5..4d105fd 100644
--- a/arch/i386/lib/Makefile
+++ b/arch/i386/lib/Makefile
@@ -4,7 +4,7 @@
 
 
 lib-y = checksum.o delay.o usercopy.o getuser.o putuser.o memcpy.o strstr.o \
-   bitops.o semaphore.o
+   bitops.o semaphore.o string.o
 
 lib-$(CONFIG_X86_USE_3DNOW) += mmx.o
 
diff --git a/arch/i386/lib/string.c b/arch/i386/lib/string.c
new file mode 100644
index 000..2c773fe
--- /dev/null
+++ b/arch/i386/lib/string.c
@@ -0,0 +1,257 @@
+/*
+ * Most of the string-functions are rather heavily hand-optimized,
+ * see especially strsep,strstr,str[c]spn. They should work, but are not
+ * very easy to understand. Everything is done entirely within the register
+ * set, making the functions fast and clean. String instructions have been
+ * used through-out, making for slightly unclear code :-)
+ *
+ * AK: On P4 and K7 using non string instruction implementations might be 
faster
+ * for large memory blocks. But most of them are unlikely to be used on large
+ * strings.
+ */
+
+#include linux/string.h
+#include linux/module.h
+
+#ifdef __HAVE_ARCH_STRCPY
+char *strcpy(char * dest,const char *src)
+{
+   int d0, d1, d2;
+   asm volatile( 1:\tlodsb\n\t
+   stosb\n\t
+   testb %%al,%%al\n\t
+   jne 1b
+   : =S (d0), =D (d1), =a (d2)
+   :0 (src),1 (dest) : memory);
+   return dest;
+}
+EXPORT_SYMBOL(strcpy);
+#endif
+
+#ifdef __HAVE_ARCH_STRNCPY
+char *strncpy(char * dest,const char *src,size_t count)
+{
+   int d0, d1, d2, d3;
+   asm volatile( 1:\tdecl %2\n\t
+   js 2f\n\t
+   lodsb\n\t
+   stosb\n\t
+   testb %%al,%%al\n\t
+   jne 1b\n\t
+   rep\n\t
+   stosb\n
+   2:
+   : =S (d0), =D (d1), =c (d2), =a (d3)
+   :0 (src),1 (dest),2 (count) : memory);
+   return dest;
+}
+EXPORT_SYMBOL(strncpy);
+#endif
+
+#ifdef __HAVE_ARCH_STRCAT
+char *strcat(char * dest,const char * src)
+{
+   int d0, d1, d2, d3;
+   asm volatile( repne\n\t
+   scasb\n\t
+   decl %1\n
+   1:\tlodsb\n\t
+   stosb\n\t
+   testb %%al,%%al\n\t
+   jne 1b
+   : =S (d0), =D (d1), =a (d2), =c (d3)
+   : 0 (src), 1 (dest), 2 (0), 3 (0xu): memory);
+   return dest;
+}
+EXPORT_SYMBOL(strcat);
+#endif
+
+#ifdef __HAVE_ARCH_STRNCAT
+char *strncat(char * dest,const char * src,size_t count)
+{
+   int d0, d1, d2, d3;
+   asm volatile( repne\n\t
+   scasb\n\t
+   decl %1\n\t
+   movl %8,%3\n
+   1:\tdecl %3\n\t
+   js 2f\n\t
+   lodsb\n\t
+   stosb\n\t
+   testb %%al,%%al\n\t
+   jne 1b\n
+   2:\txorl %2,%2\n\t
+   stosb
+   : =S (d0), =D (d1), =a (d2), =c (d3)
+   : 0 (src),1 (dest),2 (0),3 (0xu), g (count)
+   : memory);
+   return dest;
+}
+EXPORT_SYMBOL(strncat);
+#endif
+
+#ifdef __HAVE_ARCH_STRCMP
+int strcmp(const char * cs,const char * ct)
+{
+   int d0, d1;
+   int res;
+   asm volatile( 1:\tlodsb\n\t
+   scasb\n\t
+   jne 2f\n\t
+   testb %%al,%%al\n\t
+   jne 1b\n\t
+   xorl %%eax,%%eax\n\t
+   jmp 3f\n
+   2:\tsbbl %%eax,%%eax\n\t
+   orb $1,%%al\n
+   3:
+   :=a (res), =S (d0), =D (d1)

x86: Support __attribute__((__cold__)) in gcc 4.3

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a586df067afe0580bb02b7a6312ca2afe49bba03
Commit: a586df067afe0580bb02b7a6312ca2afe49bba03
Parent: b520b85a963bf7b14b9614579aff14558d7ee264
Author: Andi Kleen [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:00 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:08 2007 -0700

x86: Support __attribute__((__cold__)) in gcc 4.3

gcc 4.3 supports a new __attribute__((__cold__)) to mark functions cold. Any
path directly leading to a call of this function will be unlikely. And gcc
will try to generate smaller code for the function itself.

Please use with care. The code generation advantage isn't large and in most
cases it is not worth uglifying code with this.

This patch marks some common error functions like panic(), printk()
as cold.  This will longer term make many unlikely()s unnecessary, although
we can keep them for now for older compilers.

BUG is not marked cold because there is currently no way to tell
gcc to mark a inline function told.

Also all __init and __exit functions are marked cold. With a non -Os
build this will tell the compiler to generate slightly smaller code
for them. I think it currently only uses less alignments for labels,
but that might change in the future.

One disadvantage over *likely() is that they cannot be easily instrumented
to verify them.

Another drawback is that only the latest gcc 4.3 snapshots support this.
Unfortunately we cannot detect this using the preprocessor. This means older
snapshots will fail now. I don't think that's a problem because they are
unreleased compilers that nobody should be using.

gcc also has a __hot__ attribute, but I don't see any sense in using
this in the kernel right now. But someday I hope gcc will be able
to use more aggressive optimizing for hot functions even in -Os,
if that happens it should be added.

Includes compile fix from Thomas Gleixner.

Cc: Jan Hubicka [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/linux/compiler-gcc4.h |   18 ++
 include/linux/compiler.h  |9 +
 include/linux/init.h  |8 
 include/linux/kernel.h|8 
 4 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
index a03e939..14f7494 100644
--- a/include/linux/compiler-gcc4.h
+++ b/include/linux/compiler-gcc4.h
@@ -23,3 +23,21 @@
  * code
  */
 #define uninitialized_var(x) x = x
+
+#if !(__GNUC__ == 4  __GNUC_MINOR__  3)
+/* Mark functions as cold. gcc will assume any path leading to a call
+   to them will be unlikely.  This means a lot of manual unlikely()s
+   are unnecessary now for any paths leading to the usual suspects
+   like BUG(), printk(), panic() etc. [but let's keep them for now for
+   older compilers]
+
+   Early snapshots of gcc 4.3 don't support this and we can't detect this
+   in the preprocessor, but we can live with this because they're unreleased.
+   Maketime probing would be overkill here.
+
+   gcc also has a __attribute__((__hot__)) to move hot functions into
+   a special section, but I don't see any sense in this right now in
+   the kernel context */
+#define __cold __attribute__((__cold__))
+
+#endif
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 8287a72..12a1291 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -174,4 +174,13 @@ extern void __chk_io_ptr(const void __iomem *);
 # define __attribute_const__   /* unimplemented */
 #endif
 
+/*
+ * Tell gcc if a function is cold. The compiler will assume any path
+ * directly leading to the call is unlikely.
+ */
+
+#ifndef __cold
+#define __cold
+#endif
+
 #endif /* __LINUX_COMPILER_H */
diff --git a/include/linux/init.h b/include/linux/init.h
index 5b52853..f0d0e32 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -40,10 +40,10 @@
 
 /* These are for everybody (although not all archs will actually
discard it in modules) */
-#define __init __attribute__ ((__section__ (.init.text)))
+#define __init __attribute__ ((__section__ (.init.text))) __cold
 #define __initdata __attribute__ ((__section__ (.init.data)))
 #define __exitdata __attribute__ ((__section__(.exit.data)))
-#define __exit_call__attribute_used__ __attribute__ ((__section__ 
(.exitcall.exit)))
+#define __exit_call__attribute_used__ __attribute__ ((__section__ 
(.exitcall.exit))) __cold
 
 /* modpost check for section mismatches during the kernel build.
  * A section mismatch happens when there are references from a
@@ -59,9 +59,9 @@
 #define __initdata_refok  __attribute__ ((__section__ 
(.data.init.refok)))
 

x86_64: Add vDSO for x86-64 with gettimeofday/clock_gettime/getcpu

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2aae950b21e4bc789d1fc6668faf67e8748300b7
Commit: 2aae950b21e4bc789d1fc6668faf67e8748300b7
Parent: a586df067afe0580bb02b7a6312ca2afe49bba03
Author: Andi Kleen [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:01 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:08 2007 -0700

x86_64: Add vDSO for x86-64 with gettimeofday/clock_gettime/getcpu

This implements new vDSO for x86-64.  The concept is similar
to the existing vDSOs on i386 and PPC.  x86-64 has had static
vsyscalls before,  but these are not flexible enough anymore.

A vDSO is a ELF shared library supplied by the kernel that is mapped into
user address space.  The vDSO mapping is randomized for each process
for security reasons.

Doing this was needed for clock_gettime, because clock_gettime
always needs a syscall fallback and having one at a fixed
address would have made buffer overflow exploits too easy to write.

The vdso can be disabled with vdso=0

It currently includes a new gettimeofday implemention and optimized
clock_gettime(). The gettimeofday implementation is slightly faster
than the one in the old vsyscall.  clock_gettime is significantly faster
than the syscall for CLOCK_MONOTONIC and CLOCK_REALTIME.

The new calls are generally faster than the old vsyscall.

Advantages over the old x86-64 vsyscalls:
- Extensible
- Randomized
- Cleaner
- Easier to virtualize (the old static address range previously causes
overhead e.g. for Xen because it has to create special page tables for it)

Weak points:
- glibc support still to be written

The VM interface is partly based on Ingo Molnar's i386 version.

Includes compile fix from Joachim Deguara

Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 Documentation/kernel-parameters.txt |2 +-
 arch/x86_64/Makefile|3 +-
 arch/x86_64/ia32/ia32_binfmt.c  |1 +
 arch/x86_64/kernel/time.c   |1 +
 arch/x86_64/kernel/vmlinux.lds.S|9 ++
 arch/x86_64/kernel/vsyscall.c   |   22 +-
 arch/x86_64/mm/init.c   |9 ++
 arch/x86_64/vdso/Makefile   |   49 
 arch/x86_64/vdso/vclock_gettime.c   |  120 ++
 arch/x86_64/vdso/vdso-note.S|   12 +++
 arch/x86_64/vdso/vdso-start.S   |2 +
 arch/x86_64/vdso/vdso.S |2 +
 arch/x86_64/vdso/vdso.lds.S |   77 +++
 arch/x86_64/vdso/vextern.h  |   16 
 arch/x86_64/vdso/vgetcpu.c  |   50 +
 arch/x86_64/vdso/vma.c  |  139 +++
 arch/x86_64/vdso/voffset.h  |1 +
 arch/x86_64/vdso/vvar.c |   12 +++
 include/asm-x86_64/auxvec.h |2 +
 include/asm-x86_64/elf.h|   13 +++
 include/asm-x86_64/mmu.h|1 +
 include/asm-x86_64/vgtod.h  |   29 +++
 include/asm-x86_64/vsyscall.h   |3 +-
 23 files changed, 554 insertions(+), 21 deletions(-)

diff --git a/Documentation/kernel-parameters.txt 
b/Documentation/kernel-parameters.txt
index 5fbe077..fb80e9f 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1882,7 +1882,7 @@ and is between 256 and 4096 characters. It is defined in 
the file
usbhid.mousepoll=
[USBHID] The interval which mice are to be polled at.
 
-   vdso=   [IA-32,SH]
+   vdso=   [IA-32,SH,x86-64]
vdso=2: enable compat VDSO (default with COMPAT_VDSO)
vdso=1: enable VDSO (default)
vdso=0: disable VDSO mapping
diff --git a/arch/x86_64/Makefile b/arch/x86_64/Makefile
index 29617ae..128561d 100644
--- a/arch/x86_64/Makefile
+++ b/arch/x86_64/Makefile
@@ -76,7 +76,8 @@ head-y := arch/x86_64/kernel/head.o 
arch/x86_64/kernel/head64.o arch/x86_64/kern
 libs-y += arch/x86_64/lib/
 core-y += arch/x86_64/kernel/ \
   arch/x86_64/mm/ \
-  arch/x86_64/crypto/
+  arch/x86_64/crypto/ \
+  arch/x86_64/vdso/
 core-$(CONFIG_IA32_EMULATION)  += arch/x86_64/ia32/
 drivers-$(CONFIG_PCI)  += arch/x86_64/pci/
 drivers-$(CONFIG_OPROFILE) += arch/x86_64/oprofile/
diff --git a/arch/x86_64/ia32/ia32_binfmt.c b/arch/x86_64/ia32/ia32_binfmt.c
index ed56a88..b70f3e7 100644
--- a/arch/x86_64/ia32/ia32_binfmt.c
+++ b/arch/x86_64/ia32/ia32_binfmt.c
@@ -38,6 +38,7 @@
 
 int sysctl_vsyscall32 = 1;
 
+#undef ARCH_DLINFO
 #define 

i386: Add L3 cache support to AMD CPUID4 emulation

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=67cddd947992b02f01ad093ec814738c5827d17c
Commit: 67cddd947992b02f01ad093ec814738c5827d17c
Parent: 2aae950b21e4bc789d1fc6668faf67e8748300b7
Author: Andi Kleen [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:03 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:08 2007 -0700

i386: Add L3 cache support to AMD CPUID4 emulation

With that an L3 cache is correctly reported in the cache information in /sys

With fixes from Andreas Herrmann and Dean Gaudet and Joachim Deguara

Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/cpu/amd.c |8 +++-
 arch/i386/kernel/cpu/intel_cacheinfo.c |   74 +++-
 arch/x86_64/kernel/setup.c |7 ++-
 3 files changed, 65 insertions(+), 24 deletions(-)

diff --git a/arch/i386/kernel/cpu/amd.c b/arch/i386/kernel/cpu/amd.c
index 6f47eee..815a5f0 100644
--- a/arch/i386/kernel/cpu/amd.c
+++ b/arch/i386/kernel/cpu/amd.c
@@ -272,8 +272,12 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
}
 #endif
 
-   if (cpuid_eax(0x8000) = 0x8006)
-   num_cache_leaves = 3;
+   if (cpuid_eax(0x8000) = 0x8006) {
+   if ((c-x86 == 0x10)  (cpuid_edx(0x8006)  0xf000))
+   num_cache_leaves = 4;
+   else
+   num_cache_leaves = 3;
+   }
 
if (amd_apic_timer_broken())
set_bit(X86_FEATURE_LAPIC_TIMER_BROKEN, c-x86_capability);
diff --git a/arch/i386/kernel/cpu/intel_cacheinfo.c 
b/arch/i386/kernel/cpu/intel_cacheinfo.c
index 25b4b7d..43db806 100644
--- a/arch/i386/kernel/cpu/intel_cacheinfo.c
+++ b/arch/i386/kernel/cpu/intel_cacheinfo.c
@@ -4,7 +4,7 @@
  *  Changes:
  *  Venkatesh Pallipadi: Adding cache identification through cpuid(4)
  * Ashok Raj [EMAIL PROTECTED]: Work with CPU hotplug 
infrastructure.
- * Andi Kleen  : CPUID4 emulation on AMD.
+ * Andi Kleen / Andreas Herrmann   : CPUID4 emulation on AMD.
  */
 
 #include linux/init.h
@@ -135,7 +135,7 @@ unsigned short  num_cache_leaves;
 
 /* AMD doesn't have CPUID4. Emulate it here to report the same
information to the user.  This makes some assumptions about the machine:
-   No L3, L2 not shared, no SMT etc. that is currently true on AMD CPUs.
+   L2 not shared, no SMT etc. that is currently true on AMD CPUs.
 
In theory the TLBs could be reported as fake type (they are in dummy).
Maybe later */
@@ -159,13 +159,26 @@ union l2_cache {
unsigned val;
 };
 
+union l3_cache {
+   struct {
+   unsigned line_size : 8;
+   unsigned lines_per_tag : 4;
+   unsigned assoc : 4;
+   unsigned res : 2;
+   unsigned size_encoded : 14;
+   };
+   unsigned val;
+};
+
 static const unsigned short assocs[] = {
[1] = 1, [2] = 2, [4] = 4, [6] = 8,
-   [8] = 16,
+   [8] = 16, [0xa] = 32, [0xb] = 48,
+   [0xc] = 64,
[0xf] = 0x // ??
-   };
-static const unsigned char levels[] = { 1, 1, 2 };
-static const unsigned char types[] = { 1, 2, 3 };
+};
+
+static const unsigned char levels[] = { 1, 1, 2, 3 };
+static const unsigned char types[] = { 1, 2, 3, 3 };
 
 static void __cpuinit amd_cpuid4(int leaf, union _cpuid4_leaf_eax *eax,
   union _cpuid4_leaf_ebx *ebx,
@@ -175,37 +188,58 @@ static void __cpuinit amd_cpuid4(int leaf, union 
_cpuid4_leaf_eax *eax,
unsigned line_size, lines_per_tag, assoc, size_in_kb;
union l1_cache l1i, l1d;
union l2_cache l2;
+   union l3_cache l3;
+   union l1_cache *l1 = l1d;
 
eax-full = 0;
ebx-full = 0;
ecx-full = 0;
 
cpuid(0x8005, dummy, dummy, l1d.val, l1i.val);
-   cpuid(0x8006, dummy, dummy, l2.val, dummy);
-
-   if (leaf  2 || !l1d.val || !l1i.val || !l2.val)
-   return;
-
-   eax-split.is_self_initializing = 1;
-   eax-split.type = types[leaf];
-   eax-split.level = levels[leaf];
-   eax-split.num_threads_sharing = 0;
-   eax-split.num_cores_on_die = current_cpu_data.x86_max_cores - 1;
-
-   if (leaf = 1) {
-   union l1_cache *l1 = leaf == 0 ? l1d : l1i;
+   cpuid(0x8006, dummy, dummy, l2.val, l3.val);
+
+   switch (leaf) {
+   case 1:
+   l1 = l1i;
+   case 0:
+   if (!l1-val)
+   return;
assoc = l1-assoc;
line_size = l1-line_size;
lines_per_tag = l1-lines_per_tag;
size_in_kb = l1-size_in_kb;
-   } else {
+   break;
+   case 2:
+   if (!l2.val)
+   return;
assoc = l2.assoc;
  

x86_64: remove extra extern declaring about dmi_ioremap

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=af3e9a2e33952204e070bf5dfeebe293e90444b8
Commit: af3e9a2e33952204e070bf5dfeebe293e90444b8
Parent: 67cddd947992b02f01ad093ec814738c5827d17c
Author: Yinghai Lu [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:04 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:08 2007 -0700

x86_64: remove extra extern declaring about dmi_ioremap

Signed-off-by: Yinghai Lu [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/asm-x86_64/dmi.h |5 +
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/include/asm-x86_64/dmi.h b/include/asm-x86_64/dmi.h
index 93b2b15..d02e32e 100644
--- a/include/asm-x86_64/dmi.h
+++ b/include/asm-x86_64/dmi.h
@@ -3,15 +3,12 @@
 
 #include asm/io.h
 
-extern void *dmi_ioremap(unsigned long addr, unsigned long size);
-extern void dmi_iounmap(void *addr, unsigned long size);
-
 #define DMI_MAX_DATA 2048
 
 extern int dmi_alloc_index;
 extern char dmi_alloc_data[DMI_MAX_DATA];
 
-/* This is so early that there is no good way to allocate dynamic memory. 
+/* This is so early that there is no good way to allocate dynamic memory.
Allocate data in an BSS array. */
 static inline void *dmi_alloc(unsigned 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


x86_64: Don't use softirq safe locks in smp_call_function

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d9c6d69145ec696128961204f755a3b01edc2ff6
Commit: d9c6d69145ec696128961204f755a3b01edc2ff6
Parent: af3e9a2e33952204e070bf5dfeebe293e90444b8
Author: Andi Kleen [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:05 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:08 2007 -0700

x86_64: Don't use softirq safe locks in smp_call_function

It is not fully softirq safe anyways.

Can't do a WARN_ON unfortunately because it could trigger in the
panic case.

Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/kernel/smp.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86_64/kernel/smp.c b/arch/x86_64/kernel/smp.c
index 0694940..df4a828 100644
--- a/arch/x86_64/kernel/smp.c
+++ b/arch/x86_64/kernel/smp.c
@@ -386,9 +386,9 @@ int smp_call_function_single (int cpu, void (*func) (void 
*info), void *info,
return 0;
}
 
-   spin_lock_bh(call_lock);
+   spin_lock(call_lock);
__smp_call_function_single(cpu, func, info, nonatomic, wait);
-   spin_unlock_bh(call_lock);
+   spin_unlock(call_lock);
put_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


i386: Reserve the right performance counter for the Intel PerfMon NMI watchdog

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e82f64e5bb0648a13630d752c35be1e7bd8bab96
Commit: e82f64e5bb0648a13630d752c35be1e7bd8bab96
Parent: d9c6d69145ec696128961204f755a3b01edc2ff6
Author: Björn Steinbrink [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:06 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:08 2007 -0700

i386: Reserve the right performance counter for the Intel PerfMon NMI 
watchdog

The Intel PerfMon NMI watchdog reserves the first performance counter,
but uses the second one. Make it correctly reserve the second one.

Signed-off-by: Björn Steinbrink [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/cpu/perfctr-watchdog.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/i386/kernel/cpu/perfctr-watchdog.c 
b/arch/i386/kernel/cpu/perfctr-watchdog.c
index 4d26d51..30b5e48 100644
--- a/arch/i386/kernel/cpu/perfctr-watchdog.c
+++ b/arch/i386/kernel/cpu/perfctr-watchdog.c
@@ -599,8 +599,8 @@ static struct wd_ops intel_arch_wd_ops = {
.setup = setup_intel_arch_watchdog,
.rearm = p6_rearm,
.stop = single_msr_stop_watchdog,
-   .perfctr = MSR_ARCH_PERFMON_PERFCTR0,
-   .evntsel = MSR_ARCH_PERFMON_EVENTSEL0,
+   .perfctr = MSR_ARCH_PERFMON_PERFCTR1,
+   .evntsel = MSR_ARCH_PERFMON_EVENTSEL1,
 };
 
 static void probe_nmi_watchdog(void)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86_64: hpet tsc calibration fix broken smi detection logic

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8180a550284bf2c8e13414082fc20b8983c2c401
Commit: 8180a550284bf2c8e13414082fc20b8983c2c401
Parent: e82f64e5bb0648a13630d752c35be1e7bd8bab96
Author: Thomas Gleixner [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:07 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:08 2007 -0700

x86_64: hpet tsc calibration fix broken smi detection logic

The current SMI detection logic in read_hpet_tsc() makes sure,
that when a SMI happens between the read of the HPET counter and
the read of the TSC, this wrong value is used for TSC calibration.

This is not the intention of the function. The comparison must ensure,
that we do _NOT_ use such a value.

Fix the check to use calibration values where delta of the two TSC reads
is smaller than a reasonable threshold.

Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
Signed-off-by: Chris Wright [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/kernel/hpet.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86_64/kernel/hpet.c b/arch/x86_64/kernel/hpet.c
index b828696..6b46040 100644
--- a/arch/x86_64/kernel/hpet.c
+++ b/arch/x86_64/kernel/hpet.c
@@ -190,7 +190,7 @@ int hpet_reenable(void)
  */
 
 #define TICK_COUNT 1
-#define TICK_MIN   5000
+#define SMI_THRESHOLD 5
 #define MAX_TRIES  5
 
 /*
@@ -205,7 +205,7 @@ static void __init read_hpet_tsc(int *hpet, int *tsc)
tsc1 = get_cycles_sync();
hpet1 = hpet_readl(HPET_COUNTER);
tsc2 = get_cycles_sync();
-   if (tsc2 - tsc1  TICK_MIN)
+   if ((tsc2 - tsc1)  SMI_THRESHOLD)
break;
}
*hpet = hpet1;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i386: remove pit_interrupt_hook

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bef9f9de32ec201ea5372caf2c76e7c71f80ee35
Commit: bef9f9de32ec201ea5372caf2c76e7c71f80ee35
Parent: 8180a550284bf2c8e13414082fc20b8983c2c401
Author: Chris Wright [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:08 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:08 2007 -0700

i386: remove pit_interrupt_hook

Remove pit_interrupt_hook as it adds just an extra layer.

Signed-off-by: Chris Wright [EMAIL PROTECTED]
Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/asm-i386/i8253.h |   11 ---
 include/asm-i386/mach-default/do_timer.h |2 +-
 include/asm-i386/mach-voyager/do_timer.h |2 +-
 3 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/include/asm-i386/i8253.h b/include/asm-i386/i8253.h
index 6cb0dd4..a06b8ec 100644
--- a/include/asm-i386/i8253.h
+++ b/include/asm-i386/i8253.h
@@ -7,15 +7,4 @@ extern spinlock_t i8253_lock;
 
 extern struct clock_event_device *global_clock_event;
 
-/**
- * pit_interrupt_hook - hook into timer tick
- * @regs:  standard registers from interrupt
- *
- * Call the global clock event handler.
- **/
-static inline void pit_interrupt_hook(void)
-{
-   global_clock_event-event_handler(global_clock_event);
-}
-
 #endif /* __ASM_I8253_H__ */
diff --git a/include/asm-i386/mach-default/do_timer.h 
b/include/asm-i386/mach-default/do_timer.h
index 56e5689..23ecda0 100644
--- a/include/asm-i386/mach-default/do_timer.h
+++ b/include/asm-i386/mach-default/do_timer.h
@@ -12,5 +12,5 @@
 
 static inline void do_timer_interrupt_hook(void)
 {
-   pit_interrupt_hook();
+   global_clock_event-event_handler(global_clock_event);
 }
diff --git a/include/asm-i386/mach-voyager/do_timer.h 
b/include/asm-i386/mach-voyager/do_timer.h
index 60f9dcc..bc2b589 100644
--- a/include/asm-i386/mach-voyager/do_timer.h
+++ b/include/asm-i386/mach-voyager/do_timer.h
@@ -12,7 +12,7 @@
  **/
 static inline void do_timer_interrupt_hook(void)
 {
-   pit_interrupt_hook();
+   global_clock_event-event_handler(global_clock_event);
voyager_timer_interrupt();
 }
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86_64: Untangle asm/hpet.h from asm/timex.h

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=55f93afd89fe6b9b9e12cfb2d3eb1a68e21f529e
Commit: 55f93afd89fe6b9b9e12cfb2d3eb1a68e21f529e
Parent: bef9f9de32ec201ea5372caf2c76e7c71f80ee35
Author: Chris Wright [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:09 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:08 2007 -0700

x86_64: Untangle asm/hpet.h from asm/timex.h

When making changes to x86_64 timers, I noticed that touching hpet.h 
triggered
an unreasonably large rebuild.  Untangling it from timex.h quiets the extra
rebuild quite a bit.

Cc: john stultz [EMAIL PROTECTED]
Signed-off-by: Chris Wright [EMAIL PROTECTED]
Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/char/rtc.c |2 +-
 include/asm-x86_64/apic.h  |2 ++
 include/asm-x86_64/hpet.h  |1 -
 include/asm-x86_64/timex.h |1 -
 4 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
index 30c3f54..ec6b65e 100644
--- a/drivers/char/rtc.c
+++ b/drivers/char/rtc.c
@@ -82,7 +82,7 @@
 #include asm/uaccess.h
 #include asm/system.h
 
-#if defined(__i386__)
+#ifdef CONFIG_X86
 #include asm/hpet.h
 #endif
 
diff --git a/include/asm-x86_64/apic.h b/include/asm-x86_64/apic.h
index 45e9fca..4c2d84d 100644
--- a/include/asm-x86_64/apic.h
+++ b/include/asm-x86_64/apic.h
@@ -86,6 +86,8 @@ extern void setup_apic_routing(void);
 extern void setup_APIC_extened_lvt(unsigned char lvt_off, unsigned char vector,
   unsigned char msg_type, unsigned char mask);
 
+extern int apic_is_clustered_box(void);
+
 #define K8_APIC_EXT_LVT_BASE0x500
 #define K8_APIC_EXT_INT_MSG_FIX 0x0
 #define K8_APIC_EXT_INT_MSG_SMI 0x2
diff --git a/include/asm-x86_64/hpet.h b/include/asm-x86_64/hpet.h
index 59a66f0..71ccdd1 100644
--- a/include/asm-x86_64/hpet.h
+++ b/include/asm-x86_64/hpet.h
@@ -55,7 +55,6 @@
 
 extern int is_hpet_enabled(void);
 extern int hpet_rtc_timer_init(void);
-extern int apic_is_clustered_box(void);
 extern int hpet_arch_init(void);
 extern int hpet_timer_stop_set_go(unsigned long tick);
 extern int hpet_reenable(void);
diff --git a/include/asm-x86_64/timex.h b/include/asm-x86_64/timex.h
index f6527e1..6ed21f4 100644
--- a/include/asm-x86_64/timex.h
+++ b/include/asm-x86_64/timex.h
@@ -9,7 +9,6 @@
 #include asm/8253pit.h
 #include asm/msr.h
 #include asm/vsyscall.h
-#include asm/hpet.h
 #include asm/system.h
 #include asm/processor.h
 #include asm/tsc.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


x86_64: use generic cmos update

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=af74522ab782c718783b9d85d6d53b8cbf0c7b17
Commit: af74522ab782c718783b9d85d6d53b8cbf0c7b17
Parent: 55f93afd89fe6b9b9e12cfb2d3eb1a68e21f529e
Author: Thomas Gleixner [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:11 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:08 2007 -0700

x86_64: use generic cmos update

Use the generic cmos update function in kernel/time/ntp.c

Cc: john stultz [EMAIL PROTECTED]
Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
Signed-off-by: Chris Wright [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/Kconfig   |4 
 arch/x86_64/kernel/time.c |   25 +
 2 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
index 14bf8ce..fca1a85 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86_64/Kconfig
@@ -32,6 +32,10 @@ config GENERIC_TIME_VSYSCALL
bool
default y
 
+config GENERIC_CMOS_UPDATE
+   bool
+   default y
+
 config ZONE_DMA32
bool
default y
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
index 5405a69..d0e014e 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -80,8 +80,9 @@ EXPORT_SYMBOL(profile_pc);
  * sheet for details.
  */
 
-static void set_rtc_mmss(unsigned long nowtime)
+static int set_rtc_mmss(unsigned long nowtime)
 {
+   int retval = 0;
int real_seconds, real_minutes, cmos_minutes;
unsigned char control, freq_select;
 
@@ -121,6 +122,7 @@ static void set_rtc_mmss(unsigned long nowtime)
if (abs(real_minutes - cmos_minutes) = 30) {
printk(KERN_WARNING time.c: can't update CMOS clock 
   from %d to %d\n, cmos_minutes, real_minutes);
+   retval = -1;
} else {
BIN_TO_BCD(real_seconds);
BIN_TO_BCD(real_minutes);
@@ -140,12 +142,17 @@ static void set_rtc_mmss(unsigned long nowtime)
CMOS_WRITE(freq_select, RTC_FREQ_SELECT);
 
spin_unlock(rtc_lock);
+
+   return retval;
 }
 
+int update_persistent_clock(struct timespec now)
+{
+   return set_rtc_mmss(now.tv_sec);
+}
 
 void main_timer_handler(void)
 {
-   static unsigned long rtc_update = 0;
 /*
  * Here we are in the timer irq handler. We have irqs locally disabled (so we
  * don't need spin_lock_irqsave()) but we don't know if the timer_bh is running
@@ -173,20 +180,6 @@ void main_timer_handler(void)
if (!using_apic_timer)
smp_local_timer_interrupt();
 
-/*
- * If we have an externally synchronized Linux clock, then update CMOS clock
- * accordingly every ~11 minutes. set_rtc_mmss() will be called in the jiffy
- * closest to exactly 500 ms before the next second. If the update fails, we
- * don't care, as it'll be updated on the next turn, and the problem (time way
- * off) isn't likely to go away much sooner anyway.
- */
-
-   if (ntp_synced()  xtime.tv_sec  rtc_update 
-   abs(xtime.tv_nsec - 5) = tick_nsec / 2) {
-   set_rtc_mmss(xtime.tv_sec);
-   rtc_update = xtime.tv_sec + 660;
-   }
- 
write_sequnlock(xtime_lock);
 }
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86_64: Use generic xtime init

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ef81ab2c72e6979367612502fefbb18669e37879
Commit: ef81ab2c72e6979367612502fefbb18669e37879
Parent: af74522ab782c718783b9d85d6d53b8cbf0c7b17
Author: Thomas Gleixner [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:12 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:08 2007 -0700

x86_64: Use generic xtime init

xtime can be initialized including the cmos update from the generic
timekeeping code. Remove the arch specific implementation.

Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
Signed-off-by: Chris Wright [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/kernel/time.c |   40 +---
 1 files changed, 1 insertions(+), 39 deletions(-)

diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
index d0e014e..8dc6f21 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -193,7 +193,7 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
 }
 
-static unsigned long get_cmos_time(void)
+unsigned long read_persistent_clock(void)
 {
unsigned int year, mon, day, hour, min, sec;
unsigned long flags;
@@ -367,11 +367,6 @@ void __init time_init(void)
 {
if (nohpet)
hpet_address = 0;
-   xtime.tv_sec = get_cmos_time();
-   xtime.tv_nsec = 0;
-
-   set_normalized_timespec(wall_to_monotonic,
-   -xtime.tv_sec, -xtime.tv_nsec);
 
if (hpet_arch_init())
hpet_address = 0;
@@ -409,54 +404,21 @@ void __init time_init(void)
setup_irq(0, irq0);
 }
 
-
-static long clock_cmos_diff;
-static unsigned long sleep_start;
-
 /*
  * sysfs support for the timer.
  */
 
 static int timer_suspend(struct sys_device *dev, pm_message_t state)
 {
-   /*
-* Estimate time zone so that set_time can update the clock
-*/
-   long cmos_time =  get_cmos_time();
-
-   clock_cmos_diff = -cmos_time;
-   clock_cmos_diff += get_seconds();
-   sleep_start = cmos_time;
return 0;
 }
 
 static int timer_resume(struct sys_device *dev)
 {
-   unsigned long flags;
-   unsigned long sec;
-   unsigned long ctime = get_cmos_time();
-   long sleep_length = (ctime - sleep_start) * HZ;
-
-   if (sleep_length  0) {
-   printk(KERN_WARNING Time skew detected in timer resume!\n);
-   /* The time after the resume must not be earlier than the time
-* before the suspend or some nasty things will happen
-*/
-   sleep_length = 0;
-   ctime = sleep_start;
-   }
if (hpet_address)
hpet_reenable();
else
i8254_timer_resume();
-
-   sec = ctime + clock_cmos_diff;
-   write_seqlock_irqsave(xtime_lock,flags);
-   xtime.tv_sec = sec;
-   xtime.tv_nsec = 0;
-   jiffies += sleep_length;
-   write_sequnlock_irqrestore(xtime_lock,flags);
-   touch_softlockup_watchdog();
return 0;
 }
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86_64: Remove dead code and other janitor work in tsc.c

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7ff984785cf08e96bd46f7d9c7bf4d73f871599b
Commit: 7ff984785cf08e96bd46f7d9c7bf4d73f871599b
Parent: ef81ab2c72e6979367612502fefbb18669e37879
Author: Thomas Gleixner [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:13 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:08 2007 -0700

x86_64: Remove dead code and other janitor work in tsc.c

Remove unused code and variables and do some codingstyle / whitespace
cleanups while at it.

Cc: john stultz [EMAIL PROTECTED]
Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
Signed-off-by: Chris Wright [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/kernel/tsc.c |   39 +++
 1 files changed, 11 insertions(+), 28 deletions(-)

diff --git a/arch/x86_64/kernel/tsc.c b/arch/x86_64/kernel/tsc.c
index e850aa0..9b76b03 100644
--- a/arch/x86_64/kernel/tsc.c
+++ b/arch/x86_64/kernel/tsc.c
@@ -61,25 +61,9 @@ inline int check_tsc_unstable(void)
  * first tick after the change will be slightly wrong.
  */
 
-#include linux/workqueue.h
-
-static unsigned int cpufreq_delayed_issched = 0;
-static unsigned int cpufreq_init = 0;
-static struct work_struct cpufreq_delayed_get_work;
-
-static void handle_cpufreq_delayed_get(struct work_struct *v)
-{
-   unsigned int cpu;
-   for_each_online_cpu(cpu) {
-   cpufreq_get(cpu);
-   }
-   cpufreq_delayed_issched = 0;
-}
-
-static unsigned int  ref_freq = 0;
-static unsigned long loops_per_jiffy_ref = 0;
-
-static unsigned long tsc_khz_ref = 0;
+static unsigned int  ref_freq;
+static unsigned long loops_per_jiffy_ref;
+static unsigned long tsc_khz_ref;
 
 static int time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
 void *data)
@@ -125,10 +109,8 @@ static struct notifier_block time_cpufreq_notifier_block = 
{
 
 static int __init cpufreq_tsc(void)
 {
-   INIT_WORK(cpufreq_delayed_get_work, handle_cpufreq_delayed_get);
-   if (!cpufreq_register_notifier(time_cpufreq_notifier_block,
-  CPUFREQ_TRANSITION_NOTIFIER))
-   cpufreq_init = 1;
+   cpufreq_register_notifier(time_cpufreq_notifier_block,
+ CPUFREQ_TRANSITION_NOTIFIER);
return 0;
 }
 
@@ -153,17 +135,18 @@ __cpuinit int unsynchronized_tsc(void)
 #endif
/* Most intel systems have synchronized TSCs except for
   multi node systems */
-   if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) {
+   if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) {
 #ifdef CONFIG_ACPI
/* But TSC doesn't tick in C3 so don't use it there */
-   if (acpi_gbl_FADT.header.length  0  acpi_gbl_FADT.C3latency 
 1000)
+   if (acpi_gbl_FADT.header.length  0 
+   acpi_gbl_FADT.C3latency  1000)
return 1;
 #endif
-   return 0;
+   return 0;
}
 
-   /* Assume multi socket systems are not synchronized */
-   return num_present_cpus()  1;
+   /* Assume multi socket systems are not synchronized */
+   return num_present_cpus()  1;
 }
 
 int __init notsc_setup(char *s)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86_64: Fix APIC typo

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f40f31bfe104d50d4fceb760ec48d2effd0610aa
Commit: f40f31bfe104d50d4fceb760ec48d2effd0610aa
Parent: 7ff984785cf08e96bd46f7d9c7bf4d73f871599b
Author: Thomas Gleixner [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:14 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:09 2007 -0700

x86_64: Fix APIC typo

Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
Signed-off-by: Chris Wright [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/kernel/apic.c|4 ++--
 arch/x86_64/kernel/mce_amd.c |6 +++---
 include/asm-x86_64/apic.h|4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c
index 1b0e07b..4ba5a69 100644
--- a/arch/x86_64/kernel/apic.c
+++ b/arch/x86_64/kernel/apic.c
@@ -990,8 +990,8 @@ int setup_profiling_timer(unsigned int multiplier)
return -EINVAL;
 }
 
-void setup_APIC_extened_lvt(unsigned char lvt_off, unsigned char vector,
-   unsigned char msg_type, unsigned char mask)
+void setup_APIC_extended_lvt(unsigned char lvt_off, unsigned char vector,
+unsigned char msg_type, unsigned char mask)
 {
unsigned long reg = (lvt_off  4) + K8_APIC_EXT_LVT_BASE;
unsigned int  v   = (mask  16) | (msg_type  8) | vector;
diff --git a/arch/x86_64/kernel/mce_amd.c b/arch/x86_64/kernel/mce_amd.c
index 03356e6..2f8a7f1 100644
--- a/arch/x86_64/kernel/mce_amd.c
+++ b/arch/x86_64/kernel/mce_amd.c
@@ -157,9 +157,9 @@ void __cpuinit mce_amd_feature_init(struct cpuinfo_x86 *c)
high |= K8_APIC_EXT_LVT_ENTRY_THRESHOLD  20;
wrmsr(address, low, high);
 
-   setup_APIC_extened_lvt(K8_APIC_EXT_LVT_ENTRY_THRESHOLD,
-  THRESHOLD_APIC_VECTOR,
-  K8_APIC_EXT_INT_MSG_FIX, 0);
+   setup_APIC_extended_lvt(K8_APIC_EXT_LVT_ENTRY_THRESHOLD,
+   THRESHOLD_APIC_VECTOR,
+   K8_APIC_EXT_INT_MSG_FIX, 0);
 
threshold_defaults.address = address;
threshold_restart_bank(threshold_defaults, 0, 0);
diff --git a/include/asm-x86_64/apic.h b/include/asm-x86_64/apic.h
index 4c2d84d..85125ef 100644
--- a/include/asm-x86_64/apic.h
+++ b/include/asm-x86_64/apic.h
@@ -83,8 +83,8 @@ extern void disable_APIC_timer(void);
 extern void enable_APIC_timer(void);
 extern void setup_apic_routing(void);
 
-extern void setup_APIC_extened_lvt(unsigned char lvt_off, unsigned char vector,
-  unsigned char msg_type, unsigned char mask);
+extern void setup_APIC_extended_lvt(unsigned char lvt_off, unsigned char 
vector,
+   unsigned char msg_type, unsigned char mask);
 
 extern int apic_is_clustered_box(void);
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86_64: fiuxp pt_reqs leftovers

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=aec8148fda5686b671fbbd9ffd6f432a1f80ee3c
Commit: aec8148fda5686b671fbbd9ffd6f432a1f80ee3c
Parent: f40f31bfe104d50d4fceb760ec48d2effd0610aa
Author: Thomas Gleixner [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:15 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:09 2007 -0700

x86_64: fiuxp pt_reqs leftovers

The hpet_rtc_interrupt handler still uses pt_regs. Fix it.

Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
Signed-off-by: Chris Wright [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/kernel/hpet.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86_64/kernel/hpet.c b/arch/x86_64/kernel/hpet.c
index 6b46040..636f4f9 100644
--- a/arch/x86_64/kernel/hpet.c
+++ b/arch/x86_64/kernel/hpet.c
@@ -439,7 +439,7 @@ int hpet_rtc_dropped_irq(void)
return 1;
 }
 
-irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id)
 {
struct rtc_time curr_time;
unsigned long rtc_int_flag = 0;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86: share hpet.h with i386

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0655d7c32bd21685a58fc4636f378d086396eb68
Commit: 0655d7c32bd21685a58fc4636f378d086396eb68
Parent: aec8148fda5686b671fbbd9ffd6f432a1f80ee3c
Author: Thomas Gleixner [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:16 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:09 2007 -0700

x86: share hpet.h with i386

hpet.h in asm-i386 and asm-x86_64 contain tons of duplicated stuff.
Consolidate into one shared header file.

AK: Fix i386 compilation with !X86_IO_APIC

Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
Signed-off-by: Chris Wright [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/hpet.c   |1 +
 include/asm-i386/hpet.h   |  126 +
 include/asm-x86_64/hpet.h |   61 +-
 3 files changed, 50 insertions(+), 138 deletions(-)

diff --git a/arch/i386/kernel/hpet.c b/arch/i386/kernel/hpet.c
index cfbf792..662d797 100644
--- a/arch/i386/kernel/hpet.c
+++ b/arch/i386/kernel/hpet.c
@@ -5,6 +5,7 @@
 #include linux/init.h
 #include linux/sysdev.h
 #include linux/pm.h
+#include linux/delay.h
 
 #include asm/hpet.h
 #include asm/io.h
diff --git a/include/asm-i386/hpet.h b/include/asm-i386/hpet.h
index dddeedf..c82dc7e 100644
--- a/include/asm-i386/hpet.h
+++ b/include/asm-i386/hpet.h
@@ -4,112 +4,82 @@
 
 #ifdef CONFIG_HPET_TIMER
 
-#include linux/errno.h
-#include linux/module.h
-#include linux/sched.h
-#include linux/kernel.h
-#include linux/param.h
-#include linux/string.h
-#include linux/mm.h
-#include linux/interrupt.h
-#include linux/time.h
-#include linux/delay.h
-#include linux/init.h
-#include linux/smp.h
-
-#include asm/io.h
-#include asm/smp.h
-#include asm/irq.h
-#include asm/msr.h
-#include asm/delay.h
-#include asm/mpspec.h
-#include asm/uaccess.h
-#include asm/processor.h
-
-#include linux/timex.h
-
 /*
  * Documentation on HPET can be found at:
  *  http://www.intel.com/ial/home/sp/pcmmspec.htm
  *  ftp://download.intel.com/ial/home/sp/mmts098.pdf
  */
 
-#define HPET_MMAP_SIZE 1024
-
-#define HPET_ID0x000
-#define HPET_PERIOD0x004
-#define HPET_CFG   0x010
-#define HPET_STATUS0x020
-#define HPET_COUNTER   0x0f0
-#define HPET_T0_CFG0x100
-#define HPET_T0_CMP0x108
-#define HPET_T0_ROUTE  0x110
-#define HPET_T1_CFG0x120
-#define HPET_T1_CMP0x128
-#define HPET_T1_ROUTE  0x130
-#define HPET_T2_CFG0x140
-#define HPET_T2_CMP0x148
-#define HPET_T2_ROUTE  0x150
-
-#define HPET_ID_LEGSUP 0x8000
-#define HPET_ID_NUMBER 0x1f00
-#define HPET_ID_REV0x00ff
+#define HPET_MMAP_SIZE 1024
+
+#define HPET_ID0x000
+#define HPET_PERIOD0x004
+#define HPET_CFG   0x010
+#define HPET_STATUS0x020
+#define HPET_COUNTER   0x0f0
+#define HPET_T0_CFG0x100
+#define HPET_T0_CMP0x108
+#define HPET_T0_ROUTE  0x110
+#define HPET_T1_CFG0x120
+#define HPET_T1_CMP0x128
+#define HPET_T1_ROUTE  0x130
+#define HPET_T2_CFG0x140
+#define HPET_T2_CMP0x148
+#define HPET_T2_ROUTE  0x150
+
+#define HPET_ID_REV0x00ff
+#define HPET_ID_NUMBER 0x1f00
+#define HPET_ID_64BIT  0x2000
+#define HPET_ID_LEGSUP 0x8000
+#define HPET_ID_VENDOR 0x
 #defineHPET_ID_NUMBER_SHIFT8
+#define HPET_ID_VENDOR_SHIFT   16
 
-#define HPET_CFG_ENABLE0x001
-#define HPET_CFG_LEGACY0x002
+#define HPET_ID_VENDOR_80860x8086
+
+#define HPET_CFG_ENABLE0x001
+#define HPET_CFG_LEGACY0x002
 #defineHPET_LEGACY_82542
 #defineHPET_LEGACY_RTC 8
 
-#define HPET_TN_ENABLE 0x004
-#define HPET_TN_PERIODIC   0x008
-#define HPET_TN_PERIODIC_CAP   0x010
-#define HPET_TN_SETVAL 0x040
-#define HPET_TN_32BIT  0x100
-
-/* Use our own asm for 64 bit multiply/divide */
-#define ASM_MUL64_REG(eax_out,edx_out,reg_in,eax_in)   \
-   __asm__ __volatile__(mull %2  \
-   :=a (eax_out), =d (edx_out) \
-   :r (reg_in), 0 (eax_in))
+#define HPET_TN_LEVEL  0x0002
+#define HPET_TN_ENABLE 0x0004
+#define HPET_TN_PERIODIC   0x0008
+#define HPET_TN_PERIODIC_CAP   0x0010
+#define HPET_TN_64BIT_CAP  0x0020
+#define HPET_TN_SETVAL 0x0040
+#define HPET_TN_32BIT  0x0100
+#define HPET_TN_ROUTE  0x3e00
+#define HPET_TN_FSB0x4000
+#define HPET_TN_FSB_CAP0x8000
+#define HPET_TN_ROUTE_SHIFT9
 
-#define 

x86_64: apic.c coding style janitor work

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6935d1f922e5f676ebe98fac700da9c5bf6acfca
Commit: 6935d1f922e5f676ebe98fac700da9c5bf6acfca
Parent: 0655d7c32bd21685a58fc4636f378d086396eb68
Author: Thomas Gleixner [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:17 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:09 2007 -0700

x86_64: apic.c coding style janitor work

Fix coding style, white space wreckage and remove unused code.

Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
Signed-off-by: Chris Wright [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/kernel/apic.c |   73 ++--
 1 files changed, 30 insertions(+), 43 deletions(-)

diff --git a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c
index 4ba5a69..900ff38 100644
--- a/arch/x86_64/kernel/apic.c
+++ b/arch/x86_64/kernel/apic.c
@@ -92,8 +92,9 @@ unsigned int safe_apic_wait_icr_idle(void)
 void enable_NMI_through_LVT0 (void * dummy)
 {
unsigned int v;
-   
-   v = APIC_DM_NMI;/* unmask and set to NMI */
+
+   /* unmask and set to NMI */
+   v = APIC_DM_NMI;
apic_write(APIC_LVT0, v);
 }
 
@@ -120,7 +121,7 @@ void ack_bad_irq(unsigned int irq)
 * holds up an irq slot - in excessive cases (when multiple
 * unexpected vectors occur) that might lock up the APIC
 * completely.
-* But don't ack when the APIC is disabled. -AK
+* But don't ack when the APIC is disabled. -AK
 */
if (!disable_apic)
ack_APIC_irq();
@@ -616,7 +617,7 @@ early_param(apic, apic_set_verbosity);
  * Detect and enable local APICs on non-SMP boards.
  * Original code written by Keir Fraser.
  * On AMD64 we trust the BIOS - if it says no APIC it is likely
- * not correctly set up (usually the APIC timer won't work etc.) 
+ * not correctly set up (usually the APIC timer won't work etc.)
  */
 
 static int __init detect_init_APIC (void)
@@ -789,13 +790,13 @@ static void setup_APIC_timer(unsigned int clocks)
local_irq_save(flags);
 
/* wait for irq slice */
-   if (hpet_address  hpet_use_timer) {
-   int trigger = hpet_readl(HPET_T0_CMP);
-   while (hpet_readl(HPET_COUNTER) = trigger)
-   /* do nothing */ ;
-   while (hpet_readl(HPET_COUNTER)   trigger)
-   /* do nothing */ ;
-   } else {
+   if (hpet_address  hpet_use_timer) {
+   int trigger = hpet_readl(HPET_T0_CMP);
+   while (hpet_readl(HPET_COUNTER) = trigger)
+   /* do nothing */ ;
+   while (hpet_readl(HPET_COUNTER)   trigger)
+   /* do nothing */ ;
+   } else {
int c1, c2;
outb_p(0x00, 0x43);
c2 = inb_p(0x40);
@@ -881,10 +882,10 @@ static unsigned int calibration_result;
 
 void __init setup_boot_APIC_clock (void)
 {
-   if (disable_apic_timer) { 
-   printk(KERN_INFO Disabling APIC timer\n); 
-   return; 
-   } 
+   if (disable_apic_timer) {
+   printk(KERN_INFO Disabling APIC timer\n);
+   return;
+   }
 
printk(KERN_INFO Using local APIC timer interrupts.\n);
using_apic_timer = 1;
@@ -1128,20 +1129,6 @@ asmlinkage void smp_spurious_interrupt(void)
if (v  (1  (SPURIOUS_APIC_VECTOR  0x1f)))
ack_APIC_irq();
 
-#if 0
-   static unsigned long last_warning; 
-   static unsigned long skipped; 
-
-   /* see sw-dev-man vol 3, chapter 7.4.13.5 */
-   if (time_before(last_warning+30*HZ,jiffies)) { 
-   printk(KERN_INFO spurious APIC interrupt on CPU#%d, %ld 
skipped.\n,
-  smp_processor_id(), skipped);
-   last_warning = jiffies; 
-   skipped = 0;
-   } else { 
-   skipped++; 
-   } 
-#endif 
irq_exit();
 }
 
@@ -1173,11 +1160,11 @@ asmlinkage void smp_error_interrupt(void)
   7: Illegal register address
*/
printk (KERN_DEBUG APIC error on CPU%d: %02x(%02x)\n,
-   smp_processor_id(), v , v1);
+   smp_processor_id(), v , v1);
irq_exit();
 }
 
-int disable_apic; 
+int disable_apic;
 
 /*
  * This initializes the IO-APIC and APIC hardware if this is
@@ -1185,11 +1172,11 @@ int disable_apic;
  */
 int __init APIC_init_uniprocessor (void)
 {
-   if (disable_apic) { 
+   if (disable_apic) {
printk(KERN_INFO Apic disabled\n);
-   return -1; 
+   return -1;
}
-   if (!cpu_has_apic) { 
+   if (!cpu_has_apic) {
disable_apic = 1;
printk(KERN_INFO Apic disabled 

x86_64: time.c white space wreckage cleanup

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2618f86e0010fc6703e77af3613bac7ade46efc6
Commit: 2618f86e0010fc6703e77af3613bac7ade46efc6
Parent: 6935d1f922e5f676ebe98fac700da9c5bf6acfca
Author: Thomas Gleixner [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:18 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:09 2007 -0700

x86_64: time.c white space wreckage cleanup

Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
Signed-off-by: Chris Wright [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/kernel/time.c |   90 ++--
 1 files changed, 45 insertions(+), 45 deletions(-)

diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
index 8dc6f21..3c34e8d 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -220,7 +220,7 @@ unsigned long read_persistent_clock(void)
/*
 * We know that x86-64 always uses BCD format, no need to check the
 * config register.
-*/
+*/
 
BCD_TO_BIN(sec);
BCD_TO_BIN(min);
@@ -233,11 +233,11 @@ unsigned long read_persistent_clock(void)
BCD_TO_BIN(century);
year += century * 100;
printk(KERN_INFO Extended CMOS year: %d\n, century * 100);
-   } else { 
+   } else {
/*
 * x86-64 systems only exists since 2002.
 * This will work up to Dec 31, 2100
-*/
+*/
year += 2000;
}
 
@@ -249,45 +249,45 @@ unsigned long read_persistent_clock(void)
 #define TICK_COUNT 1
 static unsigned int __init tsc_calibrate_cpu_khz(void)
 {
-   int tsc_start, tsc_now;
-   int i, no_ctr_free;
-   unsigned long evntsel3 = 0, pmc3 = 0, pmc_now = 0;
-   unsigned long flags;
-
-   for (i = 0; i  4; i++)
-   if (avail_to_resrv_perfctr_nmi_bit(i))
-   break;
-   no_ctr_free = (i == 4);
-   if (no_ctr_free) {
-   i = 3;
-   rdmsrl(MSR_K7_EVNTSEL3, evntsel3);
-   wrmsrl(MSR_K7_EVNTSEL3, 0);
-   rdmsrl(MSR_K7_PERFCTR3, pmc3);
-   } else {
-   reserve_perfctr_nmi(MSR_K7_PERFCTR0 + i);
-   reserve_evntsel_nmi(MSR_K7_EVNTSEL0 + i);
-   }
-   local_irq_save(flags);
-   /* start meauring cycles, incrementing from 0 */
-   wrmsrl(MSR_K7_PERFCTR0 + i, 0);
-   wrmsrl(MSR_K7_EVNTSEL0 + i, 1  22 | 3  16 | 0x76);
-   rdtscl(tsc_start);
-   do {
-   rdmsrl(MSR_K7_PERFCTR0 + i, pmc_now);
-   tsc_now = get_cycles_sync();
-   } while ((tsc_now - tsc_start)  TICK_COUNT);
-
-   local_irq_restore(flags);
-   if (no_ctr_free) {
-   wrmsrl(MSR_K7_EVNTSEL3, 0);
-   wrmsrl(MSR_K7_PERFCTR3, pmc3);
-   wrmsrl(MSR_K7_EVNTSEL3, evntsel3);
-   } else {
-   release_perfctr_nmi(MSR_K7_PERFCTR0 + i);
-   release_evntsel_nmi(MSR_K7_EVNTSEL0 + i);
-   }
-
-   return pmc_now * tsc_khz / (tsc_now - tsc_start);
+   int tsc_start, tsc_now;
+   int i, no_ctr_free;
+   unsigned long evntsel3 = 0, pmc3 = 0, pmc_now = 0;
+   unsigned long flags;
+
+   for (i = 0; i  4; i++)
+   if (avail_to_resrv_perfctr_nmi_bit(i))
+   break;
+   no_ctr_free = (i == 4);
+   if (no_ctr_free) {
+   i = 3;
+   rdmsrl(MSR_K7_EVNTSEL3, evntsel3);
+   wrmsrl(MSR_K7_EVNTSEL3, 0);
+   rdmsrl(MSR_K7_PERFCTR3, pmc3);
+   } else {
+   reserve_perfctr_nmi(MSR_K7_PERFCTR0 + i);
+   reserve_evntsel_nmi(MSR_K7_EVNTSEL0 + i);
+   }
+   local_irq_save(flags);
+   /* start meauring cycles, incrementing from 0 */
+   wrmsrl(MSR_K7_PERFCTR0 + i, 0);
+   wrmsrl(MSR_K7_EVNTSEL0 + i, 1  22 | 3  16 | 0x76);
+   rdtscl(tsc_start);
+   do {
+   rdmsrl(MSR_K7_PERFCTR0 + i, pmc_now);
+   tsc_now = get_cycles_sync();
+   } while ((tsc_now - tsc_start)  TICK_COUNT);
+
+   local_irq_restore(flags);
+   if (no_ctr_free) {
+   wrmsrl(MSR_K7_EVNTSEL3, 0);
+   wrmsrl(MSR_K7_PERFCTR3, pmc3);
+   wrmsrl(MSR_K7_EVNTSEL3, evntsel3);
+   } else {
+   release_perfctr_nmi(MSR_K7_PERFCTR0 + i);
+   release_evntsel_nmi(MSR_K7_EVNTSEL0 + i);
+   }
+
+   return pmc_now * tsc_khz / (tsc_now - tsc_start);
 }
 
 /*
@@ -315,7 +315,7 @@ static unsigned int __init pit_calibrate_tsc(void)
end = get_cycles_sync();
 
spin_unlock_irqrestore(i8253_lock, flags);
-   
+
return (end - start) / 50;
 }
 
@@ -360,7 +360,7 @@ static struct irqaction irq0 = 

x86_64: Avoid too many remote cpu references due to /proc/stat

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c3508f8f341f19f6b1c3f854f144540427668151
Commit: c3508f8f341f19f6b1c3f854f144540427668151
Parent: 2618f86e0010fc6703e77af3613bac7ade46efc6
Author: Ravikiran G Thirumalai [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:19 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:09 2007 -0700

x86_64: Avoid too many remote cpu references due to /proc/stat

Too many remote cpu references due to /proc/stat.

On x86_64, with newer kernel versions, kstat_irqs is a bit of a problem.
On every call to kstat_irqs, the process brings in per-cpu data from all
online cpus.  Doing this for NR_IRQS, which is now 256 + 32 * NR_CPUS
results in (256+32*63) * 63 remote cpu references on a 64 cpu config.
/proc/stat is parsed by common commands like top, who etc, causing lots
of cacheline transfers

This statistic seems useless.  Other 'big iron' arches disable this.

AK: changed to remove for all SMP setups
AK: add comment

Signed-off-by: Ravikiran Thirumalai [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/proc/proc_misc.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index f133afe..bee251c 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -507,7 +507,8 @@ static int show_stat(struct seq_file *p, void *v)
}
seq_printf(p, intr %llu, (unsigned long long)sum);
 
-#if !defined(CONFIG_PPC64)  !defined(CONFIG_ALPHA)  !defined(CONFIG_IA64)
+#ifndef CONFIG_SMP
+   /* Touches too many cache lines on SMP setups */
for (i = 0; i  NR_IRQS; i++)
seq_printf(p,  %u, per_irq_sum[i]);
 #endif
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86_64: ia32entry adjustments

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cdc1793ef7f5ccc47696e3d00b827e832e4c5bdb
Commit: cdc1793ef7f5ccc47696e3d00b827e832e4c5bdb
Parent: c3508f8f341f19f6b1c3f854f144540427668151
Author: Jan Beulich [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:20 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:09 2007 -0700

x86_64: ia32entry adjustments

Consolidate the three 32-bit system call entry points so that they all
treat registers in similar ways.

Signed-off-by: Jan Beulich [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/ia32/ia32entry.S |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S
index 3f66e97..9382786 100644
--- a/arch/x86_64/ia32/ia32entry.S
+++ b/arch/x86_64/ia32/ia32entry.S
@@ -104,7 +104,7 @@ ENTRY(ia32_sysenter_target)
pushq   %rax
CFI_ADJUST_CFA_OFFSET 8
cld
-   SAVE_ARGS 0,0,0
+   SAVE_ARGS 0,0,1
/* no need to do an access_ok check here because rbp has been
   32bit zero extended */ 
 1: movl(%rbp),%r9d
@@ -294,7 +294,7 @@ ia32_badarg:
  */
 
 ENTRY(ia32_syscall)
-   CFI_STARTPROC   simple
+   CFI_STARTPROC32 simple
CFI_SIGNAL_FRAME
CFI_DEF_CFA rsp,SS+8-RIP
/*CFI_REL_OFFSETss,SS-RIP*/
@@ -330,6 +330,7 @@ ia32_sysret:
 
 ia32_tracesys:  
SAVE_REST
+   CLEAR_RREGS
movq $-ENOSYS,RAX(%rsp) /* really needed? */
movq %rsp,%rdi/* pt_regs - arg1 */
call syscall_trace_enter
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i386: allow debuggers to access the vsyscall page with compat vDSO

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2f30c00702aca3229e1157718675f0ee56d2a931
Commit: 2f30c00702aca3229e1157718675f0ee56d2a931
Parent: cdc1793ef7f5ccc47696e3d00b827e832e4c5bdb
Author: Jan Beulich [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:21 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:09 2007 -0700

i386: allow debuggers to access the vsyscall page with compat vDSO

Signed-off-by: Jan Beulich [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/sysenter.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/i386/kernel/sysenter.c b/arch/i386/kernel/sysenter.c
index ff4ee6f..6deb159 100644
--- a/arch/i386/kernel/sysenter.c
+++ b/arch/i386/kernel/sysenter.c
@@ -336,7 +336,9 @@ struct vm_area_struct *get_gate_vma(struct task_struct *tsk)
 
 int in_gate_area(struct task_struct *task, unsigned long addr)
 {
-   return 0;
+   const struct vm_area_struct *vma = get_gate_vma(task);
+
+   return vma  addr = vma-vm_start  addr  vma-vm_end;
 }
 
 int in_gate_area_no_task(unsigned long 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


x86_64: minor exception trace variables cleanup

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=74a1ddc597d83d5ca6541b15a15f80a3722e3a1e
Commit: 74a1ddc597d83d5ca6541b15a15f80a3722e3a1e
Parent: 2f30c00702aca3229e1157718675f0ee56d2a931
Author: Jan Beulich [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:22 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:09 2007 -0700

x86_64: minor exception trace variables cleanup

Signed-off-by: Jan Beulich [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/mm/fault.c |2 +-
 arch/x86_64/mm/init.c  |2 --
 2 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c
index 84f1172..99a8018 100644
--- a/arch/x86_64/mm/fault.c
+++ b/arch/x86_64/mm/fault.c
@@ -301,7 +301,7 @@ static int vmalloc_fault(unsigned long address)
return 0;
 }
 
-int page_fault_trace = 0;
+static int page_fault_trace;
 int exception_trace = 1;
 
 /*
diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c
index 2f67322..381c2ec 100644
--- a/arch/x86_64/mm/init.c
+++ b/arch/x86_64/mm/init.c
@@ -700,8 +700,6 @@ int kern_addr_valid(unsigned long addr)
 #ifdef CONFIG_SYSCTL
 #include linux/sysctl.h
 
-extern int exception_trace, page_fault_trace;
-
 static ctl_table debug_table2[] = {
{
.ctl_name   = 99,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86_64: remove unused variable maxcpus

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d567b6a955c2c1a6b0e8fc13ecddc7d4ac4900a2
Commit: d567b6a955c2c1a6b0e8fc13ecddc7d4ac4900a2
Parent: 74a1ddc597d83d5ca6541b15a15f80a3722e3a1e
Author: Jan Beulich [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:23 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:09 2007 -0700

x86_64: remove unused variable maxcpus

.. and adjust documentation to properly reflect options that are
x86-64 specific.

Signed-off-by: Jan Beulich [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 Documentation/x86_64/boot-options.txt |6 --
 arch/x86_64/kernel/mpparse.c  |1 -
 2 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/Documentation/x86_64/boot-options.txt 
b/Documentation/x86_64/boot-options.txt
index 6177d88..a4595b2 100644
--- a/Documentation/x86_64/boot-options.txt
+++ b/Documentation/x86_64/boot-options.txt
@@ -134,12 +134,6 @@ Non Executable Mappings
 
 SMP
 
-  nosmpOnly use a single CPU
-
-  maxcpus=NUMBER only use upto NUMBER CPUs
-
-  cpumask=MASK   only use cpus with bits set in mask
-
   additional_cpus=NUM Allow NUM more CPUs for hotplug
 (defaults are specified by the BIOS, see 
Documentation/x86_64/cpu-hotplug-spec)
 
diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c
index 0ec8490..8bf0ca0 100644
--- a/arch/x86_64/kernel/mpparse.c
+++ b/arch/x86_64/kernel/mpparse.c
@@ -32,7 +32,6 @@
 
 /* Have we found an MP table */
 int smp_found_config;
-unsigned int __initdata maxcpus = NR_CPUS;
 
 /*
  * Various Linux-internal data structures created from the
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i386: smp-alt-once option is only useful with HOTPLUG_CPU

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=09488165d5cc795a90b789c5657b1cbd279beb16
Commit: 09488165d5cc795a90b789c5657b1cbd279beb16
Parent: d567b6a955c2c1a6b0e8fc13ecddc7d4ac4900a2
Author: Jan Beulich [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:25 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:09 2007 -0700

i386: smp-alt-once option is only useful with HOTPLUG_CPU

Hence remove its handling in the opposite case.

Signed-off-by: Jan Beulich [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/alternative.c |   14 +-
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/arch/i386/kernel/alternative.c b/arch/i386/kernel/alternative.c
index d8cda14..0695be5 100644
--- a/arch/i386/kernel/alternative.c
+++ b/arch/i386/kernel/alternative.c
@@ -5,9 +5,8 @@
 #include asm/alternative.h
 #include asm/sections.h
 
-static int noreplace_smp = 0;
-static int smp_alt_once  = 0;
-static int debug_alternative = 0;
+#ifdef CONFIG_HOTPLUG_CPU
+static int smp_alt_once;
 
 static int __init bootonly(char *str)
 {
@@ -15,6 +14,11 @@ static int __init bootonly(char *str)
return 1;
 }
 __setup(smp-alt-boot, bootonly);
+#else
+#define smp_alt_once 1
+#endif
+
+static int debug_alternative;
 
 static int __init debug_alt(char *str)
 {
@@ -23,6 +27,8 @@ static int __init debug_alt(char *str)
 }
 __setup(debug-alternative, debug_alt);
 
+static int noreplace_smp;
+
 static int __init setup_noreplace_smp(char *str)
 {
noreplace_smp = 1;
@@ -376,8 +382,6 @@ void __init alternative_instructions(void)
 #ifdef CONFIG_HOTPLUG_CPU
if (num_possible_cpus()  2)
smp_alt_once = 1;
-#else
-   smp_alt_once = 1;
 #endif
 
 #ifdef CONFIG_SMP
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i386: minor nx handling adjustment

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d5321abe6abd16e1749ccd89636415d39611e138
Commit: d5321abe6abd16e1749ccd89636415d39611e138
Parent: 09488165d5cc795a90b789c5657b1cbd279beb16
Author: Jan Beulich [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:26 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:09 2007 -0700

i386: minor nx handling adjustment

Constrain __supported_pte_mask and NX handling to just the PAE kernel.

Signed-off-by: Jan Beulich [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/mm/init.c |7 ---
 include/asm-i386/page.h |1 -
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c
index 6e72f22..e1a9a80 100644
--- a/arch/i386/mm/init.c
+++ b/arch/i386/mm/init.c
@@ -471,6 +471,10 @@ void zap_low_mappings (void)
flush_tlb_all();
 }
 
+int nx_enabled = 0;
+
+#ifdef CONFIG_X86_PAE
+
 static int disable_nx __initdata = 0;
 u64 __supported_pte_mask __read_mostly = ~_PAGE_NX;
 EXPORT_SYMBOL_GPL(__supported_pte_mask);
@@ -500,9 +504,6 @@ static int __init noexec_setup(char *str)
 }
 early_param(noexec, noexec_setup);
 
-int nx_enabled = 0;
-#ifdef CONFIG_X86_PAE
-
 static void __init set_nx(void)
 {
unsigned int v[4], l, h;
diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h
index 99cf5d3..80ecc66 100644
--- a/include/asm-i386/page.h
+++ b/include/asm-i386/page.h
@@ -44,7 +44,6 @@
 extern int nx_enabled;
 
 #ifdef CONFIG_X86_PAE
-extern unsigned long long __supported_pte_mask;
 typedef struct { unsigned long pte_low, pte_high; } pte_t;
 typedef struct { unsigned long long pmd; } pmd_t;
 typedef struct { unsigned long long pgd; } pgd_t;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i386: remapped_pgdat_init() static

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=10079ae35fc91a0d5afa50eb4ccc82fb8f7124e9
Commit: 10079ae35fc91a0d5afa50eb4ccc82fb8f7124e9
Parent: d5321abe6abd16e1749ccd89636415d39611e138
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:27 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:09 2007 -0700

i386: remapped_pgdat_init() static

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/setup.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 74871d0..ec4dfcc 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -466,7 +466,7 @@ void __init setup_bootmem_allocator(void)
  *
  * This should all compile down to nothing when NUMA is off.
  */
-void __init remapped_pgdat_init(void)
+static void __init remapped_pgdat_init(void)
 {
int nid;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i386: arch/i386/kernel/i8253.c should #include asm/timer.h

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3f9c8d19d26e016de31d1e59a573913edc64ce5c
Commit: 3f9c8d19d26e016de31d1e59a573913edc64ce5c
Parent: 10079ae35fc91a0d5afa50eb4ccc82fb8f7124e9
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:28 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:09 2007 -0700

i386: arch/i386/kernel/i8253.c should #include asm/timer.h

Every file should include the headers containing the prototypes for its
global functions.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/i8253.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/i386/kernel/i8253.c b/arch/i386/kernel/i8253.c
index bde249d..73c3342 100644
--- a/arch/i386/kernel/i8253.c
+++ b/arch/i386/kernel/i8253.c
@@ -13,6 +13,7 @@
 #include asm/delay.h
 #include asm/i8253.h
 #include asm/io.h
+#include asm/timer.h
 
 #include io_ports.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


i386: timer_irq_works() static again

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f0a7a5c93dfd1c0348dbbdb6f22cb82d99079c93
Commit: f0a7a5c93dfd1c0348dbbdb6f22cb82d99079c93
Parent: 3f9c8d19d26e016de31d1e59a573913edc64ce5c
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:29 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:09 2007 -0700

i386: timer_irq_works() static again

timer_irq_works() needlessly became global.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/io_apic.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index 21db8f5..1bc4f7e 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -1902,7 +1902,7 @@ __setup(no_timer_check, notimercheck);
  * - if this function detects that timer IRQs are defunct, then we fall
  *   back to ISA timer IRQs
  */
-int __init timer_irq_works(void)
+static int __init timer_irq_works(void)
 {
unsigned long t1 = jiffies;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86_64: Quicklist support for x86_64

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=34feb2c83beb3bdf13535a36770f7e50b47ef299
Commit: 34feb2c83beb3bdf13535a36770f7e50b47ef299
Parent: f0a7a5c93dfd1c0348dbbdb6f22cb82d99079c93
Author: Christoph Lameter [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:30 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:09 2007 -0700

x86_64: Quicklist support for x86_64

This adds caching of pgds and puds, pmds, pte.  That way we can avoid costly
zeroing and initialization of special mappings in the pgd.

A second quicklist is useful to separate out PGD handling.  We can carry the
initialized pgds over to the next process needing them.

Also clean up the pgd_list handling to use regular list macros.  There is no
need anymore to avoid the lru field.

Move the add/removal of the pgds to the pgdlist into the constructor /
destructor.  That way the implementation is congruent with i386.

Signed-off-by: Christoph Lameter [EMAIL PROTECTED]
Cc: David S. Miller [EMAIL PROTECTED]
Cc: Luck, Tony [EMAIL PROTECTED]
Acked-by: William Lee Irwin III [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/Kconfig  |8 
 arch/x86_64/kernel/process.c |1 +
 arch/x86_64/kernel/smp.c |2 +-
 include/asm-x86_64/pgalloc.h |   73 --
 include/asm-x86_64/pgtable.h |1 -
 5 files changed, 59 insertions(+), 26 deletions(-)

diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
index fca1a85..45f82ae 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86_64/Kconfig
@@ -60,6 +60,14 @@ config ZONE_DMA
bool
default y
 
+config QUICKLIST
+   bool
+   default y
+
+config NR_QUICK
+   int
+   default 2
+
 config ISA
bool
 
diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c
index 5909039..180f4c0 100644
--- a/arch/x86_64/kernel/process.c
+++ b/arch/x86_64/kernel/process.c
@@ -207,6 +207,7 @@ void cpu_idle (void)
if (__get_cpu_var(cpu_idle_state))
__get_cpu_var(cpu_idle_state) = 0;
 
+   check_pgt_cache();
rmb();
idle = pm_idle;
if (!idle)
diff --git a/arch/x86_64/kernel/smp.c b/arch/x86_64/kernel/smp.c
index df4a828..673a300 100644
--- a/arch/x86_64/kernel/smp.c
+++ b/arch/x86_64/kernel/smp.c
@@ -241,7 +241,7 @@ void flush_tlb_mm (struct mm_struct * mm)
}
if (!cpus_empty(cpu_mask))
flush_tlb_others(cpu_mask, mm, FLUSH_ALL);
-
+   check_pgt_cache();
preempt_enable();
 }
 EXPORT_SYMBOL(flush_tlb_mm);
diff --git a/include/asm-x86_64/pgalloc.h b/include/asm-x86_64/pgalloc.h
index 8bb5646..b467be6 100644
--- a/include/asm-x86_64/pgalloc.h
+++ b/include/asm-x86_64/pgalloc.h
@@ -4,6 +4,10 @@
 #include asm/pda.h
 #include linux/threads.h
 #include linux/mm.h
+#include linux/quicklist.h
+
+#define QUICK_PGD 0/* We preserve special mappings over free */
+#define QUICK_PT 1 /* Other page table pages that are zero on free */
 
 #define pmd_populate_kernel(mm, pmd, pte) \
set_pmd(pmd, __pmd(_PAGE_TABLE | __pa(pte)))
@@ -20,23 +24,23 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t 
*pmd, struct page *p
 static inline void pmd_free(pmd_t *pmd)
 {
BUG_ON((unsigned long)pmd  (PAGE_SIZE-1));
-   free_page((unsigned long)pmd);
+   quicklist_free(QUICK_PT, NULL, pmd);
 }
 
 static inline pmd_t *pmd_alloc_one (struct mm_struct *mm, unsigned long addr)
 {
-   return (pmd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT);
+   return (pmd_t *)quicklist_alloc(QUICK_PT, GFP_KERNEL|__GFP_REPEAT, 
NULL);
 }
 
 static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
 {
-   return (pud_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT);
+   return (pud_t *)quicklist_alloc(QUICK_PT, GFP_KERNEL|__GFP_REPEAT, 
NULL);
 }
 
 static inline void pud_free (pud_t *pud)
 {
BUG_ON((unsigned long)pud  (PAGE_SIZE-1));
-   free_page((unsigned long)pud);
+   quicklist_free(QUICK_PT, NULL, pud);
 }
 
 static inline void pgd_list_add(pgd_t *pgd)
@@ -57,41 +61,57 @@ static inline void pgd_list_del(pgd_t *pgd)
spin_unlock(pgd_lock);
 }
 
-static inline pgd_t *pgd_alloc(struct mm_struct *mm)
+static inline void pgd_ctor(void *x)
 {
unsigned boundary;
-   pgd_t *pgd = (pgd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
-   if (!pgd)
-   return NULL;
-   pgd_list_add(pgd);
+   pgd_t *pgd = x;
+   struct page *page = virt_to_page(pgd);
+
/*
 * Copy kernel pointers in from init.
-* Could keep a freelist or slab cache of those because the 

x86_64: extract helper function from e820_register_active_regions

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3af044e0f832cfa3fcdce14dc30678b79dd36995
Commit: 3af044e0f832cfa3fcdce14dc30678b79dd36995
Parent: 34feb2c83beb3bdf13535a36770f7e50b47ef299
Author: David Rientjes [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:31 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:10 2007 -0700

x86_64: extract helper function from e820_register_active_regions

The logic in e820_find_active_regions() for determining the true active
regions for an e820 entry given a range of PFN's is needed for
e820_hole_size() as well.

e820_hole_size() is called from the NUMA emulation code to determine the
reserved area within an address range on a per-node basis.  Its logic should
duplicate that of finding active regions in an e820 entry because these are
the only true ranges we may register anyway.

[EMAIL PROTECTED]: cleanup]
Cc: Mel Gorman [EMAIL PROTECTED]
Signed-off-by: David Rientjes [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/kernel/e820.c |   82 ++--
 1 files changed, 48 insertions(+), 34 deletions(-)

diff --git a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c
index 13c6c37..2570643 100644
--- a/arch/x86_64/kernel/e820.c
+++ b/arch/x86_64/kernel/e820.c
@@ -289,47 +289,61 @@ void __init e820_mark_nosave_regions(void)
}
 }
 
-/* Walk the e820 map and register active regions within a node */
-void __init
-e820_register_active_regions(int nid, unsigned long start_pfn,
-   unsigned long end_pfn)
+/*
+ * Finds an active region in the address range from start_pfn to end_pfn and
+ * returns its range in ei_startpfn and ei_endpfn for the e820 entry.
+ */
+static int __init e820_find_active_region(const struct e820entry *ei,
+ unsigned long start_pfn,
+ unsigned long end_pfn,
+ unsigned long *ei_startpfn,
+ unsigned long *ei_endpfn)
 {
-   int i;
-   unsigned long ei_startpfn, ei_endpfn;
-   for (i = 0; i  e820.nr_map; i++) {
-   struct e820entry *ei = e820.map[i];
-   ei_startpfn = round_up(ei-addr, PAGE_SIZE)  PAGE_SHIFT;
-   ei_endpfn = round_down(ei-addr + ei-size, PAGE_SIZE)
-PAGE_SHIFT;
+   *ei_startpfn = round_up(ei-addr, PAGE_SIZE)  PAGE_SHIFT;
+   *ei_endpfn = round_down(ei-addr + ei-size, PAGE_SIZE)  PAGE_SHIFT;
 
-   /* Skip map entries smaller than a page */
-   if (ei_startpfn = ei_endpfn)
-   continue;
+   /* Skip map entries smaller than a page */
+   if (*ei_startpfn = *ei_endpfn)
+   return 0;
 
-   /* Check if end_pfn_map should be updated */
-   if (ei-type != E820_RAM  ei_endpfn  end_pfn_map)
-   end_pfn_map = ei_endpfn;
+   /* Check if end_pfn_map should be updated */
+   if (ei-type != E820_RAM  *ei_endpfn  end_pfn_map)
+   end_pfn_map = *ei_endpfn;
 
-   /* Skip if map is outside the node */
-   if (ei-type != E820_RAM ||
-   ei_endpfn = start_pfn ||
-   ei_startpfn = end_pfn)
-   continue;
+   /* Skip if map is outside the node */
+   if (ei-type != E820_RAM || *ei_endpfn = start_pfn ||
+   *ei_startpfn = end_pfn)
+   return 0;
 
-   /* Check for overlaps */
-   if (ei_startpfn  start_pfn)
-   ei_startpfn = start_pfn;
-   if (ei_endpfn  end_pfn)
-   ei_endpfn = end_pfn;
+   /* Check for overlaps */
+   if (*ei_startpfn  start_pfn)
+   *ei_startpfn = start_pfn;
+   if (*ei_endpfn  end_pfn)
+   *ei_endpfn = end_pfn;
 
-   /* Obey end_user_pfn to save on memmap */
-   if (ei_startpfn = end_user_pfn)
-   continue;
-   if (ei_endpfn  end_user_pfn)
-   ei_endpfn = end_user_pfn;
+   /* Obey end_user_pfn to save on memmap */
+   if (*ei_startpfn = end_user_pfn)
+   return 0;
+   if (*ei_endpfn  end_user_pfn)
+   *ei_endpfn = end_user_pfn;
 
-   add_active_range(nid, ei_startpfn, ei_endpfn);
-   }
+   return 1;
+}
+
+/* Walk the e820 map and register active regions within a node */
+void __init
+e820_register_active_regions(int nid, unsigned long start_pfn,
+   

x86_64: fake pxm-to-node mapping for fake numa

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3484d79813707bb6045773953a809abba443dc20
Commit: 3484d79813707bb6045773953a809abba443dc20
Parent: 3af044e0f832cfa3fcdce14dc30678b79dd36995
Author: David Rientjes [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:32 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:10 2007 -0700

x86_64: fake pxm-to-node mapping for fake numa

For NUMA emulation, our SLIT should represent the true NUMA topology of the
system but our proximity domain to node ID mapping needs to reflect the
emulated state.

When NUMA emulation has successfully setup fake nodes on the system, a new
function, acpi_fake_nodes() is called.  This function determines the 
proximity
domain (_PXM) for each true node found on the system.  It then finds which
emulated nodes have been allocated on this true node as determined by its
starting address.  The node ID to PXM mapping is changed so that each fake
node ID points to the PXM of the true node that it is located on.

If the machine failed to register a SLIT, then we assume there is no special
requirement for emulated node affinity so we use the default LOCAL_DISTANCE,
which is newly exported to this code, as our measurement if the emulated 
nodes
appear in the same PXM.  Otherwise, we use REMOTE_DISTANCE.

PXM_INVAL and NID_INVAL are also exported to the ACPI header file so that we
can compare node_to_pxm() results in generic code (in this case, the SRAT
code).

Cc: Len Brown [EMAIL PROTECTED]
Signed-off-by: David Rientjes [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/mm/numa.c |1 +
 arch/x86_64/mm/srat.c |   76 +++--
 drivers/acpi/numa.c   |   11 --
 include/acpi/acpi_numa.h  |1 +
 include/asm-x86_64/acpi.h |   11 ++
 include/linux/acpi.h  |3 ++
 6 files changed, 96 insertions(+), 7 deletions(-)

diff --git a/arch/x86_64/mm/numa.c b/arch/x86_64/mm/numa.c
index 5154894..30bf804 100644
--- a/arch/x86_64/mm/numa.c
+++ b/arch/x86_64/mm/numa.c
@@ -484,6 +484,7 @@ out:
nodes[i].end  PAGE_SHIFT);
setup_node_bootmem(i, nodes[i].start, nodes[i].end);
}
+   acpi_fake_nodes(nodes, num_nodes);
numa_init_array();
return 0;
 }
diff --git a/arch/x86_64/mm/srat.c b/arch/x86_64/mm/srat.c
index 0e0725d..7ac8ff3 100644
--- a/arch/x86_64/mm/srat.c
+++ b/arch/x86_64/mm/srat.c
@@ -350,7 +350,7 @@ acpi_numa_memory_affinity_init(struct 
acpi_srat_mem_affinity *ma)
 
 /* Sanity check to catch more bad SRATs (they are amazingly common).
Make sure the PXMs cover all memory. */
-static int nodes_cover_memory(void)
+static int __init nodes_cover_memory(const struct bootnode *nodes)
 {
int i;
unsigned long pxmram, e820ram;
@@ -406,7 +406,7 @@ int __init acpi_scan_nodes(unsigned long start, unsigned 
long end)
}
}
 
-   if (!nodes_cover_memory()) {
+   if (!nodes_cover_memory(nodes)) {
bad_srat();
return -1;
}
@@ -440,6 +440,75 @@ int __init acpi_scan_nodes(unsigned long start, unsigned 
long end)
return 0;
 }
 
+#ifdef CONFIG_NUMA_EMU
+static int __init find_node_by_addr(unsigned long addr)
+{
+   int ret = NUMA_NO_NODE;
+   int i;
+
+   for_each_node_mask(i, nodes_parsed) {
+   /*
+* Find the real node that this emulated node appears on.  For
+* the sake of simplicity, we only use a real node's starting
+* address to determine which emulated node it appears on.
+*/
+   if (addr = nodes[i].start  addr  nodes[i].end) {
+   ret = i;
+   break;
+   }
+   }
+   return i;
+}
+
+/*
+ * In NUMA emulation, we need to setup proximity domain (_PXM) to node ID
+ * mappings that respect the real ACPI topology but reflect our emulated
+ * environment.  For each emulated node, we find which real node it appears on
+ * and create PXM to NID mappings for those fake nodes which mirror that
+ * locality.  SLIT will now represent the correct distances between emulated
+ * nodes as a result of the real topology.
+ */
+void __init acpi_fake_nodes(const struct bootnode *fake_nodes, int num_nodes)
+{
+   int i;
+   int fake_node_to_pxm_map[MAX_NUMNODES] = {
+   [0 ... MAX_NUMNODES-1] = PXM_INVAL
+   };
+
+   printk(KERN_INFO Faking PXM affinity for fake nodes on real 
+topology.\n);
+   for (i = 0; i  num_nodes; i++) {
+   int nid, pxm;
+
+   nid = 

x86_64: fake apicid_to_node mapping for fake numa

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=08705b89ecb0f4b0ba5735630ef988bd9fd9dd95
Commit: 08705b89ecb0f4b0ba5735630ef988bd9fd9dd95
Parent: 3484d79813707bb6045773953a809abba443dc20
Author: David Rientjes [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:33 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:10 2007 -0700

x86_64: fake apicid_to_node mapping for fake numa

When we are in the emulated NUMA case, we need to make sure that all 
existing
apicid_to_node mappings that point to real node ID's now point to the
equivalent fake node ID's.

If we simply iterate over all apicid_to_node[] members for each node, we 
risk
remapping an entry if it shares a node ID with a real node.  Since apicid's
may not be consecutive, we're forced to create an automatic array of
apicid_to_node mappings and then copy it over once we have finished 
remapping
fake to real nodes.

Signed-off-by: David Rientjes [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/mm/srat.c |   13 -
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/arch/x86_64/mm/srat.c b/arch/x86_64/mm/srat.c
index 7ac8ff3..acdf03e 100644
--- a/arch/x86_64/mm/srat.c
+++ b/arch/x86_64/mm/srat.c
@@ -470,10 +470,13 @@ static int __init find_node_by_addr(unsigned long addr)
  */
 void __init acpi_fake_nodes(const struct bootnode *fake_nodes, int num_nodes)
 {
-   int i;
+   int i, j;
int fake_node_to_pxm_map[MAX_NUMNODES] = {
[0 ... MAX_NUMNODES-1] = PXM_INVAL
};
+   unsigned char fake_apicid_to_node[MAX_LOCAL_APIC] = {
+   [0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE
+   };
 
printk(KERN_INFO Faking PXM affinity for fake nodes on real 
 topology.\n);
@@ -487,9 +490,17 @@ void __init acpi_fake_nodes(const struct bootnode 
*fake_nodes, int num_nodes)
if (pxm == PXM_INVAL)
continue;
fake_node_to_pxm_map[i] = pxm;
+   /*
+* For each apicid_to_node mapping that exists for this real
+* node, it must now point to the fake node ID.
+*/
+   for (j = 0; j  MAX_LOCAL_APIC; j++)
+   if (apicid_to_node[j] == nid)
+   fake_apicid_to_node[j] = i;
}
for (i = 0; i  num_nodes; i++)
__acpi_map_pxm_to_node(fake_node_to_pxm_map[i], i);
+   memcpy(apicid_to_node, fake_apicid_to_node, sizeof(apicid_to_node));
 
nodes_clear(nodes_parsed);
for (i = 0; i  num_nodes; i++)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i386: insert unclaimed MMCONFIG resources

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a5ba7971045a90a36cef8f7d5a3075600b475b74
Commit: a5ba7971045a90a36cef8f7d5a3075600b475b74
Parent: 08705b89ecb0f4b0ba5735630ef988bd9fd9dd95
Author: Aaron Durbin [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:34 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:10 2007 -0700

i386: insert unclaimed MMCONFIG resources

Insert the unclaimed MMCONFIG resources into the resource tree without the
IORESOURCE_BUSY flag during late initialization.  This allows the MMCONFIG
regions to be visible in the iomem resource tree without interfering with
other system resources that were discovered during PCI initialization.

[EMAIL PROTECTED]: nanofixes]
Signed-off-by: Aaron Durbin [EMAIL PROTECTED]
Cc: David Rientjes [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/pci/mmconfig-shared.c |   48 --
 1 files changed, 45 insertions(+), 3 deletions(-)

diff --git a/arch/i386/pci/mmconfig-shared.c b/arch/i386/pci/mmconfig-shared.c
index c7cabee..4df637e 100644
--- a/arch/i386/pci/mmconfig-shared.c
+++ b/arch/i386/pci/mmconfig-shared.c
@@ -24,6 +24,9 @@
 
 DECLARE_BITMAP(pci_mmcfg_fallback_slots, 32*PCI_MMCFG_MAX_CHECK_BUS);
 
+/* Indicate if the mmcfg resources have been placed into the resource table. */
+static int __initdata pci_mmcfg_resources_inserted;
+
 /* K8 systems have some devices (typically in the builtin northbridge)
that are only accessible using type1
Normally this can be expressed in the MCFG by not listing them
@@ -170,7 +173,7 @@ static int __init pci_mmcfg_check_hostbridge(void)
return name != NULL;
 }
 
-static void __init pci_mmcfg_insert_resources(void)
+static void __init pci_mmcfg_insert_resources(unsigned long resource_flags)
 {
 #define PCI_MMCFG_RESOURCE_NAME_LEN 19
int i;
@@ -194,10 +197,13 @@ static void __init pci_mmcfg_insert_resources(void)
 cfg-pci_segment);
res-start = cfg-address;
res-end = res-start + (num_buses  20) - 1;
-   res-flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+   res-flags = IORESOURCE_MEM | resource_flags;
insert_resource(iomem_resource, res);
names += PCI_MMCFG_RESOURCE_NAME_LEN;
}
+
+   /* Mark that the resources have been inserted. */
+   pci_mmcfg_resources_inserted = 1;
 }
 
 static void __init pci_mmcfg_reject_broken(int type)
@@ -267,7 +273,43 @@ void __init pci_mmcfg_init(int type)
if (type == 1)
unreachable_devices();
if (known_bridge)
-   pci_mmcfg_insert_resources();
+   pci_mmcfg_insert_resources(IORESOURCE_BUSY);
pci_probe = (pci_probe  ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF;
+   } else {
+   /*
+* Signal not to attempt to insert mmcfg resources because
+* the architecture mmcfg setup could not initialize.
+*/
+   pci_mmcfg_resources_inserted = 1;
}
 }
+
+static int __init pci_mmcfg_late_insert_resources(void)
+{
+   /*
+* If resources are already inserted or we are not using MMCONFIG,
+* don't insert the resources.
+*/
+   if ((pci_mmcfg_resources_inserted == 1) ||
+   (pci_probe  PCI_PROBE_MMCONF) == 0 ||
+   (pci_mmcfg_config_num == 0) ||
+   (pci_mmcfg_config == NULL) ||
+   (pci_mmcfg_config[0].address == 0))
+   return 1;
+
+   /*
+* Attempt to insert the mmcfg resources but not with the busy flag
+* marked so it won't cause request errors when __request_region is
+* called.
+*/
+   pci_mmcfg_insert_resources(0);
+
+   return 0;
+}
+
+/*
+ * Perform MMCONFIG resource insertion after PCI initialization to allow for
+ * misprogrammed MCFG tables that state larger sizes but actually conflict
+ * with other system resources.
+ */
+late_initcall(pci_mmcfg_late_insert_resources);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86_64: O_EXCL on /dev/mcelog

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f528e7ba28492e363a64c80c414ded4cadf48f89
Commit: f528e7ba28492e363a64c80c414ded4cadf48f89
Parent: a5ba7971045a90a36cef8f7d5a3075600b475b74
Author: Tim Hockin [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:35 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:10 2007 -0700

x86_64: O_EXCL on /dev/mcelog

Background:
 /dev/mcelog is a clear-on-read interface.  It is currently possible for
 multiple users to open and read() the device.  Users are protected from
 each other during any one read, but not across reads.

Description:
 This patch adds support for O_EXCL to /dev/mcelog.  If a user opens the
 device with O_EXCL, no other user may open the device (EBUSY).  Likewise,
 any user that tries to open the device with O_EXCL while another user has
 the device will fail (EBUSY).

Result:
 Applications can get exclusive access to /dev/mcelog.  Applications that
 do not care will be unchanged.

Alternatives:
 A simpler choice would be to only allow one open() at all, regardless of
 O_EXCL.

Testing:
 I wrote an application that opens /dev/mcelog with O_EXCL and observed
 that any other app that tried to open /dev/mcelog would fail until the
 exclusive app had closed the device.

Caveats:
 None.

Signed-off-by: Tim Hockin [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/kernel/mce.c |   36 
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c
index f3fb817..77fee48 100644
--- a/arch/x86_64/kernel/mce.c
+++ b/arch/x86_64/kernel/mce.c
@@ -465,6 +465,40 @@ void __cpuinit mcheck_init(struct cpuinfo_x86 *c)
  * Character device to read and clear the MCE log.
  */
 
+static DEFINE_SPINLOCK(mce_state_lock);
+static int open_count; /* #times opened */
+static int open_exclu; /* already open exclusive? */
+
+static int mce_open(struct inode *inode, struct file *file)
+{
+   spin_lock(mce_state_lock);
+
+   if (open_exclu || (open_count  (file-f_flags  O_EXCL))) {
+   spin_unlock(mce_state_lock);
+   return -EBUSY;
+   }
+
+   if (file-f_flags  O_EXCL)
+   open_exclu = 1;
+   open_count++;
+
+   spin_unlock(mce_state_lock);
+
+   return 0;
+}
+
+static int mce_release(struct inode *inode, struct file *file)
+{
+   spin_lock(mce_state_lock);
+
+   open_count--;
+   open_exclu = 0;
+
+   spin_unlock(mce_state_lock);
+
+   return 0;
+}
+
 static void collect_tscs(void *data) 
 { 
unsigned long *cpu_tsc = (unsigned long *)data;
@@ -555,6 +589,8 @@ static int mce_ioctl(struct inode *i, struct file 
*f,unsigned int cmd, unsigned
 }
 
 static const struct file_operations mce_chrdev_ops = {
+   .open = mce_open,
+   .release = mce_release,
.read = mce_read,
.ioctl = mce_ioctl,
 };
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86_64: support poll() on /dev/mcelog

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e02e68d31e2d436197386997727b216fee9c4623
Commit: e02e68d31e2d436197386997727b216fee9c4623
Parent: f528e7ba28492e363a64c80c414ded4cadf48f89
Author: Tim Hockin [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:36 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:10 2007 -0700

x86_64: support poll() on /dev/mcelog

Background:
 /dev/mcelog is typically polled manually.  This is less than optimal for
 situations where accurate accounting of MCEs is important.  Calling
 poll() on /dev/mcelog does not work.

Description:
 This patch adds support for poll() to /dev/mcelog.  This results in
 immediate wakeup of user apps whenever the poller finds MCEs.  Because
 the exception handler can not take any locks, it can not call the wakeup
 itself.  Instead, it uses a thread_info flag (TIF_MCE_NOTIFY) which is
 caught at the next return from interrupt or exit from idle, calling the
 mce_user_notify() routine.  This patch also disables the fake panic
 path of the mce_panic(), because it results in printk()s in the exception
 handler and crashy systems.

 This patch also does some small cleanup for essentially unused variables,
 and moves the user notification into the body of the poller, so it is
 only called once per poll, rather than once per CPU.

Result:
 Applications can now poll() on /dev/mcelog.  When an error is logged
 (whether through the poller or through an exception) the applications are
 woken up promptly.  This should not affect any previous behaviors.  If no
 MCEs are being logged, there is no overhead.

Alternatives:
 I considered simply supporting poll() through the poller and not using
 TIF_MCE_NOTIFY at all.  However, the time between an uncorrectable error
 happening and the user application being notified is *the*most* critical
 window for us.  Many uncorrectable errors can be logged to the network if
 given a chance.

 I also considered doing the MCE poll directly from the idle notifier, but
 decided that was overkill.

Testing:
 I used an error-injecting DIMM to create lots of correctable DRAM errors
 and verified that my user app is woken up in sync with the polling 
interval.
 I also used the northbridge to inject uncorrectable ECC errors, and
 verified (printk() to the rescue) that the notify routine is called and the
 user app does wake up.  I built with PREEMPT on and off, and verified
 that my machine survives MCEs.

[EMAIL PROTECTED]: build fix]
Signed-off-by: Tim Hockin [EMAIL PROTECTED]
Signed-off-by: William Irwin [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/kernel/entry.S   |6 +-
 arch/x86_64/kernel/mce.c |  105 -
 arch/x86_64/kernel/signal.c  |7 +++
 include/asm-x86_64/mce.h |2 +
 include/asm-x86_64/thread_info.h |2 +
 5 files changed, 82 insertions(+), 40 deletions(-)

diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S
index a67f87b..830cfc6 100644
--- a/arch/x86_64/kernel/entry.S
+++ b/arch/x86_64/kernel/entry.S
@@ -282,7 +282,7 @@ sysret_careful:
 sysret_signal:
TRACE_IRQS_ON
sti
-   testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx
+   testl 
$(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP|_TIF_MCE_NOTIFY),%edx
jz1f
 
/* Really a signal */
@@ -375,7 +375,7 @@ int_very_careful:
jmp int_restore_rest

 int_signal:
-   testl $(_TIF_NOTIFY_RESUME|_TIF_SIGPENDING|_TIF_SINGLESTEP),%edx
+   testl 
$(_TIF_NOTIFY_RESUME|_TIF_SIGPENDING|_TIF_SINGLESTEP|_TIF_MCE_NOTIFY),%edx
jz 1f
movq %rsp,%rdi  # ptregs - arg1
xorl %esi,%esi  # oldset - arg2
@@ -599,7 +599,7 @@ retint_careful:
jmp retint_check

 retint_signal:
-   testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx
+   testl 
$(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP|_TIF_MCE_NOTIFY),%edx
jzretint_swapgs
TRACE_IRQS_ON
sti
diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c
index 77fee48..9686135 100644
--- a/arch/x86_64/kernel/mce.c
+++ b/arch/x86_64/kernel/mce.c
@@ -18,6 +18,8 @@
 #include linux/capability.h
 #include linux/cpu.h
 #include linux/percpu.h
+#include linux/poll.h
+#include linux/thread_info.h
 #include linux/ctype.h
 #include linux/kmod.h
 #include linux/kdebug.h
@@ -26,6 +28,7 @@
 #include asm/mce.h
 #include asm/uaccess.h
 #include asm/smp.h
+#include asm/idle.h
 
 #define MISC_MCELOG_MINOR 227
 #define NR_BANKS 6
@@ -39,8 +42,7 @@ static int mce_dont_init;

x86_64: mcelog tolerant level cleanup

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bd78432c8f209a1028f4e5bada8b1da1d8e4da09
Commit: bd78432c8f209a1028f4e5bada8b1da1d8e4da09
Parent: e02e68d31e2d436197386997727b216fee9c4623
Author: Tim Hockin [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:37 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:10 2007 -0700

x86_64: mcelog tolerant level cleanup

Background:
 The MCE handler has several paths that it can take, depending on various
 conditions of the MCE status and the value of the 'tolerant' knob.  The
 exact semantics are not well defined and the code is a bit twisty.

Description:
 This patch makes the MCE handler's behavior more clear by documenting the
 behavior for various 'tolerant' levels.  It also fixes or enhances
 several small things in the handler.  Specifically:
 * If RIPV is set it is not safe to restart, so set the 'no way out'
   flag rather than the 'kill it' flag.
 * Don't panic() on correctable MCEs.
 * If the _OVER bit is set *and* the _UC bit is set (meaning possibly
   dropped uncorrected errors), set the 'no way out' flag.
 * Use EIPV for testing whether an app can be killed (SIGBUS) rather
   than RIPV.  According to docs, EIPV indicates that the error is
   related to the IP, while RIPV simply means the IP is valid to
   restart from.
 * Don't clear the MCi_STATUS registers until after the panic() path.
   This leaves the status bits set after the panic() so clever BIOSes
   can find them (and dumb BIOSes can do nothing).

 This patch also calls nonseekable_open() in mce_open (as suggested by 
akpm).

Result:
 Tolerant levels behave almost identically to how they always have, but
 not it's well defined.  There's a slightly higher chance of panic()ing
 when multiple errors happen (a good thing, IMHO).  If you take an MBE and
 panic(), the error status bits are not cleared.

Alternatives:
 None.

Testing:
 I used software to inject correctable and uncorrectable errors.  With
 tolerant = 3, the system usually survives.  With tolerant = 2, the system
 usually panic()s (PCC) but not always.  With tolerant = 1, the system
 always panic()s.  When the system panic()s, the BIOS is able to detect
 that the cause of death was an MC4.  I was not able to reproduce the
 case of a non-PCC error in userspace, with EIPV, with (tolerant  3).
 That will be rare at best.

Signed-off-by: Tim Hockin [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 Documentation/x86_64/boot-options.txt |8 ++-
 Documentation/x86_64/machinecheck |   14 +++--
 arch/x86_64/kernel/mce.c  |  101 ++---
 3 files changed, 80 insertions(+), 43 deletions(-)

diff --git a/Documentation/x86_64/boot-options.txt 
b/Documentation/x86_64/boot-options.txt
index a4595b2..9453118 100644
--- a/Documentation/x86_64/boot-options.txt
+++ b/Documentation/x86_64/boot-options.txt
@@ -14,9 +14,11 @@ Machine check
mce=nobootlog
Disable boot machine check logging.
mce=tolerancelevel (number)
-   0: always panic, 1: panic if deadlock possible,
-   2: try to avoid panic, 3: never panic or exit (for testing)
-   default is 1
+   0: always panic on uncorrected errors, log corrected errors
+   1: panic or SIGBUS on uncorrected errors, log corrected errors
+   2: SIGBUS or log uncorrected errors, log corrected errors
+   3: never panic or SIGBUS, log all errors (for testing only)
+   Default is 1
Can be also set using sysfs which is preferable.
 
nomce (for compatibility with i386): same as mce=off
diff --git a/Documentation/x86_64/machinecheck 
b/Documentation/x86_64/machinecheck
index feaeaf6..a05e58e 100644
--- a/Documentation/x86_64/machinecheck
+++ b/Documentation/x86_64/machinecheck
@@ -49,12 +49,14 @@ tolerant
Since machine check exceptions can happen any time it is sometimes
risky for the kernel to kill a process because it defies
normal kernel locking rules. The tolerance level configures
-   how hard the kernel tries to recover even at some risk of deadlock.
-
-   0: always panic,
-   1: panic if deadlock possible,
-   2: try to avoid panic,
-   3: never panic or exit (for testing only)
+   how hard the kernel tries to recover even at some risk of
+   deadlock.  Higher tolerant values trade potentially better uptime
+   with the risk of a crash or even corruption (for tolerant = 3).
+
+   0: always panic on uncorrected errors, log corrected errors
+   

i386: fix machine rebooting

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8b93789808756bcc1e5c90c99f1b1ef52f839a51
Commit: 8b93789808756bcc1e5c90c99f1b1ef52f839a51
Parent: bd78432c8f209a1028f4e5bada8b1da1d8e4da09
Author: Truxton Fulton [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:38 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:10 2007 -0700

i386: fix machine rebooting

Commit 59f4e7d572980a521b7bdba74ab71b21f5995538 fixed machine rebooting
on Truxton's machine (when no keyboard was present).  But it broke it on
Lee's machine.

The patch reinstates the old (pre-59f4e7d572980a521b7bdba74ab71b21f5995538)
code and if that doesn't work out, try the new,
post-59f4e7d572980a521b7bdba74ab71b21f5995538 code instead.

Cc: Lee Garrett [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/asm-i386/mach-default/mach_reboot.h |   25 -
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/include/asm-i386/mach-default/mach_reboot.h 
b/include/asm-i386/mach-default/mach_reboot.h
index a955e57..e23fd9f 100644
--- a/include/asm-i386/mach-default/mach_reboot.h
+++ b/include/asm-i386/mach-default/mach_reboot.h
@@ -19,14 +19,37 @@ static inline void kb_wait(void)
 static inline void mach_reboot(void)
 {
int i;
+
+   /* old method, works on most machines */
for (i = 0; i  10; i++) {
kb_wait();
udelay(50);
+   outb(0xfe, 0x64);   /* pulse reset low */
+   udelay(50);
+   }
+
+   /* New method: sets the System flag which, when set, indicates
+* successful completion of the keyboard controller self-test (Basic
+* Assurance Test, BAT).  This is needed for some machines with no
+* keyboard plugged in.  This read-modify-write sequence sets only the
+* system flag
+*/
+   for (i = 0; i  10; i++) {
+   int cmd;
+
+   outb(0x20, 0x64);   /* read Controller Command Byte */
+   udelay(50);
+   kb_wait();
+   udelay(50);
+   cmd = inb(0x60);
+   udelay(50);
+   kb_wait();
+   udelay(50);
outb(0x60, 0x64);   /* write Controller Command Byte */
udelay(50);
kb_wait();
udelay(50);
-   outb(0x14, 0x60);   /* set System flag */
+   outb(cmd | 0x04, 0x60); /* set System flag */
udelay(50);
kb_wait();
udelay(50);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i386: fix section mismatch warnings in mtrr

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9ef231a436fddb34d806f599c97b479691b3c38b
Commit: 9ef231a436fddb34d806f599c97b479691b3c38b
Parent: 8b93789808756bcc1e5c90c99f1b1ef52f839a51
Author: Sam Ravnborg [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:39 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:10 2007 -0700

i386: fix section mismatch warnings in mtrr

Following section mismatch warnings were reported by Andrey Borzenkov:

WARNING: arch/i386/kernel/built-in.o - Section mismatch: reference to 
.init.text:amd_init_mtrr from .text between 'mtrr_bp_init' (at offset 0x967a) 
and 'mtrr_attrib_to_str'
WARNING: arch/i386/kernel/built-in.o - Section mismatch: reference to 
.init.text:cyrix_init_mtrr from .text between 'mtrr_bp_init' (at offset 0x967f) 
and 'mtrr_attrib_to_str'
WARNING: arch/i386/kernel/built-in.o - Section mismatch: reference to 
.init.text:centaur_init_mtrr from .text between 'mtrr_bp_init' (at offset 
0x9684) and 'mtrr_attrib_to_str'
WARNING: arch/i386/kernel/built-in.o - Section mismatch: reference to 
.init.text: from .text between 'get_mtrr_state' (at offset 0xa735) and 
'generic_get_mtrr'
WARNING: arch/i386/kernel/built-in.o - Section mismatch: reference to 
.init.text: from .text between 'get_mtrr_state' (at offset 0xa749) and 
'generic_get_mtrr'
WARNING: arch/i386/kernel/built-in.o - Section mismatch: reference to 
.init.text: from .text between 'get_mtrr_state' (at offset 0xa770) and 
'generic_get_mtrr'

It was tracked down to a few functions missing __init tag.
Compile tested only.

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/cpu/mtrr/generic.c |2 +-
 arch/i386/kernel/cpu/mtrr/main.c|2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/i386/kernel/cpu/mtrr/generic.c 
b/arch/i386/kernel/cpu/mtrr/generic.c
index f6e4694..56f64e3 100644
--- a/arch/i386/kernel/cpu/mtrr/generic.c
+++ b/arch/i386/kernel/cpu/mtrr/generic.c
@@ -79,7 +79,7 @@ static void print_fixed(unsigned base, unsigned step, const 
mtrr_type*types)
 }
 
 /*  Grab all of the MTRR state for this CPU into *state  */
-void get_mtrr_state(void)
+void __init get_mtrr_state(void)
 {
unsigned int i;
struct mtrr_var_range *vrs;
diff --git a/arch/i386/kernel/cpu/mtrr/main.c b/arch/i386/kernel/cpu/mtrr/main.c
index 75dc6d5..c48b6fe 100644
--- a/arch/i386/kernel/cpu/mtrr/main.c
+++ b/arch/i386/kernel/cpu/mtrr/main.c
@@ -643,7 +643,7 @@ static struct sysdev_driver mtrr_sysdev_driver = {
  * initialized (i.e. before smp_init()).
  * 
  */
-__init void mtrr_bp_init(void)
+void __init mtrr_bp_init(void)
 {
init_ifs();
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86: PM_TRACE support

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=44bf4cea43816d43deab73c1c16361e86eaa
Commit: 44bf4cea43816d43deab73c1c16361e86eaa
Parent: 9ef231a436fddb34d806f599c97b479691b3c38b
Author: Nigel Cunningham [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:41 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:10 2007 -0700

x86: PM_TRACE support

Signed-off-by: Nigel Cunningham [EMAIL PROTECTED]
Cc: Randy Dunlap [EMAIL PROTECTED]
Cc: Rafael J. Wysocki [EMAIL PROTECTED]
Cc: Pavel Machek [EMAIL PROTECTED]
Acked-by: Linus Torvalds [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/kernel/vmlinux.lds.S  |7 +++
 drivers/base/power/trace.c|5 -
 include/asm-i386/resume-trace.h   |   13 +
 include/asm-x86_64/resume-trace.h |   13 +
 include/linux/resume-trace.h  |   19 +--
 kernel/power/Kconfig  |2 +-
 6 files changed, 43 insertions(+), 16 deletions(-)

diff --git a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86_64/kernel/vmlinux.lds.S
index c2d5a84..8778848 100644
--- a/arch/x86_64/kernel/vmlinux.lds.S
+++ b/arch/x86_64/kernel/vmlinux.lds.S
@@ -54,6 +54,13 @@ SECTIONS
 
   RODATA
 
+  . = ALIGN(4);
+  .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {
+   __tracedata_start = .;
+   *(.tracedata)
+   __tracedata_end = .;
+  }
+
   . = ALIGN(PAGE_SIZE);/* Align data segment to page size boundary */
/* Data */
   .data : AT(ADDR(.data) - LOAD_OFFSET) {
diff --git a/drivers/base/power/trace.c b/drivers/base/power/trace.c
index a9ab30f..2b0c601 100644
--- a/drivers/base/power/trace.c
+++ b/drivers/base/power/trace.c
@@ -142,6 +142,7 @@ void set_trace_device(struct device *dev)
 {
dev_hash_value = hash_string(DEVSEED, dev-bus_id, DEVHASH);
 }
+EXPORT_SYMBOL(set_trace_device);
 
 /*
  * We could just take the tracedata index into the .tracedata
@@ -162,6 +163,7 @@ void generate_resume_trace(void *tracedata, unsigned int 
user)
file_hash_value = hash_string(lineno, file, FILEHASH);
set_magic_time(user_hash_value, file_hash_value, dev_hash_value);
 }
+EXPORT_SYMBOL(generate_resume_trace);
 
 extern char __tracedata_start, __tracedata_end;
 static int show_file_hash(unsigned int value)
@@ -170,7 +172,8 @@ static int show_file_hash(unsigned int value)
char *tracedata;
 
match = 0;
-   for (tracedata = __tracedata_start ; tracedata  __tracedata_end ; 
tracedata += 6) {
+   for (tracedata = __tracedata_start ; tracedata  __tracedata_end ;
+   tracedata += 2 + sizeof(unsigned long)) {
unsigned short lineno = *(unsigned short *)tracedata;
const char *file = *(const char **)(tracedata + 2);
unsigned int hash = hash_string(lineno, file, FILEHASH);
diff --git a/include/asm-i386/resume-trace.h b/include/asm-i386/resume-trace.h
new file mode 100644
index 000..ec9cfd6
--- /dev/null
+++ b/include/asm-i386/resume-trace.h
@@ -0,0 +1,13 @@
+#define TRACE_RESUME(user) do {\
+   if (pm_trace_enabled) { \
+   void *tracedata;\
+   asm volatile(movl $1f,%0\n\
+   .section .tracedata,\a\\n   \
+   1:\t.word %c1\n   \
+   \t.long %c2\n \
+   .previous \
+   :=r (tracedata)   \
+   : i (__LINE__), i (__FILE__));  \
+   generate_resume_trace(tracedata, user); \
+   }   \
+} while (0)
diff --git a/include/asm-x86_64/resume-trace.h 
b/include/asm-x86_64/resume-trace.h
new file mode 100644
index 000..34bf998
--- /dev/null
+++ b/include/asm-x86_64/resume-trace.h
@@ -0,0 +1,13 @@
+#define TRACE_RESUME(user) do {\
+   if (pm_trace_enabled) { \
+   void *tracedata;\
+   asm volatile(movq $1f,%0\n\
+   .section .tracedata,\a\\n   \
+   1:\t.word %c1\n   \
+   \t.quad %c2\n \
+   .previous \
+   :=r (tracedata)   \
+   : i (__LINE__), i (__FILE__));  \
+   generate_resume_trace(tracedata, user); \
+   }  

x86: Make Alt-SysRq-p display the debug register contents

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bb1995d52b05f7e671914454d0ae57bd4170ef47
Commit: bb1995d52b05f7e671914454d0ae57bd4170ef47
Parent: 44bf4cea43816d43deab73c1c16361e86eaa
Author: Alan Stern [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:42 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:10 2007 -0700

x86: Make Alt-SysRq-p display the debug register contents

This patch (as921) adds code to the show_regs() routine in i386 and x86_64
to print the contents of the debug registers along with all the others.

Signed-off-by: Alan Stern [EMAIL PROTECTED]
Signed-off-by: Roland McGrath [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/process.c   |   12 
 arch/x86_64/kernel/process.c |   10 ++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index 6c49acb..8466471 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -300,6 +300,7 @@ early_param(idle, idle_setup);
 void show_regs(struct pt_regs * regs)
 {
unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L;
+   unsigned long d0, d1, d2, d3, d6, d7;
 
printk(\n);
printk(Pid: %d, comm: %20s\n, current-pid, current-comm);
@@ -324,6 +325,17 @@ void show_regs(struct pt_regs * regs)
cr3 = read_cr3();
cr4 = read_cr4_safe();
printk(CR0: %08lx CR2: %08lx CR3: %08lx CR4: %08lx\n, cr0, cr2, cr3, 
cr4);
+
+   get_debugreg(d0, 0);
+   get_debugreg(d1, 1);
+   get_debugreg(d2, 2);
+   get_debugreg(d3, 3);
+   printk(DR0: %08lx DR1: %08lx DR2: %08lx DR3: %08lx\n,
+   d0, d1, d2, d3);
+   get_debugreg(d6, 6);
+   get_debugreg(d7, 7);
+   printk(DR6: %08lx DR7: %08lx\n, d6, d7);
+
show_trace(NULL, regs, regs-esp);
 }
 
diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c
index 180f4c0..bbfc957 100644
--- a/arch/x86_64/kernel/process.c
+++ b/arch/x86_64/kernel/process.c
@@ -306,6 +306,7 @@ early_param(idle, idle_setup);
 void __show_regs(struct pt_regs * regs)
 {
unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L, fs, gs, shadowgs;
+   unsigned long d0, d1, d2, d3, d6, d7;
unsigned int fsindex,gsindex;
unsigned int ds,cs,es; 
 
@@ -350,6 +351,15 @@ void __show_regs(struct pt_regs * regs)
   fs,fsindex,gs,gsindex,shadowgs); 
printk(CS:  %04x DS: %04x ES: %04x CR0: %016lx\n, cs, ds, es, cr0); 
printk(CR2: %016lx CR3: %016lx CR4: %016lx\n, cr2, cr3, cr4);
+
+   get_debugreg(d0, 0);
+   get_debugreg(d1, 1);
+   get_debugreg(d2, 2);
+   printk(DR0: %016lx DR1: %016lx DR2: %016lx\n, d0, d1, d2);
+   get_debugreg(d3, 3);
+   get_debugreg(d6, 6);
+   get_debugreg(d7, 7);
+   printk(DR3: %016lx DR6: %016lx DR7: %016lx\n, d3, d6, d7);
 }
 
 void show_regs(struct pt_regs *regs)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i386: add reference to the arguments

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=459029541d857258dfa9ad29e443d287a74c36fe
Commit: 459029541d857258dfa9ad29e443d287a74c36fe
Parent: bb1995d52b05f7e671914454d0ae57bd4170ef47
Author: Andrew Morton [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:43 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:10 2007 -0700

i386: add reference to the arguments

Prevent stuff like this:

mm/vmalloc.c: In function 'unmap_kernel_range':
mm/vmalloc.c:75: warning: unused variable 'start'

Cc: Benjamin Herrenschmidt [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/asm-i386/tlbflush.h |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/include/asm-i386/tlbflush.h b/include/asm-i386/tlbflush.h
index fc525c5..a50fa67 100644
--- a/include/asm-i386/tlbflush.h
+++ b/include/asm-i386/tlbflush.h
@@ -160,7 +160,11 @@ DECLARE_PER_CPU(struct tlb_state, cpu_tlbstate);
native_flush_tlb_others(mask, mm, va)
 #endif
 
-#define flush_tlb_kernel_range(start, end) flush_tlb_all()
+static inline void flush_tlb_kernel_range(unsigned long start,
+   unsigned long end)
+{
+   flush_tlb_all();
+}
 
 static inline void flush_tlb_pgtables(struct mm_struct *mm,
  unsigned long start, unsigned long end)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86: round_jiffies() for i386 and x86-64 non-critical/corrected MCE polling

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=22293e5806f58a9682267139678a5cc117fd3dcf
Commit: 22293e5806f58a9682267139678a5cc117fd3dcf
Parent: 459029541d857258dfa9ad29e443d287a74c36fe
Author: Venki Pallipadi [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:44 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:10 2007 -0700

x86: round_jiffies() for i386 and x86-64 non-critical/corrected MCE polling

This helps to reduce the frequency at which the CPU must be taken out of a
lower-power state.

Signed-off-by: Venkatesh Pallipadi [EMAIL PROTECTED]
Acked-by: Tim Hockin [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/cpu/mcheck/non-fatal.c |4 ++--
 arch/x86_64/kernel/mce.c|9 ++---
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/arch/i386/kernel/cpu/mcheck/non-fatal.c 
b/arch/i386/kernel/cpu/mcheck/non-fatal.c
index 6b5d351..bf39409 100644
--- a/arch/i386/kernel/cpu/mcheck/non-fatal.c
+++ b/arch/i386/kernel/cpu/mcheck/non-fatal.c
@@ -57,7 +57,7 @@ static DECLARE_DELAYED_WORK(mce_work, mce_work_fn);
 static void mce_work_fn(struct work_struct *work)
 { 
on_each_cpu(mce_checkregs, NULL, 1, 1);
-   schedule_delayed_work(mce_work, MCE_RATE);
+   schedule_delayed_work(mce_work, round_jiffies_relative(MCE_RATE));
 } 
 
 static int __init init_nonfatal_mce_checker(void)
@@ -82,7 +82,7 @@ static int __init init_nonfatal_mce_checker(void)
/*
 * Check for non-fatal errors every MCE_RATE s
 */
-   schedule_delayed_work(mce_work, MCE_RATE);
+   schedule_delayed_work(mce_work, round_jiffies_relative(MCE_RATE));
printk(KERN_INFO Machine check exception polling timer started.\n);
return 0;
 }
diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c
index 7c8ab42..4d8450e 100644
--- a/arch/x86_64/kernel/mce.c
+++ b/arch/x86_64/kernel/mce.c
@@ -375,7 +375,8 @@ static void mcheck_timer(struct work_struct *work)
if (mce_notify_user()) {
next_interval = max(next_interval/2, HZ/100);
} else {
-   next_interval = min(next_interval*2, check_interval*HZ);
+   next_interval = min(next_interval*2,
+   (int)round_jiffies_relative(check_interval*HZ));
}
 
schedule_delayed_work(mcheck_work, next_interval);
@@ -428,7 +429,8 @@ static __init int periodic_mcheck_init(void)
 { 
next_interval = check_interval * HZ;
if (next_interval)
-   schedule_delayed_work(mcheck_work, next_interval);
+   schedule_delayed_work(mcheck_work,
+ round_jiffies_relative(next_interval));
idle_notifier_register(mce_idle_notifier);
return 0;
 } 
@@ -720,7 +722,8 @@ static void mce_restart(void)
on_each_cpu(mce_init, NULL, 1, 1);   
next_interval = check_interval * HZ;
if (next_interval)
-   schedule_delayed_work(mcheck_work, next_interval);
+   schedule_delayed_work(mcheck_work,
+ round_jiffies_relative(next_interval));
 }
 
 static struct sysdev_class mce_sysclass = {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86_64: check remote IRR bit before migrating level triggered irq

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ef3e28c5b956cbb3b17531c85b698a27e83d5cf2
Commit: ef3e28c5b956cbb3b17531c85b698a27e83d5cf2
Parent: 22293e5806f58a9682267139678a5cc117fd3dcf
Author: Eric W. Biederman [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:45 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:10 2007 -0700

x86_64: check remote IRR bit before migrating level triggered irq

On x86_64 kernel, level triggered irq migration gets initiated in the
context of that interrupt(after executing the irq handler) and following
steps are followed to do the irq migration.

1. mask IOAPIC RTE entry; // write to IOAPIC RTE
2. EOI;   // processor EOI write
3. reprogram IOAPIC RTE entry // write to IOAPIC RTE with new destination 
and
  // and interrupt vector due to per cpu vector
  // allocation.
4. unmask IOAPIC RTE entry;   // write to IOAPIC RTE

Because of the per cpu vector allocation in x86_64 kernels, when the irq
migrates to a different cpu, new vector(corresponding to the new cpu) will
get allocated.

An EOI write to local APIC has a side effect of generating an EOI write for
level trigger interrupts (normally this is a broadcast to all IOAPICs).
The EOI broadcast generated as a side effect of EOI write to processor may
be delayed while the other IOAPIC writes (step 3 and 4) can go through.

Normally, the EOI generated by local APIC for level trigger interrupt
contains vector number.  The IOAPIC will take this vector number and search
the IOAPIC RTE entries for an entry with matching vector number and clear
the remote IRR bit (indicate EOI).  However, if the vector number is
changed (as in step 3) the IOAPIC will not find the RTE entry when the EOI
is received later.  This will cause the remote IRR to get stuck causing the
interrupt hang (no more interrupt from this RTE).

Current x86_64 kernel assumes that remote IRR bit is cleared by the time
IOAPIC RTE is reprogrammed.  Fix this assumption by checking for remote IRR
bit and if it still set, delay the irq migration to the next interrupt
arrival event(hopefully, next time remote IRR bit will get cleared before
the IOAPIC RTE is reprogrammed).

Initial analysis and patch from Nanhai.

Clean up patch from Suresh.

Rewritten to be less intrusive, and to contain a big fat comment by Eric.

[EMAIL PROTECTED]: fix comments]
Acked-by: Ingo Molnar [EMAIL PROTECTED]
Cc: Nanhai Zou [EMAIL PROTECTED]
Acked-by: Suresh Siddha [EMAIL PROTECTED]
Cc: Asit Mallick [EMAIL PROTECTED]
Cc: Keith Packard [EMAIL PROTECTED]
Signed-off-by: Eric W. Biederman [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/kernel/io_apic.c |   58 -
 1 files changed, 56 insertions(+), 2 deletions(-)

diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index 1c6c6f7..050141c 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -152,6 +152,32 @@ static inline void io_apic_modify(unsigned int apic, 
unsigned int value)
writel(value, io_apic-data);
 }
 
+static int io_apic_level_ack_pending(unsigned int irq)
+{
+   struct irq_pin_list *entry;
+   unsigned long flags;
+   int pending = 0;
+
+   spin_lock_irqsave(ioapic_lock, flags);
+   entry = irq_2_pin + irq;
+   for (;;) {
+   unsigned int reg;
+   int pin;
+
+   pin = entry-pin;
+   if (pin == -1)
+   break;
+   reg = io_apic_read(entry-apic, 0x10 + pin*2);
+   /* Is the remote IRR bit set? */
+   pending |= (reg  14)  1;
+   if (!entry-next)
+   break;
+   entry = irq_2_pin + entry-next;
+   }
+   spin_unlock_irqrestore(ioapic_lock, flags);
+   return pending;
+}
+
 /*
  * Synchronize the IO-APIC and the CPU by doing
  * a dummy read from the IO-APIC
@@ -1418,9 +1444,37 @@ static void ack_apic_level(unsigned int irq)
ack_APIC_irq();
 
/* Now we can move and renable the irq */
-   move_masked_irq(irq);
-   if (unlikely(do_unmask_irq))
+   if (unlikely(do_unmask_irq)) {
+   /* Only migrate the irq if the ack has been received.
+*
+* On rare occasions the broadcast level triggered ack gets
+* delayed going to ioapics, and if we reprogram the
+* vector while Remote IRR is still set the irq will never
+* fire again.
+*
+* 

x86: remove support for the Rise CPU

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9596017e79cddb4f4fd4b896425a30f86946ce85
Commit: 9596017e79cddb4f4fd4b896425a30f86946ce85
Parent: ef3e28c5b956cbb3b17531c85b698a27e83d5cf2
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:46 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:10 2007 -0700

x86: remove support for the Rise CPU

The Rise CPUs were only very short-lived, and there are no reports of
anyone both owning one and running Linux on it.

Googling for the printk string CPU: Rise iDragon didn't find any dmesg
available online.

If it turns out that against all expectations there are actually users
reverting this patch would be easy.

This patch will make the kernel images smaller by a few bytes for all
i386 users.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Acked-by: Dave Jones [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/cpu/Makefile  |1 -
 arch/i386/kernel/cpu/common.c  |2 -
 arch/i386/kernel/cpu/rise.c|   52 
 include/asm-i386/processor.h   |1 -
 include/asm-x86_64/processor.h |1 -
 5 files changed, 0 insertions(+), 57 deletions(-)

diff --git a/arch/i386/kernel/cpu/Makefile b/arch/i386/kernel/cpu/Makefile
index 0b6a855..778396c 100644
--- a/arch/i386/kernel/cpu/Makefile
+++ b/arch/i386/kernel/cpu/Makefile
@@ -9,7 +9,6 @@ obj-y   +=  cyrix.o
 obj-y  +=  centaur.o
 obj-y  +=  transmeta.o
 obj-y  +=  intel.o intel_cacheinfo.o addon_cpuid_features.o
-obj-y  +=  rise.o
 obj-y  +=  nexgen.o
 obj-y  +=  umc.o
 
diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c
index e5419a9..d506201 100644
--- a/arch/i386/kernel/cpu/common.c
+++ b/arch/i386/kernel/cpu/common.c
@@ -606,7 +606,6 @@ extern int nsc_init_cpu(void);
 extern int amd_init_cpu(void);
 extern int centaur_init_cpu(void);
 extern int transmeta_init_cpu(void);
-extern int rise_init_cpu(void);
 extern int nexgen_init_cpu(void);
 extern int umc_init_cpu(void);
 
@@ -618,7 +617,6 @@ void __init early_cpu_init(void)
amd_init_cpu();
centaur_init_cpu();
transmeta_init_cpu();
-   rise_init_cpu();
nexgen_init_cpu();
umc_init_cpu();
early_cpu_detect();
diff --git a/arch/i386/kernel/cpu/rise.c b/arch/i386/kernel/cpu/rise.c
deleted file mode 100644
index 50076f2..000
--- a/arch/i386/kernel/cpu/rise.c
+++ /dev/null
@@ -1,52 +0,0 @@
-#include linux/kernel.h
-#include linux/init.h
-#include linux/bitops.h
-#include asm/processor.h
-
-#include cpu.h
-
-static void __cpuinit init_rise(struct cpuinfo_x86 *c)
-{
-   printk(CPU: Rise iDragon);
-   if (c-x86_model  2)
-   printk( II);
-   printk(\n);
-
-   /* Unhide possibly hidden capability flags
-  The mp6 iDragon family don't have MSRs.
-  We switch on extra features with this cpuid weirdness: */
-   __asm__ (
-   movl $0x6363452a, %%eax\n\t
-   movl $0x3231206c, %%ecx\n\t
-   movl $0x2a32313a, %%edx\n\t
-   cpuid\n\t
-   movl $0x63634523, %%eax\n\t
-   movl $0x32315f6c, %%ecx\n\t
-   movl $0x213a, %%edx\n\t
-   cpuid\n\t : : : eax, ebx, ecx, edx
-   );
-   set_bit(X86_FEATURE_CX8, c-x86_capability);
-}
-
-static struct cpu_dev rise_cpu_dev __cpuinitdata = {
-   .c_vendor   = Rise,
-   .c_ident= { RiseRiseRise },
-   .c_models = {
-   { .vendor = X86_VENDOR_RISE, .family = 5, .model_names = 
- { 
- [0] = iDragon, 
- [2] = iDragon, 
- [8] = iDragon II, 
- [9] = iDragon II
- }
-   },
-   },
-   .c_init = init_rise,
-};
-
-int __init rise_init_cpu(void)
-{
-   cpu_devs[X86_VENDOR_RISE] = rise_cpu_dev;
-   return 0;
-}
-
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h
index 422cffe..48a7f69 100644
--- a/include/asm-i386/processor.h
+++ b/include/asm-i386/processor.h
@@ -88,7 +88,6 @@ struct cpuinfo_x86 {
 #define X86_VENDOR_UMC 3
 #define X86_VENDOR_NEXGEN 4
 #define X86_VENDOR_CENTAUR 5
-#define X86_VENDOR_RISE 6
 #define X86_VENDOR_TRANSMETA 7
 #define X86_VENDOR_NSC 8
 #define X86_VENDOR_NUM 9
diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h
index efc87a5..a1645bb 100644
--- a/include/asm-x86_64/processor.h
+++ b/include/asm-x86_64/processor.h
@@ -83,7 +83,6 @@ struct cpuinfo_x86 {
 #define X86_VENDOR_UMC 3
 #define X86_VENDOR_NEXGEN 4
 #define X86_VENDOR_CENTAUR 5
-#define X86_VENDOR_RISE 6
 #define X86_VENDOR_TRANSMETA 

x86_64: generalize calgary_increase_split_completion_timeout

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a2b663f6728ab71f0e45db41333fb0aaf5e59072
Commit: a2b663f6728ab71f0e45db41333fb0aaf5e59072
Parent: 9596017e79cddb4f4fd4b896425a30f86946ce85
Author: Muli Ben-Yehuda [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:47 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:11 2007 -0700

x86_64: generalize calgary_increase_split_completion_timeout

... will be used by CalIOC2 later

Signed-off-by: Muli Ben-Yehuda [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/kernel/pci-calgary.c |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/x86_64/kernel/pci-calgary.c b/arch/x86_64/kernel/pci-calgary.c
index 5bd20b5..4b0c3ad 100644
--- a/arch/x86_64/kernel/pci-calgary.c
+++ b/arch/x86_64/kernel/pci-calgary.c
@@ -775,8 +775,8 @@ static void calgary_watchdog(unsigned long data)
}
 }
 
-static void __init calgary_increase_split_completion_timeout(void __iomem 
*bbar,
-   unsigned char busnum)
+static void __init calgary_set_split_completion_timeout(void __iomem *bbar,
+   unsigned char busnum, unsigned long timeout)
 {
u64 val64;
void __iomem *target;
@@ -802,7 +802,7 @@ static void __init 
calgary_increase_split_completion_timeout(void __iomem *bbar,
/* zero out this PHB's timer bits */
mask = ~(0xFUL  phb_shift);
val64 = mask;
-   val64 |= (CCR_2SEC_TIMEOUT  phb_shift);
+   val64 |= (timeout  phb_shift);
writeq(cpu_to_be64(val64), target);
readq(target); /* flush */
 }
@@ -836,7 +836,8 @@ static void __init calgary_enable_translation(struct 
pci_dev *dev)
 * http://bugzilla.kernel.org/show_bug.cgi?id=7180
 */
if (busnum == 1)
-   calgary_increase_split_completion_timeout(bbar, busnum);
+   calgary_set_split_completion_timeout(bbar, busnum,
+CCR_2SEC_TIMEOUT);
 
init_timer(tbl-watchdog_timer);
tbl-watchdog_timer.function = calgary_watchdog;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86_64: update copyright notice

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9882234bf2e54ebf4866245d46e2c704a1214ad9
Commit: 9882234bf2e54ebf4866245d46e2c704a1214ad9
Parent: a2b663f6728ab71f0e45db41333fb0aaf5e59072
Author: Muli Ben-Yehuda [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:48 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:11 2007 -0700

x86_64: update copyright notice

Signed-off-by: Muli Ben-Yehuda [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/kernel/pci-calgary.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86_64/kernel/pci-calgary.c b/arch/x86_64/kernel/pci-calgary.c
index 4b0c3ad..b1ab0d5 100644
--- a/arch/x86_64/kernel/pci-calgary.c
+++ b/arch/x86_64/kernel/pci-calgary.c
@@ -1,7 +1,7 @@
 /*
  * Derived from arch/powerpc/kernel/iommu.c
  *
- * Copyright (C) IBM Corporation, 2006
+ * Copyright IBM Corporation, 2006-2007
  * Copyright (C) 2006  Jon Mason [EMAIL PROTECTED]
  *
  * Author: Jon Mason [EMAIL PROTECTED]
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86_64: introduce handle_quirks() for various chipset quirks

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b8d2ea1b87b02fc94ffcab58b29c83fbbb6a1e4e
Commit: b8d2ea1b87b02fc94ffcab58b29c83fbbb6a1e4e
Parent: 9882234bf2e54ebf4866245d46e2c704a1214ad9
Author: Muli Ben-Yehuda [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:49 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:11 2007 -0700

x86_64: introduce handle_quirks() for various chipset quirks

Move the aic94xx split completion timeout handling there.

Signed-off-by: Muli Ben-Yehuda [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/kernel/pci-calgary.c |   25 +
 1 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/arch/x86_64/kernel/pci-calgary.c b/arch/x86_64/kernel/pci-calgary.c
index b1ab0d5..9f6dd44 100644
--- a/arch/x86_64/kernel/pci-calgary.c
+++ b/arch/x86_64/kernel/pci-calgary.c
@@ -807,6 +807,20 @@ static void __init 
calgary_set_split_completion_timeout(void __iomem *bbar,
readq(target); /* flush */
 }
 
+static void __init calgary_handle_quirks(struct pci_dev* dev)
+{
+   unsigned char busnum = dev-bus-number;
+   struct iommu_table *tbl = dev-sysdata;
+
+   /*
+* Give split completion a longer timeout on bus 1 for aic94xx
+* http://bugzilla.kernel.org/show_bug.cgi?id=7180
+*/
+   if (busnum == 1)
+   calgary_set_split_completion_timeout(tbl-bbar, busnum,
+CCR_2SEC_TIMEOUT);
+}
+
 static void __init calgary_enable_translation(struct pci_dev *dev)
 {
u32 val32;
@@ -831,14 +845,6 @@ static void __init calgary_enable_translation(struct 
pci_dev *dev)
writel(cpu_to_be32(val32), target);
readl(target); /* flush */
 
-   /*
-* Give split completion a longer timeout on bus 1 for aic94xx
-* http://bugzilla.kernel.org/show_bug.cgi?id=7180
-*/
-   if (busnum == 1)
-   calgary_set_split_completion_timeout(bbar, busnum,
-CCR_2SEC_TIMEOUT);
-
init_timer(tbl-watchdog_timer);
tbl-watchdog_timer.function = calgary_watchdog;
tbl-watchdog_timer.data = (unsigned long)dev;
@@ -890,6 +896,9 @@ static int __init calgary_init_one(struct pci_dev *dev)
 
pci_dev_get(dev);
dev-bus-self = dev;
+
+   calgary_handle_quirks(dev);
+
calgary_enable_translation(dev);
 
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


  1   2   >