1. 20 2月, 2011 5 次提交
    • L
      USB: Reset USB 3.0 devices on (re)discovery · 07194ab7
      Luben Tuikov 提交于
      If the device isn't reset, the XHCI HCD sends
      SET ADDRESS to address 0 while the device is
      already in Addressed state, and the request is
      dropped on the floor as it is addressed to the
      default address. This sequence of events, which this
      patch fixes looks like this:
      
      usb_reset_and_verify_device()
      	hub_port_init()
      		hub_set_address()
      			SET_ADDRESS to 0 with 1
      		usb_get_device_descriptor(udev, 8)
      		usb_get_device_descriptor(udev, 18)
      	descriptors_changed() --> goto re_enumerate:
      		hub_port_logical_disconnect()
      			kick_khubd()
      
      And then:
      
      hub_events()
      	hub_port_connect_change()
      		usb_disconnect()
      			usb_disable_device()
      		new device struct
      		sets device state to Powered
      		choose_address()
      		hub_port_init() <-- no reset, but SET ADDRESS to 0 with 1, timeout!
      
      The solution is to always reset the device in
      hub_port_init() to put it in a known state.
      
      Note from Sarah Sharp:
      
      This patch should be queued for stable trees all the way back to 2.6.34,
      since that was the first kernel that supported configured device reset.
      The code this patch touches has been there since 2.6.32, but the bug
      would never be hit before 2.6.34 because the xHCI driver would
      completely reject an attempt to reset a configured device under xHCI.
      Signed-off-by: NLuben Tuikov <ltuikov@yahoo.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@kernel.org
      07194ab7
    • P
      xhci: Fix an error in count_sg_trbs_needed() · bcd2fde0
      Paul Zimmerman 提交于
      The expression
      
      	while (running_total < sg_dma_len(sg))
      
      does not take into account that the remaining data length can be less
      than sg_dma_len(sg). In that case, running_total can end up being
      greater than the total data length, so an extra TRB is counted.
      Changing the expression to
      
      	while (running_total < sg_dma_len(sg) && running_total < temp)
      
      fixes that.
      
      This patch should be queued for stable kernels back to 2.6.31.
      Signed-off-by: NPaul Zimmerman <paulz@synopsys.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@kernel.org
      bcd2fde0
    • P
      xhci: Fix errors in the running total calculations in the TRB math · 5807795b
      Paul Zimmerman 提交于
      Calculations like
      
      	running_total = TRB_MAX_BUFF_SIZE -
      		(sg_dma_address(sg) & (TRB_MAX_BUFF_SIZE - 1));
      	if (running_total != 0)
      		num_trbs++;
      
      are incorrect, because running_total can never be zero, so the if()
      expression will never be true. I think the intention was that
      running_total be in the range of 0 to TRB_MAX_BUFF_SIZE-1, not 1
      to TRB_MAX_BUFF_SIZE. So adding a
      
      	running_total &= TRB_MAX_BUFF_SIZE - 1;
      
      fixes the problem.
      
      This patch should be queued for stable kernels back to 2.6.31.
      Signed-off-by: NPaul Zimmerman <paulz@synopsys.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@kernel.org
      5807795b
    • P
      xhci: Clarify some expressions in the TRB math · a2490187
      Paul Zimmerman 提交于
      This makes it easier to spot some problems, which will be fixed by the
      next patch in the series. Also change dev_dbg to dev_err in
      check_trb_math(), so any math errors will be visible even when running
      with debug disabled.
      
      Note: This patch changes the expressions containing
      "((1 << TRB_MAX_BUFF_SHIFT) - 1)" to use the equivalent
      "(TRB_MAX_BUFF_SIZE - 1)". No change in behavior is intended for
      those expressions.
      
      This patch should be queued for stable kernels back to 2.6.31.
      Signed-off-by: NPaul Zimmerman <paulz@synopsys.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@kernel.org
      a2490187
    • P
      xhci: Avoid BUG() in interrupt context · 68e41c5d
      Paul Zimmerman 提交于
      Change the BUGs in xhci_find_new_dequeue_state() to WARN_ONs, to avoid
      bringing down the box if one of them is hit
      
      This patch should be queued for stable kernels back to 2.6.31.
      Signed-off-by: NPaul Zimmerman <paulz@synopsys.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@kernel.org
      68e41c5d
  2. 18 2月, 2011 9 次提交
    • G
      Revert "USB: Reset USB 3.0 devices on (re)discovery" · 9ce4f80f
      Greg Kroah-Hartman 提交于
      This reverts commit 637d11bf.  Sarah
      wants to tweak it some more before it's applied to the tree.
      
      Cc: Luben Tuikov <ltuikov@yahoo.com>
      Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9ce4f80f
    • G
      Merge branch 'for-greg' of git://gitorious.org/usb/usb into usb-linus · dd305ad4
      Greg Kroah-Hartman 提交于
      * 'for-greg' of git://gitorious.org/usb/usb:
        usb: musb: omap2430: fix kernel panic on reboot
        usb: musb: fix build breakage
      dd305ad4
    • J
      USB: musb: omap2430: fix kernel panic on reboot · 19b9a83e
      Johan Hovold 提交于
      Cancel idle timer in musb_platform_exit.
      
      The idle timer could trigger after clock had been disabled leading to
      kernel panic when MUSB_DEVCTL is accessed in musb_do_idle on 2.6.37.
      
      The fault below is no longer triggered on 2.6.38-rc4 (clock is disabled
      later, and only if compiled as a module, and the offending memory access
      has moved) but the timer should be cancelled nonetheless.
      
      Rebooting... musb_hdrc musb_hdrc: remove, state 4
      usb usb1: USB disconnect, address 1
      musb_hdrc musb_hdrc: USB bus 1 deregistered
      Unhandled fault: external abort on non-linefetch (0x1028) at 0xfa0ab060
      Internal error: : 1028 [#1] PREEMPT
      last sysfs file: /sys/kernel/uevent_seqnum
      Modules linked in:
      CPU: 0    Not tainted  (2.6.37+ #6)
      PC is at musb_do_idle+0x24/0x138
      LR is at musb_do_idle+0x18/0x138
      pc : [<c02377d8>]    lr : [<c02377cc>]    psr: 80000193
      sp : cf2bdd80  ip : cf2bdd80  fp : c048a20c
      r10: c048a60c  r9 : c048a40c  r8 : cf85e110
      r7 : cf2bc000  r6 : 40000113  r5 : c0489800  r4 : cf85e110
      r3 : 00000004  r2 : 00000006  r1 : fa0ab000  r0 : cf8a7000
      Flags: Nzcv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
      Control: 10c5387d  Table: 8faac019  DAC: 00000015
      Process reboot (pid: 769, stack limit = 0xcf2bc2f0)
      Stack: (0xcf2bdd80 to 0xcf2be000)
      dd80: 00000103 c0489800 c02377b4 c005fa34 00000555 c0071a8c c04a3858 cf2bdda8
      dda0: 00000555 c048a00c cf2bdda8 cf2bdda8 1838beb0 00000103 00000004 cf2bc000
      ddc0: 00000001 00000001 c04896c8 0000000a 00000000 c005ac14 00000001 c003f32c
      dde0: 00000000 00000025 00000000 cf2bc000 00000002 00000001 cf2bc000 00000000
      de00: 00000001 c005ad08 cf2bc000 c002e07c c03ec039 ffffffff fa200000 c0033608
      de20: 00000001 00000000 cf852c14 cf81f200 c045b714 c045b708 cf2bc000 c04a37e8
      de40: c0033c04 cf2bc000 00000000 00000001 cf2bde68 cf2bde68 c01c3abc c004f7d8
      de60: 60000013 ffffffff c0033c04 00000000 01234567 fee1dead 00000000 c006627c
      de80: 00000001 c00662c8 28121969 c00663ec cfa38c40 cf9f6a00 cf2bded0 cf9f6a0c
      dea0: 00000000 cf92f000 00008914 c02cd284 c04a55c8 c028b398 c00715c0 becf24a8
      dec0: 30687465 00000000 00000000 00000000 00000002 1301a8c0 00000000 00000000
      dee0: 00000002 1301a8c0 00000000 00000000 c0450494 cf527920 00011f10 cf2bdf08
      df00: 00011f10 cf2bdf10 00011f10 cf2bdf18 c00f0b44 c004f7e8 cf2bdf18 cf2bdf18
      df20: 00011f10 cf2bdf30 00011f10 cf2bdf38 cf401300 cf486100 00000008 c00d2b28
      df40: 00011f10 cf401300 00200200 c00d3388 00011f10 cfb63a88 cfb63a80 c00c2f08
      df60: 00000000 00000000 cfb63a80 00000000 cf0a3480 00000006 c0033c04 cfb63a80
      df80: 00000000 c00c0104 00000003 cf0a3480 cfb63a80 00000000 00000001 00000004
      dfa0: 00000058 c0033a80 00000000 00000001 fee1dead 28121969 01234567 00000000
      dfc0: 00000000 00000001 00000004 00000058 00000001 00000001 00000000 00000001
      dfe0: 4024d200 becf2cb0 00009210 4024d218 60000010 fee1dead 00000000 00000000
      [<c02377d8>] (musb_do_idle+0x24/0x138) from [<c005fa34>] (run_timer_softirq+0x1a8/0x26)
      [<c005fa34>] (run_timer_softirq+0x1a8/0x26c) from [<c005ac14>] (__do_softirq+0x88/0x13)
      [<c005ac14>] (__do_softirq+0x88/0x138) from [<c005ad08>] (irq_exit+0x44/0x98)
      [<c005ad08>] (irq_exit+0x44/0x98) from [<c002e07c>] (asm_do_IRQ+0x7c/0xa0)
      [<c002e07c>] (asm_do_IRQ+0x7c/0xa0) from [<c0033608>] (__irq_svc+0x48/0xa8)
      Exception stack(0xcf2bde20 to 0xcf2bde68)
      de20: 00000001 00000000 cf852c14 cf81f200 c045b714 c045b708 cf2bc000 c04a37e8
      de40: c0033c04 cf2bc000 00000000 00000001 cf2bde68 cf2bde68 c01c3abc c004f7d8
      de60: 60000013 ffffffff
      [<c0033608>] (__irq_svc+0x48/0xa8) from [<c004f7d8>] (sub_preempt_count+0x0/0xb8)
      Code: ebf86030 e5940098 e594108c e5902010 (e5d13060)
      ---[ end trace 3689c0d808f9bf7c ]---
      Kernel panic - not syncing: Fatal exception in interrupt
      
      Cc: stable <stable@kernel.org>
      Signed-off-by: NJohan Hovold <jhovold@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      19b9a83e
    • J
      sierra: add new ID for Airprime/Sierra USB IP modem · e1dc5157
      Jon Thomas 提交于
      I picked up a new Sierra usb 308 (At&t Shockwave) on 2/2011 and the vendor code
      is 0x0f3d
      
      Looking up vendor and product id's I see:
      
      0f3d  Airprime, Incorporated
       0112  CDMA 1xEVDO PC Card, PC 5220
      
      Sierra and Airprime are somehow related and I'm guessing the At&t usb 308 might
      be have some common hardware with the AirPrime SL809x.
      Signed-off-by: NJon Thomas <jthomas@redhat.com>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e1dc5157
    • J
      USB: serial/usb_wwan, fix tty NULL dereference · 38237fd2
      Jiri Slaby 提交于
      tty_port_tty_get may return without any problems NULL. Handle this
      case and do not oops in usb_wwan_indat_callback by dereferencing it.
      
      The oops:
      Unable to handle kernel paging request for data at address 0x000000d8
      Faulting instruction address: 0xc0175b3c
      Oops: Kernel access of bad area, sig: 11 [#1]
      PowerPC 40x Platform
      last sysfs file:
      /sys/devices/pci0000:00/0000:00:00.0/0000:01:00.0/0000:02:09.2/usb1/idVendor
      Modules linked in:
      NIP: c0175b3c LR: c0175e7c CTR: c0215c90
      REGS: c77f7d50 TRAP: 0300   Not tainted  (2.6.37-rc5)
      MSR: 00021030 <ME,CE,IR,DR>  CR: 88482028  XER: 2000005f
      DEAR: 000000d8, ESR: 00000000
      TASK = c7141b90[1149] 'wvdial' THREAD: c2750000
      GPR00: 00021030 c77f7e00 c7141b90 00000000 0000000e 00000000 0000000e c0410680
      GPR08: c683db00 00000000 00000001 c03c81f8 88482028 10073ef4 ffffffb9 ffffff94
      GPR16: 00000000 fde036c0 00200200 00100100 00000001 ffffff8d c34fabcc 00000000
      GPR24: c71120d4 00000000 00000000 0000000e 00021030 00000000 00000000 0000000e
      NIP [c0175b3c] tty_buffer_request_room+0x2c/0x194
      LR [c0175e7c] tty_insert_flip_string_fixed_flag+0x3c/0xb0
      Call Trace:
      [c77f7e00] [00000003] 0x3 (unreliable)
      [c77f7e30] [c0175e7c] tty_insert_flip_string_fixed_flag+0x3c/0xb0
      [c77f7e60] [c0215df4] usb_wwan_indat_callback+0x164/0x170
      ...
      
      References: https://bugzilla.kernel.org/show_bug.cgi?id=24582
      Cc: Amit Shah <amitshah@gmx.net>
      Cc: baoyb <baoyb@avit.org.cn>
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      38237fd2
    • L
      USB: Reset USB 3.0 devices on (re)discovery · 637d11bf
      Luben Tuikov 提交于
      If the device isn't reset, the XHCI HCD sends
      SET ADDRESS to address 0 while the device is
      already in Addressed state, and the request is
      dropped on the floor as it is addressed to the
      default address. This sequence of events, which this
      patch fixes looks like this:
      
      usb_reset_and_verify_device()
      	hub_port_init()
      		hub_set_address()
      			SET_ADDRESS to 0 with 1
      		usb_get_device_descriptor(udev, 8)
      		usb_get_device_descriptor(udev, 18)
      	descriptors_changed() --> goto re_enumerate:
      		hub_port_logical_disconnect()
      			kick_khubd()
      
      And then:
      
      hub_events()
      	hub_port_connect_change()
      		usb_disconnect()
      			usb_disable_device()
      		new device struct
      		sets device state to Powered
      		choose_address()
      		hub_port_init() <-- no reset, but SET ADDRESS to 0 with 1, timeout!
      
      The solution is to always reset the device in
      hub_port_init() to put it in a known state.
      Signed-off-by: NLuben Tuikov <ltuikov@yahoo.com>
      Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      637d11bf
    • M
      USB: Add quirk for Samsung Android phone modem · 72a012ce
      Maciej Szmigiero 提交于
      My Galaxy Spica needs this quirk when in modem mode, otherwise
      it causes endless USB bus resets and is unusable in this mode.
      
      Unfortunately Samsung decided to reuse ID of its old CDMA phone SGH-I500
      for the modem part.
      That's why in addition to this patch the visor driver must be prevented
      from binding to SPH-I500 ID, so ACM driver can do that.
      Signed-off-by: NMaciej Szmigiero <mhej@o2.pl>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      72a012ce
    • M
      USB: Add Samsung SGH-I500/Android modem ID switch to visor driver · acb52cb1
      Maciej Szmigiero 提交于
      [USB]Add Samsung SGH-I500/Android modem ID switch to visor driver
      
      Samsung decided to reuse USB ID of its old CDMA phone SGH-I500 for the
      modem part of some of their Android phones. At least Galaxy Spica
      is affected.
      
      This modem needs ACM driver and does not work with visor driver which
      binds the conflicting ID for SGH-I500.
      Because SGH-I500 is pretty an old hardware its best to add switch to
      visor
      driver in cause somebody still wants to use that phone with Linux.
      
      Note that this is needed only when using the Android phone as modem,
      not in USB storage or ADB mode.
      Signed-off-by: NMaciej Szmigiero <mhej@o2.pl>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      acb52cb1
    • A
      USB: add quirks entry for Keytouch QWERTY Panel · 3c18e30f
      Alan Stern 提交于
      This patch (as1448) adds a quirks entry for the Keytouch QWERTY Panel
      firmware, used in the IEC 60945 keyboard.  This device crashes during
      enumeration when the computer asks for its configuration string
      descriptor.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested-by: Nkholis <nur.kholis.majid@gmail.com>
      CC: <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      3c18e30f
  3. 17 2月, 2011 2 次提交
    • J
      usb: musb: omap2430: fix kernel panic on reboot · b193b412
      Johan Hovold 提交于
      Cancel idle timer in musb_platform_exit.
      
      The idle timer could trigger after clock had been disabled leading to
      kernel panic when MUSB_DEVCTL is accessed in musb_do_idle on 2.6.37.
      
      The fault below is no longer triggered on 2.6.38-rc4 (clock is disabled
      later, and only if compiled as a module, and the offending memory access
      has moved) but the timer should be cancelled nonetheless.
      
      Rebooting... musb_hdrc musb_hdrc: remove, state 4
      usb usb1: USB disconnect, address 1
      musb_hdrc musb_hdrc: USB bus 1 deregistered
      Unhandled fault: external abort on non-linefetch (0x1028) at 0xfa0ab060
      Internal error: : 1028 [#1] PREEMPT
      last sysfs file: /sys/kernel/uevent_seqnum
      Modules linked in:
      CPU: 0    Not tainted  (2.6.37+ #6)
      PC is at musb_do_idle+0x24/0x138
      LR is at musb_do_idle+0x18/0x138
      pc : [<c02377d8>]    lr : [<c02377cc>]    psr: 80000193
      sp : cf2bdd80  ip : cf2bdd80  fp : c048a20c
      r10: c048a60c  r9 : c048a40c  r8 : cf85e110
      r7 : cf2bc000  r6 : 40000113  r5 : c0489800  r4 : cf85e110
      r3 : 00000004  r2 : 00000006  r1 : fa0ab000  r0 : cf8a7000
      Flags: Nzcv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
      Control: 10c5387d  Table: 8faac019  DAC: 00000015
      Process reboot (pid: 769, stack limit = 0xcf2bc2f0)
      Stack: (0xcf2bdd80 to 0xcf2be000)
      dd80: 00000103 c0489800 c02377b4 c005fa34 00000555 c0071a8c c04a3858 cf2bdda8
      dda0: 00000555 c048a00c cf2bdda8 cf2bdda8 1838beb0 00000103 00000004 cf2bc000
      ddc0: 00000001 00000001 c04896c8 0000000a 00000000 c005ac14 00000001 c003f32c
      dde0: 00000000 00000025 00000000 cf2bc000 00000002 00000001 cf2bc000 00000000
      de00: 00000001 c005ad08 cf2bc000 c002e07c c03ec039 ffffffff fa200000 c0033608
      de20: 00000001 00000000 cf852c14 cf81f200 c045b714 c045b708 cf2bc000 c04a37e8
      de40: c0033c04 cf2bc000 00000000 00000001 cf2bde68 cf2bde68 c01c3abc c004f7d8
      de60: 60000013 ffffffff c0033c04 00000000 01234567 fee1dead 00000000 c006627c
      de80: 00000001 c00662c8 28121969 c00663ec cfa38c40 cf9f6a00 cf2bded0 cf9f6a0c
      dea0: 00000000 cf92f000 00008914 c02cd284 c04a55c8 c028b398 c00715c0 becf24a8
      dec0: 30687465 00000000 00000000 00000000 00000002 1301a8c0 00000000 00000000
      dee0: 00000002 1301a8c0 00000000 00000000 c0450494 cf527920 00011f10 cf2bdf08
      df00: 00011f10 cf2bdf10 00011f10 cf2bdf18 c00f0b44 c004f7e8 cf2bdf18 cf2bdf18
      df20: 00011f10 cf2bdf30 00011f10 cf2bdf38 cf401300 cf486100 00000008 c00d2b28
      df40: 00011f10 cf401300 00200200 c00d3388 00011f10 cfb63a88 cfb63a80 c00c2f08
      df60: 00000000 00000000 cfb63a80 00000000 cf0a3480 00000006 c0033c04 cfb63a80
      df80: 00000000 c00c0104 00000003 cf0a3480 cfb63a80 00000000 00000001 00000004
      dfa0: 00000058 c0033a80 00000000 00000001 fee1dead 28121969 01234567 00000000
      dfc0: 00000000 00000001 00000004 00000058 00000001 00000001 00000000 00000001
      dfe0: 4024d200 becf2cb0 00009210 4024d218 60000010 fee1dead 00000000 00000000
      [<c02377d8>] (musb_do_idle+0x24/0x138) from [<c005fa34>] (run_timer_softirq+0x1a8/0x26)
      [<c005fa34>] (run_timer_softirq+0x1a8/0x26c) from [<c005ac14>] (__do_softirq+0x88/0x13)
      [<c005ac14>] (__do_softirq+0x88/0x138) from [<c005ad08>] (irq_exit+0x44/0x98)
      [<c005ad08>] (irq_exit+0x44/0x98) from [<c002e07c>] (asm_do_IRQ+0x7c/0xa0)
      [<c002e07c>] (asm_do_IRQ+0x7c/0xa0) from [<c0033608>] (__irq_svc+0x48/0xa8)
      Exception stack(0xcf2bde20 to 0xcf2bde68)
      de20: 00000001 00000000 cf852c14 cf81f200 c045b714 c045b708 cf2bc000 c04a37e8
      de40: c0033c04 cf2bc000 00000000 00000001 cf2bde68 cf2bde68 c01c3abc c004f7d8
      de60: 60000013 ffffffff
      [<c0033608>] (__irq_svc+0x48/0xa8) from [<c004f7d8>] (sub_preempt_count+0x0/0xb8)
      Code: ebf86030 e5940098 e594108c e5902010 (e5d13060)
      ---[ end trace 3689c0d808f9bf7c ]---
      Kernel panic - not syncing: Fatal exception in interrupt
      
      Cc: stable@kernel.org
      Signed-off-by: NJohan Hovold <jhovold@gmail.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      b193b412
    • F
      usb: musb: fix build breakage · 5990378b
      Felipe Balbi 提交于
      commit 06624818
      (usb: musb: disable double buffering when it's broken),
      introduced a compile error when gadget API is disabled.
      
      Fix it.
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      5990378b
  4. 16 2月, 2011 23 次提交
  5. 15 2月, 2011 1 次提交