Skip to content

Commit

Permalink
Merge branch 'stable' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/cmetcalf/linux-tile

Pull arch/tile bug fixes from Chris Metcalf:
 "This includes Paul Gortmaker's change to fix the <asm/system.h>
  disintegration issues on tile, a fix to unbreak the tilepro ethernet
  driver, and a backlog of bugfix-only changes from internal Tilera
  development over the last few months.

  They have all been to LKML and on linux-next for the last few days.
  The EDAC change to MAINTAINERS is an oddity but discussion on the
  linux-edac list suggested I ask you to pull that change through my
  tree since they don't have a tree to pull edac changes from at the
  moment."

* 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile: (39 commits)
  drivers/net/ethernet/tile: fix netdev_alloc_skb() bombing
  MAINTAINERS: update EDAC information
  tilepro ethernet driver: fix a few minor issues
  tile-srom.c driver: minor code cleanup
  edac: say "TILEGx" not "TILEPro" for the tilegx edac driver
  arch/tile: avoid accidentally unmasking NMI-type interrupt accidentally
  arch/tile: remove bogus performance optimization
  arch/tile: return SIGBUS for addresses that are unaligned AND invalid
  arch/tile: fix finv_buffer_remote() for tilegx
  arch/tile: use atomic exchange in arch_write_unlock()
  arch/tile: stop mentioning the "kvm" subdirectory
  arch/tile: export the page_home() function.
  arch/tile: fix pointer cast in cacheflush.c
  arch/tile: fix single-stepping over swint1 instructions on tilegx
  arch/tile: implement panic_smp_self_stop()
  arch/tile: add "nop" after "nap" to help GX idle power draw
  arch/tile: use proper memparse() for "maxmem" options
  arch/tile: fix up locking in pgtable.c slightly
  arch/tile: don't leak kernel memory when we unload modules
  arch/tile: fix bug in delay_backoff()
  ...
  • Loading branch information
torvalds committed Apr 7, 2012
2 parents 9479f0f + 00a62d4 commit 4157368
Show file tree
Hide file tree
Showing 33 changed files with 501 additions and 300 deletions.
22 changes: 11 additions & 11 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2450,53 +2450,53 @@ F: fs/ecryptfs/

EDAC-CORE
M: Doug Thompson <[email protected]>
L: [email protected] (moderated for non-subscribers)
L: [email protected]
W: bluesmoke.sourceforge.net
S: Supported
F: Documentation/edac.txt
F: drivers/edac/edac_*
F: drivers/edac/
F: include/linux/edac.h

EDAC-AMD64
M: Doug Thompson <[email protected]>
M: Borislav Petkov <[email protected]>
L: [email protected] (moderated for non-subscribers)
L: [email protected]
W: bluesmoke.sourceforge.net
S: Supported
F: drivers/edac/amd64_edac*

EDAC-E752X
M: Mark Gross <[email protected]>
M: Doug Thompson <[email protected]>
L: [email protected] (moderated for non-subscribers)
L: [email protected]
W: bluesmoke.sourceforge.net
S: Maintained
F: drivers/edac/e752x_edac.c

EDAC-E7XXX
M: Doug Thompson <[email protected]>
L: [email protected] (moderated for non-subscribers)
L: [email protected]
W: bluesmoke.sourceforge.net
S: Maintained
F: drivers/edac/e7xxx_edac.c

EDAC-I82443BXGX
M: Tim Small <[email protected]>
L: [email protected] (moderated for non-subscribers)
L: [email protected]
W: bluesmoke.sourceforge.net
S: Maintained
F: drivers/edac/i82443bxgx_edac.c

EDAC-I3000
M: Jason Uhlenkott <[email protected]>
L: [email protected] (moderated for non-subscribers)
L: [email protected]
W: bluesmoke.sourceforge.net
S: Maintained
F: drivers/edac/i3000_edac.c

EDAC-I5000
M: Doug Thompson <[email protected]>
L: [email protected] (moderated for non-subscribers)
L: [email protected]
W: bluesmoke.sourceforge.net
S: Maintained
F: drivers/edac/i5000_edac.c
Expand Down Expand Up @@ -2525,21 +2525,21 @@ F: drivers/edac/i7core_edac.c
EDAC-I82975X
M: Ranganathan Desikan <[email protected]>
M: "Arvind R." <[email protected]>
L: [email protected] (moderated for non-subscribers)
L: [email protected]
W: bluesmoke.sourceforge.net
S: Maintained
F: drivers/edac/i82975x_edac.c

EDAC-PASEMI
M: Egor Martovetsky <[email protected]>
L: [email protected] (moderated for non-subscribers)
L: [email protected]
W: bluesmoke.sourceforge.net
S: Maintained
F: drivers/edac/pasemi_edac.c

EDAC-R82600
M: Tim Small <[email protected]>
L: [email protected] (moderated for non-subscribers)
L: [email protected]
W: bluesmoke.sourceforge.net
S: Maintained
F: drivers/edac/r82600_edac.c
Expand Down
8 changes: 6 additions & 2 deletions arch/tile/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ config TILE
select GENERIC_PENDING_IRQ if SMP
select GENERIC_IRQ_SHOW
select SYS_HYPERVISOR
select ARCH_HAVE_NMI_SAFE_CMPXCHG if !M386
select ARCH_HAVE_NMI_SAFE_CMPXCHG

# FIXME: investigate whether we need/want these options.
# select HAVE_IOREMAP_PROT
Expand Down Expand Up @@ -69,6 +69,9 @@ config ARCH_PHYS_ADDR_T_64BIT
config ARCH_DMA_ADDR_T_64BIT
def_bool y

config NEED_DMA_MAP_STATE
def_bool y

config LOCKDEP_SUPPORT
def_bool y

Expand Down Expand Up @@ -118,7 +121,7 @@ config 64BIT

config ARCH_DEFCONFIG
string
default "arch/tile/configs/tile_defconfig" if !TILEGX
default "arch/tile/configs/tilepro_defconfig" if !TILEGX
default "arch/tile/configs/tilegx_defconfig" if TILEGX

source "init/Kconfig"
Expand Down Expand Up @@ -240,6 +243,7 @@ endchoice

config PAGE_OFFSET
hex
depends on !64BIT
default 0xF0000000 if VMSPLIT_3_75G
default 0xE0000000 if VMSPLIT_3_5G
default 0xB0000000 if VMSPLIT_2_75G
Expand Down
5 changes: 2 additions & 3 deletions arch/tile/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ ifneq ($(CONFIG_DEBUG_EXTRA_FLAGS),"")
KBUILD_CFLAGS += $(CONFIG_DEBUG_EXTRA_FLAGS)
endif

LIBGCC_PATH := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
LIBGCC_PATH := \
$(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name)

# Provide the path to use for "make defconfig".
KBUILD_DEFCONFIG := $(ARCH)_defconfig
Expand All @@ -53,8 +54,6 @@ libs-y += $(LIBGCC_PATH)
# See arch/tile/Kbuild for content of core part of the kernel
core-y += arch/tile/

core-$(CONFIG_KVM) += arch/tile/kvm/

ifdef TILERA_ROOT
INSTALL_PATH ?= $(TILERA_ROOT)/tile/boot
endif
Expand Down
4 changes: 2 additions & 2 deletions arch/tile/include/arch/spr_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
_concat4(SPR_IPI_EVENT_, CONFIG_KERNEL_PL,,)
#define SPR_IPI_EVENT_RESET_K \
_concat4(SPR_IPI_EVENT_RESET_, CONFIG_KERNEL_PL,,)
#define SPR_IPI_MASK_SET_K \
_concat4(SPR_IPI_MASK_SET_, CONFIG_KERNEL_PL,,)
#define SPR_IPI_EVENT_SET_K \
_concat4(SPR_IPI_EVENT_SET_, CONFIG_KERNEL_PL,,)
#define INT_IPI_K \
_concat4(INT_IPI_, CONFIG_KERNEL_PL,,)

Expand Down
50 changes: 2 additions & 48 deletions arch/tile/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#ifndef _ASM_TILE_ATOMIC_H
#define _ASM_TILE_ATOMIC_H

#include <asm/cmpxchg.h>

#ifndef __ASSEMBLY__

#include <linux/compiler.h>
Expand Down Expand Up @@ -121,54 +123,6 @@ static inline int atomic_read(const atomic_t *v)
*/
#define atomic_add_negative(i, v) (atomic_add_return((i), (v)) < 0)

/* Nonexistent functions intended to cause link errors. */
extern unsigned long __xchg_called_with_bad_pointer(void);
extern unsigned long __cmpxchg_called_with_bad_pointer(void);

#define xchg(ptr, x) \
({ \
typeof(*(ptr)) __x; \
switch (sizeof(*(ptr))) { \
case 4: \
__x = (typeof(__x))(typeof(__x-__x))atomic_xchg( \
(atomic_t *)(ptr), \
(u32)(typeof((x)-(x)))(x)); \
break; \
case 8: \
__x = (typeof(__x))(typeof(__x-__x))atomic64_xchg( \
(atomic64_t *)(ptr), \
(u64)(typeof((x)-(x)))(x)); \
break; \
default: \
__xchg_called_with_bad_pointer(); \
} \
__x; \
})

#define cmpxchg(ptr, o, n) \
({ \
typeof(*(ptr)) __x; \
switch (sizeof(*(ptr))) { \
case 4: \
__x = (typeof(__x))(typeof(__x-__x))atomic_cmpxchg( \
(atomic_t *)(ptr), \
(u32)(typeof((o)-(o)))(o), \
(u32)(typeof((n)-(n)))(n)); \
break; \
case 8: \
__x = (typeof(__x))(typeof(__x-__x))atomic64_cmpxchg( \
(atomic64_t *)(ptr), \
(u64)(typeof((o)-(o)))(o), \
(u64)(typeof((n)-(n)))(n)); \
break; \
default: \
__cmpxchg_called_with_bad_pointer(); \
} \
__x; \
})

#define tas(ptr) (xchg((ptr), 1))

#endif /* __ASSEMBLY__ */

#ifndef __tilegx__
Expand Down
2 changes: 1 addition & 1 deletion arch/tile/include/asm/atomic_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ static inline u64 atomic64_add_return(u64 i, atomic64_t *v)
* @u: ...unless v is equal to u.
*
* Atomically adds @a to @v, so long as @v was not already @u.
* Returns the old value of @v.
* Returns non-zero if @v was not @u, and zero otherwise.
*/
static inline u64 atomic64_add_unless(atomic64_t *v, u64 a, u64 u)
{
Expand Down
8 changes: 4 additions & 4 deletions arch/tile/include/asm/bitops_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ static inline void clear_bit(unsigned nr, volatile unsigned long *addr)

static inline void change_bit(unsigned nr, volatile unsigned long *addr)
{
unsigned long old, mask = (1UL << (nr % BITS_PER_LONG));
long guess, oldval;
unsigned long mask = (1UL << (nr % BITS_PER_LONG));
unsigned long guess, oldval;
addr += nr / BITS_PER_LONG;
old = *addr;
oldval = *addr;
do {
guess = oldval;
oldval = atomic64_cmpxchg((atomic64_t *)addr,
Expand Down Expand Up @@ -85,7 +85,7 @@ static inline int test_and_change_bit(unsigned nr,
volatile unsigned long *addr)
{
unsigned long mask = (1UL << (nr % BITS_PER_LONG));
long guess, oldval = *addr;
unsigned long guess, oldval;
addr += nr / BITS_PER_LONG;
oldval = *addr;
do {
Expand Down
73 changes: 73 additions & 0 deletions arch/tile/include/asm/cmpxchg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* cmpxchg.h -- forked from asm/atomic.h with this copyright:
*
* Copyright 2010 Tilera Corporation. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, version 2.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
* NON INFRINGEMENT. See the GNU General Public License for
* more details.
*
*/

#ifndef _ASM_TILE_CMPXCHG_H
#define _ASM_TILE_CMPXCHG_H

#ifndef __ASSEMBLY__

/* Nonexistent functions intended to cause link errors. */
extern unsigned long __xchg_called_with_bad_pointer(void);
extern unsigned long __cmpxchg_called_with_bad_pointer(void);

#define xchg(ptr, x) \
({ \
typeof(*(ptr)) __x; \
switch (sizeof(*(ptr))) { \
case 4: \
__x = (typeof(__x))(typeof(__x-__x))atomic_xchg( \
(atomic_t *)(ptr), \
(u32)(typeof((x)-(x)))(x)); \
break; \
case 8: \
__x = (typeof(__x))(typeof(__x-__x))atomic64_xchg( \
(atomic64_t *)(ptr), \
(u64)(typeof((x)-(x)))(x)); \
break; \
default: \
__xchg_called_with_bad_pointer(); \
} \
__x; \
})

#define cmpxchg(ptr, o, n) \
({ \
typeof(*(ptr)) __x; \
switch (sizeof(*(ptr))) { \
case 4: \
__x = (typeof(__x))(typeof(__x-__x))atomic_cmpxchg( \
(atomic_t *)(ptr), \
(u32)(typeof((o)-(o)))(o), \
(u32)(typeof((n)-(n)))(n)); \
break; \
case 8: \
__x = (typeof(__x))(typeof(__x-__x))atomic64_cmpxchg( \
(atomic64_t *)(ptr), \
(u64)(typeof((o)-(o)))(o), \
(u64)(typeof((n)-(n)))(n)); \
break; \
default: \
__cmpxchg_called_with_bad_pointer(); \
} \
__x; \
})

#define tas(ptr) (xchg((ptr), 1))

#endif /* __ASSEMBLY__ */

#endif /* _ASM_TILE_CMPXCHG_H */
2 changes: 1 addition & 1 deletion arch/tile/include/asm/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#define NR_IRQS 32

/* IRQ numbers used for linux IPIs. */
#define IRQ_RESCHEDULE 1
#define IRQ_RESCHEDULE 0

#define irq_canonicalize(irq) (irq)

Expand Down
2 changes: 1 addition & 1 deletion arch/tile/include/asm/spinlock_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ static inline void arch_read_unlock(arch_rwlock_t *rw)
static inline void arch_write_unlock(arch_rwlock_t *rw)
{
__insn_mf();
rw->lock = 0;
__insn_exch4(&rw->lock, 0); /* Avoid waiting in the write buffer. */
}

static inline int arch_read_trylock(arch_rwlock_t *rw)
Expand Down
1 change: 0 additions & 1 deletion arch/tile/include/asm/stack.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
struct KBacktraceIterator {
BacktraceIterator it;
struct task_struct *task; /* task we are backtracing */
pte_t *pgtable; /* page table for user space access */
int end; /* iteration complete. */
int new_context; /* new context is starting */
int profile; /* profiling, so stop on async intrpt */
Expand Down
6 changes: 5 additions & 1 deletion arch/tile/include/asm/traps.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ void do_breakpoint(struct pt_regs *, int fault_num);


#ifdef __tilegx__
/* kernel/single_step.c */
void gx_singlestep_handle(struct pt_regs *, int fault_num);

/* kernel/intvec_64.S */
void fill_ra_stack(void);
#endif

#endif /* _ASM_TILE_SYSCALLS_H */
#endif /* _ASM_TILE_TRAPS_H */
2 changes: 2 additions & 0 deletions arch/tile/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ STD_ENTRY(cpu_idle_on_new_stack)
/* Loop forever on a nap during SMP boot. */
STD_ENTRY(smp_nap)
nap
nop /* avoid provoking the icache prefetch with a jump */
j smp_nap /* we are not architecturally guaranteed not to exit nap */
jrp lr /* clue in the backtracer */
STD_ENDPROC(smp_nap)
Expand All @@ -105,5 +106,6 @@ STD_ENTRY(_cpu_idle)
.global _cpu_idle_nap
_cpu_idle_nap:
nap
nop /* avoid provoking the icache prefetch with a jump */
jrp lr
STD_ENDPROC(_cpu_idle)
Loading

0 comments on commit 4157368

Please sign in to comment.