linux-2.6
14 years agointel-iommu: Introduce first_pte_in_page() to simplify PTE-setting loops
David Woodhouse [Thu, 2 Jul 2009 10:21:16 +0000 (11:21 +0100)] 
intel-iommu: Introduce first_pte_in_page() to simplify PTE-setting loops

On Wed, 2009-07-01 at 16:59 -0700, Linus Torvalds wrote:
> I also _really_ hate how you do
>
>         (unsigned long)pte >> VTD_PAGE_SHIFT ==
>         (unsigned long)first_pte >> VTD_PAGE_SHIFT

Kill this, in favour of just looking to see if the incremented pte
pointer has 'wrapped' onto the next page. Which means we have to check
it _after_ incrementing it, not before.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Use cmpxchg64_local() for setting PTEs
David Woodhouse [Wed, 1 Jul 2009 19:27:03 +0000 (20:27 +0100)] 
intel-iommu: Use cmpxchg64_local() for setting PTEs

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Warn about unmatched unmap requests
David Woodhouse [Wed, 1 Jul 2009 18:27:53 +0000 (19:27 +0100)] 
intel-iommu: Warn about unmatched unmap requests

This would have found the bug in i386 pci_unmap_addr() a long time ago.
We shouldn't just silently return without doing anything.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Kill superfluous mapping_lock
David Woodhouse [Wed, 1 Jul 2009 18:30:28 +0000 (19:30 +0100)] 
intel-iommu: Kill superfluous mapping_lock

Since we're using cmpxchg64() anyway (because that's the only way to do
an atomic 64-bit store on i386), we might as well ditch the extra
locking and just use cmpxchg64() to ensure that we don't add the page
twice.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Ensure that PTE writes are 64-bit atomic, even on i386
David Woodhouse [Wed, 1 Jul 2009 18:21:24 +0000 (19:21 +0100)] 
intel-iommu: Ensure that PTE writes are 64-bit atomic, even on i386

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Make iommu=pt work on i386 too
David Woodhouse [Wed, 1 Jul 2009 17:56:16 +0000 (18:56 +0100)] 
intel-iommu: Make iommu=pt work on i386 too

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Performance improvement for dma_pte_free_pagetable()
David Woodhouse [Tue, 30 Jun 2009 02:40:07 +0000 (03:40 +0100)] 
intel-iommu: Performance improvement for dma_pte_free_pagetable()

As with other functions, batch the CPU data cache flushes and don't keep
recalculating PTE addresses.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Don't free too much in dma_pte_free_pagetable()
David Woodhouse [Tue, 30 Jun 2009 02:38:09 +0000 (03:38 +0100)] 
intel-iommu: Don't free too much in dma_pte_free_pagetable()

The loop condition was wrong -- we should free a PMD only if its
_entire_ range is within the range we're intending to clear. The
early-termination condition was right, but not the loop.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: dump mappings but don't die on pte already set
David Woodhouse [Mon, 29 Jun 2009 21:06:43 +0000 (22:06 +0100)] 
intel-iommu: dump mappings but don't die on pte already set

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Combine domain_pfn_mapping() and domain_sg_mapping()
David Woodhouse [Mon, 29 Jun 2009 11:30:54 +0000 (12:30 +0100)] 
intel-iommu: Combine domain_pfn_mapping() and domain_sg_mapping()

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Introduce domain_sg_mapping() to speed up intel_map_sg()
David Woodhouse [Mon, 29 Jun 2009 10:17:38 +0000 (11:17 +0100)] 
intel-iommu: Introduce domain_sg_mapping() to speed up intel_map_sg()

Instead of calling domain_pfn_mapping() repeatedly with single or
small numbers of pages, just pass the sglist in. It can optimise the
number of cache flushes like domain_pfn_mapping() does, and gives a huge
speedup for large scatterlists.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Simplify __intel_alloc_iova()
David Woodhouse [Sun, 28 Jun 2009 20:20:51 +0000 (21:20 +0100)] 
intel-iommu: Simplify __intel_alloc_iova()

There's no need for the separate iommu_alloc_iova() function, and
certainly not for it to be global. Remove the underscores while we're at
it.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Performance improvement for domain_pfn_mapping()
David Woodhouse [Sun, 28 Jun 2009 19:38:49 +0000 (20:38 +0100)] 
intel-iommu: Performance improvement for domain_pfn_mapping()

As with dma_pte_clear_range(), don't keep flushing a single PTE at a
time. And also micro-optimise the setting of PTE values rather than
using the helper functions to do all the masking.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Performance improvement for dma_pte_clear_range()
David Woodhouse [Sun, 28 Jun 2009 17:52:20 +0000 (18:52 +0100)] 
intel-iommu: Performance improvement for dma_pte_clear_range()

It's a bit silly to repeatedly call domain_flush_cache() for each PTE
individually, as we clear it. Instead, batch them up and flush a whole
range at a time. We might as well refrain from recalculating the PTE
address from scratch each time round the loop too.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Clean up iommu_domain_identity_map()
David Woodhouse [Sun, 28 Jun 2009 15:35:56 +0000 (16:35 +0100)] 
intel-iommu: Clean up iommu_domain_identity_map()

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Remove last use of PHYSICAL_PAGE_MASK, for reserving PCI BARs
David Woodhouse [Sun, 28 Jun 2009 15:00:42 +0000 (16:00 +0100)] 
intel-iommu: Remove last use of PHYSICAL_PAGE_MASK, for reserving PCI BARs

This is fairly broken anyway -- it doesn't take hotplug into account.
We should probably be checking page_is_ram() instead.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Make iommu_flush_iotlb_psi() take pfn as argument
David Woodhouse [Sun, 28 Jun 2009 14:33:46 +0000 (15:33 +0100)] 
intel-iommu: Make iommu_flush_iotlb_psi() take pfn as argument

Most of its callers are having to shift for themselves anyway, so we might
as well do it in iommu_flush_iotlb_psi().

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Change aligned_size() to aligned_nrpages()
David Woodhouse [Sun, 28 Jun 2009 14:03:06 +0000 (15:03 +0100)] 
intel-iommu: Change aligned_size() to aligned_nrpages()

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Clean up intel_map_sg(), remove domain_page_mapping()
David Woodhouse [Sun, 28 Jun 2009 13:49:31 +0000 (14:49 +0100)] 
intel-iommu: Clean up intel_map_sg(), remove domain_page_mapping()

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Use domain_pfn_mapping() in intel_iommu_map_range()
David Woodhouse [Sun, 28 Jun 2009 13:22:28 +0000 (14:22 +0100)] 
intel-iommu: Use domain_pfn_mapping() in intel_iommu_map_range()

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Use domain_pfn_mapping() in __intel_map_single()
David Woodhouse [Sun, 28 Jun 2009 13:01:43 +0000 (14:01 +0100)] 
intel-iommu: Use domain_pfn_mapping() in __intel_map_single()

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Introduce domain_pfn_mapping()
David Woodhouse [Sun, 28 Jun 2009 10:55:58 +0000 (11:55 +0100)] 
intel-iommu: Introduce domain_pfn_mapping()

... and use it in the trivial cases; the other callers want individual
(and bisectable) attention, since I screwed them up the first time...

Make the BUG_ON() happen on too-large virtual address rather than
physical address, too. That's the one we care about.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Clean up address handling in domain_page_mapping()
David Woodhouse [Sun, 28 Jun 2009 09:53:37 +0000 (10:53 +0100)] 
intel-iommu: Clean up address handling in domain_page_mapping()

No more masking and alignment; just use pfns.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Change addr_to_dma_pte() to pfn_to_dma_pte()
David Woodhouse [Sun, 28 Jun 2009 09:37:25 +0000 (10:37 +0100)] 
intel-iommu: Change addr_to_dma_pte() to pfn_to_dma_pte()

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Clean up intel_iommu_unmap_range()
David Woodhouse [Sat, 27 Jun 2009 23:51:17 +0000 (00:51 +0100)] 
intel-iommu: Clean up intel_iommu_unmap_range()

Use unaligned address for domain->max_addr. That algorithm isn't ideal
anyway -- we should probably just look at the last iova in the tree.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Make dma_pte_free_pagetable() take pfns as argument
David Woodhouse [Sat, 27 Jun 2009 23:27:49 +0000 (00:27 +0100)] 
intel-iommu: Make dma_pte_free_pagetable() take pfns as argument

With some cleanup of intel_unmap_page(), intel_unmap_sg() and
vm_domain_exit() to no longer play with 64-bit addresses.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Make dma_pte_free_pagetable() use pfns
David Woodhouse [Sat, 27 Jun 2009 21:41:00 +0000 (22:41 +0100)] 
intel-iommu: Make dma_pte_free_pagetable() use pfns

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Make dma_pte_clear_range() take pfns as argument
David Woodhouse [Sat, 27 Jun 2009 21:09:11 +0000 (22:09 +0100)] 
intel-iommu: Make dma_pte_clear_range() take pfns as argument

Noting that this is now an _inclusive_ range.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Make dma_pte_clear_range() use pfns
David Woodhouse [Sat, 27 Jun 2009 18:15:01 +0000 (19:15 +0100)] 
intel-iommu: Make dma_pte_clear_range() use pfns

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Don't just mask out too-big physical addresses; BUG() instead
David Woodhouse [Sat, 27 Jun 2009 18:00:32 +0000 (19:00 +0100)] 
intel-iommu: Don't just mask out too-big physical addresses; BUG() instead

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Make dma_pte_clear_one() take pfn not address
David Woodhouse [Sat, 27 Jun 2009 16:44:39 +0000 (17:44 +0100)] 
intel-iommu: Make dma_pte_clear_one() take pfn not address

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Change dma_addr_level_pte() to dma_pfn_level_pte()
David Woodhouse [Sat, 27 Jun 2009 16:14:59 +0000 (17:14 +0100)] 
intel-iommu: Change dma_addr_level_pte() to dma_pfn_level_pte()

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Change address_level_offset() to pfn_level_offset()
David Woodhouse [Sat, 27 Jun 2009 15:40:08 +0000 (16:40 +0100)] 
intel-iommu: Change address_level_offset() to pfn_level_offset()

We're shifting the inputs for now, but that'll change...

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Change dma_set_pte_addr() to dma_set_pte_pfn()
David Woodhouse [Sat, 27 Jun 2009 15:21:20 +0000 (16:21 +0100)] 
intel-iommu: Change dma_set_pte_addr() to dma_set_pte_pfn()

Add some helpers for converting between VT-d and normal system pfns,
since system pages can be larger than VT-d pages.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Clean up identity mapping code, remove CONFIG_DMAR_GFX_WA
David Woodhouse [Fri, 26 Jun 2009 18:10:36 +0000 (19:10 +0100)] 
intel-iommu: Clean up identity mapping code, remove CONFIG_DMAR_GFX_WA

There's no need for the GFX workaround now we have 'iommu=pt' for the
cases where people really care about performance. There's no need to
have a special case for just one type of device.

This also speeds up the iommu=pt path and reduces memory usage by
setting up the si_domain _once_ and then using it for all devices,
rather than giving each device its own private page tables.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Create new iommu_domain_identity_map() function
David Woodhouse [Fri, 26 Jun 2009 17:50:28 +0000 (18:50 +0100)] 
intel-iommu: Create new iommu_domain_identity_map() function

We'll want to do this to a _domain_ (the si_domain) rather than a PCI device.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Only avoid flushing device IOTLB for domain ID 0 in caching mode
Yu Zhao [Mon, 29 Jun 2009 03:31:45 +0000 (11:31 +0800)] 
intel-iommu: Only avoid flushing device IOTLB for domain ID 0 in caching mode

In caching mode, domain ID 0 is reserved for non-present to present
mapping flush. Device IOTLB doesn't need to be flushed in this case.

Previously we were avoiding the flush for domain zero, even if the IOMMU
wasn't in caching mode and domain zero wasn't special.

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agoMerge git://git.infradead.org/iommu-2.6
Linus Torvalds [Sun, 28 Jun 2009 18:06:11 +0000 (11:06 -0700)] 
Merge git://git.infradead.org/iommu-2.6

* git://git.infradead.org/iommu-2.6:
  intel-iommu: fix Identity Mapping to be arch independent

14 years agoMerge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 28 Jun 2009 18:05:28 +0000 (11:05 -0700)] 
Merge branch 'x86-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86, delay: tsc based udelay should have rdtsc_barrier
  x86, setup: correct include file in <asm/boot.h>
  x86, setup: Fix typo "CONFIG_x86_64" in <asm/boot.h>
  x86, mce: percpu mcheck_timer should be pinned
  x86: Add sysctl to allow panic on IOCK NMI error
  x86: Fix uv bau sending buffer initialization
  x86, mce: Fix mce resume on 32bit
  x86: Move init_gbpages() to setup_arch()
  x86: ensure percpu lpage doesn't consume too much vmalloc space
  x86: implement percpu_alloc kernel parameter
  x86: fix pageattr handling for lpage percpu allocator and re-enable it
  x86: reorganize cpa_process_alias()
  x86: prepare setup_pcpu_lpage() for pageattr fix
  x86: rename remap percpu first chunk allocator to lpage
  x86: fix duplicate free in setup_pcpu_remap() failure path
  percpu: fix too lazy vunmap cache flushing
  x86: Set cpu_llc_id on AMD CPUs

14 years agoMerge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 28 Jun 2009 18:05:16 +0000 (11:05 -0700)] 
Merge branch 'timers-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  timer stats: Optimize by adding quick check to avoid function calls
  timers: Fix timer_migration interface which accepts any number as input

14 years agoMerge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 28 Jun 2009 18:05:04 +0000 (11:05 -0700)] 
Merge branch 'tracing-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  ftrace: Fix the output of profile
  ring-buffer: Make it generally available
  ftrace: Remove duplicate newline
  tracing: Fix trace_buf_size boot option
  ftrace: Fix t_hash_start()
  ftrace: Don't manipulate @pos in t_start()
  ftrace: Don't increment @pos in g_start()
  tracing: Reset iterator in t_start()
  trace_stat: Don't increment @pos in seq start()
  tracing_bprintk: Don't increment @pos in t_start()
  tracing/events: Don't increment @pos in s_start()

14 years agoMerge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds
Linus Torvalds [Sun, 28 Jun 2009 18:02:32 +0000 (11:02 -0700)] 
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds

* 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds:
  leds: Futher document blink_set
  leds: Add options to have GPIO LEDs start on or keep their state
  leds: LED driver for National Semiconductor LP3944 Funlight Chip
  leds: pca9532 - Indent using tabs, not spaces.
  leds: Remove an orphan Kconfig entry
  leds: Further document parameters for blink_set()
  leds: alix-leds2 fixed for Award BIOS
  leds: leds-gpio - fix a section mismatch
  leds: add the sysfs interface into the leds-bd2802 driver for changing wave pattern and led current.
  leds: change the license information
  leds: fix led-bd2802 errors while resuming

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp
Linus Torvalds [Fri, 26 Jun 2009 16:39:40 +0000 (09:39 -0700)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/bp/bp

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp:
  amd64_edac: misc small cleanups
  amd64_edac: fix ecc_enable_override handling
  amd64_edac: check only ECC bit in amd64_determine_edac_cap

14 years agoMerge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Linus Torvalds [Fri, 26 Jun 2009 16:39:02 +0000 (09:39 -0700)] 
Merge branch 'merge' of git://git./linux/kernel/git/benh/powerpc

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (29 commits)
  powerpc/rtas: Fix watchdog driver temperature read functionality
  powerpc/mm: Fix potential access to freed pages when using hugetlbfs
  powerpc/440: Fix warning early debug code
  powerpc/of: Fix usage of dev_set_name() in of_device_alloc()
  powerpc/pasemi: Use raw spinlock in SMP TB sync
  powerpc: Use one common impl. of RTAS timebase sync and use raw spinlock
  powerpc/rtas: Turn rtas lock into a raw spinlock
  powerpc: Add irqtrace support for 32-bit powerpc
  powerpc/BSR: Fix BSR to allow mmap of small BSR on 64k kernel
  powerpc/BSR: add 4096 byte BSR size
  powerpc: Map more memory early on 601 processors
  powerpc/pmac: Fix DMA ops for MacIO devices
  powerpc/mm: Make k(un)map_atomic out of line
  powerpc: Fix mpic alloc warning
  powerpc: Fix output from show_regs
  powerpc/pmac: Fix issues with PowerMac "PowerSurge" SMP
  powerpc/amigaone: Limit ISA I/O range to 4k in the device tree
  powerpc/warp: Platform fix for i2c change
  powerpc: Have git ignore generated files from dtc compile
  powerpc/mpic: Fix mapping of "DCR" based MPIC variants
  ...

14 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
Linus Torvalds [Fri, 26 Jun 2009 16:37:52 +0000 (09:37 -0700)] 
Merge branch 'release' of git://git./linux/kernel/git/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
  ACPI: video: prevent NULL deref in acpi_get_pci_dev()
  eeepc-laptop: add rfkill support for the 3G modem in Eee PC 901 Go
  eeepc-laptop: get the right value for CMSG
  eeepc-laptop: makes get_acpi() returns -ENODEV
  eeepc-laptop: right parent device
  eeepc-laptop: rfkill refactoring
  eeepc-laptop.c: use pr_fmt and pr_<level>
  eeepc-laptop: Register as a pci-hotplug device

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
Linus Torvalds [Fri, 26 Jun 2009 16:37:19 +0000 (09:37 -0700)] 
Merge git://git./linux/kernel/git/sfrench/cifs-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
  [CIFS] remove unknown mount option warning message
  [CIFS] remove bkl usage from umount begin
  cifs: Fix incorrect return code being printed in cFYI messages
  [CIFS] cleanup asn handling for ntlmssp
  [CIFS] Copy struct *after* setting the port, instead of before.
  cifs: remove rw/ro options
  cifs: fix problems with earlier patches
  cifs: have cifs parse scope_id out of IPv6 addresses and use it
  [CIFS] Do not send tree disconnect if session is already disconnected
  [CIFS] Fix build break
  cifs: display scopeid in /proc/mounts
  cifs: add new routine for converting AF_INET and AF_INET6 addrs
  cifs: have cifs_show_options show forceuid/forcegid options
  cifs: remove unneeded NULL checks from cifs_show_options

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
Linus Torvalds [Fri, 26 Jun 2009 15:48:42 +0000 (08:48 -0700)] 
Merge git://git./linux/kernel/git/davem/sparc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  sparc32: Fix makefile not generating required files
  sparc32: Fix tftpboot.img Makefile
  sparc: fix tftpboot.img build
  sparc32: Fix obvious build issues for tftpboot.img build.
  sparc64: Fix build warnings in piggyback_64.c
  sparc64: Don't use alloc_bootmem() in init_IRQ() code paths.

14 years agoamd64_edac: misc small cleanups
Borislav Petkov [Wed, 10 Jun 2009 15:36:57 +0000 (17:36 +0200)] 
amd64_edac: misc small cleanups

- cleanup debug calls
- shorten function names
- cleanup error exit paths

Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
14 years agoamd64_edac: fix ecc_enable_override handling
Borislav Petkov [Mon, 22 Jun 2009 17:42:24 +0000 (19:42 +0200)] 
amd64_edac: fix ecc_enable_override handling

amd64_check_ecc_enabled() returns non-zero status when ECC
checking/correcting is disabled and this fails further loading of the
driver even when 'ecc_enable_override' boot param is used.

Fix that by clearing return status in that case.

Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
14 years agoamd64_edac: check only ECC bit in amd64_determine_edac_cap
Borislav Petkov [Wed, 10 Jun 2009 16:29:54 +0000 (18:29 +0200)] 
amd64_edac: check only ECC bit in amd64_determine_edac_cap

Checking whether the machine is using ECC enabled DRAM is done through
testing the DimmEccEn bit in the DRAM Cfg Low register (F2x[1,0]90). Do
that instead of testing all bits from the DimmEccEn upwards.

Also, remove mci->edac_cap assignment and use value returned from
amd64_determine_edac_cap().

Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
14 years agointel-iommu: fix Identity Mapping to be arch independent
Chris Wright [Fri, 26 Jun 2009 01:52:05 +0000 (18:52 -0700)] 
intel-iommu: fix Identity Mapping to be arch independent

Drop the e820 scanning and use existing function for finding valid
RAM regions to add to 1:1 mapping.

Signed-off-by: Chris Wright <chrisw@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agoftrace: Fix the output of profile
Li Zefan [Fri, 26 Jun 2009 03:15:37 +0000 (11:15 +0800)] 
ftrace: Fix the output of profile

The first entry of the ftrace profile was always skipped when
reading trace_stat/functionX.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <4A443D59.4080307@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoMerge commit 'kumar/next' into merge
Benjamin Herrenschmidt [Fri, 26 Jun 2009 06:58:01 +0000 (16:58 +1000)] 
Merge commit 'kumar/next' into merge

14 years agopowerpc/rtas: Fix watchdog driver temperature read functionality
Adrian Reber [Thu, 26 Mar 2009 02:05:42 +0000 (02:05 +0000)] 
powerpc/rtas: Fix watchdog driver temperature read functionality

Using the RTAS watchdog driver to read out the temperature crashes
on a PXCAB:

Unable to handle kernel paging request for data at address 0xfe347b50
Faulting instruction address: 0xc00000000001af64
Oops: Kernel access of bad area, sig: 11 [#1]

The wrong usage of "(void *)__pa(&temperature)" in rtas_call() is
removed by using the function rtas_get_sensor() which does the
right thing.

Signed-off-by: Adrian Reber <adrian@lisas.de>
Acked-by: Utz Bacher <utz.bacher@de.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/mm: Fix potential access to freed pages when using hugetlbfs
Benjamin Herrenschmidt [Mon, 15 Jun 2009 16:53:43 +0000 (16:53 +0000)] 
powerpc/mm: Fix potential access to freed pages when using hugetlbfs

When using 64k page sizes, our PTE pages are split in two halves,
the second half containing the "extension" used to keep track of
individual 4k pages when not using HW 64k pages.

However, our page tables used for hugetlb have a slightly different
format and don't carry that "second half".

Our code that batched PTEs to be invalidated unconditionally reads
the "second half" (to put it into the batch), which means that when
called to invalidate hugetlb PTEs, it will access unrelated memory.

It breaks when CONFIG_DEBUG_PAGEALLOC is enabled.

This fixes it by only accessing the second half when the _PAGE_COMBO
bit is set in the first half, which indicates that we are dealing with
a "combo" page which represents 16x4k subpages. Anything else shouldn't
have this bit set and thus not require loading from the second half.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/440: Fix warning early debug code
Benjamin Herrenschmidt [Tue, 16 Jun 2009 15:55:19 +0000 (15:55 +0000)] 
powerpc/440: Fix warning early debug code

The function udbg_44x_as1_flush() has the wrong prototype causing
a warning when enabling 440 early debug.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/of: Fix usage of dev_set_name() in of_device_alloc()
Benjamin Herrenschmidt [Tue, 16 Jun 2009 15:55:18 +0000 (15:55 +0000)] 
powerpc/of: Fix usage of dev_set_name() in of_device_alloc()

dev_set_name() takes a format string, so use it properly and avoid
a warning with recent gcc's

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/pasemi: Use raw spinlock in SMP TB sync
Benjamin Herrenschmidt [Tue, 16 Jun 2009 16:42:51 +0000 (16:42 +0000)] 
powerpc/pasemi: Use raw spinlock in SMP TB sync

spin_lock() can hang if called while the timebase is frozen,
so use a raw lock instead, also disable interrupts while
at it.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc: Use one common impl. of RTAS timebase sync and use raw spinlock
Benjamin Herrenschmidt [Tue, 16 Jun 2009 16:42:50 +0000 (16:42 +0000)] 
powerpc: Use one common impl. of RTAS timebase sync and use raw spinlock

Several platforms use their own copy of what is essentially the same code,
using RTAS to synchronize the timebases when bringing up new CPUs. This
moves it all into a single common implementation and additionally
turns the spinlock into a raw spinlock since the former can rely on
the timebase not being frozen when spinlock debugging is enabled, and finally
masks interrupts while the timebase is disabled.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/rtas: Turn rtas lock into a raw spinlock
Benjamin Herrenschmidt [Tue, 16 Jun 2009 16:42:49 +0000 (16:42 +0000)] 
powerpc/rtas: Turn rtas lock into a raw spinlock

RTAS currently uses a normal spinlock. However it can be called from
contexts where this is not necessarily a good idea. For example, it
can be called while syncing timebases, with the core timebase being
frozen. Unfortunately, that will deadlock in case of lock contention
when spinlock debugging is enabled as the spin lock debugging code
will try to use __delay() which ... relies on the timebase being
enabled.

Also RTAS can be used in some low level IRQ handling code path so it
may as well be a raw spinlock for -rt sake.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc: Add irqtrace support for 32-bit powerpc
Benjamin Herrenschmidt [Wed, 17 Jun 2009 17:43:59 +0000 (17:43 +0000)] 
powerpc: Add irqtrace support for 32-bit powerpc

Based on initial work from: Dale Farnsworth <dale@farnsworth.org>

Add the low level irq tracing hooks for 32-bit powerpc needed
to enable full lockdep functionality.

The approach taken to deal with the code in entry_32.S is that
we don't trace all the transitions of MSR:EE when we just turn
it off to peek at TI_FLAGS without races. Only when we are
calling into C code or returning from exceptions with a state
that have changed from what lockdep thinks.

There's a little bugger though: If we take an exception that
keeps interrupts enabled (such as an alignment exception) while
interrupts are enabled, we will call trace_hardirqs_on() on the
way back spurriously. Not a big deal, but to get rid of it would
require remembering in pt_regs that the exception was one of the
type that kept interrupts enabled which we don't know at this
stage. (Well, we could test all cases for regs->trap but that
sucks too much).

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Tested-by: Kumar Gala <galak@kernel.crashing.org>
14 years agopowerpc/BSR: Fix BSR to allow mmap of small BSR on 64k kernel
Sonny Rao [Thu, 18 Jun 2009 15:13:04 +0000 (15:13 +0000)] 
powerpc/BSR: Fix BSR to allow mmap of small BSR on 64k kernel

On Mon, Nov 17, 2008 at 01:26:13AM -0600, Sonny Rao wrote:
> On Fri, Nov 07, 2008 at 04:28:29PM +1100, Paul Mackerras wrote:
> > Sonny Rao writes:
> >
> > > Fix the BSR driver to allow small BSR devices, which are limited to a
> > > single 4k space, on a 64k page kernel.  Previously the driver would
> > > reject the mmap since the size was smaller than PAGESIZE (or because
> > > the size was greater than the size of the device).  Now, we check for
> > > this case use remap_4k_pfn(). Also, take out code to set vm_flags,
> > > as the remap_pfn functions will do this for us.
> >
> > Thanks.
> >
> > Do we know that the BSR size will always be 4k if it's not a multiple
> > of 64k?  Is it possible that we could get 8k, 16k or 32k or BSRs?
> > If it is possible, what does the user need to be able to do?  Do they
> > just want to map 4k, or might then want to map the whole thing?
>
>
> Hi Paul, I took a look at changing the driver to reject a request for
> mapping more than a single 4k page, however the only indication we get
> of the requested size in the mmap function is the vma size, and this
> is always one page at minimum.  So, it's not possible to determine if
> the user wants one 4k page or more.  As I noted in my first response,
> there is only one case where this is even possible and I don't think
> it is a significant concern.
>
> I did notice that I left out the check to see if the user is trying to
> map more than the device length, so I fixed that.  Here's the revised
> patch.

Alright, I've reworked this now so that if we get one of these cases
where there's a bsr that's > 4k and < 64k on a 64k kernel we'll only
advertise that it is a 4k BSR to userspace.  I think this is the best
solution since user programs are only supposed to look at sysfs to
determine how much can be mapped, and libbsr does this as well.

Please consider for 2.6.31 as a fix, thanks.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/BSR: add 4096 byte BSR size
Sonny Rao [Thu, 18 Jun 2009 15:14:36 +0000 (15:14 +0000)] 
powerpc/BSR: add 4096 byte BSR size

Add a 4096 byte BSR size which will be used on new machines.  Also, remove
the warning when we run into an unknown size, as this can spam the kernel
log excessively.

Signed-off-by: Sonny Rao <sonnyrao@us.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc: Map more memory early on 601 processors
Benjamin Herrenschmidt [Thu, 18 Jun 2009 19:17:39 +0000 (19:17 +0000)] 
powerpc: Map more memory early on 601 processors

The 32-bit kernel relies on some memory being mapped covering
the kernel text,data and bss at least, early during boot before
the full MMU setup is done. On 32-bit "classic" processors, this
is done using BAT registers.

On 601, the size of BATs is limited to 8M and we use 2 of them
for that initial mapping. This can become quite tight when enabling
features like lockdep, so let's use a 3rd one to bump that mapping
from 16M to 24M. We keep the 4th BAT free as it can be useful for
debugging early boot code to map things like serial ports.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/pmac: Fix DMA ops for MacIO devices
Benjamin Herrenschmidt [Thu, 18 Jun 2009 19:20:51 +0000 (19:20 +0000)] 
powerpc/pmac: Fix DMA ops for MacIO devices

The macio_dev's created to map devices inside the MacIO ASICs
don't have proper dma_ops. This causes crashes on some machines
since the SCSI code calls dma_map_* on our behalf using the
device we hang from.

This fixes it by copying the parent PCI device dma_ops into
the macio_dev when creating it.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/mm: Make k(un)map_atomic out of line
Benjamin Herrenschmidt [Thu, 18 Jun 2009 19:25:00 +0000 (19:25 +0000)] 
powerpc/mm: Make k(un)map_atomic out of line

Those functions are way too big to be inline, besides, kmap_atomic()
wants to call debug_kmap_atomic() which isn't exported for modules
and causes module link failures.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc: Fix mpic alloc warning
Kumar Gala [Thu, 18 Jun 2009 22:01:20 +0000 (22:01 +0000)] 
powerpc: Fix mpic alloc warning

Since we can use kmalloc earlier we are getting the following since the
mpic_alloc() code calls alloc_bootmem().  Move to using kzalloc() to
remove the warning.

------------[ cut here ]------------
Badness at c0583248 [verbose debug info unavailable]
NIP: c0583248 LR: c0583210 CTR: 00000004
REGS: c0741de0 TRAP: 0700   Not tainted  (2.6.30-06736-g12a31df)
MSR: 00021000 <ME,CE>  CR: 22024024  XER: 00000000
TASK = c070d3b8[0] 'swapper' THREAD: c0740000 CPU: 0
<6>GPR00: 00000001 c0741e90 c070d3b8 00000001 00000210 00000020 3fffffff 00000000
<6>GPR08: 00000000 c0c85700 c04f8c40 0000002d 22044022 1004a388 7ffd9400 00000000
<6>GPR16: 00000000 7ffcd100 7ffcd100 7ffcd100 c04f8c40 00000000 c059f62c c075a0c0
<6>GPR24: c059f648 00000000 0000000f 00000210 00000020 00000000 3fffffff 00000210
NIP [c0583248] alloc_arch_preferred_bootmem+0x50/0x80
LR [c0583210] alloc_arch_preferred_bootmem+0x18/0x80
Call Trace:
[c0741e90] [c07343b0] devtree_lock+0x0/0x24 (unreliable)
[c0741ea0] [c0583b14] ___alloc_bootmem_nopanic+0x54/0x108
[c0741ee0] [c0583e18] ___alloc_bootmem+0x18/0x50
[c0741ef0] [c057b9cc] mpic_alloc+0x48/0x710
[c0741f40] [c057ecf4] mpc85xx_ds_pic_init+0x190/0x1b8
[c0741f90] [c057633c] init_IRQ+0x24/0x34
[c0741fa0] [c05738b8] start_kernel+0x260/0x3dc
[c0741ff0] [c00003c8] skpinv+0x2e0/0x31c
Instruction dump:
409e001c 7c030378 80010014 83e1000c 38210010 7c0803a6 4e800020 3d20c0c8
39295700 80090004 7c000034 5400d97e <0f0000002f800000 409e001c 38800000

BenH: Changed to use GFP_KERNEL, the allocator will do the right thing

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc: Fix output from show_regs
Kumar Gala [Thu, 18 Jun 2009 22:29:55 +0000 (22:29 +0000)] 
powerpc: Fix output from show_regs

For some reason we've had an explicit KERN_INFO for GPR dumps.  With
recent changes we get output like:

<6>GPR00: 00000000 ef855eb0 ef858000 00000001 000000d0 f1000000 ffbc8000 ffffffff

The KERN_INFO is causing the <6>.  Don't see any reason to keep it
around.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/pmac: Fix issues with PowerMac "PowerSurge" SMP
Benjamin Herrenschmidt [Thu, 18 Jun 2009 23:30:07 +0000 (23:30 +0000)] 
powerpc/pmac: Fix issues with PowerMac "PowerSurge" SMP

The old PowerSurge SMP (ie, dual or quad 604 machines) code has
numerous issues in modern world.

One is cpu_possible_map is set too late (the device-tree is bogus)
so we fail to allocate the interrupt stacks and crash. Another
problem is the fact the timebase is frozen by the bringup of the
second CPU so the delays in the generic code will hang, we need
to move some of the calling procedure to inside the powermac code.

This makes it boot again for me

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/amigaone: Limit ISA I/O range to 4k in the device tree
Gerhard Pircher [Fri, 19 Jun 2009 11:42:36 +0000 (11:42 +0000)] 
powerpc/amigaone: Limit ISA I/O range to 4k in the device tree

The kernel reserves the I/O address space from 0x0 to 0xfff for legacy
ISA devices. Change the ranges property for the PCI2ISA bridge to match
the kernels behavior, even if the ranges property isn't used for now.

Signed-off-by: Gerhard Pircher <gerhard_pircher@gmx.net>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/warp: Platform fix for i2c change
Sean MacLennan [Fri, 19 Jun 2009 19:43:59 +0000 (19:43 +0000)] 
powerpc/warp: Platform fix for i2c change

A change to the i2c subsystem breaks the warp platform code. The patch
is cleaner anyway, the old way was a bit crufty.

For those with keen eyes, the gratuitous change in the string from
PIKA to Warp is just so the logs look a bit nicer. The following two
lines tend to be printed one after another.

  Warp POST OK
  Warp DTM thread running.

Yeah, this will be the third patch to warp.c submitted in this
release....

Cheers,
   Sean

The i2c_client struct changed, breaking the code that looked for the ad7414
chip. Use the new of_find_i2c_device_by_node function added in 2.6.29.

Signed-off-by: Sean MacLennan <smaclennan@pikatech.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc: Have git ignore generated files from dtc compile
Jon Smirl [Sun, 21 Jun 2009 15:28:00 +0000 (15:28 +0000)] 
powerpc: Have git ignore generated files from dtc compile

Have git ignore generated files from dtc compile

Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Sean MacLennan <smaclennan@pikatech.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/mpic: Fix mapping of "DCR" based MPIC variants
Benjamin Herrenschmidt [Mon, 22 Jun 2009 16:47:59 +0000 (16:47 +0000)] 
powerpc/mpic: Fix mapping of "DCR" based MPIC variants

Commit 31207dab7d2e63795eb15823947bd2f7025b08e2
"Fix incorrect allocation of interrupt rev-map"
introduced a regression crashing on boot on machines using
a "DCR" based MPIC, such as the Cell blades.

The reason is that the irq host data structure is initialized
much later as a result of that patch, causing our calls to
mpic_map() do be done before we have a host setup.

Unfortunately, this breaks _mpic_map_dcr() which uses the
mpic->irqhost to get to the device node.

This fixes it by, instead, passing the device node explicitely
to mpic_map().

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Akira Tsukamoto <akirat@rd.scei.sony.co.jp>
14 years agopowerpc: Swiotlb breaks pseries
Michael Ellerman [Mon, 22 Jun 2009 23:13:48 +0000 (23:13 +0000)] 
powerpc: Swiotlb breaks pseries

Turning on SWIOTLB selects or enables PPC_NEED_DMA_SYNC_OPS, which means
we get the non empty versions of dma_sync_* in asm/dma-mapping.h

On my pseries machine the dma_ops have no such routines and we die with
a null pointer - this patch gets it booting, is there a more elegant way
to do it?

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoACPI: video: prevent NULL deref in acpi_get_pci_dev()
Troy Moure [Thu, 25 Jun 2009 23:05:35 +0000 (17:05 -0600)] 
ACPI: video: prevent NULL deref in acpi_get_pci_dev()

ref: http://thread.gmane.org/gmane.linux.kernel/857228/focus=857468

When the ACPI video driver initializes, it does a namespace walk
looking for for supported devices. When we find an appropriate
handle, we walk up the ACPI tree looking for a PCI root bus, and
then walk back down the PCI bus, assuming that every device
inbetween is a P2P bridge.

This assumption is not correct, and is reported broken on at
least:

Dell Latitude E6400
ThinkPad X61
Dell XPS M1330

Add a NULL deref check to prevent boot panics.

Reported-by: Alessandro Suardi <alessandro.suardi@gmail.com>
Signed-off-by: Troy Moure <twmoure@szypr.net>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
14 years agoeeepc-laptop: add rfkill support for the 3G modem in Eee PC 901 Go
Corentin Chary [Thu, 25 Jun 2009 11:25:42 +0000 (13:25 +0200)] 
eeepc-laptop: add rfkill support for the 3G modem in Eee PC 901 Go

Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
14 years agoeeepc-laptop: get the right value for CMSG
Corentin Chary [Thu, 25 Jun 2009 11:25:41 +0000 (13:25 +0200)] 
eeepc-laptop: get the right value for CMSG

CMSG is an ACPI method used to find features available on
an Eee PC. But some features are never repported, even if present.

If the getter of a feature is present, this patch will set
the corresponding bit in cmsg.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
14 years agoeeepc-laptop: makes get_acpi() returns -ENODEV
Corentin Chary [Thu, 25 Jun 2009 11:25:40 +0000 (13:25 +0200)] 
eeepc-laptop: makes get_acpi() returns -ENODEV

If there is there is no getter defined, get_acpi()
will return -ENODEV.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
14 years agoeeepc-laptop: right parent device
Corentin Chary [Thu, 25 Jun 2009 11:25:39 +0000 (13:25 +0200)] 
eeepc-laptop: right parent device

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
14 years agoeeepc-laptop: rfkill refactoring
Corentin Chary [Thu, 25 Jun 2009 11:25:38 +0000 (13:25 +0200)] 
eeepc-laptop: rfkill refactoring

Refactor rfkill code, because we'll add another
rfkill for wwan3g later.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
14 years agoeeepc-laptop.c: use pr_fmt and pr_<level>
Joe Perches [Thu, 25 Jun 2009 11:25:37 +0000 (13:25 +0200)] 
eeepc-laptop.c: use pr_fmt and pr_<level>

Convert the unusual printk(EEEPC_<level> uses to
the more standard pr_fmt and pr_<level>(.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
14 years agoeeepc-laptop: Register as a pci-hotplug device
Corentin Chary [Thu, 25 Jun 2009 11:25:36 +0000 (13:25 +0200)] 
eeepc-laptop: Register as a pci-hotplug device

The eee contains a logically (but not physically) hotpluggable PCIe slot.
Currently this is handled by adding or removing the PCI device in response
to rfkill events, but if a user has forced pciehp to bind to it (with the
force=1 argument) then both drivers will try to handle the event and
hilarity (in the form of oopses) will ensue. This can be avoided by having
eee-laptop register the slot as a hotplug slot. Only one of pciehp and
eee-laptop will successfully register this, avoiding the problem.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Tested-by: Darren Salt <linux@youmustbejoking.demon.co.uk>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Len Brown <len.brown@intel.com>
14 years ago[CIFS] remove unknown mount option warning message
Steve French [Fri, 26 Jun 2009 04:07:18 +0000 (04:07 +0000)] 
[CIFS] remove unknown mount option warning message

Jeff's previous patch which removed the unneeded rw/ro
parsing can cause a minor warning in dmesg (about the
unknown rw or ro mount option) at mount time. This
patch makes cifs ignore them in kernel to remove the warning
(they are already handled in the mount helper and VFS).

Signed-off-by: Steve French <sfrench@us.ibm.com>
14 years ago[CIFS] remove bkl usage from umount begin
Steve French [Fri, 26 Jun 2009 03:25:49 +0000 (03:25 +0000)] 
[CIFS] remove bkl usage from umount begin

The lock_kernel call moved into the fs for umount_begin
is not needed.  This adds a check to make sure we don't
call umount_begin twice on the same fs.

umount_begin for cifs is probably not needed and
may eventually be able to be removed, but in
the meantime this smaller patch is safe and
gets rid of the bkl from this path which provides
some benefit.

Acked-by: Jeff Layton <redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
14 years agosparc32: Fix makefile not generating required files
Julian Calaby [Tue, 23 Jun 2009 01:45:46 +0000 (01:45 +0000)] 
sparc32: Fix makefile not generating required files

The tftpboot build was failing with missing file errors.

It turns out that $(obj)/image wasn't being generated which was causing the a.out conversion to be skipped and hence piggyback to be called with nonexistent files.

Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosparc32: Fix tftpboot.img Makefile
Julian Calaby [Sun, 21 Jun 2009 16:45:01 +0000 (16:45 +0000)] 
sparc32: Fix tftpboot.img Makefile

Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosparc: fix tftpboot.img build
Sam Ravnborg [Sun, 21 Jun 2009 16:46:10 +0000 (16:46 +0000)] 
sparc: fix tftpboot.img build

Kjetil Oftedal mentioned that piggyback_32 was failing
when building a sparc image.

I tracked this down to the fact that the kernel no longer
provided an absolute symbol named "end".

Commit 86ed40bd6fe511d26bb8f3fa65a84cb65c235366 ("sparc: unify sections.h")
renamed end to _end but failed to update piggyback_32.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Kjetil Oftedal <oftedal@gmail.com>
Cc: Robert Reif <reif@earthlink.net>
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosparc32: Fix obvious build issues for tftpboot.img build.
Robert Reif [Sun, 21 Jun 2009 16:45:44 +0000 (16:45 +0000)] 
sparc32: Fix obvious build issues for tftpboot.img build.

Signed-off-by: Robert Reif <reif@earthlink.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosparc64: Fix build warnings in piggyback_64.c
Julian Calaby [Sun, 21 Jun 2009 16:44:13 +0000 (16:44 +0000)] 
sparc64: Fix build warnings in piggyback_64.c

This patch fixes the following build warnings:
arch/sparc/boot/piggyback_64.c: In function 'main':
arch/sparc/boot/piggyback_64.c:44: warning: 'end' may be used uninitialized in this function
arch/sparc/boot/piggyback_64.c:44: warning: 'start' may be used uninitialized in this function

Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosparc64: Don't use alloc_bootmem() in init_IRQ() code paths.
David S. Miller [Fri, 26 Jun 2009 02:00:47 +0000 (19:00 -0700)] 
sparc64: Don't use alloc_bootmem() in init_IRQ() code paths.

The page allocator and SLAB are available at this point now,
and if we still try to use bootmem allocations here the kernel
spits out warnings.

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Fri, 26 Jun 2009 00:04:37 +0000 (17:04 -0700)] 
Merge branch 'drm-fixes' of git://git./linux/kernel/git/airlied/drm-2.6

* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (28 commits)
  drm: remove unused #include <linux/version.h>'s
  drm/radeon: fix driver initialization order so radeon kms can be builtin
  drm: Fix shifts which were miscalculated when converting from bitfields.
  drm/radeon: Clear surface registers at initialization time.
  drm/radeon: Don't initialize acceleration related fields of struct fb_info.
  drm/radeon: fix radeon kms framebuffer device
  drm/i915: initialize fence registers to zero when loading GEM
  drm/i915: Fix HDMI regression introduced in new chipset support
  drm/i915: fix LFP data fetch
  drm/i915: set TV detection mode when tv is already connected
  drm/i915: Catch up to obj_priv->page_list rename in disabled debug code.
  drm/i915: Fix size_t handling in off-by-default debug printfs
  drm/i915: Don't change the blank/sync width when calculating scaled modes
  drm/i915: Add support for changing LVDS panel fitting using an output property.
  drm/i915: correct suspend/resume ordering
  drm/i915: Add missing dependency on Intel AGP support.
  drm/i915: Generate 2MHz clock for display port aux channel I/O. Retry I/O.
  drm/i915: Clarify error returns from display port aux channel I/O
  drm/i915: Add CLKCFG register definition
  drm/i915: Split array of DAC limits into separate structures.
  ...

14 years agox86, delay: tsc based udelay should have rdtsc_barrier
Pallipadi, Venkatesh [Thu, 25 Jun 2009 23:44:31 +0000 (16:44 -0700)] 
x86, delay: tsc based udelay should have rdtsc_barrier

delay_tsc needs rdtsc_barrier to provide proper delay.

Output from a test driver using hpet to cross check delay
provided by udelay().

Before:
[   86.794363] Expected delay 5us actual 4679ns
[   87.154362] Expected delay 5us actual 698ns
[   87.514162] Expected delay 5us actual 4539ns
[   88.653716] Expected delay 5us actual 4539ns
[   94.664106] Expected delay 10us actual 9638ns
[   95.049351] Expected delay 10us actual 10126ns
[   95.416110] Expected delay 10us actual 9568ns
[   95.799216] Expected delay 10us actual 9638ns
[  103.624104] Expected delay 10us actual 9707ns
[  104.020619] Expected delay 10us actual 768ns
[  104.419951] Expected delay 10us actual 9707ns

After:
[   50.983320] Expected delay 5us actual 5587ns
[   51.261807] Expected delay 5us actual 5587ns
[   51.565715] Expected delay 5us actual 5657ns
[   51.861171] Expected delay 5us actual 5587ns
[   52.164704] Expected delay 5us actual 5726ns
[   52.487457] Expected delay 5us actual 5657ns
[   52.789338] Expected delay 5us actual 5726ns
[   57.119680] Expected delay 10us actual 10755ns
[   57.893997] Expected delay 10us actual 10615ns
[   58.261287] Expected delay 10us actual 10755ns
[   58.620505] Expected delay 10us actual 10825ns
[   58.941035] Expected delay 10us actual 10755ns
[   59.320903] Expected delay 10us actual 10615ns
[   61.306311] Expected delay 10us actual 10755ns
[   61.520542] Expected delay 10us actual 10615ns

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agox86, setup: correct include file in <asm/boot.h>
H. Peter Anvin [Thu, 25 Jun 2009 22:16:06 +0000 (15:16 -0700)] 
x86, setup: correct include file in <asm/boot.h>

<asm/boot.h> needs <asm/pgtable_types.h>, not <asm/page_types.h> in
order to resolve PMD_SHIFT.  Also, correct a +1 which really should be
+ THREAD_ORDER.

This is a build error which was masked by a typoed #ifdef.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agox86, setup: Fix typo "CONFIG_x86_64" in <asm/boot.h>
Robert P. J. Day [Thu, 25 Jun 2009 20:20:48 +0000 (16:20 -0400)] 
x86, setup: Fix typo "CONFIG_x86_64" in <asm/boot.h>

CONFIG_X86_64 was misspelled (wrong case), which caused the x86-64
kernel to advertise itself as more relocatable than it really is.
This could in theory cause boot failures once bootloaders start
support the new relocation fields.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agox86, mce: percpu mcheck_timer should be pinned
Hidetoshi Seto [Wed, 24 Jun 2009 00:21:10 +0000 (09:21 +0900)] 
x86, mce: percpu mcheck_timer should be pinned

If CONFIG_NO_HZ + CONFIG_SMP, timer added via add_timer() might
be migrated on other cpu.  Use add_timer_on() instead.

Avoids the following failure:

Maciej Rutecki wrote:
> > After normal boot I try:
> >
> > echo 1 > /sys/devices/system/machinecheck/machinecheck0/check_interval
> >
> > I found this in dmesg:
> >
> > [  141.704025] ------------[ cut here ]------------
> > [  141.704039] WARNING: at arch/x86/kernel/cpu/mcheck/mce.c:1102
> > mcheck_timer+0xf5/0x100()

Reported-by: Maciej Rutecki <maciej.rutecki@gmail.com>
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Tested-by: Maciej Rutecki <maciej.rutecki@gmail.com>
Acked-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agox86: Add sysctl to allow panic on IOCK NMI error
Kurt Garloff [Wed, 24 Jun 2009 21:32:11 +0000 (14:32 -0700)] 
x86: Add sysctl to allow panic on IOCK NMI error

This patch introduces a new sysctl:

    /proc/sys/kernel/panic_on_io_nmi

which defaults to 0 (off).

When enabled, the kernel panics when the kernel receives an NMI
caused by an IO error.

The IO error triggered NMI indicates a serious system
condition, which could result in IO data corruption. Rather
than contiuing, panicing and dumping might be a better choice,
so one can figure out what's causing the IO error.

This could be especially important to companies running IO
intensive applications where corruption must be avoided, e.g. a
bank's databases.

[ SuSE has been shipping it for a while, it was done at the
  request of a large database vendor, for their users. ]

Signed-off-by: Kurt Garloff <garloff@suse.de>
Signed-off-by: Roberto Angelino <robertangelino@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
LKML-Reference: <20090624213211.GA11291@kroah.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agocifs: Fix incorrect return code being printed in cFYI messages
Suresh Jayaraman [Thu, 25 Jun 2009 12:42:34 +0000 (18:12 +0530)] 
cifs: Fix incorrect return code being printed in cFYI messages

FreeXid() along with freeing Xid does add a cifsFYI debug message that
prints rc (return code) as well. In some code paths where we set/return
error code after calling FreeXid(), incorrect error code is being
printed when cifsFYI is enabled.

This could be misleading in few cases. For eg.
In cifs_open() if cifs_fill_filedata() returns a valid pointer to
cifsFileInfo, FreeXid() prints rc=-13 whereas 0 is actually being
returned. Fix this by setting rc before calling FreeXid().

Basically convert

FreeXid(xid); rc = -ERR;
return -ERR; => FreeXid(xid);
return rc;

[Note that Christoph would like to replace the GetXid/FreeXid
calls, which are primarily used for debugging.  This seems
like a good longer term goal, but although there is an
alternative tracing facility, there are no examples yet
available that I know of that we can use (yet) to
convert this cifs function entry/exit logging, and for
creating an identifier that we can use to correlate
all dmesg log entries for a particular vfs operation
(ie identify all log entries for a particular vfs
request to cifs: e.g. a particular close or read or write
or byte range lock call ... and just using the thread id
is harder).  Eventually when a replacement
for this is available (e.g. when NFS switches over and various
samples to look at in other file systems) we can remove the
GetXid/FreeXid macro but in the meantime multiple people
use this run time configurable logging all the time
for debugging, and Suresh's patch fixes a problem
which made it harder to notice some low
memory problems in the log so it is worthwhile
to fix this problem until a better logging
approach is able to be used]

Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>
Signed-off-by: Steve French <sfrench@us.ibm.com>
14 years agoMerge branch 'futexes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Thu, 25 Jun 2009 18:25:00 +0000 (11:25 -0700)] 
Merge branch 'futexes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'futexes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  futex: request only one page from get_user_pages()

14 years agousb_serial: Fix oops when unexisting usb serial device is opened.
Thadeu Lima de Souza Cascardo [Thu, 25 Jun 2009 13:41:37 +0000 (14:41 +0100)] 
usb_serial: Fix oops when unexisting usb serial device is opened.

This commit 335f8514f200e63d689113d29cb7253a5c282967 has stopped
properly checking if there is any usb serial associated with the tty in
the close function. It happens the close function is called by releasing
the terminal right after opening the device fails.

As an example, open fails with a non-existing device, when probe has
never been called, because the device has never been plugged. This is
common in systems with static modules and no udev.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoacm: Fix oops when closing ACM tty device right after open has failed.
Thadeu Lima de Souza Cascardo [Thu, 25 Jun 2009 13:41:30 +0000 (14:41 +0100)] 
acm: Fix oops when closing ACM tty device right after open has failed.

This commit 10077d4a6674f535abdbe25cdecb1202af7948f1 has stopped
checking if there was a valid acm device associated to the tty, which is
not true right after open fails and tty subsystem tries to close the
device.

As an example, open fails with a non-existing device, when probe has
never been called, because the device has never been plugged. This is
common in systems with static modules and no udev.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>