1. 25 1月, 2017 4 次提交
  2. 18 1月, 2017 2 次提交
  3. 13 1月, 2017 8 次提交
  4. 12 1月, 2017 2 次提交
  5. 09 1月, 2017 14 次提交
  6. 07 1月, 2017 1 次提交
  7. 06 1月, 2017 9 次提交
    • A
      USB: fix problems with duplicate endpoint addresses · 0a8fd134
      Alan Stern 提交于
      When checking a new device's descriptors, the USB core does not check
      for duplicate endpoint addresses.  This can cause a problem when the
      sysfs files for those endpoints are created; trying to create multiple
      files with the same name will provoke a WARNING:
      
      WARNING: CPU: 2 PID: 865 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x8a/0xa0
      sysfs: cannot create duplicate filename
      '/devices/platform/dummy_hcd.0/usb2/2-1/2-1:64.0/ep_05'
      Kernel panic - not syncing: panic_on_warn set ...
      
      CPU: 2 PID: 865 Comm: kworker/2:1 Not tainted 4.9.0-rc7+ #34
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
      Workqueue: usb_hub_wq hub_event
       ffff88006bee64c8 ffffffff81f96b8a ffffffff00000001 1ffff1000d7dcc2c
       ffffed000d7dcc24 0000000000000001 0000000041b58ab3 ffffffff8598b510
       ffffffff81f968f8 ffffffff850fee20 ffffffff85cff020 dffffc0000000000
      Call Trace:
       [<     inline     >] __dump_stack lib/dump_stack.c:15
       [<ffffffff81f96b8a>] dump_stack+0x292/0x398 lib/dump_stack.c:51
       [<ffffffff8168c88e>] panic+0x1cb/0x3a9 kernel/panic.c:179
       [<ffffffff812b80b4>] __warn+0x1c4/0x1e0 kernel/panic.c:542
       [<ffffffff812b8195>] warn_slowpath_fmt+0xc5/0x110 kernel/panic.c:565
       [<ffffffff819e70ca>] sysfs_warn_dup+0x8a/0xa0 fs/sysfs/dir.c:30
       [<ffffffff819e7308>] sysfs_create_dir_ns+0x178/0x1d0 fs/sysfs/dir.c:59
       [<     inline     >] create_dir lib/kobject.c:71
       [<ffffffff81fa1b07>] kobject_add_internal+0x227/0xa60 lib/kobject.c:229
       [<     inline     >] kobject_add_varg lib/kobject.c:366
       [<ffffffff81fa2479>] kobject_add+0x139/0x220 lib/kobject.c:411
       [<ffffffff82737a63>] device_add+0x353/0x1660 drivers/base/core.c:1088
       [<ffffffff82738d8d>] device_register+0x1d/0x20 drivers/base/core.c:1206
       [<ffffffff82cb77d3>] usb_create_ep_devs+0x163/0x260 drivers/usb/core/endpoint.c:195
       [<ffffffff82c9f27b>] create_intf_ep_devs+0x13b/0x200 drivers/usb/core/message.c:1030
       [<ffffffff82ca39d3>] usb_set_configuration+0x1083/0x18d0 drivers/usb/core/message.c:1937
       [<ffffffff82cc9e2e>] generic_probe+0x6e/0xe0 drivers/usb/core/generic.c:172
       [<ffffffff82caa7fa>] usb_probe_device+0xaa/0xe0 drivers/usb/core/driver.c:263
      
      This patch prevents the problem by checking for duplicate endpoint
      addresses during enumeration and skipping any duplicates.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-by: NAndrey Konovalov <andreyknvl@google.com>
      Tested-by: NAndrey Konovalov <andreyknvl@google.com>
      CC: <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0a8fd134
    • P
      usb: ohci-at91: use descriptor-based gpio APIs correctly · 8f12dc24
      Peter Rosin 提交于
      The gpiod_get* function family does not want the -gpio suffix.
      Use devm_gpiod_get_index_optional instead of devm_gpiod_get_optional.
      The descriptor based APIs handle active high/low automatically.
      The vbus-gpios are output, request enable while getting the gpio.
      Don't try to get any vbus-gpios for ports outside num-ports.
      
      WTF? Big sigh.
      
      Fixes: 054d4b7b ("usb: ohci-at91: Use descriptor-based gpio APIs")
      Signed-off-by: NPeter Rosin <peda@axentia.se>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8f12dc24
    • O
      usb: storage: unusual_uas: Add JMicron JMS56x to unusual device · 674aea07
      Oliver Neukum 提交于
      This device gives the following error on detection.
      xhci_hcd 0000:00:11.0: ERROR Transfer event for disabled endpoint or
      incorrect stream ring
      
      The same error is not seen when it is added to unusual_device
      list with US_FL_NO_REPORT_OPCODES passed.
      Signed-off-by: NGeorge Cherian <george.cherian@cavium.com>
      Signed-off-by: NOliver Neukum <oneukun@suse.com>
      CC: stable@vger.kernel.org
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      674aea07
    • G
      usb: hub: Move hub_port_disable() to fix warning if PM is disabled · 3bc02bce
      Geert Uytterhoeven 提交于
      If CONFIG_PM=n:
      
          drivers/usb/core/hub.c:107: warning: ‘hub_usb3_port_prepare_disable’ declared inline after being called
          drivers/usb/core/hub.c:107: warning: previous declaration of ‘hub_usb3_port_prepare_disable’ was here
      
      To fix this, move hub_port_disable() after
      hub_usb3_port_prepare_disable(), and adjust forward declarations.
      
      Fixes: 37be6676 ("usb: hub: Fix auto-remount of safely removed or ejected USB-3 devices")
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3bc02bce
    • J
      usb: musb: blackfin: add bfin_fifo_offset in bfin_ops · 5563bb57
      Jérémy Lefaure 提交于
      The function bfin_fifo_offset is defined but not used:
      
      drivers/usb/musb/blackfin.c:36:12: warning: ‘bfin_fifo_offset’ defined
      but not used [-Wunused-function]
       static u32 bfin_fifo_offset(u8 epnum)
                   ^~~~~~~~~~~~~~~~
      
      Adding bfin_fifo_offset to bfin_ops fixes this warning and allows musb
      core to call this function instead of default_fifo_offset.
      
      Fixes: cc92f681 ("usb: musb: Populate new IO functions for blackfin")
      Signed-off-by: NJérémy Lefaure <jeremy.lefaure@lse.epita.fr>
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5563bb57
    • J
      usb: musb: fix compilation warning on unused function · c8bd2ac3
      Jérémy Lefaure 提交于
      The function musb_run_resume_work is called only when CONFIG_PM is
      enabled. So this function should not be defined when CONFIG_PM is
      disabled. Otherwise the compiler issues a warning:
      
      drivers/usb/musb/musb_core.c:2057:12: error: ‘musb_run_resume_work’ defined but
      not used [-Werror=unused-function]
       static int musb_run_resume_work(struct musb *musb)
                  ^~~~~~~~~~~~~~~~~~~~
      Signed-off-by: NJérémy Lefaure <jeremy.lefaure@lse.epita.fr>
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c8bd2ac3
    • T
      usb: musb: Fix trying to free already-free IRQ 4 · 8c300fe2
      Tony Lindgren 提交于
      When unloading omap2430, we can get the following splat:
      
      WARNING: CPU: 1 PID: 295 at kernel/irq/manage.c:1478 __free_irq+0xa8/0x2c8
      Trying to free already-free IRQ 4
      ...
      [<c01a8b78>] (free_irq) from [<bf0aea84>]
      (musbhs_dma_controller_destroy+0x28/0xb0 [musb_hdrc])
      [<bf0aea84>] (musbhs_dma_controller_destroy [musb_hdrc]) from
      [<bf09f88c>] (musb_remove+0xf0/0x12c [musb_hdrc])
      [<bf09f88c>] (musb_remove [musb_hdrc]) from [<c056a384>]
      (platform_drv_remove+0x24/0x3c)
      ...
      
      This is because the irq number in use is 260 nowadays, and the dma
      controller is using u8 instead of int.
      
      Fixes: 6995eb68 ("USB: musb: enable low level DMA operation for Blackfin")
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      [b-liu@ti.com: added Fixes tag]
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8c300fe2
    • B
      usb: musb: dsps: implement clear_ep_rxintr() callback · c48400ba
      Bin Liu 提交于
      During dma teardown for dequque urb, if musb load is high, musb might
      generate bogus rx ep interrupt even when the rx fifo is flushed. In such
      case any of the follow log messages could happen.
      
          musb_host_rx 1853: BOGUS RX2 ready, csr 0000, count 0
      
          musb_host_rx 1936: RX3 dma busy, csr 2020
      
      As mentioned in the current inline comment, clearing ep interrupt in the
      teardown path avoids the bogus interrupt, so implement clear_ep_rxintr()
      callback.
      
      This bug seems to be existing since the initial driver for musb support,
      but I only validated the fix back to v4.1, so only cc stable for v4.1+.
      
      cc: stable@vger.kernel.org # 4.1+
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c48400ba
    • B
      usb: musb: core: add clear_ep_rxintr() to musb_platform_ops · 6def85a3
      Bin Liu 提交于
      During dma teardown for dequque urb, if musb load is high, musb might
      generate bogus rx ep interrupt even when the rx fifo is flushed. In such
      case any of the follow log messages could happen.
      
      	musb_host_rx 1853: BOGUS RX2 ready, csr 0000, count 0
      
      	musb_host_rx 1936: RX3 dma busy, csr 2020
      
      As mentioned in the current inline comment, clearing ep interrupt in the
      teardown path avoids the bogus interrupt.
      
      Clearing ep interrupt is platform dependent, so this patch adds a
      platform callback to allow glue driver to clear the ep interrupt.
      
      This bug seems to be existing since the initial driver for musb support,
      but I only validated the fix back to v4.1, so only cc stable for v4.1+.
      
      cc: stable@vger.kernel.org # 4.1+
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6def85a3