1. 24 Jan, 2013 5 commits
    • David Moore's avatar
      usb: Prevent dead ports when xhci is not enabled · 58b2939b
      David Moore authored
      When the xHCI driver is not available, actively switch the ports to EHCI
      mode since some BIOSes leave them in xHCI mode where they would
      otherwise appear dead.  This was discovered on a  Dell Optiplex 7010,
      but it's possible other systems could be affected.
      
      This should be backported to kernels as old as 3.0, that contain the
      commit 69e848c2 "Intel xhci: Support
      EHCI/xHCI port switching."
      Signed-off-by: default avatarDavid Moore <david.moore@gmail.com>
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      58b2939b
    • Alan Stern's avatar
      USB: XHCI: fix memory leak of URB-private data · 48c3375c
      Alan Stern authored
      This patch (as1640) fixes a memory leak in xhci-hcd.  The urb_priv
      data structure isn't always deallocated in the handle_tx_event()
      routine for non-control transfers.  The patch adds a kfree() call so
      that all paths end up freeing the memory properly.
      
      This patch should be backported to kernels as old as 2.6.36, that
      contain the commit 8e51adcc "USB: xHCI:
      Introduce urb_priv structure"
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Reported-and-tested-by: default avatarMartin Mokrejs <mmokrejs@fold.natur.cuni.cz>
      CC: <stable@vger.kernel.org>
      48c3375c
    • Nickolai Zeldovich's avatar
      drivers: xhci: fix incorrect bit test · ba7b5c22
      Nickolai Zeldovich authored
      Fix incorrect bit test that originally showed up in
      4ee823b8 "USB/xHCI: Support
      device-initiated USB 3.0 resume."
      
      Use '&' instead of '&&'.
      
      This should be backported to kernels as old as 3.4.
      Signed-off-by: default avatarNickolai Zeldovich <nickolai@csail.mit.edu>
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      ba7b5c22
    • Sarah Sharp's avatar
      xhci: Fix TD size for isochronous URBs. · f18f8ed2
      Sarah Sharp authored
      To calculate the TD size for a particular TRB in an isoc TD, we need
      know the endpoint's max packet size.  Isochronous endpoints also encode
      the number of additional service opportunities in their wMaxPacketSize
      field.  The TD size calculation did not mask off those bits before using
      the field.  This resulted in incorrect TD size information for
      isochronous TRBs when an URB frame buffer crossed a 64KB boundary.
      
      For example:
       - an isoc endpoint has 2 additional service opportunites and
         a max packet size of 1020 bytes
       - a frame transfer buffer contains 3060 bytes
       - one frame buffer crosses a 64KB boundary, and must be split into
         one 1276 byte TRB, and one 1784 byte TRB.
      
      The TD size is is the number of packets that remain to be transferred
      for a TD after processing all the max packet sized packets in the
      current TRB and all previous TRBs.
      
      For this TD, the number of packets to be transferred is (3060 / 1020),
      or 3.  The first TRB contains 1276 bytes, which means it contains one
      full packet, and a 256 byte remainder.  After processing all the max
      packet-sized packets in the first TRB, the host will have 2 packets left
      to transfer.
      
      The old code would calculate the TD size for the first TRB as:
      
      total packet count = DIV_ROUND_UP (TD length / endpoint wMaxPacketSize)
      total packet count - (first TRB length / endpoint wMaxPacketSize)
      
      The math should have been:
      
      total packet count = DIV_ROUND_UP (3060 / 1020) = 3
      3 - (1276 / 1020) = 2
      
      Since the old code didn't mask off the additional service interval bits
      from the wMaxPacketSize field, the math ended up as
      
      total packet count = DIV_ROUND_UP (3060 / 5116) = 1
      1 - (1276 / 5116) = 1
      
      Fix this by masking off the number of additional service opportunities
      in the wMaxPacketSize field.
      
      This patch should be backported to stable kernels as old as 3.0, that
      contain the commit 4da6e6f2 "xhci 1.0:
      Update TD size field format."  It may not apply well to kernels older
      than 3.2 because of commit 29cc8897
      "USB: use usb_endpoint_maxp() instead of le16_to_cpu()".
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      f18f8ed2
    • Sarah Sharp's avatar
      xhci: Fix isoc TD encoding. · 760973d2
      Sarah Sharp authored
      An isochronous TD is comprised of one isochronous TRB chained to zero or
      more normal TRBs.  Only the isoc TRB has the TBC and TLBPC fields.  The
      normal TRBs must set those fields to zeroes.  The code was setting the
      TBC and TLBPC fields for both isoc and normal TRBs.  Fix this.
      
      This should be backported to stable kernels as old as 3.0, that contain
      the commit b61d378f " xhci 1.0: Set
      transfer burst last packet count field."
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      760973d2
  2. 23 Jan, 2013 1 commit
    • Alan Stern's avatar
      USB: EHCI: fix build error in ehci-mxc · dba63b2f
      Alan Stern authored
      This patch (as1643b) fixes a build error in ehci-hcd when compiling for
      ARM with allmodconfig:
      
      drivers/usb/host/ehci-hcd.c:1285:0: warning: "PLATFORM_DRIVER" redefined [enabled by default]
      drivers/usb/host/ehci-hcd.c:1255:0: note: this is the location of the previous definition
      drivers/usb/host/ehci-mxc.c:280:31: warning: 'ehci_mxc_driver' defined but not used [-Wunused-variable]
      drivers/usb/host/ehci-hcd.c:1285:0: warning: "PLATFORM_DRIVER" redefined [enabled by default]
      drivers/usb/host/ehci-hcd.c:1255:0: note: this is the location of the previous definition
      
      The fix is to convert ehci-mxc over to the new "ehci-hcd is a library"
      scheme so that it can coexist peacefully with the ehci-platform
      driver.  As part of the conversion the ehci_mxc_priv data structure,
      which was allocated dynamically, is now placed where it belongs: in
      the private area at the end of struct ehci_hcd.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Tested-by: default avatarShawn Guo <shawn.guo@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dba63b2f
  3. 22 Jan, 2013 4 commits
  4. 21 Jan, 2013 1 commit
    • Greg Kroah-Hartman's avatar
      Merge tag 'fixes-for-v3.8-rc5' of... · ad2e6329
      Greg Kroah-Hartman authored
      Merge tag 'fixes-for-v3.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus
      
      Felipe writes:
      
        usb: fixes for v3.8-rc5
      
        Finally we have a build fix for fsl-mxc-udc UDC driver.
      
        We also have a fix for ep0 maxburst setting on DWC3
        which could confuse the HW if we tell it we had way
        too many streams on that endpoint when it _has_ to be
        only one.
      
        cppi_dma support for MUSB got a fix when running as a
        module. By dropping the wrong __init annotation, the
        function will be available even when we're modules and
        we're done with .init.text section.
      
        Last, but not least, we have a fix on FunctionFS which
        was causing a bug on our option parsing algorithm.
      ad2e6329
  5. 18 Jan, 2013 10 commits
    • Benoit Goby's avatar
      usb: gadget: FunctionFS: Fix missing braces in parse_opts · b8100750
      Benoit Goby authored
      Add missing braces around an if block in ffs_fs_parse_opts. This broke
      parsing the uid/gid mount options and causes mount to fail when using
      uid/gid. This has been introduced by commit b9b73f7c (userns: Convert usb
      functionfs to use kuid/kgid where appropriate) in 3.7.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarBenoit Goby <benoit@android.com>
      Acked-by: default avatarMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      b8100750
    • Pratyush Anand's avatar
      usb: dwc3: gadget: fix ep->maxburst for ep0 · 6048e4c6
      Pratyush Anand authored
      dwc3_gadget_set_ep_config expects maxburst as incremented by 1. So, by
      default initialize ep->maxburst to 1 for ep0.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarPratyush Anand <pratyush.anand@st.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      6048e4c6
    • Peter Chen's avatar
      ARM: i.MX clock: Change the connection-id for fsl-usb2-udc · 61c4b560
      Peter Chen authored
      As we use platform_device_id for fsl-usb2-udc driver, it needs to
      change clk connection-id, or the related devm_clk_get will be failed.
      Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
      Acked-by: default avatarShawn Guo <shawn.guo@linaro.org>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      61c4b560
    • Peter Chen's avatar
      usb: gadget: fsl_mxc_udc: replace MX35_IO_ADDRESS to ioremap · c2c9caa9
      Peter Chen authored
      As mach/hardware.h is deleted, we can't visit platform code at driver.
      It has no phy driver to combine with this controller, so it has to use
      ioremap to map phy address as a workaround.
      Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      c2c9caa9
    • Peter Chen's avatar
      usb: gadget: fsl-mxc-udc: replace cpu_is_xxx() with platform_device_id · f0ea8834
      Peter Chen authored
      As mach/hardware.h is deleted, we need to use platform_device_id to
      differentiate SoCs. Besides, one cpu_is_mx35 is useless as it has
      already used pdata to differentiate runtime
      
      Meanwhile we update the platform code accordingly.
      Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      f0ea8834
    • Sergei Shtylyov's avatar
      usb: musb: cppi_dma: drop '__init' annotation · 091a62c9
      Sergei Shtylyov authored
      This patch fixes the following:
      
      WARNING: vmlinux.o(.text+0x1e709c): Section mismatch in reference from the funct
      ion dma_controller_create() to the function .init.text:cppi_controller_start()
      The function dma_controller_create() references
      the function __init cppi_controller_start().
      This is often because dma_controller_create lacks a __init
      annotation or the annotation of cppi_controller_start is wrong.
      
      This warning is there due to the deficiency in the commit 07a67bbb (usb: musb:
      Make dma_controller_create __devinit).
      
      Since the start() method is only called from musb_init_controller() which is
      not annotated, drop '__init' annotation from cppi_controller_start() and also
      cppi_pool_init() since it gets called from that function, to avoid another
      section mismatch warning...
      Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: stable@vger.kernel.org # 3.7+
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      091a62c9
    • Linus Torvalds's avatar
      Linux 3.8-rc4 · 7d1f9aef
      Linus Torvalds authored
      7d1f9aef
    • Wolfgang Frisch's avatar
      USB: io_ti: Fix NULL dereference in chase_port() · 1ee0a224
      Wolfgang Frisch authored
      The tty is NULL when the port is hanging up.
      chase_port() needs to check for this.
      
      This patch is intended for stable series.
      The behavior was observed and tested in Linux 3.2 and 3.7.1.
      
      Johan Hovold submitted a more elaborate patch for the mainline kernel.
      
      [   56.277883] usb 1-1: edge_bulk_in_callback - nonzero read bulk status received: -84
      [   56.278811] usb 1-1: USB disconnect, device number 3
      [   56.278856] usb 1-1: edge_bulk_in_callback - stopping read!
      [   56.279562] BUG: unable to handle kernel NULL pointer dereference at 00000000000001c8
      [   56.280536] IP: [<ffffffff8144e62a>] _raw_spin_lock_irqsave+0x19/0x35
      [   56.281212] PGD 1dc1b067 PUD 1e0f7067 PMD 0
      [   56.282085] Oops: 0002 [#1] SMP
      [   56.282744] Modules linked in:
      [   56.283512] CPU 1
      [   56.283512] Pid: 25, comm: khubd Not tainted 3.7.1 #1 innotek GmbH VirtualBox/VirtualBox
      [   56.283512] RIP: 0010:[<ffffffff8144e62a>]  [<ffffffff8144e62a>] _raw_spin_lock_irqsave+0x19/0x35
      [   56.283512] RSP: 0018:ffff88001fa99ab0  EFLAGS: 00010046
      [   56.283512] RAX: 0000000000000046 RBX: 00000000000001c8 RCX: 0000000000640064
      [   56.283512] RDX: 0000000000010000 RSI: ffff88001fa99b20 RDI: 00000000000001c8
      [   56.283512] RBP: ffff88001fa99b20 R08: 0000000000000000 R09: 0000000000000000
      [   56.283512] R10: 0000000000000000 R11: ffffffff812fcb4c R12: ffff88001ddf53c0
      [   56.283512] R13: 0000000000000000 R14: 00000000000001c8 R15: ffff88001e19b9f4
      [   56.283512] FS:  0000000000000000(0000) GS:ffff88001fd00000(0000) knlGS:0000000000000000
      [   56.283512] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      [   56.283512] CR2: 00000000000001c8 CR3: 000000001dc51000 CR4: 00000000000006e0
      [   56.283512] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [   56.283512] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      [   56.283512] Process khubd (pid: 25, threadinfo ffff88001fa98000, task ffff88001fa94f80)
      [   56.283512] Stack:
      [   56.283512]  0000000000000046 00000000000001c8 ffffffff810578ec ffffffff812fcb4c
      [   56.283512]  ffff88001e19b980 0000000000002710 ffffffff812ffe81 0000000000000001
      [   56.283512]  ffff88001fa94f80 0000000000000202 ffffffff00000001 0000000000000296
      [   56.283512] Call Trace:
      [   56.283512]  [<ffffffff810578ec>] ? add_wait_queue+0x12/0x3c
      [   56.283512]  [<ffffffff812fcb4c>] ? usb_serial_port_work+0x28/0x28
      [   56.283512]  [<ffffffff812ffe81>] ? chase_port+0x84/0x2d6
      [   56.283512]  [<ffffffff81063f27>] ? try_to_wake_up+0x199/0x199
      [   56.283512]  [<ffffffff81263a5c>] ? tty_ldisc_hangup+0x222/0x298
      [   56.283512]  [<ffffffff81300171>] ? edge_close+0x64/0x129
      [   56.283512]  [<ffffffff810612f7>] ? __wake_up+0x35/0x46
      [   56.283512]  [<ffffffff8106135b>] ? should_resched+0x5/0x23
      [   56.283512]  [<ffffffff81264916>] ? tty_port_shutdown+0x39/0x44
      [   56.283512]  [<ffffffff812fcb4c>] ? usb_serial_port_work+0x28/0x28
      [   56.283512]  [<ffffffff8125d38c>] ? __tty_hangup+0x307/0x351
      [   56.283512]  [<ffffffff812e6ddc>] ? usb_hcd_flush_endpoint+0xde/0xed
      [   56.283512]  [<ffffffff8144e625>] ? _raw_spin_lock_irqsave+0x14/0x35
      [   56.283512]  [<ffffffff812fd361>] ? usb_serial_disconnect+0x57/0xc2
      [   56.283512]  [<ffffffff812ea99b>] ? usb_unbind_interface+0x5c/0x131
      [   56.283512]  [<ffffffff8128d738>] ? __device_release_driver+0x7f/0xd5
      [   56.283512]  [<ffffffff8128d9cd>] ? device_release_driver+0x1a/0x25
      [   56.283512]  [<ffffffff8128d393>] ? bus_remove_device+0xd2/0xe7
      [   56.283512]  [<ffffffff8128b7a3>] ? device_del+0x119/0x167
      [   56.283512]  [<ffffffff812e8d9d>] ? usb_disable_device+0x6a/0x180
      [   56.283512]  [<ffffffff812e2ae0>] ? usb_disconnect+0x81/0xe6
      [   56.283512]  [<ffffffff812e4435>] ? hub_thread+0x577/0xe82
      [   56.283512]  [<ffffffff8144daa7>] ? __schedule+0x490/0x4be
      [   56.283512]  [<ffffffff8105798f>] ? abort_exclusive_wait+0x79/0x79
      [   56.283512]  [<ffffffff812e3ebe>] ? usb_remote_wakeup+0x2f/0x2f
      [   56.283512]  [<ffffffff812e3ebe>] ? usb_remote_wakeup+0x2f/0x2f
      [   56.283512]  [<ffffffff810570b4>] ? kthread+0x81/0x89
      [   56.283512]  [<ffffffff81057033>] ? __kthread_parkme+0x5c/0x5c
      [   56.283512]  [<ffffffff8145387c>] ? ret_from_fork+0x7c/0xb0
      [   56.283512]  [<ffffffff81057033>] ? __kthread_parkme+0x5c/0x5c
      [   56.283512] Code: 8b 7c 24 08 e8 17 0b c3 ff 48 8b 04 24 48 83 c4 10 c3 53 48 89 fb 41 50 e8 e0 0a c3 ff 48 89 04 24 e8 e7 0a c3 ff ba 00 00 01 00
      <f0> 0f c1 13 48 8b 04 24 89 d1 c1 ea 10 66 39 d1 74 07 f3 90 66
      [   56.283512] RIP  [<ffffffff8144e62a>] _raw_spin_lock_irqsave+0x19/0x35
      [   56.283512]  RSP <ffff88001fa99ab0>
      [   56.283512] CR2: 00000000000001c8
      [   56.283512] ---[ end trace 49714df27e1679ce ]---
      Signed-off-by: default avatarWolfgang Frisch <wfpub@roembden.net>
      Cc: Johan Hovold <jhovold@gmail.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1ee0a224
    • Bjørn Mork's avatar
      USB: option: add TP-LINK HSUPA Modem MA180 · 99beb2e9
      Bjørn Mork authored
      The driver description files gives these names to the vendor specific
      functions on this modem:
      
       Diagnostics VID_2357&PID_0201&MI_00
       NMEA        VID_2357&PID_0201&MI_01
       Modem       VID_2357&PID_0201&MI_03
       Networkcard VID_2357&PID_0201&MI_04
      Reported-by: default avatarThomas Schäfer <tschaefer@t-online.de>
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      99beb2e9
    • Bjørn Mork's avatar
      USB: option: blacklist network interface on ONDA MT8205 4G LTE · 2291dff0
      Bjørn Mork authored
      The driver description files gives these names to the vendor specific
      functions on this modem:
      
       Diag   VID_19D2&PID_0265&MI_00
       NMEA   VID_19D2&PID_0265&MI_01
       AT cmd VID_19D2&PID_0265&MI_02
       Modem  VID_19D2&PID_0265&MI_03
       Net    VID_19D2&PID_0265&MI_04
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2291dff0
  6. 17 Jan, 2013 2 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 72ffaa48
      Linus Torvalds authored
      Pull more s390 patches from Martin Schwidefsky:
       "A couple of bug fixes: one of the transparent huge page primitives is
        broken, the sched_clock function overflows after 417 days, the XFS
        module has grown too large for -fpic and the new pci code has broken
        normal channel subsystem notifications."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390/chsc: fix SEI usage
        s390/time: fix sched_clock() overflow
        s390: use -fPIC for module compile
        s390/mm: fix pmd_pfn() for thp
      72ffaa48
    • Linus Torvalds's avatar
      Merge tag 'for-linus-v3.8-rc4' of git://oss.sgi.com/xfs/xfs · dfdebc24
      Linus Torvalds authored
      Pull xfs bugfixes from Ben Myers:
      
       - fix(es) for compound buffers
      
       - fix for dquot soft timer asserts due to overflow of d_blk_softlimit
      
       - fix for regression in dir v2 code introduced in commit 20f7e9f3
         ("xfs: factor dir2 block read operations")
      
      * tag 'for-linus-v3.8-rc4' of git://oss.sgi.com/xfs/xfs:
        xfs: recalculate leaf entry pointer after compacting a dir2 block
        xfs: remove int casts from debug dquot soft limit timer asserts
        xfs: fix the multi-segment log buffer format
        xfs: fix segment in xfs_buf_item_format_segment
        xfs: rename bli_format to avoid confusion with bli_formats
        xfs: use b_maps[] for discontiguous buffers
      dfdebc24
  7. 16 Jan, 2013 17 commits