dwc3-msm: Fix error path with dwc3_msm_probe() API
dwc3_msm driver probe is trying to unmap allocated per endpoint
buffer without SMMU attached. This results into below warning
when probe is encountering -EPROBE_DEFER.
WARNING: CPU: 0 PID: 4 at arch/arm/mm/dma-mapping.c:1018 __arm_dma_free+0xfc/0x11c
Freeing invalid buffer e0be9000
Modules linked in:
CPU: 0 PID: 4 Comm: kworker/0:0 Tainted: G W 4.14.83-18114-gf58b2b4-dirty #50
Workqueue: events deferred_probe_work_func
[<c010eacc>] (unwind_backtrace) from [<c010bdb8>] (show_stack+0x10/0x14)
[<c010bdb8>] (show_stack) from [<c011d034>] (__warn+0xa4/0xdc)
[<c011d034>] (__warn) from [<c011d0a0>] (warn_slowpath_fmt+0x34/0x44)
[<c011d0a0>] (warn_slowpath_fmt) from [<c01132fc>] (__arm_dma_free+0xfc/0x11c)
[<c01132fc>] (__arm_dma_free) from [<c056b8d4>] (dwc3_gadget_free_endpoints+0x124/0x1ac)
[<c056b8d4>] (dwc3_gadget_free_endpoints) from [<c056b974>] (dwc3_gadget_exit+0x18/0x13c)
[<c056b974>] (dwc3_gadget_exit) from [<c0564624>] (dwc3_remove+0x38/0x98)
[<c0564624>] (dwc3_remove) from [<c046ec44>] (platform_drv_remove+0x20/0x40)
[<c046ec44>] (platform_drv_remove) from [<c046cd1c>] (device_release_driver_internal+0x134/0x1dc)
[<c046cd1c>] (device_release_driver_internal) from [<c046b158>] (bus_remove_device+0xd4/0x114)
[<c046b158>] (bus_remove_device) from [<c04691a0>] (device_del+0x1e8/0x2a0)
[<c04691a0>] (device_del) from [<c046e9d8>] (platform_device_del+0x24/0x88)
[<c046e9d8>] (platform_device_del) from [<c046e5fc>] (platform_device_unregister+0xc/0x18)
[<c046e5fc>] (platform_device_unregister) from [<c064efdc>] (of_platform_device_destroy+0x78/0x84)
[<c064efdc>] (of_platform_device_destroy) from [<c04693d4>] (device_for_each_child+0x3c/0x6c)
[<c04693d4>] (device_for_each_child) from [<c064f014>] (of_platform_depopulate+0x2c/0x44)
[<c064f014>] (of_platform_depopulate) from [<c0576c78>] (dwc3_msm_probe+0x10c8/0x1444)
[<c0576c78>] (dwc3_msm_probe) from [<c046ebd8>] (platform_drv_probe+0x58/0xa4)
Fix this by attaching SMMU before trying to unmap allocated per
endpoint buffer.
Change-Id: I360c1759f709b8e919e3237d2903ed12808b5f7d
Signed-off-by:
Mayank Rana <mrana@codeaurora.org>
Loading
Please register or sign in to comment