pandora-kernel.git
13 years agoMN10300: Save frame pointer in thread_info struct rather than global var
David Howells [Wed, 27 Oct 2010 16:29:01 +0000 (17:29 +0100)]
MN10300: Save frame pointer in thread_info struct rather than global var

Save the current exception frame pointer in the thread_info struct rather than
in a global variable as the latter makes SMP tricky, especially when preemption
is also enabled.

This also replaces __frame with current_frame() and rearranges header file
inclusions to make it all compile.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
13 years agoMN10300: Change "Matsushita" to "Panasonic".
Akira Takeuchi [Wed, 27 Oct 2010 16:29:00 +0000 (17:29 +0100)]
MN10300: Change "Matsushita" to "Panasonic".

Change externally visible "Matsushita" instances to "Panasonic" throughout the
MN10300 arch code.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Create a defconfig for the ASB2364 board
Akira Takeuchi [Wed, 27 Oct 2010 16:29:00 +0000 (17:29 +0100)]
MN10300: Create a defconfig for the ASB2364 board

Create a defconfig for the ASB2364 board.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Update the ASB2303 defconfig
Akira Takeuchi [Wed, 27 Oct 2010 16:28:59 +0000 (17:28 +0100)]
MN10300: Update the ASB2303 defconfig

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: ASB2364: Add support for SMSC911X and SMC911X
Akira Takeuchi [Wed, 27 Oct 2010 16:28:58 +0000 (17:28 +0100)]
MN10300: ASB2364: Add support for SMSC911X and SMC911X

Add support for SMSC911X and SMC911X for the ASB2364 unit.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: steve.glendinning@smsc.com
cc: netdev@vger.kernel.org

13 years agoMN10300: ASB2364: Handle the IRQ multiplexer in the FPGA
David Howells [Wed, 27 Oct 2010 16:28:58 +0000 (17:28 +0100)]
MN10300: ASB2364: Handle the IRQ multiplexer in the FPGA

Handle the IRQ multiplexer in the FPGA by implementing a cascade interrupt
driver for it.

Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Generic time support
Mark Salter [Wed, 27 Oct 2010 16:28:57 +0000 (17:28 +0100)]
MN10300: Generic time support

Implement generic time support for MN10300.

Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Specify an ELF HWCAP flag for MN10300 Atomic Operations Unit support
Mark Salter [Wed, 27 Oct 2010 16:28:56 +0000 (17:28 +0100)]
MN10300: Specify an ELF HWCAP flag for MN10300 Atomic Operations Unit support

Use an ELF HWCAP flag to indicate to the process that the CPU provides LL/SC
equivalent atomic operations unit support in addition to BSET/BCLR.

Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Map userspace atomic op regs as a vmalloc page
Mark Salter [Wed, 27 Oct 2010 16:28:56 +0000 (17:28 +0100)]
MN10300: Map userspace atomic op regs as a vmalloc page

The AM34 processor has an atomic operation that's the equivalent of LL/SC on
other architectures.  However, rather than being done through a pair of
instructions, it's driven by writing to a pair of memory-mapped CPU control
registers.

One set of these registers (AARU/ADRU/ASRU) is available for use by userspace,
but for userspace to access them a PTE must be set up to cover the region.
This is done by dedicating the first vmalloc region page to this purpose,
setting the permissions on its PTE such that userspace can access the page.

glibc is hardcoded to expect the registers to be there.

The way atomic ops are done through these registers is straightforward:

 (1) Write the address of the word you wish to access into AARU.  This causes
     the CPU to go and fetch that word and load it into ADRU.  The status bits
     are also cleared in ASRU.

 (2) The current data value is read from the ADRU register and modified.

 (3) To alter the data in RAM, the revised data is written back to the ADRU
     register, which causes the CPU to attempt to write it back.

 (4) The ASRU.RW flag (ASRU read watch), ASRU.LW flag (bus lock watch),
     ASRU.IW (interrupt watch) and the ASRU.BW (bus error watch) flags then
     must be checked to confirm that the operation wasn't aborted.  If any of
     the watches have been set to true, the operation was aborted.

Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: And Panasonic AM34 subarch and implement SMP
Akira Takeuchi [Wed, 27 Oct 2010 16:28:55 +0000 (17:28 +0100)]
MN10300: And Panasonic AM34 subarch and implement SMP

Implement the Panasonic MN10300 AM34 CPU subarch and implement SMP support for
MN10300.  Also implement support for the MN2WS0060 processor and the ASB2364
evaluation board which are AM34 based.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Delete idle_timestamp from irq_cpustat_t
Akira Takeuchi [Wed, 27 Oct 2010 16:28:54 +0000 (17:28 +0100)]
MN10300: Delete idle_timestamp from irq_cpustat_t

Delete idle_timestamp from irq_cpustat_t as it's an unread relic.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Make various interrupt priority settings configurable
Akira Takeuchi [Wed, 27 Oct 2010 16:28:54 +0000 (17:28 +0100)]
MN10300: Make various interrupt priority settings configurable

Make the settings of interrupt priorities used by various services configurable
at run time.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Optimise do_csum()
Akira Takeuchi [Wed, 27 Oct 2010 16:28:53 +0000 (17:28 +0100)]
MN10300: Optimise do_csum()

Optimise do_csum() to gang up the loads so they're less likely to get
interruptions between.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Implement atomic ops using atomic ops unit
Mark Salter [Wed, 27 Oct 2010 16:28:52 +0000 (17:28 +0100)]
MN10300: Implement atomic ops using atomic ops unit

Implement atomic ops using the atomic ops unit available in the AM34 CPU.  This
allows the equivalent of the LL/SC instructions to be found on other CPUs.

Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Make the FPU operate in non-lazy mode under SMP
Akira Takeuchi [Wed, 27 Oct 2010 16:28:52 +0000 (17:28 +0100)]
MN10300: Make the FPU operate in non-lazy mode under SMP

Make the FPU operate in non-lazy mode under SMP so that when the process that
is currently using the FPU migrates to a different CPU, we don't have to ping
its previous CPU to flush the FPU context.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: SMP TLB flushing
Akira Takeuchi [Wed, 27 Oct 2010 16:28:51 +0000 (17:28 +0100)]
MN10300: SMP TLB flushing

Implement global TLB flushing for MN10300.  This will be used by the AM34 which
is SMP capable.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Use the [ID]PTEL2 registers rather than [ID]PTEL for TLB control
Akira Takeuchi [Wed, 27 Oct 2010 16:28:50 +0000 (17:28 +0100)]
MN10300: Use the [ID]PTEL2 registers rather than [ID]PTEL for TLB control

Use the [ID]PTEL2 registers rather than [ID]PTEL for TLB control as the bits
are a more suitable layout.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Make the use of PIDR to mark TLB entries controllable
Akira Takeuchi [Wed, 27 Oct 2010 16:28:49 +0000 (17:28 +0100)]
MN10300: Make the use of PIDR to mark TLB entries controllable

Make controllable the use of the PIDR register to mark TLB entries as belonging
to particular processes.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Rename __flush_tlb*() to local_flush_tlb*()
David Howells [Wed, 27 Oct 2010 16:28:49 +0000 (17:28 +0100)]
MN10300: Rename __flush_tlb*() to local_flush_tlb*()

Rename __flush_tlb*() to local_flush_tlb*() as it's more appropriate, and ready
to differentiate local from global TLB flushes when SMP is introduced.

Whilst we're at it, get rid of __flush_tlb_global() and make
local_flush_tlb_page() take an mm_struct pointer rather than VMA pointer.

Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: AM34 erratum requires MMUCTR read and write on exception entry
Akira Takeuchi [Wed, 27 Oct 2010 16:28:48 +0000 (17:28 +0100)]
MN10300: AM34 erratum requires MMUCTR read and write on exception entry

An AM34 erratum requires MMUCTR read and write on entry to certain exceptions,
prior to EPSW.NMID being cleared to allow NMIs to happen.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Make the boot wrapper able to use writeback caching
Akira Takeuchi [Wed, 27 Oct 2010 16:28:47 +0000 (17:28 +0100)]
MN10300: Make the boot wrapper able to use writeback caching

Make the boot wrapper able to use writeback caching, including flushing the
cache before jumping to the main kernel.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Cache: Implement SMP global cache flushing
Akira Takeuchi [Wed, 27 Oct 2010 16:28:47 +0000 (17:28 +0100)]
MN10300: Cache: Implement SMP global cache flushing

Implement SMP global cache flushing for MN10300.  This will be used by the AM34
which is SMP capable.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Allow some cacheflushes to be avoided if cache snooping is available
David Howells [Wed, 27 Oct 2010 16:28:46 +0000 (17:28 +0100)]
MN10300: Allow some cacheflushes to be avoided if cache snooping is available

The AM34 core is able to do cache snooping, and so can skip some of the cache
flushing.

Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: AM34: Add cacheflushing by using the AM34 purge registers
Akira Takeuchi [Wed, 27 Oct 2010 16:28:45 +0000 (17:28 +0100)]
MN10300: AM34: Add cacheflushing by using the AM34 purge registers

The AM34 CPU core provides an automated way of purging the cache rather than
manually iterating over all the tags in the cache.  Make it possible to use
these.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: SMP: Differentiate local cache flushing
Akira Takeuchi [Wed, 27 Oct 2010 16:28:45 +0000 (17:28 +0100)]
MN10300: SMP: Differentiate local cache flushing

Differentiate local cache flushing from global cache flushing so that they can
be done differently on SMP systems.

Rename the cache functions from:

mn10300_[id]cache_*()

to:

mn10300_[id]_localcache_*()

and on a UP system, assign the global labels to the local labels.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Cacheflush functions should take unsigned long addresses
Akira Takeuchi [Wed, 27 Oct 2010 16:28:44 +0000 (17:28 +0100)]
MN10300: Cacheflush functions should take unsigned long addresses

The functions that perform cache flushing should take addresses of unsigned
long type, not unsigned int.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: AM34: The current cacheflush routines operate by controlling tag regs
David Howells [Wed, 27 Oct 2010 16:28:43 +0000 (17:28 +0100)]
MN10300: AM34: The current cacheflush routines operate by controlling tag regs

The current cache flush and invalidate routines operate by controlling the
cache tag registers.  Rename the files and add config items to select them.

This makes it easier to support the use of other cache flush methods instead,
such as the use of AM34's area purge registers, if available.

Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Reorder asm/cacheflush.h to put primitives first
David Howells [Wed, 27 Oct 2010 16:28:43 +0000 (17:28 +0100)]
MN10300: Reorder asm/cacheflush.h to put primitives first

Reorder asm/cacheflush.h to put arch primitives first, before the main
functions so that the main functions can be inline asm rather than #defines
when non-trivial.

Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Provide a MN10300_CACHE_ENABLED config option
David Howells [Wed, 27 Oct 2010 16:28:42 +0000 (17:28 +0100)]
MN10300: Provide a MN10300_CACHE_ENABLED config option

Provide a MN10300_CACHE_ENABLED config option as inverted logic of
MN10300_CACHE_DISABLED to make things simpler.

Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Cache: Split cache bits out of arch Kconfig
David Howells [Wed, 27 Oct 2010 16:28:41 +0000 (17:28 +0100)]
MN10300: Cache: Split cache bits out of arch Kconfig

Split the cache bits out of arch/mn10300/Kconfig as they're quite complex.

Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Remove monitor/JTAG functions
Akira Takeuchi [Wed, 27 Oct 2010 16:28:41 +0000 (17:28 +0100)]
MN10300: Remove monitor/JTAG functions

Remove the monitor trap function and the set_jtag_stub function as they're not
really necessary.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Add CPU register bits for AM34
Akira Takeuchi [Wed, 27 Oct 2010 16:28:40 +0000 (17:28 +0100)]
MN10300: Add CPU register bits for AM34

Add CPU register declarations for the AM34 subarch.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Don't hard code the cacheline size in register defs
Akira Takeuchi [Wed, 27 Oct 2010 16:28:39 +0000 (17:28 +0100)]
MN10300: Don't hard code the cacheline size in register defs

Don't hard code the cacheline size in the cache control register definitions.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Move DMA engine control reg defs to MN103E010 processor directory
Akira Takeuchi [Wed, 27 Oct 2010 16:28:39 +0000 (17:28 +0100)]
MN10300: Move DMA engine control reg defs to MN103E010 processor directory

Move the DMA engine control register definitions to the MN103E010 processor
directory so that the MN2WS0050 processor can have its own.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Differentiate AM33_2 and AM33_3 in config
Akira Takeuchi [Wed, 27 Oct 2010 16:28:38 +0000 (17:28 +0100)]
MN10300: Differentiate AM33_2 and AM33_3 in config

Differentiate AM33_2 and AM33_3 CPU cores in configuration.  The MN103E010
processor contains an AM33_2 core.

Whilst we're at it, prepare for AM34-based stuff by declaring AM34_2 too.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Provide the functions to fully disable maskable interrupts
Akira Takeuchi [Wed, 27 Oct 2010 16:28:37 +0000 (17:28 +0100)]
MN10300: Provide the functions to fully disable maskable interrupts

The local_irq_disable() function and co. merely raise the interrupt mask on the
MN10300 arch to exclude normal interrupts.  This still lets other, higher
priority maskable interrupts through, such as are used to service gdbstub's
serial port and the MN10300 on-chip serial port virtual FIFOs.

Provide functions to allow the maskable interrupts to be fully disabled, which
will exclude those interrupts.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Add reads[bwl]() and writes[bwl]()
Akira Takeuchi [Wed, 27 Oct 2010 16:28:37 +0000 (17:28 +0100)]
MN10300: Add reads[bwl]() and writes[bwl]()

Add reads[bwl]() and writes[bwl]() for MN10300.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Don't cast away the volatile in test_bit()
Akira Takeuchi [Wed, 27 Oct 2010 16:28:36 +0000 (17:28 +0100)]
MN10300: Don't cast away the volatile in test_bit()

Don't cast away the volatile in test_bit()'s parameter when we change its type
from const volatile void * so that we can dereference it.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoTypedef SMP call function pointer
David Howells [Wed, 27 Oct 2010 16:28:36 +0000 (17:28 +0100)]
Typedef SMP call function pointer

Typedef the pointer to the function to be called by smp_call_function() and
friends:

typedef void (*smp_call_func_t)(void *info);

as it is used in a fair number of places.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-arch@vger.kernel.org

13 years agoMN10300: Prevent cnt32_to_63() from being preempted in sched_clock()
David Howells [Wed, 27 Oct 2010 16:28:35 +0000 (17:28 +0100)]
MN10300: Prevent cnt32_to_63() from being preempted in sched_clock()

Prevent cnt32_to_63() from being preempted in sched_clock() because it may
read its internal counter, get preempted, get delayed for more than the half
period of the 'TSC' and then write the internal counter, thus corrupting it.

Whilst some callers of sched_clock() have interrupts disabled or hold
spinlocks, not all do, and so preemption must be held here.

Note that sched_clock() is called from lockdep, but that shouldn't be a problem
because although preempt_disable() calls into lockdep, lockdep has a recursion
counter to deal with this.

Signed-off-by: David Howells <dhowells@redhat.com>
13 years agomn10300: Use pci_claim_resource
David Howells [Wed, 27 Oct 2010 16:28:34 +0000 (17:28 +0100)]
mn10300: Use pci_claim_resource

Instead of open-coding pci_find_parent_resource and request_resource,
just call pci_claim_resource.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agobitops: Change the bitmap index from int to unsigned long [mn10300]
Justin Chen [Wed, 27 Oct 2010 16:28:34 +0000 (17:28 +0100)]
bitops: Change the bitmap index from int to unsigned long [mn10300]

Change the index to unsigned long in all bitops for [mn10300]

Signed-off-by: Justin Chen <justin.chen@hp.com>
Reviewed-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: BUG to BUG_ON changes
Stoyan Gaydarov [Wed, 27 Oct 2010 16:28:33 +0000 (17:28 +0100)]
MN10300: BUG to BUG_ON changes

Signed-off-by: Stoyan Gaydarov <stoyboyker@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoPartially revert patch that encloses asm-offset.h numbers in brackets
David Howells [Wed, 27 Oct 2010 16:28:32 +0000 (17:28 +0100)]
Partially revert patch that encloses asm-offset.h numbers in brackets

Partially revert patch:

commit 3234282f33b29d349bcada40204fc7c8fda7fe72
Author: Jan Beulich <JBeulich@novell.com>
Date:   Tue Oct 19 14:52:26 2010 +0100
x86, asm: Fix CFI macro invocations to deal with shortcomings in gas

This breaks MN10300 arch as this changes many instances of instructions
similar to the following:

MOV number,D0

which represents an immediate value load into:

MOV (number),D0

which the assembler then interprets as a load from absolute address.

arch/mn10300/kernel/entry.S:64: Error: Invalid opcode/operands
arch/mn10300/kernel/entry.S:65: Error: junk at end of line, first unrecognized character is `0'
arch/mn10300/kernel/entry.S:74: Error: Invalid opcode/operands
arch/mn10300/kernel/entry.S:74: Error: junk at end of line, first unrecognized character is `1'
arch/mn10300/kernel/entry.S:75: Error: Invalid opcode/operands
arch/mn10300/kernel/entry.S:76: Error: junk at end of line, first unrecognized character is `0'

cc: Jan Beulich <jbeulich@novell.com>
cc: Alexander van Heukelum <heukelum@fastmail.fm>
cc: H. Peter Anvin <hpa@linux.intel.com>
cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agofix braino in fs: do not assign default i_ino in new_inode
Al Viro [Wed, 27 Oct 2010 03:19:36 +0000 (04:19 +0100)]
fix braino in fs: do not assign default i_ino in new_inode

usbfs_get_inode() is something completely different...

Bogosity introduced by commit 85fe4025c616 ("fs: do not assign default
i_ino in new_inode").

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoMerge branch 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Wed, 27 Oct 2010 01:57:59 +0000 (18:57 -0700)]
Merge branch 'drm-core-next' of git://git./linux/kernel/git/airlied/drm-2.6

* 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (476 commits)
  vmwgfx: Implement a proper GMR eviction mechanism
  drm/radeon/kms: fix r6xx/7xx 1D tiling CS checker v2
  drm/radeon/kms: properly compute group_size on 6xx/7xx
  drm/radeon/kms: fix 2D tile height alignment in the r600 CS checker
  drm/radeon/kms/evergreen: set the clear state to the blit state
  drm/radeon/kms: don't poll dac load detect.
  gpu: Add Intel GMA500(Poulsbo) Stub Driver
  drm/radeon/kms: MC vram map needs to be >= pci aperture size
  drm/radeon/kms: implement display watermark support for evergreen
  drm/radeon/kms/evergreen: add some additional safe regs v2
  drm/radeon/r600: fix tiling issues in CS checker.
  drm/i915: Move gpu_write_list to per-ring
  drm/i915: Invalidate the to-ring, flush the old-ring when updating domains
  drm/i915/ringbuffer: Write the value passed in to the tail register
  agp/intel: Restore valid PTE bit for Sandybridge after bdd3072
  drm/i915: Fix flushing regression from 9af90d19f
  drm/i915/sdvo: Remove unused encoding member
  i915: enable AVI infoframe for intel_hdmi.c [v4]
  drm/i915: Fix current fb blocking for page flip
  drm/i915: IS_IRONLAKE is synonymous with gen == 5
  ...

Fix up conflicts in
 - drivers/gpu/drm/i915/{i915_gem.c, i915/intel_overlay.c}: due to the
   new simplified stack-based kmap_atomic() interface
 - drivers/gpu/drm/vmwgfx/vmwgfx_drv.c: added .llseek entry due to BKL
   removal cleanups.

13 years agoMerge branches 'upstream/xenfs' and 'upstream/core' of git://git.kernel.org/pub/scm...
Linus Torvalds [Wed, 27 Oct 2010 01:20:19 +0000 (18:20 -0700)]
Merge branches 'upstream/xenfs' and 'upstream/core' of git://git./linux/kernel/git/jeremy/xen

* 'upstream/xenfs' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen:
  xen/privcmd: make privcmd visible in domU
  xen/privcmd: move remap_domain_mfn_range() to core xen code and export.
  privcmd: MMAPBATCH: Fix error handling/reporting
  xenbus: export xen_store_interface for xenfs
  xen/privcmd: make sure vma is ours before doing anything to it
  xen/privcmd: print SIGBUS faults
  xen/xenfs: set_page_dirty is supposed to return true if it dirties
  xen/privcmd: create address space to allow writable mmaps
  xen: add privcmd driver
  xen: add variable hypercall caller
  xen: add xen_set_domain_pte()
  xen: add /proc/xen/xsd_{kva,port} to xenfs

* 'upstream/core' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen: (29 commits)
  xen: include xen/xen.h for definition of xen_initial_domain()
  xen: use host E820 map for dom0
  xen: correctly rebuild mfn list list after migration.
  xen: improvements to VIRQ_DEBUG output
  xen: set up IRQ before binding virq to evtchn
  xen: ensure that all event channels start off bound to VCPU 0
  xen/hvc: only notify if we actually sent something
  xen: don't add extra_pages for RAM after mem_end
  xen: add support for PAT
  xen: make sure xen_max_p2m_pfn is up to date
  xen: limit extra memory to a certain ratio of base
  xen: add extra pages for E820 RAM regions, even if beyond mem_end
  xen: make sure xen_extra_mem_start is beyond all non-RAM e820
  xen: implement "extra" memory to reserve space for pages not present at boot
  xen: Use host-provided E820 map
  xen: don't map missing memory
  xen: defer building p2m mfn structures until kernel is mapped
  xen: add return value to set_phys_to_machine()
  xen: convert p2m to a 3 level tree
  xen: make install_p2mtop_page() static
  ...

Fix up trivial conflict in arch/x86/xen/mmu.c, and fix the use of
'reserve_early()' - in the new memblock world order it is now
'memblock_x86_reserve_range()' instead. Pointed out by Jeremy.

13 years agovmwgfx: Implement a proper GMR eviction mechanism
Thomas Hellstrom [Tue, 26 Oct 2010 19:21:47 +0000 (21:21 +0200)]
vmwgfx: Implement a proper GMR eviction mechanism

Use Ben's new range manager hooks to implement a manager for
GMRs that manages ids rather than ranges.
This means we can use the standard TTM code for binding, unbinding and
eviction.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
Linus Torvalds [Wed, 27 Oct 2010 00:58:44 +0000 (17:58 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/viro/vfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (52 commits)
  split invalidate_inodes()
  fs: skip I_FREEING inodes in writeback_sb_inodes
  fs: fold invalidate_list into invalidate_inodes
  fs: do not drop inode_lock in dispose_list
  fs: inode split IO and LRU lists
  fs: switch bdev inode bdi's correctly
  fs: fix buffer invalidation in invalidate_list
  fsnotify: use dget_parent
  smbfs: use dget_parent
  exportfs: use dget_parent
  fs: use RCU read side protection in d_validate
  fs: clean up dentry lru modification
  fs: split __shrink_dcache_sb
  fs: improve DCACHE_REFERENCED usage
  fs: use percpu counter for nr_dentry and nr_dentry_unused
  fs: simplify __d_free
  fs: take dcache_lock inside __d_path
  fs: do not assign default i_ino in new_inode
  fs: introduce a per-cpu last_ino allocator
  new helper: ihold()
  ...

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
Linus Torvalds [Wed, 27 Oct 2010 00:54:22 +0000 (17:54 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/roland/infiniband

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (63 commits)
  IB/qib: clean up properly if pci_set_consistent_dma_mask() fails
  IB/qib: Allow driver to load if PCIe AER fails
  IB/qib: Fix uninitialized pointer if CONFIG_PCI_MSI not set
  IB/qib: Fix extra log level in qib_early_err()
  RDMA/cxgb4: Remove unnecessary KERN_<level> use
  RDMA/cxgb3: Remove unnecessary KERN_<level> use
  IB/core: Add link layer type information to sysfs
  IB/mlx4: Add VLAN support for IBoE
  IB/core: Add VLAN support for IBoE
  IB/mlx4: Add support for IBoE
  mlx4_en: Change multicast promiscuous mode to support IBoE
  mlx4_core: Update data structures and constants for IBoE
  mlx4_core: Allow protocol drivers to find corresponding interfaces
  IB/uverbs: Return link layer type to userspace for query port operation
  IB/srp: Sync buffer before posting send
  IB/srp: Use list_first_entry()
  IB/srp: Reduce number of BUSY conditions
  IB/srp: Eliminate two forward declarations
  IB/mlx4: Signal node desc changes to SM by using FW to generate trap 144
  IB: Replace EXTRA_CFLAGS with ccflags-y
  ...

13 years agodrm/radeon/kms: fix r6xx/7xx 1D tiling CS checker v2
Alex Deucher [Wed, 27 Oct 2010 00:22:42 +0000 (20:22 -0400)]
drm/radeon/kms: fix r6xx/7xx 1D tiling CS checker v2

broken by:
drm/radeon/r600: fix tiling issues in CS checker.

v2: only apply it to 1D tiling case.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodocbook: add idr/ida to kernel-api docbook
Randy Dunlap [Tue, 26 Oct 2010 21:19:08 +0000 (14:19 -0700)]
docbook: add idr/ida to kernel-api docbook

Add idr/ida to kernel-api docbook.
Fix typos and kernel-doc notation.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Tejun Heo <tj@kernel.org>
Cc: Naohiro Aota <naota@elisp.net>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agodocbook: add more wait/wake/completion to device-drivers docbook
Randy Dunlap [Tue, 26 Oct 2010 21:17:25 +0000 (14:17 -0700)]
docbook: add more wait/wake/completion to device-drivers docbook

Add more wait, wake, and completion interfaces to the device-drivers
docbook.

Fix kernel-doc notation in the added files.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agodocumentation: update sysrq.txt magic sysrq keys
Randy Dunlap [Tue, 26 Oct 2010 21:20:40 +0000 (14:20 -0700)]
documentation: update sysrq.txt magic sysrq keys

Update Documentation/sysrq.txt magic sysrq keys:

 - 'g' is for kgdb (not arch-specific);
 - add 2 new uses for 'v', remove the Voyager info;
 - add 'y' info (SPARC-64 specific);

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Jason Wessel <jason.wessel@windriver.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: "James E.J. Bottomley" <James.Bottomley@suse.de>
Cc: David Airlie <airlied@linux.ie>
Acked-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoMerge branch 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspe...
Linus Torvalds [Wed, 27 Oct 2010 00:31:05 +0000 (17:31 -0700)]
Merge branch 'pm-fixes' of git://git./linux/kernel/git/rafael/suspend-2.6

* 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
  PM / Runtime: fix recursive locking warning of lockdep from rpm_resume()

13 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
Linus Torvalds [Wed, 27 Oct 2010 00:28:37 +0000 (17:28 -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: (53 commits)
  ACPI: install ACPI table handler before any dynamic tables being loaded
  ACPI / PM: Blacklist another machine that needs acpi_sleep=nonvs
  ACPI: Page based coalescing of I/O remappings optimization
  ACPI: Convert simple locking to RCU based locking
  ACPI: Pre-map 'system event' related register blocks
  ACPI: Add interfaces for ioremapping/iounmapping ACPI registers
  ACPI: Maintain a list of ACPI memory mapped I/O remappings
  ACPI: Fix ioremap size for MMIO reads and writes
  ACPI / Battery: Return -ENODEV for unknown values in get_property()
  ACPI / PM: Fix reference counting of power resources
  Subject: [PATCH] ACPICA: Fix Scope() op in module level code
  ACPI battery: support percentage battery remaining capacity
  ACPI: Make Embedded Controller command timeout delay configurable
  ACPI dock: move some functions to .init.text
  ACPI: thermal: remove unused limit code
  ACPI: static sleep_states[] and acpi_gts_bfs_check
  ACPI: remove dead code
  ACPI: delete dedicated MAINTAINERS entries for ACPI EC and BATTERY drivers
  ACPI: Only processor needs CPU_IDLE
  ACPICA: Update version to 20101013
  ...

13 years agoMerge branch 'idle-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb...
Linus Torvalds [Wed, 27 Oct 2010 00:28:07 +0000 (17:28 -0700)]
Merge branch 'idle-release' of git://git./linux/kernel/git/lenb/linux-idle-2.6

* 'idle-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-idle-2.6:
  intel_idle: do not use the LAPIC timer for ATOM C2
  intel_idle: add initial Sandy Bridge support
  acpi_idle: delete bogus data from cpuidle_state.power_usage
  intel_idle: delete bogus data from cpuidle_state.power_usage
  intel_idle: simplify test for leave_mm()

13 years agoMerge branch 'sfi-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb...
Linus Torvalds [Wed, 27 Oct 2010 00:27:14 +0000 (17:27 -0700)]
Merge branch 'sfi-release' of git://git./linux/kernel/git/lenb/linux-sfi-2.6

* 'sfi-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-sfi-2.6:
  SFI: remove the v0.7 related definitions from sfi.h

13 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile
Linus Torvalds [Wed, 27 Oct 2010 00:25:38 +0000 (17:25 -0700)]
Merge git://git./linux/kernel/git/cmetcalf/linux-tile

* git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
  arch/tile: convert a BUG_ON to BUILD_BUG_ON
  arch/tile: make ptrace() work properly for TILE-Gx COMPAT mode
  arch/tile: support new info op generated by compiler
  arch/tile: minor whitespace/naming changes for string support files
  arch/tile: enable single-step support for TILE-Gx
  arch/tile: parameterize system PLs to support KVM port
  arch/tile: add Tilera's <arch/sim.h> header as an open-source header
  arch/tile: Bomb C99 comments to C89 comments in tile's <arch/sim_def.h>
  arch/tile: prevent corrupt top frame from causing backtracer runaway
  arch/tile: various top-level Makefile cleanups
  arch/tile: change lower bound on syscall error return to -4095
  arch/tile: properly export __mb_incoherent for modules
  arch/tile: provide a definition of MAP_STACK
  kmemleak: add TILE to the list of supported architectures.
  char: hvc: check for error case
  arch/tile: Add a warning if we try to allocate too much vmalloc memory.
  arch/tile: update some comments to clarify register usage.
  arch/tile: use better "punctuation" for VMSPLIT_3_5G and friends
  arch/tile: Use <asm-generic/syscalls.h>
  tile: replace some BUG_ON checks with BUILD_BUG_ON checks

13 years agoMerge branch 'nfs-for-2.6.37' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
Linus Torvalds [Wed, 27 Oct 2010 00:24:28 +0000 (17:24 -0700)]
Merge branch 'nfs-for-2.6.37' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6

* 'nfs-for-2.6.37' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
  NFS: rename nfs.upcall -> nfs.idmap
  NFS: Fix a compile issue in nfs_root

13 years agoMerge branch 'akpm-incoming-1'
Linus Torvalds [Wed, 27 Oct 2010 00:15:20 +0000 (17:15 -0700)]
Merge branch 'akpm-incoming-1'

* akpm-incoming-1: (176 commits)
  scripts/checkpatch.pl: add check for declaration of pci_device_id
  scripts/checkpatch.pl: add warnings for static char that could be static const char
  checkpatch: version 0.31
  checkpatch: statement/block context analyser should look at sanitised lines
  checkpatch: handle EXPORT_SYMBOL for DEVICE_ATTR and similar
  checkpatch: clean up structure definition macro handline
  checkpatch: update copyright dates
  checkpatch: Add additional attribute #defines
  checkpatch: check for incorrect permissions
  checkpatch: ensure kconfig help checks only apply when we are adding help
  checkpatch: simplify and consolidate "missing space after" checks
  checkpatch: add check for space after struct, union, and enum
  checkpatch: returning errno typically should be negative
  checkpatch: handle casts better fixing false categorisation of : as binary
  checkpatch: ensure we do not collapse bracketed sections into constants
  checkpatch: suggest cleanpatch and cleanfile when appropriate
  checkpatch: types may sit on a line on their own
  checkpatch: fix regressions in "fix handling of leading spaces"
  div64_u64(): improve precision on 32bit platforms
  lib/parser: cleanup match_number()
  ...

13 years agoscripts/checkpatch.pl: add check for declaration of pci_device_id
Joe Perches [Tue, 26 Oct 2010 21:23:21 +0000 (14:23 -0700)]
scripts/checkpatch.pl: add check for declaration of pci_device_id

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoscripts/checkpatch.pl: add warnings for static char that could be static const char
Joe Perches [Tue, 26 Oct 2010 21:23:20 +0000 (14:23 -0700)]
scripts/checkpatch.pl: add warnings for static char that could be static const char

Add warnings for possible missing const uses of
static char foo[] = "bar"
    that could be
static const char foo[] = "bar"
and
static const char *foo[] = {"bar", "baz"}
    that could be
static const char * const foo[] = {"bar", "baz"}

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Mike Frysinger <vapier.adi@gmail.com>
Cc: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agocheckpatch: version 0.31
Andy Whitcroft [Tue, 26 Oct 2010 21:23:19 +0000 (14:23 -0700)]
checkpatch: version 0.31

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agocheckpatch: statement/block context analyser should look at sanitised lines
Andy Whitcroft [Tue, 26 Oct 2010 21:23:19 +0000 (14:23 -0700)]
checkpatch: statement/block context analyser should look at sanitised lines

When tracking context to find a block or statement we need to use the
sanitised lines, else perentheses '(' & ')' and braces '{' & '}' can throw
the scanner out.  Also fix up a couple of error outputs which include
those sanitised lines incorrectly.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agocheckpatch: handle EXPORT_SYMBOL for DEVICE_ATTR and similar
Andy Whitcroft [Tue, 26 Oct 2010 21:23:18 +0000 (14:23 -0700)]
checkpatch: handle EXPORT_SYMBOL for DEVICE_ATTR and similar

Handly definitions similar to below.  The definition macro spits out a
symbol with a prefix.  Add matching of any identifier prefix:

    DEVICE_ATTR(link_power_management_policy, S_IRUGO | S_IWUSR,
            ata_scsi_lpm_show, ata_scsi_lpm_put);
    EXPORT_SYMBOL_GPL(dev_attr_link_power_management_policy);

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agocheckpatch: clean up structure definition macro handline
Andy Whitcroft [Tue, 26 Oct 2010 21:23:18 +0000 (14:23 -0700)]
checkpatch: clean up structure definition macro handline

Handle definitions such as the following correctly, it is not
a complex statement:

    #define PREALLOC(NAME, START, END, FLAGS) {     \
    .name = (NAME),                 \
    .start = (START),               \
    .end = (END),                   \
    .flags = (FLAGS)                \
    },

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agocheckpatch: update copyright dates
Andy Whitcroft [Tue, 26 Oct 2010 21:23:17 +0000 (14:23 -0700)]
checkpatch: update copyright dates

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agocheckpatch: Add additional attribute #defines
Joe Perches [Tue, 26 Oct 2010 21:23:16 +0000 (14:23 -0700)]
checkpatch: Add additional attribute #defines

On Wed, 2010-08-11 at 12:35 -0400, Dave Jones wrote:
> I just got this from a patch I merged..
>
> ERROR: need consistent spacing around '*' (ctx:WxV)
> #121: FILE: arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c:113:
> +static struct pcc_cpu __percpu *pcc_cpu_info;
>                                 ^
> which doesn't seem right.

Perhaps these need to be added to checkpatch.

[apw@canonical.com: added tests]
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Cc: Dave Jones <davej@codemonkey.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agocheckpatch: check for incorrect permissions
Rabin Vincent [Tue, 26 Oct 2010 21:23:16 +0000 (14:23 -0700)]
checkpatch: check for incorrect permissions

Throw an error when a source file has been given execute permissions using
the mode change line present in git diffs.  Also alow the filename
matching to use the "diff" line in addition to the "+++" line, since the
mode change lines appear before any "+++" lines.

[apw@canonical.com: simplified filename logic slightly, added tests]
Cc: Andy Whitcroft <apw@canonical.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agocheckpatch: ensure kconfig help checks only apply when we are adding help
Andy Whitcroft [Tue, 26 Oct 2010 21:23:15 +0000 (14:23 -0700)]
checkpatch: ensure kconfig help checks only apply when we are adding help

When checking the length of the help we need to be sure we are seeing the
whole story before erroring.  Firstly we only want to check when adding
the help in the first place.  Second we need to be sure that we are seeing
the end of the entry, nominally when there is no context below or that
context shows the start of the next entry.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agocheckpatch: simplify and consolidate "missing space after" checks
Andy Whitcroft [Tue, 26 Oct 2010 21:23:15 +0000 (14:23 -0700)]
checkpatch: simplify and consolidate "missing space after" checks

Commonise the code for missing spaces after struct, union, and enum such
that they share the same code.  Ensure we cover all the common cases in
each case.  Check against the sanitised line to ensure we do not report on
comments and strings.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agocheckpatch: add check for space after struct, union, and enum
Andy Whitcroft [Tue, 26 Oct 2010 21:23:14 +0000 (14:23 -0700)]
checkpatch: add check for space after struct, union, and enum

Add spacing checks for struct, union, and enum definitions.  Check the
spacing after type and before the equals (=) and open brace ({).

Based on a patch by Joe Perches.

Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agocheckpatch: returning errno typically should be negative
Andy Whitcroft [Tue, 26 Oct 2010 21:23:14 +0000 (14:23 -0700)]
checkpatch: returning errno typically should be negative

Add a (strict mode only) test to check for non-negative returns of what
appear to be errno values as the majority case these should indeed be
negative.

Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agocheckpatch: handle casts better fixing false categorisation of : as binary
Andy Whitcroft [Tue, 26 Oct 2010 21:23:13 +0000 (14:23 -0700)]
checkpatch: handle casts better fixing false categorisation of : as binary

The following incantation is triggering categorisation of its colon (:) as
a binary form, which it is not:

return foo ? (s8)bar : baz;

Handle casts differently from types in the categoriser, allowing us to
better track (s8)bar as a value and not a declaration.

Reported-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agocheckpatch: ensure we do not collapse bracketed sections into constants
Andy Whitcroft [Tue, 26 Oct 2010 21:23:12 +0000 (14:23 -0700)]
checkpatch: ensure we do not collapse bracketed sections into constants

When determining if a return () sequence is a function style bracketing we
simplify the expression one bracket at a time replacing each with a
constant.  However this can trigger a false merge with expressions as
below:

return (foo)0;

Prevent this false merging.

Reported-by: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agocheckpatch: suggest cleanpatch and cleanfile when appropriate
Andy Whitcroft [Tue, 26 Oct 2010 21:23:12 +0000 (14:23 -0700)]
checkpatch: suggest cleanpatch and cleanfile when appropriate

When we hit types of whitespace which may be fixed by scripts/cleanpatch
and scripts/cleanfile suggest their use in our report.

Suggested-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agocheckpatch: types may sit on a line on their own
Andy Whitcroft [Tue, 26 Oct 2010 21:23:11 +0000 (14:23 -0700)]
checkpatch: types may sit on a line on their own

When the following form is used we have a type which fully fills a line.
This means that a type may end at the end of line as well as at the
following identifier.

int **
foo;

Reported-by: Daniel Walker <dwalker@fifo99.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agocheckpatch: fix regressions in "fix handling of leading spaces"
Andy Whitcroft [Tue, 26 Oct 2010 21:23:11 +0000 (14:23 -0700)]
checkpatch: fix regressions in "fix handling of leading spaces"

The patch "checkpatch: fix handling of leading spaces" added checks for
leading spaces on lines, but this introduces regressions.  Firstly it does
not correctly detect when we are in a comment.  Secondly it does not allow
for preprocessor command spacing.  Finally it does not allow for label
indentation which is required to be less than one tab.  Fix these up:

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agodiv64_u64(): improve precision on 32bit platforms
Brian Behlendorf [Tue, 26 Oct 2010 21:23:10 +0000 (14:23 -0700)]
div64_u64(): improve precision on 32bit platforms

The current implementation of div64_u64 for 32bit systems returns an
approximately correct result when the divisor exceeds 32bits.  Since doing
64bit division using 32bit hardware is a long since solved problem we just
use one of the existing proven methods.

Additionally, add a div64_s64 function to correctly handle doing signed
64bit division.

Addresses https://bugzilla.redhat.com/show_bug.cgi?id=616105

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Ben Woodard <bwoodard@llnl.gov>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Mark Grondona <mgrondona@llnl.gov>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agolib/parser: cleanup match_number()
Namhyung Kim [Tue, 26 Oct 2010 21:23:09 +0000 (14:23 -0700)]
lib/parser: cleanup match_number()

Use new variable 'len' to make code more readable.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agopercpu_counter: use this_cpu_ptr() instead of per_cpu_ptr()
Christoph Lameter [Tue, 26 Oct 2010 21:23:09 +0000 (14:23 -0700)]
percpu_counter: use this_cpu_ptr() instead of per_cpu_ptr()

this_cpu_ptr() avoids an array lookup and can use the percpu offset of the
local cpu directly.

Signed-off-by: Christoph Lameter <cl@linux.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agolib/list_sort: test: check element addresses
Artem Bityutskiy [Tue, 26 Oct 2010 21:23:08 +0000 (14:23 -0700)]
lib/list_sort: test: check element addresses

Improve 'lib_sort()' test and check that:
 o 'cmp()' is called only for elements which were present in the original list,
   i.e., the 'a' and 'b' parameters are valid
 o the resulted (sorted) list consists onlly of the original elements
 o intdoruce "poison" fields to make sure data around 'struc list_head' field
   are not corrupted.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Cc: Don Mullis <don.mullis@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agolib/list_sort: test: unify test messages
Artem Bityutskiy [Tue, 26 Oct 2010 21:23:08 +0000 (14:23 -0700)]
lib/list_sort: test: unify test messages

This patch unifies 'list_sort_test()' messages a bit and makes sure all of
them start with the "list_sort_test:" prefix to make it obvious for users
where the messages come from.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Cc: Don Mullis <don.mullis@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agolib/list_sort: test: improve errors handling
Artem Bityutskiy [Tue, 26 Oct 2010 21:23:07 +0000 (14:23 -0700)]
lib/list_sort: test: improve errors handling

The 'lib_sort()' test does not free memory if it fails, and it makes the
kernel panic if it cannot allocate memory.  This patch fixes the problem.

This patch also changes several small things:
 o use 'list_add()' helper instead of adding manually
 o introduce temporary 'el1' variable to avoid ugly and unreadalbe
   "if" statement
 o make 'head' to be stack variable instead of 'kmalloc()'ed, which
   simplifies code a bit

Overall, this patch is of clean-up type.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Cc: Don Mullis <don.mullis@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agolib/list_sort: test: use generic random32
Artem Bityutskiy [Tue, 26 Oct 2010 21:23:06 +0000 (14:23 -0700)]
lib/list_sort: test: use generic random32

Instead of using own pseudo-random generator, use generic linux
'random32()' function.  Presumably, this should improve test coverage.

At the same time, do the following changes:
  o Use shorter macro name for test list length
  o Do not use strange 'l_h' name for 'struct list_head' element,
    use 'list', because it is traditional name and thus, makes the
    code more obvious and readable.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Cc: Don Mullis <don.mullis@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agolib/list_sort: test: use more reasonable printk levels
Artem Bityutskiy [Tue, 26 Oct 2010 21:23:06 +0000 (14:23 -0700)]
lib/list_sort: test: use more reasonable printk levels

I do not see any reason to use KERN_WARN for normal messages and
KERN_EMERG for error messages in the lib_sort testing routine.  Let's use
more reasonable KERN_NORM and KERN_ERR levels.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Cc: Don Mullis <don.mullis@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agolib/Kconfig.debug: add list_sort debugging switch
Artem Bityutskiy [Tue, 26 Oct 2010 21:23:05 +0000 (14:23 -0700)]
lib/Kconfig.debug: add list_sort debugging switch

While hunting a non-existing bug in 'list_sort()', I've improved the
'list_sort_test()' function which tests the 'list_sort()' library call.
Although at the end I found a bug in my code, but not in 'list_sort()', I
think my clean-ups and improvements are worth merging because they make
the test function better.

This patch:

Make the self-tests selectable via Kconfig rather than by manual enabling
of DEBUG_LIST_SORT.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Cc: Don Mullis <don.mullis@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agopercpu_counter: add debugobj support
Tejun Heo [Tue, 26 Oct 2010 21:23:05 +0000 (14:23 -0700)]
percpu_counter: add debugobj support

All percpu counters are linked to a global list on initialization and
removed from it on destruction.  The list is walked during CPU up/down.
If a percpu counter is freed without being properly destroyed, the system
will oops only on the next CPU up/down making it pretty nasty to track
down.  This patch adds debugobj support for percpu counters so that such
problems can be found easily.

As percpu counters don't make sense on stack and can't be statically
initialized, debugobj support is pretty simple.  It's initialized and
activated on counter initialization, and deactivatd and destroyed on
counter destruction.  With this patch applied, the bug fixed by commit
602586a83b719df0fbd94196a1359ed35aeb2df3 (shmem: put_super must
percpu_counter_destroy) triggers the following warning on tmpfs unmount
and the system won't oops on the next cpu up/down operation.

 ------------[ cut here ]------------
 WARNING: at lib/debugobjects.c:259 debug_print_object+0x5c/0x70()
 Hardware name: Bochs
 ODEBUG: free active (active state 0) object type: percpu_counter
 Modules linked in:
 Pid: 3999, comm: umount Not tainted 2.6.36-rc2-work+ #5
 Call Trace:
  [<ffffffff81083f7f>] warn_slowpath_common+0x7f/0xc0
  [<ffffffff81084076>] warn_slowpath_fmt+0x46/0x50
  [<ffffffff813b45cc>] debug_print_object+0x5c/0x70
  [<ffffffff813b50e5>] debug_check_no_obj_freed+0x125/0x210
  [<ffffffff811577d3>] kfree+0xb3/0x2f0
  [<ffffffff81132edd>] shmem_put_super+0x1d/0x30
  [<ffffffff81162e96>] generic_shutdown_super+0x56/0xe0
  [<ffffffff81162f86>] kill_anon_super+0x16/0x60
  [<ffffffff81162ff7>] kill_litter_super+0x27/0x30
  [<ffffffff81163295>] deactivate_locked_super+0x45/0x60
  [<ffffffff81163cfa>] deactivate_super+0x4a/0x70
  [<ffffffff8117d446>] mntput_no_expire+0x86/0xe0
  [<ffffffff8117df7f>] sys_umount+0x6f/0x360
  [<ffffffff8103f01b>] system_call_fastpath+0x16/0x1b
 ---[ end trace cce2a341ba3611a7 ]---

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Thomas Gleixner <tglxlinutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoidr: fix idr_pre_get() locking description
Naohiro Aota [Tue, 26 Oct 2010 21:23:03 +0000 (14:23 -0700)]
idr: fix idr_pre_get() locking description

Despite the idr_pre_get() kernel-doc, there are some cases where you can
call idr_pre_get() from within locked regions.  Add a description for such
cases.

See also: http://lkml.org/lkml/2010/9/16/462

[akpm@linux-foundation.org: cleanups, grammatical fixes]
Signed-off-by: Naohiro Aota <naota@elisp.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agolib/bitmap.c: use hex_to_bin()
Andy Shevchenko [Tue, 26 Oct 2010 21:23:03 +0000 (14:23 -0700)]
lib/bitmap.c: use hex_to_bin()

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoMAINTAINERS: use "T: git" and whitespace trivia
Joe Perches [Tue, 26 Oct 2010 21:23:02 +0000 (14:23 -0700)]
MAINTAINERS: use "T: git" and whitespace trivia

Add missing git as a prefix for git repositories in the few places it
wasn't already used.

Convert a space delimiter to a tab.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoMAINTAINERS: remove USB ZC0301 DRIVER
Joe Perches [Tue, 26 Oct 2010 21:23:02 +0000 (14:23 -0700)]
MAINTAINERS: remove USB ZC0301 DRIVER

Removed by commit 0d58cef664e01f ("V4L/DVB: Remove obsolete zc0301 v4l
driver").

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Amerigo Wang <amwang@redhat.com>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoMAINTAINERS: remove USB OV511 DRIVER
Joe Perches [Tue, 26 Oct 2010 21:23:01 +0000 (14:23 -0700)]
MAINTAINERS: remove USB OV511 DRIVER

Removed by commit 7373ab3669aec93 ("V4L/DVB: Remove obsolete ov511
driver").

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Amerigo Wang <amwang@redhat.com>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoMAINTAINERS: merge s3c6400 and 6410 to 64xx
Joe Perches [Tue, 26 Oct 2010 21:23:01 +0000 (14:23 -0700)]
MAINTAINERS: merge s3c6400 and 6410 to 64xx

Removed by commit 431107ea5b680a24a ("ARM: S3C64XX: Merge mach-s3c6400 and
mach-s3c6410").

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoMAINTAINERS: merge s3c-244x sections
Joe Perches [Tue, 26 Oct 2010 21:23:00 +0000 (14:23 -0700)]
MAINTAINERS: merge s3c-244x sections

Removed by commit 70556b143ae4c ("ARM: S3C24XX: Remove old mach-s3c2442").

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoMAINTAINERS: merge imote2 and stargate
Joe Perches [Tue, 26 Oct 2010 21:22:59 +0000 (14:22 -0700)]
MAINTAINERS: merge imote2 and stargate

Removed by commit dcd925f95194da4 ("pxa: merge stargate2 and imote2 board
files").

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoMAINTAINERS: fix Colibri PXA270 file pattern
Joe Perches [Tue, 26 Oct 2010 21:22:59 +0000 (14:22 -0700)]
MAINTAINERS: fix Colibri PXA270 file pattern

The original commit 403d29713e0a ("pxa/income: Add Income SBC support")
started with the wrong file pattern.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoscripts/get_maintainer.pl: don't deduplicate unnamed addresses ie: mailing lists
Joe Perches [Tue, 26 Oct 2010 21:22:58 +0000 (14:22 -0700)]
scripts/get_maintainer.pl: don't deduplicate unnamed addresses ie: mailing lists

Fix a defect with the first mailing list address being used for each
subsequent mailing list.

Updated to 0.26-beta6.

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Florian Mickler <florian@mickler.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoscripts/get_maintainer.pl: use mailmap in name deduplication and other updates
Joe Perches [Tue, 26 Oct 2010 21:22:58 +0000 (14:22 -0700)]
scripts/get_maintainer.pl: use mailmap in name deduplication and other updates

Use Florian Mickler's mailmap routine to reduce name duplication.

o Add subroutine deduplicate_email to centralize code
o Add hashes for deduplicate_(name|address)_hash
o Remove now unused @interactive_to
o Whitespace neatening
o Add command line --help text
o Add --mailmap command line option control
o Interactive changes:
   - Add toggles for maintainer, git and list selections
   - Default selection is all
   - Add mailmap control

Update to 0.26-beta5

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Florian Mickler <florian@mickler.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>