1. 16 4月, 2014 7 次提交
    • D
      usb: musb: dsps: move debugfs_remove_recursive() · 0fca91b8
      Daniel Mack 提交于
      When the platform initialization fails due to missing resources, it will
      return -EPROBE_DEFER after dsps_musb_init() has been called.
      
      dsps_musb_init() calls dsps_musb_dbg_init() to allocate the debugfs
      nodes. At a later point in time, the probe will be retried, and
      dsps_musb_dbg_init() will be called again. debugfs_create_dir() will
      fail this time, as the node already exists, and so the entire device
      probe will fail with -ENOMEM.
      
      Fix this by moving debugfs_remove_recursive() from dsps_remove() to the
      plaform's exit function, so it will be cleanly torn down when the probe
      fails. It also feels more natural this way, as .exit is the counterpart
      to .init.
      Signed-off-by: NDaniel Mack <zonque@gmail.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      0fca91b8
    • L
      usb: gadget: gadgetfs: Initialize CHIP to NULL before UDC probe · 5cdf7d5b
      Lubomir Rintel 提交于
      Otherwise the value from the last probe would be retained that possibly is
      freed since (the UDC is removed) and therefore no longer relevant. Reproducible
      with the dummy UDC:
      
        modprobe dummy_hcd
        mount -t gadgetfs gadgetfs /dev/gadget
        umount /dev/gadget
        rmmod dummy_hcd
        mount -t gadgetfs gadgetfs /dev/gadget
      
      BUG: unable to handle kernel paging request at ffffffffa066fd9d
      Call Trace:
       [<ffffffff811d0cd2>] ? d_alloc_name+0x22/0x50
       [<ffffffff812b74dc>] ? selinux_d_instantiate+0x1c/0x20
       [<ffffffffa067d687>] gadgetfs_create_file+0x27/0xa0 [gadgetfs]
       [<ffffffffa067da70>] ? setup_req.isra.4+0x80/0x80 [gadgetfs]
       [<ffffffffa067dbac>] gadgetfs_fill_super+0x13c/0x180 [gadgetfs]
       [<ffffffff811bc832>] mount_single+0x92/0xc0
       [<ffffffffa067d0f8>] gadgetfs_mount+0x18/0x20 [gadgetfs]
       [<ffffffff811bc8f9>] mount_fs+0x39/0x1b0
       [<ffffffff8116b220>] ? __alloc_percpu+0x10/0x20
       [<ffffffff811d6da3>] vfs_kern_mount+0x63/0xf0
       [<ffffffff811d93be>] do_mount+0x23e/0xac0
       [<ffffffff811660eb>] ? strndup_user+0x4b/0xf0
       [<ffffffff811d9f63>] SyS_mount+0x83/0xc0
       [<ffffffff81695b69>] system_call_fastpath+0x16/0x1b
      Signed-off-by: NLubomir Rintel <lkundrak@v3.sk>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      5cdf7d5b
    • R
      usb: dwc3: core: Fix gadget for system suspend/resume · f45e5f00
      Roger Quadros 提交于
      During system resume, if the event buffers are not setup before
      the gadget controller starts then we start with invalid context
      and this can lead to bus access errors. This is especially true for
      platforms that loose the controller context during system suspend.
      e.g. AM437x.
      
      The following backtrace was found when the system is suspended
      and resumed with g_zero loaded on AM437x-evm (USB cable connected
      to host all the while).
      
      [  120.981506] WARNING: CPU: 0 PID: 1656 at drivers/bus/omap_l3_noc.c:137 l3_interrupt_handler+0x198/0x28c()
      [  120.981514] L3 custom error: MASTER:USB0 WR TARGET:GPMC
      [  120.981638] Modules linked in: g_mass_storage usb_f_mass_storage libcomposite configfs bufferclass_ti(O) omaplfb(O) cryptodev(O) dwc3 snd_soc_evm snd_soc_omap snd_pe
      [  120.981659] CPU: 0 PID: 1656 Comm: sh Tainted: G           O 3.12.10-gc559824 #1
      [  120.981669] Backtrace:
      [  120.981705] [<c0017880>] (dump_backtrace+0x0/0x10c) from [<c0017a1c>] (show_stack+0x18/0x1c)
      [  120.981730]  r6:c02819ac r5:00000009 r4:ec137cb8 r3:00000000
      [  120.981767] [<c0017a04>] (show_stack+0x0/0x1c) from [<c056c0b0>] (dump_stack+0x20/0x28)
      [  120.981802] [<c056c090>] (dump_stack+0x0/0x28) from [<c0046d08>] (warn_slowpath_common+0x70/0x90)
      [  120.981830] [<c0046c98>] (warn_slowpath_common+0x0/0x90) from [<c0046dcc>] (warn_slowpath_fmt+0x38/0x40)
      [  120.981856]  r8:c0855eb0 r7:00000002 r6:f1000700 r5:00000007 r4:80080003
      [  120.981886] [<c0046d94>] (warn_slowpath_fmt+0x0/0x40) from [<c02819ac>] (l3_interrupt_handler+0x198/0x28c)
      [  120.981900]  r3:c0801ab8 r2:c06cb354
      [  120.981936] [<c0281814>] (l3_interrupt_handler+0x0/0x28c) from [<c007162c>] (handle_irq_event_percpu+0x54/0x1b8)
      [  120.981962] [<c00715d8>] (handle_irq_event_percpu+0x0/0x1b8) from [<c00717c0>] (handle_irq_event+0x30/0x40)
      [  120.981993] [<c0071790>] (handle_irq_event+0x0/0x40) from [<c0074058>] (handle_fasteoi_irq+0x74/0x128)
      [  120.982006]  r4:ed0056c0 r3:00000000
      [  120.982033] [<c0073fe4>] (handle_fasteoi_irq+0x0/0x128) from [<c0070f34>] (generic_handle_irq+0x28/0x38)
      [  120.982046]  r4:0000002a r3:c0073fe4
      [  120.982085] [<c0070f0c>] (generic_handle_irq+0x0/0x38) from [<c0015560>] (handle_IRQ+0x38/0x8c)
      [  120.982098]  r4:c080137c r3:00000182
      [  120.982124] [<c0015528>] (handle_IRQ+0x0/0x8c) from [<c00087e0>] (gic_handle_irq+0x30/0x5c)
      [  120.982145]  r6:ec137dd0 r5:c07ac480 r4:fa24010c r3:00000100
      [  120.982169] [<c00087b0>] (gic_handle_irq+0x0/0x5c) from [<c056fcc0>] (__irq_svc+0x40/0x54)
      [  120.982179] Exception stack(0xec137dd0 to 0xec137e18)
      [  120.982195] 7dc0:                                     00000000 a00001d3 00000000 00000004
      [  120.982216] 7de0: a0000153 ec1d9010 c080de90 ec137e30 c080debc 00000000 ed756e44 ec137e2c
      [  120.982232] 7e00: ec137de0 ec137e18 bf1150e4 bf115474 60000153 ffffffff
      [  120.982253]  r7:ec137e04 r6:ffffffff r5:60000153 r4:bf115474
      [  120.982327] [<bf115438>] (dwc3_complete+0x0/0x40 [dwc3]) from [<c0338f50>] (dpm_complete+0xd4/0x19c)
      [  120.982341]  r5:ed756e10 r4:ed756e64
      [  120.982370] [<c0338e7c>] (dpm_complete+0x0/0x19c) from [<c0339034>] (dpm_resume_end+0x1c/0x20)
      [  120.982400] [<c0339018>] (dpm_resume_end+0x0/0x20) from [<c006d4ec>] (suspend_devices_and_enter+0x118/0x33c)
      [  120.982412]  r4:c0833da4 r3:00000000
      [  120.982436] [<c006d3d4>] (suspend_devices_and_enter+0x0/0x33c) from [<c006d928>] (pm_suspend+0x218/0x254)
      [  120.982458] [<c006d710>] (pm_suspend+0x0/0x254) from [<c006c594>] (state_store+0x70/0xc0)
      [  120.982478]  r6:c057a6cc r5:c06a8320 r4:00000003 r3:0000006d
      [  120.982515] [<c006c524>] (state_store+0x0/0xc0) from [<c0264cc0>] (kobj_attr_store+0x1c/0x28)
      [  120.982546] [<c0264ca4>] (kobj_attr_store+0x0/0x28) from [<c012ccb8>] (sysfs_write_file+0x170/0x1a4)
      [  120.982583] [<c012cb48>] (sysfs_write_file+0x0/0x1a4) from [<c00d17e4>] (vfs_write+0xb8/0x190)
      [  120.982611] [<c00d172c>] (vfs_write+0x0/0x190) from [<c00d1bf8>] (SyS_write+0x44/0x78)
      [  120.982641] [<c00d1bb4>] (SyS_write+0x0/0x78) from [<c0014660>] (ret_fast_syscall+0x0/0x30)
      Signed-off-by: NRoger Quadros <rogerq@ti.com>
      Acked-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      f45e5f00
    • R
      usb: gadget: zero: Fix SuperSpeed enumeration for alternate setting 1 · 9c1b7036
      Roger Quadros 提交于
      It was impossible to enumerate on a SuperSpeed (XHCI) host
      with alternate setting = 1 due to the wrongly set 'bMaxBurst'
      field in the SuperSpeed Endpoint Companion descriptor.
      
      Testcase:
      <host> modprobe -r usbtest; modprobe usbtest alt=1
      <device> modprobe g_zero
      plug device to SuperSpeed port on the host.
      
      Without this patch the host always complains like so
      "usb 12-2: Not enough bandwidth for new device state.
       usb 12-2: Not enough bandwidth for altsetting 1"
      
      Bug was introduced by commit cf9a08ae in v3.9
      
      Fixes: cf9a08ae (usb: gadget: convert source sink and loopback to
      new function interface)
      
      Cc: 3.9+ <stable@vger.kernel.org> # 3.9+
      Reviewed-by: NFelipe Balbi <balbi@ti.com>
      Acked-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NRoger Quadros <rogerq@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      9c1b7036
    • J
      usb: dwc3: gadget: Iterate only over valid endpoints · 32702e96
      Jack Pham 提交于
      Make dwc3_gadget_resize_tx_fifos() iterate only over IN
      endpoints that are actually present, based on the
      num_in_eps parameter. This terminates the loop so as to
      prevent dereferencing a potential NULL dwc->eps[i] where
      i >= (num_in_eps + num_out_eps).
      Signed-off-by: NJack Pham <jackp@codeaurora.org>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      32702e96
    • F
      usb: musb: omap2430: make sure clocks are enabled when running mailbox · 8b2bc2c9
      Felipe Balbi 提交于
      on early initialization we could fall into
      a situation where the mailbox is called before
      MUSB's clocks are running, in order to avoid
      that, make sure mailbox is always wrapped with
      pm_runtime calls.
      Reported-by: NStefan Roese <sr@denx.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      8b2bc2c9
    • F
      usb: musb: fix PHY power on/off · 3063a12b
      Felipe Balbi 提交于
      commi 30a70b02 (usb: musb: fix obex in g_nokia.ko
      causing kernel panic) removed phy_power_on()
      and phy_power_off() calls from runtime PM callbacks
      but it failed to note that the driver depended
      on pm_runtime_get_sync() calls to power up the PHY,
      thus leaving some platforms without any means to
      have a working PHY.
      
      Fix that by enabling the phy during omap2430_musb_init()
      and killing it in omap2430_musb_exit().
      
      Fixes: 30a70b02 (usb: musb: fix obex in g_nokia.ko causing kernel panic)
      Cc: <stable@vger.kernel.org> # v3.14
      Cc: Pali Rohár <pali.rohar@gmail.com>
      Cc: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
      Reported-by: NMichael Scott <hashcode0f@gmail.com>
      Tested-by: NMichael Scott <hashcode0f@gmail.com>
      Tested-by: NStefan Roese <sr@denx.de>
      Reported-by: NRabin Vincent <rabin@rab.in>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      3063a12b
  2. 07 4月, 2014 2 次提交
    • N
      target: Pass in transport supported PI at session initialization · e70beee7
      Nicholas Bellinger 提交于
      In order to support local WRITE_INSERT + READ_STRIP operations for
      non PI enabled fabrics, the fabric driver needs to be able signal
      what protection offload operations are supported.
      
      This is done at session initialization time so the modes can be
      signaled by individual se_wwn + se_portal_group endpoints, as well
      as optionally across different transports on the same endpoint.
      
      For iser-target, set TARGET_PROT_ALL if the underlying ib_device
      has already signaled PI offload support, and allow this to be
      exposed via a new iscsit_transport->iscsit_get_sup_prot_ops()
      callback.
      
      For loopback, set TARGET_PROT_ALL to signal SCSI initiator mode
      operation.
      
      For all other drivers, set TARGET_PROT_NORMAL to disable fabric
      level PI.
      
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Cc: Quinn Tran <quinn.tran@qlogic.com>
      Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      e70beee7
    • N
      target: Add TFO->abort_task for aborted task resources release · 131e6abc
      Nicholas Bellinger 提交于
      Now that TASK_ABORTED status is not generated for all cases by
      TMR ABORT_TASK + LUN_RESET, a new TFO->abort_task() caller is
      necessary in order to give fabric drivers a chance to unmap
      hardware / software resources before the se_cmd descriptor is
      released via the normal TFO->release_cmd() codepath.
      
      This patch adds TFO->aborted_task() in core_tmr_abort_task()
      in place of the original transport_send_task_abort(), and
      also updates all fabric drivers to implement this caller.
      
      The fabric drivers that include changes to perform cleanup
      via ->aborted_task() are:
      
        - iscsi-target
        - iser-target
        - srpt
        - tcm_qla2xxx
      
      The fabric drivers that currently set ->aborted_task() to
      NOPs are:
      
        - loopback
        - tcm_fc
        - usb-gadget
        - sbp-target
        - vhost-scsi
      
      For the latter five, there appears to be no additional cleanup
      required before invoking TFO->release_cmd() to release the
      se_cmd descriptor.
      
      v2 changes:
        - Move ->aborted_task() call into transport_cmd_finish_abort (Alex)
      
      Cc: Alex Leung <amleung21@yahoo.com>
      Cc: Mark Rustad <mark.d.rustad@intel.com>
      Cc: Roland Dreier <roland@kernel.org>
      Cc: Vu Pham <vu@mellanox.com>
      Cc: Chris Boot <bootc@bootc.net>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
      Cc: Saurav Kashyap <saurav.kashyap@qlogic.com>
      Cc: Quinn Tran <quinn.tran@qlogic.com>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      131e6abc
  3. 20 3月, 2014 1 次提交
    • A
      USB: disable reset-resume when USB_QUIRK_RESET is set · 1d10255c
      Alan Stern 提交于
      The USB_QUIRK_RESET flag indicates that a USB device changes its
      identity in some way when it is reset.  It may lose its firmware, its
      descriptors may change, or it may switch back to a default mode of
      operation.
      
      If a device does this, the kernel needs to avoid resetting it.  Resets
      are likely to fail, or worse, succeed while changing the device's
      state in a way the system can't detect.
      
      This means we should disable the reset-resume mechanism whenever this
      quirk flag is present.  An attempted reset-resume will fail, the
      device will be logically disconnected, and later on the hub driver
      will rediscover and re-enumerate the device.  This will cause the
      appropriate udev events to be generated, so that userspace will have a
      chance to switch the device into its normal operating mode, if
      necessary.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: Oliver Neukum <oliver@neukum.org>
      Reviewed-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1d10255c
  4. 19 3月, 2014 1 次提交
  5. 18 3月, 2014 8 次提交
  6. 13 3月, 2014 10 次提交
  7. 11 3月, 2014 2 次提交
  8. 09 3月, 2014 4 次提交
  9. 08 3月, 2014 5 次提交