Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux...
authorPaul Mundt <lethal@linux-sh.org>
Tue, 14 Jun 2011 06:15:49 +0000 (15:15 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Tue, 14 Jun 2011 06:15:49 +0000 (15:15 +0900)
arch/sh/boot/compressed/Makefile
arch/sh/include/asm/cmpxchg-grb.h
arch/sh/mm/cache-debugfs.c
drivers/dma/shdma.c
drivers/sh/clk/core.c

index 780e083..23bc849 100644 (file)
@@ -27,8 +27,6 @@ IMAGE_OFFSET  := $(shell /bin/bash -c 'printf "0x%08x" \
                        $(CONFIG_BOOT_LINK_OFFSET)]')
 endif
 
-LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
-
 ifeq ($(CONFIG_MCOUNT),y)
 ORIG_CFLAGS := $(KBUILD_CFLAGS)
 KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
@@ -37,7 +35,25 @@ endif
 LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(IMAGE_OFFSET) -e startup \
                   -T $(obj)/../../kernel/vmlinux.lds
 
-$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE
+#
+# Pull in the necessary libgcc bits from the in-kernel implementation.
+#
+lib1funcs-$(CONFIG_SUPERH32)   := ashiftrt.S ashldi3.c ashrsi3.S ashlsi3.S \
+                                  lshrsi3.S
+lib1funcs-obj                  := \
+       $(addsuffix .o, $(basename $(addprefix $(obj)/, $(lib1funcs-y))))
+
+lib1funcs-dir          := $(srctree)/arch/$(SRCARCH)/lib
+ifeq ($(BITS),64)
+       lib1funcs-dir   := $(addsuffix $(BITS), $(lib1funcs-dir))
+endif
+
+KBUILD_CFLAGS += -I$(lib1funcs-dir)
+
+$(addprefix $(obj)/,$(lib1funcs-y)): $(obj)/%: $(lib1funcs-dir)/% FORCE
+       $(call cmd,shipped)
+
+$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(lib1funcs-obj) FORCE
        $(call if_changed,ld)
        @:
 
index 4676bf5..f848dec 100644 (file)
@@ -15,8 +15,9 @@ static inline unsigned long xchg_u32(volatile u32 *m, unsigned long val)
                "   mov.l   %2,   @%1     \n\t" /* store new value */
                "1: mov     r1,   r15     \n\t" /* LOGOUT */
                : "=&r" (retval),
-                 "+r"  (m)
-               : "r"   (val)
+                 "+r"  (m),
+                 "+r"  (val)           /* inhibit r15 overloading */
+               :
                : "memory", "r0", "r1");
 
        return retval;
@@ -36,8 +37,9 @@ static inline unsigned long xchg_u8(volatile u8 *m, unsigned long val)
                "   mov.b   %2,   @%1     \n\t" /* store new value */
                "1: mov     r1,   r15     \n\t" /* LOGOUT */
                : "=&r" (retval),
-                 "+r"  (m)
-               : "r"   (val)
+                 "+r"  (m),
+                 "+r"  (val)           /* inhibit r15 overloading */
+               :
                : "memory" , "r0", "r1");
 
        return retval;
@@ -54,13 +56,14 @@ static inline unsigned long __cmpxchg_u32(volatile int *m, unsigned long old,
                "   nop                   \n\t"
                "   mov    r15,   r1      \n\t" /* r1 = saved sp */
                "   mov    #-8,   r15     \n\t" /* LOGIN */
-               "   mov.l  @%1,   %0      \n\t" /* load  old value */
-               "   cmp/eq  %0,   %2      \n\t"
+               "   mov.l  @%3,   %0      \n\t" /* load  old value */
+               "   cmp/eq  %0,   %1      \n\t"
                "   bf            1f      \n\t" /* if not equal */
-               "   mov.l   %3,   @%1     \n\t" /* store new value */
+               "   mov.l   %2,   @%3     \n\t" /* store new value */
                "1: mov     r1,   r15     \n\t" /* LOGOUT */
-               : "=&r" (retval)
-               :  "r"  (m), "r"  (old), "r"  (new)
+               : "=&r" (retval),
+                 "+r"  (old), "+r"  (new) /* old or new can be r15 */
+               :  "r"  (m)
                : "memory" , "r0", "r1", "t");
 
        return retval;
index 5241146..1157251 100644 (file)
@@ -26,9 +26,9 @@ static int cache_seq_show(struct seq_file *file, void *iter)
 {
        unsigned int cache_type = (unsigned int)file->private;
        struct cache_info *cache;
-       unsigned int waysize, way, cache_size;
-       unsigned long ccr, base;
-       static unsigned long addrstart = 0;
+       unsigned int waysize, way;
+       unsigned long ccr;
+       unsigned long addrstart = 0;
 
        /*
         * Go uncached immediately so we don't skew the results any
@@ -45,28 +45,13 @@ static int cache_seq_show(struct seq_file *file, void *iter)
        }
 
        if (cache_type == CACHE_TYPE_DCACHE) {
-               base = CACHE_OC_ADDRESS_ARRAY;
+               addrstart = CACHE_OC_ADDRESS_ARRAY;
                cache = &current_cpu_data.dcache;
        } else {
-               base = CACHE_IC_ADDRESS_ARRAY;
+               addrstart = CACHE_IC_ADDRESS_ARRAY;
                cache = &current_cpu_data.icache;
        }
 
-       /*
-        * Due to the amount of data written out (depending on the cache size),
-        * we may be iterated over multiple times. In this case, keep track of
-        * the entry position in addrstart, and rewind it when we've hit the
-        * end of the cache.
-        *
-        * Likewise, the same code is used for multiple caches, so care must
-        * be taken for bouncing addrstart back and forth so the appropriate
-        * cache is hit.
-        */
-       cache_size = cache->ways * cache->sets * cache->linesz;
-       if (((addrstart & 0xff000000) != base) ||
-            (addrstart & 0x00ffffff) > cache_size)
-               addrstart = base;
-
        waysize = cache->sets;
 
        /*
index 2a638f9..0283300 100644 (file)
@@ -1221,6 +1221,11 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
        } else {
                do {
                        for (i = chanirq_res->start; i <= chanirq_res->end; i++) {
+                               if (irq_cnt >= SH_DMAC_MAX_CHANNELS) {
+                                       irq_cap = 1;
+                                       break;
+                               }
+
                                if ((errirq_res->flags & IORESOURCE_BITS) ==
                                    IORESOURCE_IRQ_SHAREABLE)
                                        chan_flag[irq_cnt] = IRQF_SHARED;
@@ -1230,15 +1235,11 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
                                        "Found IRQ %d for channel %d\n",
                                        i, irq_cnt);
                                chan_irq[irq_cnt++] = i;
-
-                               if (irq_cnt >= SH_DMAC_MAX_CHANNELS)
-                                       break;
                        }
 
-                       if (irq_cnt >= SH_DMAC_MAX_CHANNELS) {
-                               irq_cap = 1;
+                       if (irq_cnt >= SH_DMAC_MAX_CHANNELS)
                                break;
-                       }
+
                        chanirq_res = platform_get_resource(pdev,
                                                IORESOURCE_IRQ, ++irqres);
                } while (irq_cnt < pdata->channel_num && chanirq_res);
index 4f64183..7e9c399 100644 (file)
@@ -635,7 +635,7 @@ static void clks_core_resume(void)
        struct clk *clkp;
 
        list_for_each_entry(clkp, &clock_list, node) {
-               if (likely(clkp->ops)) {
+               if (likely(clkp->usecount && clkp->ops)) {
                        unsigned long rate = clkp->rate;
 
                        if (likely(clkp->ops->set_parent))