Commit Graph

1072975 Commits

Author SHA1 Message Date
Yandong Lin
3b67ff56d6 video: rockchip: mpp: add iommu flush tlb before hw run for px30
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I20ae76b0890a8f6bee158a5a5c4dddd4d660e74a
2022-11-15 17:50:41 +08:00
William Wu
886953b713 arm64: dts: rockchip: rk3568: add quirk-skip-phy-init for usb otg0
The rk3568 usb dwc3 controller has phy management at its
own driver to cover both device and host mode. And for
usb otg0, it enable device wakeup that make the usb hcd
core to keep the phy initialized so the device can wake
up the system. However, most of rk3568 platforms power
off the logic and cause phy grf lost power, thus we need
to add quirk-skip-phy-init to reinit phy grf upon system
resume.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I14061e3b8bad05818e8496d4710695ef31deed9f
2022-11-15 17:38:32 +08:00
Finley Xiao
abb9ecec3d arm64: dts: rockchip: rk3399: Change low temperature to 10 degrees C
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I9f17e4f89a1552115b0d4a34f2290e785990c8bb
2022-11-15 14:50:24 +08:00
Jianqun Xu
6b444336b5 ARM: dts: rockchip: rk3288-linux use fiq as console
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I2c67d7e541425667cdb41d6133538acaba665e0d
2022-11-15 14:07:56 +08:00
Jianlong Wang
9b45bb6e86 ARM: configs: add fragment defconfig for rk312x
generate by:
    make ARCH=arm rockchip_linux_defconfig
    cp .config rockchip_linux.config

    make ARCH=arm rockchip_linux_defconfig rk3126_linux.config
    scripts/diffconfig -m rockchip_linux.config .config > \
        arch/arm/configs/rk3126_linux.config

    make ARCH=arm rockchip_linux_defconfig rk3126_linux_slc_nand.config
    scripts/diffconfig -m rockchip_linux.config .config > \
        arch/arm/configs/rk3126_linux_slc_nand.config

    make ARCH=arm rockchip_linux_defconfig rk3128_linux.config
    scripts/diffconfig -m rockchip_linux.config .config > \
        arch/arm/configs/rk3128_linux.config

Change-Id: I25fef40998b06ede079704fe7fc2f3b49d5b55c4
Signed-off-by: Jianlong Wang <jianlong.wang@rock-chips.com>
2022-11-15 10:49:18 +08:00
Jianqun Xu
6a7a7f513d ARM: dts: rockchip: rk3288 fix gpu node to match midgard driver
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I74cfa3309c76ca01df9b42ff39ce51c719189258
2022-11-15 10:39:50 +08:00
Damon Ding
69870f9db0 ARM: dts: rockchip: rk3288: fix display related nodes
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: I0f1dda389fe89f06495661baeb3c21edbc18dfbe
2022-11-15 10:37:59 +08:00
Wyon Bi
1e6ad41b1d ARM: dts: rockchip: rk3288: Fix edp node
Change-Id: I01855dd3ef2ea3be1db063e35f9aebd815fd66ba
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2022-11-15 10:37:59 +08:00
Damon Ding
36f27e6905 ARM: dts: rockchip: rk3288: assign clock rate for ACLK_VIO0 and ACLK_VIO1
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: I87fbbe3e043b040f8b9b9c79f21a8327b8e32bd0
2022-11-15 10:37:59 +08:00
Damon Ding
ff311139ed ARM: dts: rockchip: rk3288: remove PLL_CPLL assignment from cru node
PLL_CPLL is for VOP only, which does not need to be
initialized in CRU.

Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: Ic51b4e2ef377ee6f796e807131f1fe02d0db39cc
2022-11-15 10:37:59 +08:00
Yu Qiaowei
4bcdb727b2 video: rockchip: rga3: fix leak of release_fence_fd
When there is no acquire_fence, the allocated release_fence_fd must be
closed when the job submission fails, and it is unreasonable to require
user-space to close.

Update driver version to 1.2.22

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Ie7c3006968dbb1ba22e21d6de65037183386112e
2022-11-14 19:40:19 +08:00
Algea Cao
36d1125cc4 drm/bridge: synopsys: dw-hdmi-qp: Fix hdmi phy power off in DVI mode
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: I28d38dbc944f6760469c34b7b6a19675835daa41
2022-11-14 17:18:32 +08:00
Weixin Zhou
676fc5d2c5 arm64: dts: rockchip: rk3399: add gpio drive strength 10ma
Change-Id: Iff6303af2e87425b0509fd962b9e6b2fca8eb896
Signed-off-by: Weixin Zhou <zwx@rock-chips.com>
2022-11-14 15:36:27 +08:00
Lin Jinhan
e77294b62b crypto: rockchip: fix crush when skcipher fallback alloc failed
Change-Id: Ia48f7daac3de6f70896964c73fa87ed090aa2fa6
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2022-11-14 09:27:39 +08:00
Thinh Nguyen
1179c4729a UPSTREAM: usb: dwc3: gadget: Don't delay End Transfer on delayed_status
The gadget driver may wait on the request completion when it sets the
USB_GADGET_DELAYED_STATUS. Make sure that the End Transfer command can
go through if the dwc->delayed_status is set so that the request can
complete. When the delayed_status is set, the Setup packet is already
processed, and the next phase should be either Data or Status. It's
unlikely that the host would cancel the control transfer and send a new
Setup packet during End Transfer command. But if that's the case, we can
try again when ep0state returns to EP0_SETUP_PHASE.

Change-Id: Ie99f8e9306e1212dd602a8d9345dd5fabb640b0d
Fixes: e1ee843488 ("usb: dwc3: gadget: Force sending delayed status during soft disconnect")
Cc: stable@vger.kernel.org
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/3f9f59e5d74efcbaee444cf4b30ef639cc7b124e.1666146954.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 4db0fbb601)
2022-11-11 20:03:32 +08:00
Wesley Cheng
313d6a04df UPSTREAM: usb: dwc3: gadget: Do not clear ep delayed stop flag during ep disable
DWC3_EP_DELAYED_STOP is utilized to defer issuing the end transfer command
until the subsequent SETUP stage, in order to avoid end transfer timeouts.
During cable disconnect scenarios, __dwc3_gadget_ep_disable() is
responsible for ensuring endpoints have no active transfers pending.  Since
dwc3_remove_request() can now exit early if the EP delayed stop is set,
avoid clearing all DEP flags, otherwise the transition back into the SETUP
stage won't issue an endxfer command.

Change-Id: Ifaaf6405e24868b1b52f23aa492ed8ed783d1e14
Fixes: 2b2da6574e ("usb: dwc3: Avoid unmapping USB requests if endxfer is not complete")
Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Link: https://lore.kernel.org/r/20220919231213.21364-1-quic_wcheng@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 76bff31c7f)
2022-11-11 20:03:32 +08:00
Wesley Cheng
cf0dba7ad6 UPSTREAM: usb: dwc3: gadget: Submit endxfer command if delayed during disconnect
During a cable disconnect sequence, if ep0state is not in the SETUP phase,
then nothing will trigger any pending end transfer commands.  Force
stopping of any pending SETUP transaction, and move back to the SETUP
phase.

Change-Id: Icae282b1a47872a262fea9b6bd4e8dea08c5455d
Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Link: https://lore.kernel.org/r/20220901193625.8727-6-quic_wcheng@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 8422b769fa)
2022-11-11 20:03:32 +08:00
Wesley Cheng
d44087b472 UPSTREAM: usb: dwc3: gadget: Skip waiting for CMDACT cleared during endxfer
For endxfer commands that do not require an endpoint complete interrupt,
avoid having to wait for the command active bit to clear.  This allows for
EP0 events to continue to be handled, which allows for the controller to
complete it.  Otherwise, it is known that the endxfer command will fail if
there is a pending SETUP token that needs to be read.

Change-Id: Ib6c352ff25be3186454894da619323eabe75aa70
Suggested-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Link: https://lore.kernel.org/r/20220901193625.8727-5-quic_wcheng@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit b353eb6dc2)
2022-11-11 20:03:32 +08:00
Wesley Cheng
6f0af65133 UPSTREAM: usb: dwc3: Increase DWC3 controller halt timeout
Since EP0 transactions need to be completed before the controller halt
sequence is finished, this may take some time depending on the host and the
enabled functions.  Increase the controller halt timeout, so that we give
the controller sufficient time to handle EP0 transfers.

Change-Id: Id933051520104a7037756fe5a92220c1bd4f4939
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Link: https://lore.kernel.org/r/20220901193625.8727-4-quic_wcheng@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 461ee46750)
2022-11-11 20:03:32 +08:00
Wesley Cheng
00b2eeee67 UPSTREAM: usb: dwc3: Remove DWC3 locking during gadget suspend/resume
Remove the need for making dwc3_gadget_suspend() and dwc3_gadget_resume()
to be called in a spinlock, as dwc3_gadget_run_stop() could potentially
take some time to complete.

Change-Id: Iefb140c66f26029d9f2ba244b58092e3ea7099f4
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Link: https://lore.kernel.org/r/20220901193625.8727-3-quic_wcheng@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 5265397f94)
2022-11-11 20:03:32 +08:00
Wesley Cheng
f1d47b5138 UPSTREAM: usb: dwc3: Avoid unmapping USB requests if endxfer is not complete
If DWC3_EP_DELAYED_STOP is set during stop active transfers, then do not
continue attempting to unmap request buffers during dwc3_remove_requests().
This can lead to SMMU faults, as the controller has not stopped the
processing of the TRB.  Defer this sequence to the EP0 out start, which
ensures that there are no pending SETUP transactions before issuing the
endxfer.

Change-Id: I576922c1a9566507f8ac268a4fc2c4bfb4129aee
Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Link: https://lore.kernel.org/r/20220901193625.8727-2-quic_wcheng@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 2b2da6574e)
2022-11-11 20:03:32 +08:00
Wesley Cheng
33be4d8a2c UPSTREAM: usb: dwc3: gadget: Continue handling EP0 xfercomplete events
During soft disconnect, EP0 events are expected to be handled in order to
allow the controller to successfully move into the halted state.  Since
__dwc3_gadget_stop() is executed before polling, EP0 has been disabled, and
events are being blocked.  Allow xfercomplete events to be handled, so that
cached SETUP packets can be read out from the internal controller memory.

Without doing so, it will lead to endxfer timeouts, which results to
controller halt failures.

Change-Id: Ie58a709ee48f8f8e869285414ee2fd93d4d56326
Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Link: https://lore.kernel.org/r/20220817182359.13550-5-quic_wcheng@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit dff981842a)
2022-11-11 20:03:32 +08:00
Wesley Cheng
bb1cb9817d UPSTREAM: usb: dwc3: gadget: Synchronize IRQ between soft connect/disconnect
Ensure that there are no pending events being handled in between soft
connect/disconnect transitions.  As we are keeping interrupts enabled,
and EP0 events are still being serviced, this avoids any stale events from
being serviced.

Change-Id: I4c9aa27b64281d10c3d5f9fc3359663fd92ca2be
Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Link: https://lore.kernel.org/r/20220817182359.13550-4-quic_wcheng@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 9711c67de7)
2022-11-11 20:03:32 +08:00
Wesley Cheng
17c0654fa2 UPSTREAM: usb: dwc3: gadget: Force sending delayed status during soft disconnect
If any function drivers request for a delayed status phase, this leads to a
SETUP transfer timeout error, since the function may take longer to process
the DATA stage.  This eventually results in end transfer timeouts, as there
is a pending SETUP transaction.

In addition, allow the DWC3_EP_DELAY_STOP to be set for if there is a
delayed status requested.  Ocasionally, a host may abort the current SETUP
transaction, by issuing a subsequent SETUP token.  In those situations, it
would result in an endxfer timeout as well.

Change-Id: I7decd682cf7f5714779364465383827efa22f2a1
Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Link: https://lore.kernel.org/r/20220817182359.13550-3-quic_wcheng@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit e1ee843488)
2022-11-11 20:03:32 +08:00
Wesley Cheng
8ca246c586 BACKPORT: usb: dwc3: Do not service EP0 and conndone events if soft disconnected
There are some operations that need to be ignored if there is a soft
disconnect in progress.  This is to avoid having a pending EP0 transfer in
progress while attempting to stop active transfers and halting the
controller.

There were several instances seen where a soft disconnect was able to occur
during early link negotiation, i.e. bus reset/conndone, which leads to the
conndone handler re-configuring EPs while attempting to halt the
controller, as DEP flags are cleared as part of the soft disconnect path.

ep0out: cmd 'Start New Configuration'
ep0out: cmd 'Set Endpoint Transfer Resource'
ep0in: cmd 'Set Endpoint Transfer Resource'
ep1out: cmd 'Set Endpoint Transfer Resource'
...
event (00030601): Suspend [U3]
event (00000101): Reset [U0]
ep0out: req ffffff87e5c9e100 length 0/0 zsI ==> 0
event (00000201): Connection Done [U0]
ep0out: cmd 'Start New Configuration'
ep0out: cmd 'Set Endpoint Transfer Resource'

In addition, if a soft disconnect occurs, EP0 events are still allowed to
process, however, it will stall/restart during the SETUP phase.  The
host is still able to query for the DATA phase, leading to a
xfernotready(DATA) event.  Since none of the SETUP transfer parameters are
populated, the xfernotready is treated as a "wrong direction" error,
leading to a duplicate stall/restart routine.

Add the proper softconnect/connected checks in sequences that are
potentially involved during soft disconnect processing.

Change-Id: Iaeae73684d91391ab51a02db59e7d04d3a196301
Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Link: https://lore.kernel.org/r/20220817182359.13550-2-quic_wcheng@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 359d5a85a7)
2022-11-11 20:03:32 +08:00
Wesley Cheng
d3b61da8cf UPSTREAM: usb: dwc3: gadget: Avoid duplicate requests to enable Run/Stop
Relocate the pullups_connected check until after it is ensured that there
are no runtime PM transitions.  If another context triggered the DWC3
core's runtime resume, it may have already enabled the Run/Stop.  Do not
re-run the entire pullup sequence again, as it may issue a core soft
reset while Run/Stop is already set.

This patch depends on
  commit 69e131d1ac ("usb: dwc3: gadget: Prevent repeat pullup()")

Change-Id: Ic4fa942b4c5f39da71741146fb50b6785ba026ba
Fixes: 77adb8bdf4 ("usb: dwc3: gadget: Allow runtime suspend if UDC unbinded")
Cc: stable <stable@kernel.org>
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Link: https://lore.kernel.org/r/20220728020647.9377-1-quic_wcheng@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 040f2dbd20)
2022-11-11 20:03:32 +08:00
Michael Grzeschik
8f20fc0a19 UPSTREAM: usb: dwc3: gadget: conditionally remove requests
The functions stop_active_transfers and ep_disable are both calling
remove_requests. This functions in both cases will giveback the requests
with status ESHUTDOWN, which also represents an physical disconnection.
For ep_disable this is not true. This patch adds the status parameter to
remove_requests and sets the status to ECONNRESET on ep_disable.

Change-Id: I7bb9dead0d4f4a50bc5600abb2a64d1d63257355
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20220720213523.1055897-1-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit b44c0e7fef)
2022-11-11 20:03:32 +08:00
Wesley Cheng
bbce23d3be UPSTREAM: usb: dwc3: ep0: Properly handle setup_packet_pending scenario in data stage
During a 3 stage SETUP transfer, if the host sends another SETUP token
before completing the status phase, it signifies that the host has aborted
the current control transfer.  Currently, if a setup_packet_pending is
received, there are no subsequent calls to dwc3_ep0_out_start() to fetch
the new SETUP packet.  This leads to a stall on EP0, as host does not
expect another STATUS phase as it has aborted the current transfer.

Fix this issue by explicitly stalling and restarting EP0, as well as
resetting the trb_enqueue indexes.  (without this, there is a chance the
SETUP TRB is set up on trb_endqueue == 1)

Change-Id: Ib4502a1e5d70b46b6314b4061788d3883e2bdf42
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Link: https://lore.kernel.org/r/20220712014403.2977-1-quic_wcheng@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 5e76ee96be)
2022-11-11 20:03:32 +08:00
Kushagra Verma
7468a28eab UPSTREAM: usb: dwc3: Fix a repeated word checkpatch warning
Fixes a repeated word checkpatch warning in ep0.c by removing the repeated
'only' word.

Change-Id: Id02e91b0f536a426acb4961f7dc836f30e8ce173
Signed-off-by: Kushagra Verma <kushagra765@outlook.com>
Link: https://lore.kernel.org/r/HK0PR01MB2801996E815208393170010FF8D39@HK0PR01MB2801.apcprd01.prod.exchangelabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit d1b39dd581)
2022-11-11 20:03:32 +08:00
Kushagra Verma
1c05ec4e21 UPSTREAM: usb: dwc3: Fix bare use of unsigned checkpatch warning
Fixes the bare use of unsigned warning from checkpatch.pl in core.c by
changing 'unsigned' to 'unsigned int'.

Change-Id: I887e31d6592f3b753fbce3a644e6691b87bf0efc
Signed-off-by: Kushagra Verma <kushagra765@outlook.com>
Link: https://lore.kernel.org/r/HK0PR01MB280160BCA168FA9FE159F02AF8D39@HK0PR01MB2801.apcprd01.prod.exchangelabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit ca80ca6186)
2022-11-11 20:03:32 +08:00
Mayank Rana
873b6da780 UPSTREAM: usb: dwc3: core: Add error log when core soft reset failed
DWC3 controller soft reset is important operation for USB functionality.
In case when it fails, currently there is no failure log. Hence add
error log when core soft reset failed.

Change-Id: I2de0d6d1f94a85d9efa85b06387858a8db0841e4
Signed-off-by: Mayank Rana <quic_mrana@quicinc.com>
Link: https://lore.kernel.org/r/1652897572-14461-1-git-send-email-quic_mrana@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 859bdc3595)
2022-11-11 20:03:32 +08:00
Mayank Rana
1929d9ae15 UPSTREAM: usb: dwc3: Fix ep0 handling when getting reset while doing control transfer
According to the databook ep0 should be in setup phase during reset.
If host issues reset between control transfers, ep0 will be  in an
invalid state. Fix this by issuing stall and restart on ep0 if it
is not in setup phase.

Also SW needs to complete pending control transfer and setup core for
next setup stage as per data book. Hence check ep0 state during reset
interrupt handling and make sure active transfers on ep0 out/in
endpoint are stopped by queuing ENDXFER command for that endpoint and
restart ep0 out again to receive next setup packet.

Change-Id: I4127a1d80d3f555ef606e22b49b309f24b7413bc
Signed-off-by: Mayank Rana <quic_mrana@quicinc.com>
Link: https://lore.kernel.org/r/1651693001-29891-1-git-send-email-quic_mrana@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 9d778f0c5f)
2022-11-11 20:03:32 +08:00
Kushagra Verma
5a08fd1159 UPSTREAM: USB / dwc3: Fix a checkpatch warning in core.c
This patch fixes the following checkpatch.pl warning in core.c:
    WARNING: braces {} are not necessary for any arm of this statement

Change-Id: I17810f2c4b6fcaf7091e97a6050b9ed125a32233
Signed-off-by: Kushagra Verma <kushagra765@outlook.com>
Link: https://lore.kernel.org/r/TYZPR01MB39354534E2F9EE4E022DDAFFF8C89@TYZPR01MB3935.apcprd01.prod.exchangelabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit d090c7a2ab)
2022-11-11 20:03:32 +08:00
Thinh Nguyen
42973c2690 UPSTREAM: usb: dwc3: gadget: Delay issuing End Transfer
If the controller hasn't DMA'ed the Setup data from its fifo, it won't
process the End Transfer command. Polling for the command completion may
block the driver from servicing the Setup phase and cause a timeout.
Previously we only check and delay issuing End Transfer in the case of
endpoint dequeue. Let's do that for all End Transfer scenarios.

Change-Id: I38ca19735337ca3e09d0d27d6623ea7acae37b16
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/2fcf3b5d90068d549589a57a27a79f76c6769b04.1650593829.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit f66eef8fb8)
2022-11-11 20:03:32 +08:00
Thinh Nguyen
aa6ce8654e UPSTREAM: usb: dwc3: gadget: Only End Transfer for ep0 data phase
The driver shouldn't be able to issue End Transfer to the control
endpoint at anytime. Typically we should only do so in error cases such
as invalid/unexpected direction of Data Phase as described in the
control transfer flow of the programming guide. It _may_ end started
data phase during controller deinitialization from soft disconnect or
driver removal. However, that should not happen because the driver
should be maintained in EP0_SETUP_PHASE during driver tear-down. On
soft-connect, the controller should be reset from a soft-reset and there
should be no issue starting the control endpoint.

Change-Id: I1dabd91d5078be2af8ff65e1fadd3cf16e76db7f
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/3c6643678863a26702e4115e9e19d7d94a30d49c.1650593829.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit ace17b6ee4)
2022-11-11 20:03:32 +08:00
Thinh Nguyen
fa866ff228 BACKPORT: usb: dwc3: ep0: Don't prepare beyond Setup stage
Since we can't guarantee that the host won't send new Setup packet
before going through the device-initiated disconnect, don't prepare
beyond the Setup stage and keep the device in EP0_SETUP_PHASE. This
ensures that the device-initated disconnect sequence can go through
gracefully. Note that the controller won't service the End Transfer
command if it can't DMA out the Setup packet.

Change-Id: I797d9cc93f775929acdead9762e79e073ac61239
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/6bacec56ecabb2c6e49a09cedfcac281fdc97de0.1650593829.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c96683798e)
2022-11-11 20:03:32 +08:00
Thinh Nguyen
26eef0a006 UPSTREAM: usb: dwc3: gadget: Don't modify GEVNTCOUNT in pullup()
If the GEVNTCOUNT indicates events in the event buffer, the driver needs
to acknowledge them before the controller can halt. Simply let the
interrupt handler acknowledges the remaining event generated by the
controller while polling for DSTS.DEVCTLHLT. This avoids disabling irq
and taking care of race condition between the interrupt handlers and
pullup().

Change-Id: Ief1bc9deb10e02f84fdc952481a7bb98f9cf8b78
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/ea306ec93c41ccafbdb5d16404ff3b6eca299613.1650593829.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 8f8034f493)
2022-11-11 20:03:32 +08:00
Thinh Nguyen
ac866b5b8b UPSTREAM: usb: dwc3: gadget: Refactor pullup()
Move soft-disconnect sequence out of dwc3_gadget_pullup(). No
functional change here.

Change-Id: I2ddbae436142ad57564142240129ef7c29f0a955
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/4c0f259b17d95acaaa931f90276683a48a32fe22.1650593829.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 861c010a2e)
2022-11-11 20:03:32 +08:00
Thinh Nguyen
cf9aef9a99 UPSTREAM: usb: dwc3: gadget: Prevent repeat pullup()
Don't do soft-disconnect if it's previously done. Likewise, don't do
soft-connect if the device is currently connected and running. It would
break normal operation.

Currently the caller of pullup() (udc's sysfs soft_connect) only checks
if it had initiated disconnect to prevent repeating soft-disconnect. It
doesn't check for soft-connect. To be safe, let's keep the check here
regardless whether the udc core is fixed.

Change-Id: I07eaeb0ed388ef967eeb9c7513a9c1b260f8d9c5
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/1c1345bd66c97a9d32f77d63aaadd04b7b037143.1650593829.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 69e131d1ac)
2022-11-11 20:03:32 +08:00
Wesley Cheng
80e501ef08 BACKPORT: usb: dwc3: EP clear halt leading to clearing of delayed_status
The usb_ep_clear_halt() API can be called from the function driver, and
translates to dwc3_gadget_ep_set_halt().  This routine is shared with when
the host issues a clear feature ENDPOINT_HALT, and is differentiated by the
protocol argument.  If the following sequence occurs, there can be a
situation where the delayed_status flag is improperly cleared for the wrong
SETUP transaction:

1. Vendor specific control transfer returns USB_GADGET_DELAYED_STATUS.
2. DWC3 gadget sets dwc->delayed_status to '1'.
3. Another function driver issues a usb_ep_clear_halt() call.
4. DWC3 gadget issues dwc3_stop_active_transfer() and sets
   DWC3_EP_PENDING_CLEAR_STALL.
5. EP command complete interrupt triggers for the end transfer, and
   dwc3_ep0_send_delayed_status() is allowed to run, as delayed_status
   is '1' due to step#1.
6. STATUS phase is sent, and delayed_status is cleared.
7. Vendor specific control transfer is finished being handled, and issues
   usb_composite_setup_continue().  This results in queuing of a data
   phase.

Cache the protocol flag so that DWC3 gadget is aware of when the clear halt
is due to a SETUP request from the host versus when it is sourced from a
function driver.  This allows for the EP command complete interrupt to know
if it needs to issue a delayed status phase.

Change-Id: If19e1628c151a109820a60e7b4c4c6f6128a2242
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Link: https://lore.kernel.org/r/20220414073902.21960-1-quic_wcheng@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 2840d6dfcf)
2022-11-11 20:03:32 +08:00
Michael Grzeschik
0ec00e864a UPSTREAM: usb: dwc3: gadget: move cmd_endtransfer to extra function
This patch adds the extra function __dwc3_stop_active_transfer to
consolidate the same codepath.

Change-Id: I59d031db6eb52487f443fc6eef11214ca2d95234
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20220306211251.2281335-3-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit e192cc7b52)
2022-11-11 20:03:32 +08:00
Thinh Nguyen
415b0d9d14 UPSTREAM: usb: dwc3: gadget: Skip checking Update Transfer status
If we're not setting CMDACT (from "No Response" Update Transfer
command), then there's no point in checking for the command status. So
skip it. This can reduce a register read delay and improve performance.

Change-Id: I00106aab2965b3c65de8a9ea5e4846e59472c101
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/3dc31cf11581ae3ee82d9202dda3fc17d897d786.1638240306.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit bc27117c7c)
2022-11-11 20:03:32 +08:00
Sandy Huang
a1be106ef0 drm/rockchip: add support vop3
Rockchip VOP3 is new VOP architecture base on VOP2, compared to the
VOP2, the biggest change is VOP overlay and post process module.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I19ee4e91aa430ec8b80095702c697d08a696d52b
2022-11-11 19:45:35 +08:00
Lin Jinhan
fa0690beb7 ARM: dts: rockchip: rv1106-thunder-boot: remove MCLK_REF_MIPI0 control
On some sensors, the exposure configuration for the first frame
 will be lost if the MCLK was ever turned off before stream on.
(Such as GC2093.)

Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I06f7eb24fa4f13afaca32f66701956e216b552ec
2022-11-11 16:56:11 +08:00
Shunhua Lan
99edbfa6ee arm64: dts: rockchip: rk3588-evb: use rockchip,hdmi as hdmirx audio machine driver
Signed-off-by: Shunhua Lan <lsh@rock-chips.com>
Change-Id: I4b71a030a4880805eb3c62ecf3038c74f0494f77
2022-11-11 11:33:56 +08:00
Shunhua Lan
d8ca2c67b5 media: rockchip: hdmirx: report audio off event
For hdmirx controllers, audio interface always act as master And
will make system wait a long time for audio data, Here report a
audio off event to audio stream, Then applications can exit immediately

Signed-off-by: Shunhua Lan <lsh@rock-chips.com>
Change-Id: Ia8b458d5a45f8c84f17dfd10cf8bdae8d6a6016d
2022-11-11 11:32:48 +08:00
Herman Chen
25e0528c51 video: rockchip: mpp: Add reg range dump
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I0999877a10767d90fec32b2858beff72642a0a55
2022-11-11 09:28:56 +08:00
Shunhua Lan
b22cb46be7 ASoC: hdmi-codec: pcm stop when plug out
Signed-off-by: Shunhua Lan <lsh@rock-chips.com>
Change-Id: I1507dc6b92a0342e6b3d86472618f90dc721e779
2022-11-10 19:19:18 +08:00
Jianqun Xu
5a4a287ae5 ARM: dts: rockchip: rk3288: move i2c0 to the front of other i2c
Move i2c0 node ahead before i2c1, make the i2c0 to be probed first.

Change-Id: I822622fc1f1ed41729851294858246cf6da8c202
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-11-10 17:28:46 +08:00
Zefa Chen
da1b05c63b media: rockchip: vicap fixed frame_phase state with wake up mode
sometimes, cause buffer state error in thunderboot mode

Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I1b750cbad21e29b112d8e7670029c6f1d0d53fc3
2022-11-10 17:12:47 +08:00