Merge branch 'sh/for-2.6.33' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6

* 'sh/for-2.6.33' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
sh: Remove superfluous setup_frame_reg call
sh: Don't continue unwinding across interrupts
sh: Setup frame pointer in handle_exception path
sh: Correct the offset of the return address in ret_from_exception
usb: r8a66597-hcd: Fix up spinlock recursion in root hub polling.
usb: r8a66597-hcd: Flush the D-cache for the pipe-in transfer buffers.

+58 -14
+2 -1
arch/sh/kernel/cpu/sh3/entry.S
··· 132 mov #1, r5 133 134 call_handle_tlbmiss: 135 - setup_frame_reg 136 mov.l 1f, r0 137 mov r5, r8 138 mov.l @r0, r6 ··· 364 mov.l @k2, k2 ! read out vector and keep in k2 365 366 handle_exception_special: 367 ! Setup return address and jump to exception handler 368 mov.l 7f, r9 ! fetch return address 369 stc r2_bank, r0 ! k2 (vector)
··· 132 mov #1, r5 133 134 call_handle_tlbmiss: 135 mov.l 1f, r0 136 mov r5, r8 137 mov.l @r0, r6 ··· 365 mov.l @k2, k2 ! read out vector and keep in k2 366 367 handle_exception_special: 368 + setup_frame_reg 369 + 370 ! Setup return address and jump to exception handler 371 mov.l 7f, r9 ! fetch return address 372 stc r2_bank, r0 ! k2 (vector)
+20
arch/sh/kernel/dwarf.c
··· 540 mempool_free(frame, dwarf_frame_pool); 541 } 542 543 /** 544 * dwarf_unwind_stack - unwind the stack 545 * ··· 679 680 addr = frame->cfa + reg->addr; 681 frame->return_addr = __raw_readl(addr); 682 683 return frame; 684
··· 540 mempool_free(frame, dwarf_frame_pool); 541 } 542 543 + extern void ret_from_irq(void); 544 + 545 /** 546 * dwarf_unwind_stack - unwind the stack 547 * ··· 677 678 addr = frame->cfa + reg->addr; 679 frame->return_addr = __raw_readl(addr); 680 + 681 + /* 682 + * Ah, the joys of unwinding through interrupts. 683 + * 684 + * Interrupts are tricky - the DWARF info needs to be _really_ 685 + * accurate and unfortunately I'm seeing a lot of bogus DWARF 686 + * info. For example, I've seen interrupts occur in epilogues 687 + * just after the frame pointer (r14) had been restored. The 688 + * problem was that the DWARF info claimed that the CFA could be 689 + * reached by using the value of the frame pointer before it was 690 + * restored. 691 + * 692 + * So until the compiler can be trusted to produce reliable 693 + * DWARF info when it really matters, let's stop unwinding once 694 + * we've calculated the function that was interrupted. 695 + */ 696 + if (prev && prev->pc == (unsigned long)ret_from_irq) 697 + frame->return_addr = 0; 698 699 return frame; 700
+7 -1
arch/sh/kernel/entry-common.S
··· 70 CFI_STARTPROC simple 71 CFI_DEF_CFA r14, 0 72 CFI_REL_OFFSET 17, 64 73 - CFI_REL_OFFSET 15, 0 74 CFI_REL_OFFSET 14, 56 75 preempt_stop() 76 ENTRY(ret_from_irq) 77 !
··· 70 CFI_STARTPROC simple 71 CFI_DEF_CFA r14, 0 72 CFI_REL_OFFSET 17, 64 73 + CFI_REL_OFFSET 15, 60 74 CFI_REL_OFFSET 14, 56 75 + CFI_REL_OFFSET 13, 52 76 + CFI_REL_OFFSET 12, 48 77 + CFI_REL_OFFSET 11, 44 78 + CFI_REL_OFFSET 10, 40 79 + CFI_REL_OFFSET 9, 36 80 + CFI_REL_OFFSET 8, 32 81 preempt_stop() 82 ENTRY(ret_from_irq) 83 !
+29 -12
drivers/usb/host/r8a66597-hcd.c
··· 35 #include <linux/usb.h> 36 #include <linux/platform_device.h> 37 #include <linux/io.h> 38 #include <linux/irq.h> 39 40 #include "../core/hcd.h" 41 #include "r8a66597.h" ··· 822 enable_r8a66597_pipe_dma(r8a66597, dev, pipe, urb); 823 } 824 825 /* this function must be called with interrupt disabled */ 826 static void force_dequeue(struct r8a66597 *r8a66597, u16 pipenum, u16 address) 827 { ··· 860 list_del(&td->queue); 861 kfree(td); 862 863 - if (urb) { 864 - usb_hcd_unlink_urb_from_ep(r8a66597_to_hcd(r8a66597), 865 - urb); 866 867 - spin_unlock(&r8a66597->lock); 868 - usb_hcd_giveback_urb(r8a66597_to_hcd(r8a66597), urb, 869 - -ENODEV); 870 - spin_lock(&r8a66597->lock); 871 - } 872 break; 873 } 874 } ··· 1022 /* this function must be called with interrupt disabled */ 1023 static void r8a66597_check_syssts(struct r8a66597 *r8a66597, int port, 1024 u16 syssts) 1025 { 1026 if (syssts == SE0) { 1027 r8a66597_write(r8a66597, ~ATTCH, get_intsts_reg(port)); ··· 1041 usb_hcd_resume_root_hub(r8a66597_to_hcd(r8a66597)); 1042 } 1043 1044 usb_hcd_poll_rh_status(r8a66597_to_hcd(r8a66597)); 1045 } 1046 1047 /* this function must be called with interrupt disabled */ ··· 1303 if (usb_pipeisoc(urb->pipe)) 1304 urb->start_frame = r8a66597_get_frame(hcd); 1305 1306 - usb_hcd_unlink_urb_from_ep(r8a66597_to_hcd(r8a66597), urb); 1307 - spin_unlock(&r8a66597->lock); 1308 - usb_hcd_giveback_urb(hcd, urb, status); 1309 - spin_lock(&r8a66597->lock); 1310 } 1311 1312 if (restart) {
··· 35 #include <linux/usb.h> 36 #include <linux/platform_device.h> 37 #include <linux/io.h> 38 + #include <linux/mm.h> 39 #include <linux/irq.h> 40 + #include <asm/cacheflush.h> 41 42 #include "../core/hcd.h" 43 #include "r8a66597.h" ··· 820 enable_r8a66597_pipe_dma(r8a66597, dev, pipe, urb); 821 } 822 823 + static void r8a66597_urb_done(struct r8a66597 *r8a66597, struct urb *urb, 824 + int status) 825 + __releases(r8a66597->lock) 826 + __acquires(r8a66597->lock) 827 + { 828 + if (usb_pipein(urb->pipe) && usb_pipetype(urb->pipe) != PIPE_CONTROL) { 829 + void *ptr; 830 + 831 + for (ptr = urb->transfer_buffer; 832 + ptr < urb->transfer_buffer + urb->transfer_buffer_length; 833 + ptr += PAGE_SIZE) 834 + flush_dcache_page(virt_to_page(ptr)); 835 + } 836 + 837 + usb_hcd_unlink_urb_from_ep(r8a66597_to_hcd(r8a66597), urb); 838 + spin_unlock(&r8a66597->lock); 839 + usb_hcd_giveback_urb(r8a66597_to_hcd(r8a66597), urb, status); 840 + spin_lock(&r8a66597->lock); 841 + } 842 + 843 /* this function must be called with interrupt disabled */ 844 static void force_dequeue(struct r8a66597 *r8a66597, u16 pipenum, u16 address) 845 { ··· 838 list_del(&td->queue); 839 kfree(td); 840 841 + if (urb) 842 + r8a66597_urb_done(r8a66597, urb, -ENODEV); 843 844 break; 845 } 846 } ··· 1006 /* this function must be called with interrupt disabled */ 1007 static void r8a66597_check_syssts(struct r8a66597 *r8a66597, int port, 1008 u16 syssts) 1009 + __releases(r8a66597->lock) 1010 + __acquires(r8a66597->lock) 1011 { 1012 if (syssts == SE0) { 1013 r8a66597_write(r8a66597, ~ATTCH, get_intsts_reg(port)); ··· 1023 usb_hcd_resume_root_hub(r8a66597_to_hcd(r8a66597)); 1024 } 1025 1026 + spin_unlock(&r8a66597->lock); 1027 usb_hcd_poll_rh_status(r8a66597_to_hcd(r8a66597)); 1028 + spin_lock(&r8a66597->lock); 1029 } 1030 1031 /* this function must be called with interrupt disabled */ ··· 1283 if (usb_pipeisoc(urb->pipe)) 1284 urb->start_frame = r8a66597_get_frame(hcd); 1285 1286 + r8a66597_urb_done(r8a66597, urb, status); 1287 } 1288 1289 if (restart) {