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 132 mov #1, r5 133 133 134 134 call_handle_tlbmiss: 135 - setup_frame_reg 136 135 mov.l 1f, r0 137 136 mov r5, r8 138 137 mov.l @r0, r6 ··· 364 365 mov.l @k2, k2 ! read out vector and keep in k2 365 366 366 367 handle_exception_special: 368 + setup_frame_reg 369 + 367 370 ! Setup return address and jump to exception handler 368 371 mov.l 7f, r9 ! fetch return address 369 372 stc r2_bank, r0 ! k2 (vector)
+20
arch/sh/kernel/dwarf.c
··· 540 540 mempool_free(frame, dwarf_frame_pool); 541 541 } 542 542 543 + extern void ret_from_irq(void); 544 + 543 545 /** 544 546 * dwarf_unwind_stack - unwind the stack 545 547 * ··· 679 677 680 678 addr = frame->cfa + reg->addr; 681 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; 682 698 683 699 return frame; 684 700
+7 -1
arch/sh/kernel/entry-common.S
··· 70 70 CFI_STARTPROC simple 71 71 CFI_DEF_CFA r14, 0 72 72 CFI_REL_OFFSET 17, 64 73 - CFI_REL_OFFSET 15, 0 73 + CFI_REL_OFFSET 15, 60 74 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 75 81 preempt_stop() 76 82 ENTRY(ret_from_irq) 77 83 !
+29 -12
drivers/usb/host/r8a66597-hcd.c
··· 35 35 #include <linux/usb.h> 36 36 #include <linux/platform_device.h> 37 37 #include <linux/io.h> 38 + #include <linux/mm.h> 38 39 #include <linux/irq.h> 40 + #include <asm/cacheflush.h> 39 41 40 42 #include "../core/hcd.h" 41 43 #include "r8a66597.h" ··· 822 820 enable_r8a66597_pipe_dma(r8a66597, dev, pipe, urb); 823 821 } 824 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 + 825 843 /* this function must be called with interrupt disabled */ 826 844 static void force_dequeue(struct r8a66597 *r8a66597, u16 pipenum, u16 address) 827 845 { ··· 860 838 list_del(&td->queue); 861 839 kfree(td); 862 840 863 - if (urb) { 864 - usb_hcd_unlink_urb_from_ep(r8a66597_to_hcd(r8a66597), 865 - urb); 841 + if (urb) 842 + r8a66597_urb_done(r8a66597, urb, -ENODEV); 866 843 867 - spin_unlock(&r8a66597->lock); 868 - usb_hcd_giveback_urb(r8a66597_to_hcd(r8a66597), urb, 869 - -ENODEV); 870 - spin_lock(&r8a66597->lock); 871 - } 872 844 break; 873 845 } 874 846 } ··· 1022 1006 /* this function must be called with interrupt disabled */ 1023 1007 static void r8a66597_check_syssts(struct r8a66597 *r8a66597, int port, 1024 1008 u16 syssts) 1009 + __releases(r8a66597->lock) 1010 + __acquires(r8a66597->lock) 1025 1011 { 1026 1012 if (syssts == SE0) { 1027 1013 r8a66597_write(r8a66597, ~ATTCH, get_intsts_reg(port)); ··· 1041 1023 usb_hcd_resume_root_hub(r8a66597_to_hcd(r8a66597)); 1042 1024 } 1043 1025 1026 + spin_unlock(&r8a66597->lock); 1044 1027 usb_hcd_poll_rh_status(r8a66597_to_hcd(r8a66597)); 1028 + spin_lock(&r8a66597->lock); 1045 1029 } 1046 1030 1047 1031 /* this function must be called with interrupt disabled */ ··· 1303 1283 if (usb_pipeisoc(urb->pipe)) 1304 1284 urb->start_frame = r8a66597_get_frame(hcd); 1305 1285 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); 1286 + r8a66597_urb_done(r8a66597, urb, status); 1310 1287 } 1311 1288 1312 1289 if (restart) {