1. 01 5月, 2018 2 次提交
  2. 23 4月, 2018 2 次提交
    • J
      USB: musb: dsps: drop duplicate phy initialisation · be75d8f1
      Johan Hovold 提交于
      Since commit 39cee200 ("usb: musb: core: call init and shutdown for
      the usb phy") the musb USB phy is initialised by musb_core, but the
      original initialisation in the dsps-glue init callback was left in
      place resulting in two calls to phy init during probe (and similarly,
      two shutdowns on remove).
      
      Drop the duplicate phy init and shutdown calls from the dsps glue in
      favour of the ones in musb core, which other glue drivers rely on.
      
      Note however that any generic phy is still initialised in the glue init
      callback (just as for the other drivers).
      
      Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      Acked-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      be75d8f1
    • J
      USB: musb: host: prevent core phy initialisation · 1f81f118
      Johan Hovold 提交于
      Set the new HCD flag which prevents USB core from trying to manage our
      phys.
      
      This is needed to be able to associate the controller platform device
      with the glue device device-tree node on the BBB which uses legacy USB
      phys. Otherwise, the generic phy lookup in usb_phy_roothub_init() and
      thus HCD registration fails repeatedly with -EPROBE_DEFER (see commit
      178a0bce ("usb: core: hcd: integrate the PHY wrapper into the HCD
      core")).
      
      Note that a related phy-lookup issue was recently worked around in the
      phy core by commit b7563e27 ("phy: work around 'phys' references to
      usb-nop-xceiv devices"). Something similar may now be needed for other
      USB phys, and in particular if we eventually want to let USB core manage
      musb generic phys.
      
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1f81f118
  3. 30 3月, 2018 1 次提交
  4. 26 3月, 2018 2 次提交
  5. 13 3月, 2018 1 次提交
  6. 10 3月, 2018 1 次提交
  7. 07 3月, 2018 1 次提交
    • M
      usb: musb: call pm_runtime_{get,put}_sync before reading vbus registers · df6b074d
      Merlijn Wajer 提交于
      Without pm_runtime_{get,put}_sync calls in place, reading
      vbus status via /sys causes the following error:
      
      Unhandled fault: external abort on non-linefetch (0x1028) at 0xfa0ab060
      pgd = b333e822
      [fa0ab060] *pgd=48011452(bad)
      
      [<c05261b0>] (musb_default_readb) from [<c0525bd0>] (musb_vbus_show+0x58/0xe4)
      [<c0525bd0>] (musb_vbus_show) from [<c04c0148>] (dev_attr_show+0x20/0x44)
      [<c04c0148>] (dev_attr_show) from [<c0259f74>] (sysfs_kf_seq_show+0x80/0xdc)
      [<c0259f74>] (sysfs_kf_seq_show) from [<c0210bac>] (seq_read+0x250/0x448)
      [<c0210bac>] (seq_read) from [<c01edb40>] (__vfs_read+0x1c/0x118)
      [<c01edb40>] (__vfs_read) from [<c01edccc>] (vfs_read+0x90/0x144)
      [<c01edccc>] (vfs_read) from [<c01ee1d0>] (SyS_read+0x3c/0x74)
      [<c01ee1d0>] (SyS_read) from [<c0106fe0>] (ret_fast_syscall+0x0/0x54)
      
      Solution was suggested by Tony Lindgren <tony@atomide.com>.
      Signed-off-by: NMerlijn Wajer <merlijn@wizzup.org>
      Acked-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      df6b074d
  8. 20 2月, 2018 2 次提交
  9. 24 1月, 2018 2 次提交
  10. 09 1月, 2018 1 次提交
  11. 03 1月, 2018 2 次提交
  12. 09 12月, 2017 1 次提交
    • B
      usb: musb: da8xx: fix babble condition handling · bd3486de
      Bin Liu 提交于
      When babble condition happens, the musb controller might automatically
      turns off VBUS. On DA8xx platform, the controller generates drvvbus
      interrupt for turning off VBUS along with the babble interrupt.
      
      In this case, we should handle the babble interrupt first and recover
      from the babble condition.
      
      This change ignores the drvvbus interrupt if babble interrupt is also
      generated at the same time, so the babble recovery routine works
      properly.
      
      Cc: stable@vger.kernel.org # v3.16+
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bd3486de
  13. 07 11月, 2017 1 次提交
    • G
      USB: musb: Remove redundant license text · 21b650c2
      Greg Kroah-Hartman 提交于
      Now that the SPDX tag is in all USB files, that identifies the license
      in a specific and legally-defined manner.  So the extra GPL text wording
      can be removed as it is no longer needed at all.
      
      This is done on a quest to remove the 700+ different ways that files in
      the kernel describe the GPL license text.  And there's unneeded stuff
      like the address (sometimes incorrect) for the FSF which is never
      needed.
      
      No copyright headers or other non-license-description text was removed.
      
      Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
      Cc: Chen-Yu Tsai <wens@csie.org>
      Acked-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      21b650c2
  14. 04 11月, 2017 1 次提交
  15. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  16. 01 11月, 2017 2 次提交
  17. 30 10月, 2017 2 次提交
  18. 17 10月, 2017 7 次提交
  19. 28 8月, 2017 6 次提交
    • J
      USB: musb: dsps: add explicit runtime resume at suspend · 706d61b2
      Johan Hovold 提交于
      The musb_dsps driver is special in that the parent (glue) device's
      driver is accessing registers mapped by the child. The clock is however
      shared and is managed by the grandparent device.
      
      Since commit 869c5978 ("usb: musb: dsps: add support for suspend and
      resume") the dsps driver has been accessing these registers as part of
      suspend and resume.
      
      The parent driver obviously cannot runtime resume the child during
      system suspend and is currently relying on the fact that the child will
      be RPM_ACTIVE throughout suspend. The suspend implementation also makes
      sure to check that the child is indeed present (and hence the clock
      enabled) before accessing the registers.
      
      Let's add an explicit runtime resume of the glue device itself to enable
      the clock before doing the register accesses in case these assumptions ever
      change (i.e. if the child is left runtime suspended).
      
      Note that the glue-timer cancellation is moved after the child-presence
      check to keep error handling simple. This should be fine as the timer is
      not setup until the controller is being registered and at that time
      glue->musb and its driver data have already been initialised.
      
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Daniel Mack <zonque@gmail.com>
      Cc: Tony Lindgren <tony@atomide.com>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      706d61b2
    • J
      USB: musb: fix external abort on suspend · 082df8be
      Johan Hovold 提交于
      Make sure that the controller is runtime resumed when system suspending
      to avoid an external abort when accessing the interrupt registers:
      
        Unhandled fault: external abort on non-linefetch (0x1008) at 0xd025840a
        ...
        [<c05481a4>] (musb_default_readb) from [<c0545abc>] (musb_disable_interrupts+0x84/0xa8)
        [<c0545abc>] (musb_disable_interrupts) from [<c0546b08>] (musb_suspend+0x38/0xb8)
        [<c0546b08>] (musb_suspend) from [<c04a57f8>] (platform_pm_suspend+0x3c/0x64)
      
      This is easily reproduced on a BBB by enabling the peripheral port only
      (as the host port may enable the shared clock) and keeping it
      disconnected so that the controller is runtime suspended. (Well, you
      would also need to the not-yet-merged am33xx-suspend patches by Dave
      Gerlach to be able to suspend the BBB.)
      
      This is a regression that was introduced by commit 1c4d0b4e ("usb:
      musb: Remove pm_runtime_set_irq_safe") which allowed the parent glue
      device to runtime suspend and thereby exposed a couple of older issues:
      
      Register accesses without explicitly making sure the controller is
      runtime resumed during suspend was first introduced by commit c338412b
      ("usb: musb: unconditionally save and restore the context on suspend")
      in 3.14.
      
      Commit a1fc1920 ("usb: musb: core: make sure musb is in RPM_ACTIVE on
      resume") later started setting the RPM status to active during resume,
      and this was also implicitly relying on the parent always being active.
      Since commit 71723f95 ("PM / runtime: print error when activating a
      child to unactive parent") this now also results in the following
      warning:
      
        musb-hdrc musb-hdrc.0: runtime PM trying to activate child device
          musb-hdrc.0 but parent (47401400.usb) is not active
      
      This patch has been verified on 4.13-rc2, 4.12 and 4.9 using a BBB
      (the dsps glue would always be active also in 4.8).
      
      Fixes: c338412b ("usb: musb: unconditionally save and restore the context on suspend")
      Fixes: a1fc1920 ("usb: musb: core: make sure musb is in RPM_ACTIVE on resume")
      Fixes: 1c4d0b4e ("usb: musb: Remove pm_runtime_set_irq_safe")
      Cc: stable <stable@vger.kernel.org>	# 4.8+
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Daniel Mack <zonque@gmail.com>
      Cc: Dave Gerlach <d-gerlach@ti.com>
      Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Tony Lindgren <tony@atomide.com>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      082df8be
    • B
      usb: musb: fix endpoint fifo allocation for 4KB fifo memory · 55aad53f
      Bin Liu 提交于
      The fifo memory allocation in mode_2_cfg[] doesn't utilize all the 4KB
      memory.
      
      Increse some endpoint fifo buffers to fully use all the 4KB memory. Now
      we can support more webcam usecases on DA8xx.
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      55aad53f
    • B
      usb: musb: print an error message when high bandwidth is unsupported · 1bff25ea
      Bin Liu 提交于
      There are multiple places in usb core or controller driver which returns
      -EMSGSIZE when a class driver queueing urb failed, so the "Message too
      long" log doesn't help much for understanding the error.
      
      Let the musb driver to specifically print a error message when
      musb_urb_enqueue() returns -EMSGSIZE.
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1bff25ea
    • B
      usb: musb: print an error message when hwep alloc failed · a2f65606
      Bin Liu 提交于
      Print an error message with qh maxpacket size and hb_mult when hwep
      allocation failed, so we have a better idea why it is failed.
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a2f65606
    • B
      usb: musb: add helper function musb_ep_xfertype_string · 0ccbadaf
      Bin Liu 提交于
      Add helper function musb_ep_xfertype_string() to return the ep transfer
      type string.
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0ccbadaf
  20. 30 7月, 2017 1 次提交
    • B
      usb: musb: fix tx fifo flush handling again · 45d73860
      Bin Liu 提交于
      commit 68fe05e2 ("usb: musb: fix tx fifo flush handling") drops the
      1ms delay trying to solve the long disconnect time issue when
      application queued many tx urbs. However, the 1ms delay is needed for
      some use cases, for example, without the delay, reconnecting AR9271 WIFI
      dongle no longer works if the connection is dropped from the AP.
      
      So let's add back the 1ms delay in musb_h_tx_flush_fifo(), and solve the
      long disconnect time problem with a separate patch for
      usb_hcd_flush_endpoint().
      
      Cc: stable@vger.kernel.org # v4.4+
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      45d73860
  21. 27 6月, 2017 1 次提交