1. 02 Oct, 2020 23 commits
    • Peter Chen's avatar
      usb: cdns3: imx: add glue layer runtime pm implementation · ff6d6e6c
      Peter Chen authored
      Add imx glue layer runtime pm implementation, and the runtime
      pm is default off.
      Reviewed-by: default avatarPawel Laszczak <pawell@cadence.com>
      Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      ff6d6e6c
    • Peter Chen's avatar
      usb: cdns3: add runtime PM support · b1234e3b
      Peter Chen authored
      Introduce runtime PM and wakeup interrupt handler for cdns3,
      the runtime PM is default off since other cdns3 may not
      implement glue layer support for runtime PM.
      
      One typical wakeup event use case is xHCI runtime suspend will clear
      USBCMD.RS bit, after that the xHCI will not trigger any interrupts,
      so its parent (cdns core device) needs to resume xHCI device when
      any (wakeup) events occurs at host port.
      
      When the controller is in low power mode, the lpm flag will be set.
      The interrupt triggered later than lpm flag is set considers as
      wakeup interrupt and handled at cdns_wakeup_irq. Once the wakeup
      occurs, it first disables interrupt to avoid later interrupt
      occurrence since the controller is in low power mode at that
      time, and access registers may be invalid at that time. At wakeup
      handler, it will call pm_request_resume to wakeup xHCI device, and
      at runtime resume handler, it will enable interrupt again.
      
      The API platform_suspend is introduced for glue layer to implement
      platform specific PM sequence.
      Reviewed-by: default avatarPawel Laszczak <pawell@cadence.com>
      Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      b1234e3b
    • Peter Chen's avatar
      usb: cdns3: introduce set_phy_power_on{off} APIs · efe2fa08
      Peter Chen authored
      Since we have both USB2 and USB3 PHYs for cdns3 controller, it is
      better we have unity APIs to handle both USB2 and USB3's power, it
      could simplify code for error handling and further power management
      implementation.
      Reviewed-by: default avatarPawel Laszczak <pawell@cadence.com>
      Reviewed-by: default avatarJun Li <jun.li@nxp.com>
      Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      efe2fa08
    • YueHaibing's avatar
      usb: mtu3: Remove unsused inline function is_first_entry · 753a18c2
      YueHaibing authored
      It is never used, so can be removed.
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      753a18c2
    • Li Jun's avatar
      usb: dwc3: core: do not queue work if dr_mode is not USB_DR_MODE_OTG · dc336b19
      Li Jun authored
      Do not try to queue a drd work if dr_mode is not USB_DR_MODE_OTG
      because the work is not inited, this may be triggered by user try
      to change mode file of debugfs on a single role port, which will
      cause below kernel dump:
      [   60.115529] ------------[ cut here ]------------
      [   60.120166] WARNING: CPU: 1 PID: 627 at kernel/workqueue.c:1473
      __queue_work+0x46c/0x520
      [   60.128254] Modules linked in:
      [   60.131313] CPU: 1 PID: 627 Comm: sh Not tainted
      5.7.0-rc4-00022-g914a586-dirty #135
      [   60.139054] Hardware name: NXP i.MX8MQ EVK (DT)
      [   60.143585] pstate: a0000085 (NzCv daIf -PAN -UAO)
      [   60.148376] pc : __queue_work+0x46c/0x520
      [   60.152385] lr : __queue_work+0x314/0x520
      [   60.156393] sp : ffff8000124ebc40
      [   60.159705] x29: ffff8000124ebc40 x28: ffff800011808018
      [   60.165018] x27: ffff800011819ef8 x26: ffff800011d39980
      [   60.170331] x25: ffff800011808018 x24: 0000000000000100
      [   60.175643] x23: 0000000000000013 x22: 0000000000000001
      [   60.180955] x21: ffff0000b7c08e00 x20: ffff0000b6c31080
      [   60.186267] x19: ffff0000bb99bc00 x18: 0000000000000000
      [   60.191579] x17: 0000000000000000 x16: 0000000000000000
      [   60.196891] x15: 0000000000000000 x14: 0000000000000000
      [   60.202202] x13: 0000000000000000 x12: 0000000000000000
      [   60.207515] x11: 0000000000000000 x10: 0000000000000040
      [   60.212827] x9 : ffff800011d55460 x8 : ffff800011d55458
      [   60.218138] x7 : ffff0000b7800028 x6 : 0000000000000000
      [   60.223450] x5 : ffff0000b7800000 x4 : 0000000000000000
      [   60.228762] x3 : ffff0000bb997cc0 x2 : 0000000000000001
      [   60.234074] x1 : 0000000000000000 x0 : ffff0000b6c31088
      [   60.239386] Call trace:
      [   60.241834]  __queue_work+0x46c/0x520
      [   60.245496]  queue_work_on+0x6c/0x90
      [   60.249075]  dwc3_set_mode+0x48/0x58
      [   60.252651]  dwc3_mode_write+0xf8/0x150
      [   60.256489]  full_proxy_write+0x5c/0xa8
      [   60.260327]  __vfs_write+0x18/0x40
      [   60.263729]  vfs_write+0xdc/0x1c8
      [   60.267045]  ksys_write+0x68/0xf0
      [   60.270360]  __arm64_sys_write+0x18/0x20
      [   60.274286]  el0_svc_common.constprop.0+0x68/0x160
      [   60.279077]  do_el0_svc+0x20/0x80
      [   60.282394]  el0_sync_handler+0x10c/0x178
      [   60.286403]  el0_sync+0x140/0x180
      [   60.289716] ---[ end trace 70b155582e2b7988 ]---
      Signed-off-by: default avatarLi Jun <jun.li@nxp.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      dc336b19
    • Zqiang's avatar
      usb: gadget: function: printer: fix use-after-free in __lock_acquire · e8d5f92b
      Zqiang authored
      Fix this by increase object reference count.
      
      BUG: KASAN: use-after-free in __lock_acquire+0x3fd4/0x4180
      kernel/locking/lockdep.c:3831
      Read of size 8 at addr ffff8880683b0018 by task syz-executor.0/3377
      
      CPU: 1 PID: 3377 Comm: syz-executor.0 Not tainted 5.6.11 #1
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
      Call Trace:
       __dump_stack lib/dump_stack.c:77 [inline]
       dump_stack+0xce/0x128 lib/dump_stack.c:118
       print_address_description.constprop.4+0x21/0x3c0 mm/kasan/report.c:374
       __kasan_report+0x131/0x1b0 mm/kasan/report.c:506
       kasan_report+0x12/0x20 mm/kasan/common.c:641
       __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:135
       __lock_acquire+0x3fd4/0x4180 kernel/locking/lockdep.c:3831
       lock_acquire+0x127/0x350 kernel/locking/lockdep.c:4488
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
       _raw_spin_lock_irqsave+0x35/0x50 kernel/locking/spinlock.c:159
       printer_ioctl+0x4a/0x110 drivers/usb/gadget/function/f_printer.c:723
       vfs_ioctl fs/ioctl.c:47 [inline]
       ksys_ioctl+0xfb/0x130 fs/ioctl.c:763
       __do_sys_ioctl fs/ioctl.c:772 [inline]
       __se_sys_ioctl fs/ioctl.c:770 [inline]
       __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:770
       do_syscall_64+0x9e/0x510 arch/x86/entry/common.c:294
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      RIP: 0033:0x4531a9
      Code: ed 60 fc ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48
      89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d
      01 f0 ff ff 0f 83 bb 60 fc ff c3 66 2e 0f 1f 84 00 00 00 00
      RSP: 002b:00007fd14ad72c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
      RAX: ffffffffffffffda RBX: 000000000073bfa8 RCX: 00000000004531a9
      RDX: fffffffffffffff9 RSI: 000000000000009e RDI: 0000000000000003
      RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000246 R12: 00000000004bbd61
      R13: 00000000004d0a98 R14: 00007fd14ad736d4 R15: 00000000ffffffff
      
      Allocated by task 2393:
       save_stack+0x21/0x90 mm/kasan/common.c:72
       set_track mm/kasan/common.c:80 [inline]
       __kasan_kmalloc.constprop.3+0xa7/0xd0 mm/kasan/common.c:515
       kasan_kmalloc+0x9/0x10 mm/kasan/common.c:529
       kmem_cache_alloc_trace+0xfa/0x2d0 mm/slub.c:2813
       kmalloc include/linux/slab.h:555 [inline]
       kzalloc include/linux/slab.h:669 [inline]
       gprinter_alloc+0xa1/0x870 drivers/usb/gadget/function/f_printer.c:1416
       usb_get_function+0x58/0xc0 drivers/usb/gadget/functions.c:61
       config_usb_cfg_link+0x1ed/0x3e0 drivers/usb/gadget/configfs.c:444
       configfs_symlink+0x527/0x11d0 fs/configfs/symlink.c:202
       vfs_symlink+0x33d/0x5b0 fs/namei.c:4201
       do_symlinkat+0x11b/0x1d0 fs/namei.c:4228
       __do_sys_symlinkat fs/namei.c:4242 [inline]
       __se_sys_symlinkat fs/namei.c:4239 [inline]
       __x64_sys_symlinkat+0x73/0xb0 fs/namei.c:4239
       do_syscall_64+0x9e/0x510 arch/x86/entry/common.c:294
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      Freed by task 3368:
       save_stack+0x21/0x90 mm/kasan/common.c:72
       set_track mm/kasan/common.c:80 [inline]
       kasan_set_free_info mm/kasan/common.c:337 [inline]
       __kasan_slab_free+0x135/0x190 mm/kasan/common.c:476
       kasan_slab_free+0xe/0x10 mm/kasan/common.c:485
       slab_free_hook mm/slub.c:1444 [inline]
       slab_free_freelist_hook mm/slub.c:1477 [inline]
       slab_free mm/slub.c:3034 [inline]
       kfree+0xf7/0x410 mm/slub.c:3995
       gprinter_free+0x49/0xd0 drivers/usb/gadget/function/f_printer.c:1353
       usb_put_function+0x38/0x50 drivers/usb/gadget/functions.c:87
       config_usb_cfg_unlink+0x2db/0x3b0 drivers/usb/gadget/configfs.c:485
       configfs_unlink+0x3b9/0x7f0 fs/configfs/symlink.c:250
       vfs_unlink+0x287/0x570 fs/namei.c:4073
       do_unlinkat+0x4f9/0x620 fs/namei.c:4137
       __do_sys_unlink fs/namei.c:4184 [inline]
       __se_sys_unlink fs/namei.c:4182 [inline]
       __x64_sys_unlink+0x42/0x50 fs/namei.c:4182
       do_syscall_64+0x9e/0x510 arch/x86/entry/common.c:294
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      The buggy address belongs to the object at ffff8880683b0000
       which belongs to the cache kmalloc-1k of size 1024
      The buggy address is located 24 bytes inside of
       1024-byte region [ffff8880683b0000, ffff8880683b0400)
      The buggy address belongs to the page:
      page:ffffea0001a0ec00 refcount:1 mapcount:0 mapping:ffff88806c00e300
      index:0xffff8880683b1800 compound_mapcount: 0
      flags: 0x100000000010200(slab|head)
      raw: 0100000000010200 0000000000000000 0000000600000001 ffff88806c00e300
      raw: ffff8880683b1800 000000008010000a 00000001ffffffff 0000000000000000
      page dumped because: kasan: bad access detected
      Reported-by: default avatarKyungtae Kim <kt0755@gmail.com>
      Signed-off-by: default avatarZqiang <qiang.zhang@windriver.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      e8d5f92b
    • Florian Fainelli's avatar
      MAINTAINERS: Add entry for Broadcom BDC driver · aa8c16e4
      Florian Fainelli authored
      The Broadcom BDC driver did not have a MAINTAINERS entry which made it
      escape review from Al and myself, add an entry so the relevant mailing
      lists and people are copied.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      aa8c16e4
    • Michał Mirosław's avatar
      usb: gadget: f_acm: don't disable disabled EP · e7a0ed3f
      Michał Mirosław authored
      Make debugging real problems easier by not trying to disable an EP that
      was not yet enabled.
      Reviewed-by: default avatarPeter Chen <peter.chen@nxp.com>
      Signed-off-by: default avatarMichał Mirosław <mirq-linux@rere.qmqm.pl>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      e7a0ed3f
    • Tao Ren's avatar
      usb: gadget: aspeed: fixup vhub port irq handling · a1c0169a
      Tao Ren authored
      This is a follow-on patch for commit a23be4ed ("usb: gadget: aspeed:
      improve vhub port irq handling"): for_each_set_bit() is replaced with
      simple for() loop because for() loop runs faster on ASPEED BMC.
      Signed-off-by: default avatarTao Ren <rentao.bupt@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      a1c0169a
    • Felipe Balbi's avatar
      usb: dwc3: gadget: fix checkpatch warnings · e319bd62
      Felipe Balbi authored
      no functional changes
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      e319bd62
    • Felipe Balbi's avatar
      usb: dwc3: core: fix checkpatch warnings · 87b923a2
      Felipe Balbi authored
      no functional changes
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      87b923a2
    • Felipe Balbi's avatar
      usb: dwc3: debugfs: fix checkpatch warnings · 9ae0eb45
      Felipe Balbi authored
      no functional changes
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      9ae0eb45
    • Felipe Balbi's avatar
      usb: dwc3: qcom: fix checkpatch warnings · 993ffc5b
      Felipe Balbi authored
      no functional changes
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      993ffc5b
    • Felipe Balbi's avatar
      usb: dwc3: ep0: fix checkpatch warnings · c64b475b
      Felipe Balbi authored
      no functional changes
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      c64b475b
    • Felipe Balbi's avatar
      usb: dwc3: debug: fix checkpatch warning · 035cbca1
      Felipe Balbi authored
      no functional changes
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      035cbca1
    • Felipe Balbi's avatar
      usb: dwc3: trace: fix checkpatch warnings · 159fdf29
      Felipe Balbi authored
      no functional changes
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      159fdf29
    • Felipe Balbi's avatar
      usb: dwc3: ulpi: fix checkpatch warning · 2a499b45
      Felipe Balbi authored
      no functional changes.
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      2a499b45
    • Felipe Balbi's avatar
      usb: dwc3: meson: fix checkpatch errors and warnings · e5ee93d4
      Felipe Balbi authored
      no functional changes.
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      e5ee93d4
    • Felipe Balbi's avatar
      usb: dwc3: debug: fix sparse warning · 27c7ab0f
      Felipe Balbi authored
      Fix the following sparse warning:
      
      drivers/usb/dwc3/trace.c: note: in included file (through drivers/usb/dwc3/trace.h):
      drivers/usb/dwc3/debug.h:374:39: warning: cast to non-scalar
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      27c7ab0f
    • Felipe Balbi's avatar
      usb: dwc3: meson: fix coccinelle WARNING · a793cf81
      Felipe Balbi authored
      Coccinelle suggests using PTR_ERR_OR_ZERO().
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      a793cf81
    • Sandeep Maheswaram's avatar
      usb: dwc3: qcom: Add interconnect support in dwc3 driver · bea46b98
      Sandeep Maheswaram authored
      Add interconnect support in dwc3-qcom driver to vote for bus
      bandwidth.
      
      This requires for two different paths - from USB to
      DDR. The other is from APPS to USB.
      Reviewed-by: default avatarMatthias Kaehlcke <mka@chromium.org>
      Signed-off-by: default avatarSandeep Maheswaram <sanm@codeaurora.org>
      Signed-off-by: default avatarChandana Kishori Chiluveru <cchiluve@codeaurora.org>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      bea46b98
    • Linus Walleij's avatar
      usb: gadget: udc: Drop surplus include · 072f34c2
      Linus Walleij authored
      The UDC NET2272 driver includes <linux/gpio.h> but does not
      use any symbols from this file, so drop the include.
      
      Cc: Felipe Balbi <balbi@kernel.org>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      072f34c2
    • Peter Chen's avatar
      MAINTAINERS: add Cadence USB3 DRD IP driver entry · 5b311668
      Peter Chen authored
      Add Cadence USB3 DRD IP driver entry
      Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      5b311668
  2. 24 Sep, 2020 14 commits
    • Cristian Birsan's avatar
      ARM: dts: at91: sam9x60ek: enable usb device · 84b522e6
      Cristian Birsan authored
      Enable usb device for sam9x60ek board.
      Signed-off-by: default avatarCristian Birsan <cristian.birsan@microchip.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      84b522e6
    • Cristian Birsan's avatar
      usb: gadget: udc: atmel: update endpoint allocation for sam9x60 · 26b32424
      Cristian Birsan authored
      The DPRAM memory from the USB High Speed Device Port (UDPHS) hardware
      block was increased. This patch updates the endpoint allocation for sam9x60
      to take advantage of this larger memory. At the same time the
      constraint to allocate the endpoints in order was lifted. To handle old
      and new hardware in the same driver the ep_prealloc was added.
      Signed-off-by: default avatarCristian Birsan <cristian.birsan@microchip.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      26b32424
    • Cristian Birsan's avatar
      usb: gadget: udc: atmel: use 1 bank endpoints for control transfers · 5b041a30
      Cristian Birsan authored
      Use 1 bank endpoints for control transfers
      Signed-off-by: default avatarCristian Birsan <cristian.birsan@microchip.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      5b041a30
    • Cristian Birsan's avatar
      usb: gadget: udc: atmel: simplify endpoint allocation · 033b8966
      Cristian Birsan authored
      Simplify the endpoint allocation and cleanup the code.
      Signed-off-by: default avatarCristian Birsan <cristian.birsan@microchip.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      033b8966
    • Cristian Birsan's avatar
    • Claudiu Beznea's avatar
      usb: gadget: udc: atmel: use of_find_matching_node_and_match · 3a482178
      Claudiu Beznea authored
      Instead of trying to match every possible compatible use
      of_find_matching_node_and_match() and pass the compatible array.
      Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
      Signed-off-by: default avatarCristian Birsan <cristian.birsan@microchip.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      3a482178
    • Martin Blumenstingl's avatar
      usb: dwc2: Add missing cleanups when usb_add_gadget_udc() fails · e1c08cf2
      Martin Blumenstingl authored
      Call dwc2_debugfs_exit() and dwc2_hcd_remove() (if the HCD was enabled
      earlier) when usb_add_gadget_udc() has failed. This ensures that the
      debugfs entries created by dwc2_debugfs_init() as well as the HCD are
      cleaned up in the error path.
      
      Fixes: 207324a3 ("usb: dwc2: Postponed gadget registration to the udc class driver")
      Acked-by: default avatarMinas Harutyunyan <hminas@synopsys.com>
      Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      e1c08cf2
    • Thinh Nguyen's avatar
      usb: dwc3: core: Print warning on unsupported speed · e518bdd9
      Thinh Nguyen authored
      The user may have more information to override the HW parameter to
      specify the maximum_speed. However, if the user specifies a
      maximum_speed that the controller doesn't support, print out a warning.
      Signed-off-by: default avatarThinh Nguyen <thinhn@synopsys.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      e518bdd9
    • Thinh Nguyen's avatar
      usb: dwc3: core: Properly default unspecified speed · b574ce3e
      Thinh Nguyen authored
      If the maximum_speed is not specified, default the device speed base on
      its HW capability. Don't prematurely check HW capability before
      validating the maximum_speed device property. The device property takes
      precedence in dwc->maximum_speed.
      
      Fixes: 0e1e5c47 ("usb: dwc3: add support for USB 2.0-only core configuration")
      Reported-by: default avatarChunfeng Yun <chunfeng.yun@mediatek.com>
      Signed-off-by: default avatarThinh Nguyen <thinhn@synopsys.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      b574ce3e
    • Nathan Chancellor's avatar
      usb: dwc2: Fix parameter type in function pointer prototype · 362b9398
      Nathan Chancellor authored
      When booting up on a Raspberry Pi 4 with Control Flow Integrity checking
      enabled, the following warning/panic happens:
      
      [    1.626435] CFI failure (target: dwc2_set_bcm_params+0x0/0x4):
      [    1.632408] WARNING: CPU: 0 PID: 32 at kernel/cfi.c:30 __cfi_check_fail+0x54/0x5c
      [    1.640021] Modules linked in:
      [    1.643137] CPU: 0 PID: 32 Comm: kworker/0:1 Not tainted 5.8.0-rc6-next-20200724-00051-g89ba619726de #1
      [    1.652693] Hardware name: Raspberry Pi 4 Model B Rev 1.2 (DT)
      [    1.658637] Workqueue: events deferred_probe_work_func
      [    1.663870] pstate: 60000005 (nZCv daif -PAN -UAO BTYPE=--)
      [    1.669542] pc : __cfi_check_fail+0x54/0x5c
      [    1.673798] lr : __cfi_check_fail+0x54/0x5c
      [    1.678050] sp : ffff8000102bbaa0
      [    1.681419] x29: ffff8000102bbaa0 x28: ffffab09e21c7000
      [    1.686829] x27: 0000000000000402 x26: ffff0000f6e7c228
      [    1.692238] x25: 00000000fb7cdb0d x24: 0000000000000005
      [    1.697647] x23: ffffab09e2515000 x22: ffffab09e069a000
      [    1.703055] x21: 4c550309df1cf4c1 x20: ffffab09e2433c60
      [    1.708462] x19: ffffab09e160dc50 x18: ffff0000f6e8cc78
      [    1.713870] x17: 0000000000000041 x16: ffffab09e0bce6f8
      [    1.719278] x15: ffffab09e1c819b7 x14: 0000000000000003
      [    1.724686] x13: 00000000ffffefff x12: 0000000000000000
      [    1.730094] x11: 0000000000000000 x10: 00000000ffffffff
      [    1.735501] x9 : c932f7abfc4bc600 x8 : c932f7abfc4bc600
      [    1.740910] x7 : 077207610770075f x6 : ffff0000f6c38f00
      [    1.746317] x5 : 0000000000000000 x4 : 0000000000000000
      [    1.751723] x3 : 0000000000000000 x2 : 0000000000000000
      [    1.757129] x1 : ffff8000102bb7d8 x0 : 0000000000000032
      [    1.762539] Call trace:
      [    1.765030]  __cfi_check_fail+0x54/0x5c
      [    1.768938]  __cfi_check+0x5fa6c/0x66afc
      [    1.772932]  dwc2_init_params+0xd74/0xd78
      [    1.777012]  dwc2_driver_probe+0x484/0x6ec
      [    1.781180]  platform_drv_probe+0xb4/0x100
      [    1.785350]  really_probe+0x228/0x63c
      [    1.789076]  driver_probe_device+0x80/0xc0
      [    1.793247]  __device_attach_driver+0x114/0x160
      [    1.797857]  bus_for_each_drv+0xa8/0x128
      [    1.801851]  __device_attach.llvm.14901095709067289134+0xc0/0x170
      [    1.808050]  bus_probe_device+0x44/0x100
      [    1.812044]  deferred_probe_work_func+0x78/0xb8
      [    1.816656]  process_one_work+0x204/0x3c4
      [    1.820736]  worker_thread+0x2f0/0x4c4
      [    1.824552]  kthread+0x174/0x184
      [    1.827837]  ret_from_fork+0x10/0x18
      
      CFI validates that all indirect calls go to a function with the same
      exact function pointer prototype. In this case, dwc2_set_bcm_params
      is the target, which has a parameter of type 'struct dwc2_hsotg *',
      but it is being implicitly cast to have a parameter of type 'void *'
      because that is the set_params function pointer prototype. Make the
      function pointer protoype match the definitions so that there is no
      more violation.
      
      Fixes: 7de1debc ("usb: dwc2: Remove platform static params")
      Link: https://github.com/ClangBuiltLinux/linux/issues/1107Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      362b9398
    • Mauro Carvalho Chehab's avatar
      usb: dwc3: simple: add support for Hikey 970 · b68d9251
      Mauro Carvalho Chehab authored
      This binding driver is needed for Hikey 970 to work,
      as otherwise a Serror is produced:
      
          [    1.837458] SError Interrupt on CPU0, code 0xbf000002 -- SError
          [    1.837462] CPU: 0 PID: 74 Comm: kworker/0:1 Not tainted 5.8.0+ #205
          [    1.837463] Hardware name: HiKey970 (DT)
          [    1.837465] Workqueue: events deferred_probe_work_func
          [    1.837467] pstate: 20000005 (nzCv daif -PAN -UAO BTYPE=--)
          [    1.837468] pc : _raw_spin_unlock_irqrestore+0x18/0x50
          [    1.837469] lr : regmap_unlock_spinlock+0x14/0x20
          [    1.837470] sp : ffff8000124dba60
          [    1.837471] x29: ffff8000124dba60 x28: 0000000000000000
          [    1.837474] x27: ffff0001b7e854c8 x26: ffff80001204ea18
          [    1.837476] x25: 0000000000000005 x24: ffff800011f918f8
          [    1.837479] x23: ffff800011fbb588 x22: ffff0001b7e40e00
          [    1.837481] x21: 0000000000000100 x20: 0000000000000000
          [    1.837483] x19: ffff0001b767ec00 x18: 00000000ff10c000
          [    1.837485] x17: 0000000000000002 x16: 0000b0740fdb9950
          [    1.837488] x15: ffff8000116c1198 x14: ffffffffffffffff
          [    1.837490] x13: 0000000000000030 x12: 0101010101010101
          [    1.837493] x11: 0000000000000020 x10: ffff0001bf17d130
          [    1.837495] x9 : 0000000000000000 x8 : ffff0001b6938080
          [    1.837497] x7 : 0000000000000000 x6 : 000000000000003f
          [    1.837500] x5 : 0000000000000000 x4 : 0000000000000000
          [    1.837502] x3 : ffff80001096a880 x2 : 0000000000000000
          [    1.837505] x1 : ffff0001b7e40e00 x0 : 0000000100000001
          [    1.837507] Kernel panic - not syncing: Asynchronous SError Interrupt
          [    1.837509] CPU: 0 PID: 74 Comm: kworker/0:1 Not tainted 5.8.0+ #205
          [    1.837510] Hardware name: HiKey970 (DT)
          [    1.837511] Workqueue: events deferred_probe_work_func
          [    1.837513] Call trace:
          [    1.837514]  dump_backtrace+0x0/0x1e0
          [    1.837515]  show_stack+0x18/0x24
          [    1.837516]  dump_stack+0xc0/0x11c
          [    1.837517]  panic+0x15c/0x324
          [    1.837518]  nmi_panic+0x8c/0x90
          [    1.837519]  arm64_serror_panic+0x78/0x84
          [    1.837520]  do_serror+0x158/0x15c
          [    1.837521]  el1_error+0x84/0x100
          [    1.837522]  _raw_spin_unlock_irqrestore+0x18/0x50
          [    1.837523]  regmap_write+0x58/0x80
          [    1.837524]  hi3660_reset_deassert+0x28/0x34
          [    1.837526]  reset_control_deassert+0x50/0x260
          [    1.837527]  reset_control_deassert+0xf4/0x260
          [    1.837528]  dwc3_probe+0x5dc/0xe6c
          [    1.837529]  platform_drv_probe+0x54/0xb0
          [    1.837530]  really_probe+0xe0/0x490
          [    1.837531]  driver_probe_device+0xf4/0x160
          [    1.837532]  __device_attach_driver+0x8c/0x114
          [    1.837533]  bus_for_each_drv+0x78/0xcc
          [    1.837534]  __device_attach+0x108/0x1a0
          [    1.837535]  device_initial_probe+0x14/0x20
          [    1.837537]  bus_probe_device+0x98/0xa0
          [    1.837538]  deferred_probe_work_func+0x88/0xe0
          [    1.837539]  process_one_work+0x1cc/0x350
          [    1.837540]  worker_thread+0x2c0/0x470
          [    1.837541]  kthread+0x154/0x160
          [    1.837542]  ret_from_fork+0x10/0x30
          [    1.837569] SMP: stopping secondary CPUs
          [    1.837570] Kernel Offset: 0x1d0000 from 0xffff800010000000
          [    1.837571] PHYS_OFFSET: 0x0
          [    1.837572] CPU features: 0x240002,20882004
          [    1.837573] Memory Limit: none
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      b68d9251
    • Peter Chen's avatar
      usb: cdns3: gadget: free interrupt after gadget has deleted · 98df91f8
      Peter Chen authored
      The interrupt may occur during the gadget deletion, it fixes the
      below oops.
      
      [ 2394.974604] configfs-gadget gadget: suspend
      [ 2395.042578] configfs-gadget 5b130000.usb: unregistering UDC driver [g1]
      [ 2395.382562] irq 229: nobody cared (try booting with the "irqpoll" option)
      [ 2395.389362] CPU: 0 PID: 301 Comm: kworker/u12:6 Not tainted 5.8.0-rc3-next-20200703-00060-g2f13b83cbf30-dirty #456
      [ 2395.399712] Hardware name: Freescale i.MX8QM MEK (DT)
      [ 2395.404782] Workqueue: 2-0051 tcpm_state_machine_work
      [ 2395.409832] Call trace:
      [ 2395.412289]  dump_backtrace+0x0/0x1d0
      [ 2395.415950]  show_stack+0x1c/0x28
      [ 2395.419271]  dump_stack+0xbc/0x118
      [ 2395.422678]  __report_bad_irq+0x50/0xe0
      [ 2395.426513]  note_interrupt+0x2cc/0x38c
      [ 2395.430355]  handle_irq_event_percpu+0x88/0x90
      [ 2395.434800]  handle_irq_event+0x4c/0xe8
      [ 2395.438640]  handle_fasteoi_irq+0xbc/0x168
      [ 2395.442740]  generic_handle_irq+0x34/0x48
      [ 2395.446752]  __handle_domain_irq+0x68/0xc0
      [ 2395.450846]  gic_handle_irq+0x64/0x150
      [ 2395.454596]  el1_irq+0xb8/0x180
      [ 2395.457733]  __do_softirq+0xac/0x3b8
      [ 2395.461310]  irq_exit+0xc0/0xe0
      [ 2395.464448]  __handle_domain_irq+0x6c/0xc0
      [ 2395.468540]  gic_handle_irq+0x64/0x150
      [ 2395.472295]  el1_irq+0xb8/0x180
      [ 2395.475436]  _raw_spin_unlock_irqrestore+0x14/0x48
      [ 2395.480232]  usb_gadget_disconnect+0x120/0x140
      [ 2395.484678]  usb_gadget_remove_driver+0xb4/0xd0
      [ 2395.489208]  usb_del_gadget+0x6c/0xc8
      [ 2395.492872]  cdns3_gadget_exit+0x5c/0x120
      [ 2395.496882]  cdns3_role_stop+0x60/0x90
      [ 2395.500634]  cdns3_role_set+0x64/0xd8
      [ 2395.504301]  usb_role_switch_set_role.part.0+0x3c/0x90
      [ 2395.509444]  usb_role_switch_set_role+0x20/0x30
      [ 2395.513978]  tcpm_mux_set+0x60/0xf8
      [ 2395.517470]  tcpm_reset_port+0xa4/0xf0
      [ 2395.521222]  tcpm_detach.part.0+0x44/0x50
      [ 2395.525227]  tcpm_state_machine_work+0x8b0/0x2360
      [ 2395.529932]  process_one_work+0x1c8/0x470
      [ 2395.533939]  worker_thread+0x50/0x420
      [ 2395.537603]  kthread+0x148/0x168
      [ 2395.540830]  ret_from_fork+0x10/0x18
      [ 2395.544399] handlers:
      [ 2395.546671] [<000000008dea28da>] cdns3_wakeup_irq
      [ 2395.551375] [<000000009fee5c61>] cdns3_drd_irq threaded [<000000005148eaec>] cdns3_drd_thread_irq
      [ 2395.560255] Disabling IRQ #229
      [ 2395.563454] configfs-gadget gadget: unbind function 'Mass Storage Function'/000000000132f835
      [ 2395.563657] configfs-gadget gadget: unbind
      [ 2395.563917] udc 5b130000.usb: releasing '5b130000.usb'
      
      Fixes: 7733f6c3 ("usb: cdns3: Add Cadence USB3 DRD Driver")
      Cc: <stable@vger.kernel.org>
      Acked-by: default avatarRoger Quadros <rogerq@ti.com>
      Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      98df91f8
    • Thinh Nguyen's avatar
      usb: dwc3: gadget: END_TRANSFER before CLEAR_STALL command · d97c78a1
      Thinh Nguyen authored
      According the programming guide (for all DWC3 IPs), when the driver
      handles ClearFeature(halt) request, it should issue CLEAR_STALL command
      _after_ the END_TRANSFER command completes. The END_TRANSFER command may
      take some time to complete. So, delay the ClearFeature(halt) request
      control status stage and wait for END_TRANSFER command completion
      interrupt. Only after END_TRANSFER command completes that the driver
      may issue CLEAR_STALL command.
      
      Cc: stable@vger.kernel.org
      Fixes: cb11ea56 ("usb: dwc3: gadget: Properly handle ClearFeature(halt)")
      Signed-off-by: default avatarThinh Nguyen <thinhn@synopsys.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      d97c78a1
    • Thinh Nguyen's avatar
      usb: dwc3: gadget: Resume pending requests after CLEAR_STALL · c503672a
      Thinh Nguyen authored
      The function driver may queue new requests right after halting the
      endpoint (i.e. queue new requests while the endpoint is stalled).
      There's no restriction preventing it from doing so. However, dwc3
      currently drops those requests after CLEAR_STALL. The driver should only
      drop started requests. Keep the pending requests in the pending list to
      resume and process them after the host issues ClearFeature(Halt) to the
      endpoint.
      
      Cc: stable@vger.kernel.org
      Fixes: cb11ea56 ("usb: dwc3: gadget: Properly handle ClearFeature(halt)")
      Signed-off-by: default avatarThinh Nguyen <thinhn@synopsys.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      c503672a
  3. 20 Sep, 2020 3 commits