Commit Graph

1056370 Commits

Author SHA1 Message Date
Ren Jianing
7e08fbf2c8 usb: gadget: f_fs: fix ep req_match error for composite device
This patch add direction index for eps_revmap, which can avoid matching
to the requests for other functions.

For example, if we config ep1in for uac and ep1out for adb, the requests
for ep1in will be matching to ffs without this patch.

Change-Id: Ic7a52fca35503656bbc306c9f0014dfdea61392b
Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2021-06-16 18:22:21 +08:00
William Wu
bcf7606d61 usb: gadget: add transfer_type in struct usb_ep for rockchip
The usb gadget core set the chosen endpoint descriptor for
each endpoints in config_ep_by_speed(), however, we want
to get the transfer type of the endpoints earlier on the
rockchip platforms for usb controller initialization
(e.g. do tx fifos resize for rockchip usb dwc3 controller),
so this patch add transfer_type in the struct usb_ep, and
set the transfer_type in the usb_ep_autoconfig_ss().

Change-Id: Ia2added218e180dda7a7ca5da09ee18d63be1ff0
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2021-06-16 18:22:19 +08:00
Ren Jianing
be3429e9b2 usb: gadget: f_uac: add pktsize calculating at setting playback srate
Without this patch, we only calculate usb request packet_size when
start playback. If PC set sample rate after opening stream, the value
of packet_size will not be updated to uac driver and the gadget will
send error size of pcm data.

Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Change-Id: Iaa54ed740c98e5f12bf9cf680b50cf4be931cfbd
2021-06-16 18:21:34 +08:00
William Wu
c55a0ab282 usb: gadget: f_uac: add volume and mute feature unit
This patch adds feature unit descriptor for f_uac1 and f_uac2,
and supports volume control and mute control for capture and
playback.

By default, the volume and mute feature unit descriptors are NOT
add in the UAC descriptor. The user can define whether the UAC1/
UAC2 shall support volume and mute functionality via the attributes
c_feature_unit/p_feature_unit in the UAC function directory.

For example, user can add the volume and mute feature unit descriptors
for UAC1 capture and playback:

echo 1 > /config/usb-gadget/gadget/functions/uac1.name/c_feature_unit
echo 1 > /config/usb-gadget/gadget/functions/uac1.name/p_feature_unit

This patch also adds uevents for volume and mute functionality. The
user can complete the real volume and mute control functionality in
the user space depends on these new uevents (like the uac_app in the
RV1126/RV1109 SDK).

Change-Id: I76d447a19fd69e038851040cd73e6c7d420f467d
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2021-06-16 18:15:08 +08:00
William Wu
adc23c13ff usb: gadget: f_rndis: handle the packet filter class request
This patch handles the class specific control request
"USB_CDC_SET_ETHERNET_PACKET_FILTER" for rndis. Actually,
the cdc_filter is not rndis specific, so we don't really
set the cdc_filter to the wValue of setup request for
rndis, and just return value 0 for the setup request to
avoid usb controllers stall ep0.

Change-Id: I42f9835a9812b8dfa640562b8555bc5f9b022256
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2021-06-16 18:13:14 +08:00
Ren Jianing
ac1ed698c3 usb: gadget: u_audio: add uevent for set_alt and set_srate
This patch add uevent to notify the application layer when it should
playback or capture and setting the accuration sample rate.

The event consists of three parts, namely USB_STATE, STREAM_DIRECTION
and STREAM_STATE. For example:

g_audio_work: sent uac uevent USB_STATE=SET_INTERFACE STREAM_DIRECTION=IN STREAM_STATE=OFF
g_audio_work: sent uac uevent USB_STATE=SET_INTERFACE STREAM_DIRECTION=OUT STREAM_STATE=ON
g_audio_work: sent uac uevent USB_STATE=SET_SAMPLE_RATE STREAM_DIRECTION=OUT SAMPLE_RATE=44100

Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Change-Id: Ia01572d92d0c3ae40b19e772571282b8806da9e5
2021-06-16 18:13:14 +08:00
Ren Jianing
37ed8f4607 FROMLIST: usb: gadget: f_uac*: Support multiple sampling rates
Implement support for multiple sampling rates in the USB Audio gadgets.
A list of sampling rates can be specified via configfs. All enabled
sampling rates are sent to the USB host on request. When the host
selects a sampling rate the internal active rate is updated. The
currently configured rates are exposed through amixer controls. Also on
pcm open from userspace the requested rated is checked against the
currently configured rate of the host.

Link: https://lore.kernel.org/patchwork/patch/805286/
Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Change-Id: I43dc28462062c9aa179c2b9c8e7e50c307137874
2021-06-16 18:13:14 +08:00
Ren Jianing
70267887d6 FROMLIST: usb: gadget: f_uac*: Reduce code duplication
This replaces the dedicated headers for uac1 and uac2 functions with a
shared header for both of them. Apart from unifying the struct names,
further duplicated code for configfs setup is moved out of the function
files into the shared header.

Link: https://lore.kernel.org/patchwork/patch/805285/
Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Change-Id: Ie866bd02f174dc91168fe0bc49b571a77d849a42
2021-06-16 18:13:14 +08:00
Julian Scheel
d390fcf2f7 FROMLIST: usb: gadget: f_uac1: Fix endpoint reading
The endpoint is stored in the lower byte of wIndex, according to USB
Audio 1.0 specification, section 5.2.1.1.

Link: https://lore.kernel.org/patchwork/patch/805284/
Change-Id: I16634151e98cfb0f7107e96463a20b8fa8d7072f
Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2021-06-16 18:13:14 +08:00
William Wu
02d2e8fcb4 usb: gadget: uvc: allow zero bytesused for rockchip uvc
For rockchip platforms, the userspace uvc application use
bytesused == 0 as a way to indicate that the data is all
zero and unused. In that case, the uvc driver should use
the allow_zero_bytesused flag to keep bytesused 0 rather
than use the buf actual size instead. This can help to
preview 1080P@MJPG faster.

Change-Id: Ic4d561f18e85d759b5a2405db4f6fb48533e1781
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2021-06-16 18:13:14 +08:00
William Wu
fbb23b9e8c usb: gadget: uvc: add a new attribute uvc_num_request
This patch adds a new uvc attribute "uvc_num_request" to
set the number of uvc requests. And the maximum limit is
set to UVC_MAX_NUM_REQUESTS (8), the default value of
uvc_num_request is set to UVC_NUM_REQUESTS (4).

Change-Id: I69d6a4d6547a81b67ce447f271c7a5103671767e
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2021-06-16 18:13:14 +08:00
William Wu
29ef90251a usb: gadget: udc: core: fix possible NULL pointer dereference
This patch fixes the following panic when use uvc function and
do reboot during uvc preview.

Unable to handle kernel NULL pointer dereference at virtual address 000001fd
pgd = 85dd55c1
[000001fd] *pgd=00000000
Internal error: Oops: 17 [#1] PREEMPT SMP ARM
Modules linked in: galcore(O)
CPU: 0 PID: 716 Comm: xc:RkAiqCoreThr Tainted: G        W  O      4.19.111 #18
Hardware name: Generic DT based system
PC is at usb_gadget_deactivate+0x0/0x6c
LR is at usb_function_deactivate+0x54/0x74

It's because that do reboot operation will call configfs_composite_unbind()
to set cdev->gadget to NULL.

Change-Id: I6fbfe9b58f865113d04ca7ce0b74b00f8d89227c
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2021-06-16 18:13:14 +08:00
Zeng Tao
02bfaf0477 FROMLIST: usb: gadget: uvc: configfs: add framebased format support
As we know, The framebased format can be used to support a lot of
formats other than YUV and MJPEG, for example: H264 or H265.
And Nowadays, the H264 and H265 is used more and more compared to the
MJPEG, so there is a need to support such usecase, although the new UVC
1.5 and the UVC1.1 extensions already support H264, but they are much
more expensive and most of the time, what we need is just a channel to
stream the video frames.

In this patch, we implement the framebased format and set it to H264 by
default, and the users could change the video format as they need through
the guid configfs attribute node.

Change-Id: Ie1c62f5fb4fa57c24a2878f9992c982e9deb302e
Signed-off-by: Zeng Tao <prime.zeng@hisilicon.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(am from https://patchwork.kernel.org/patch/10722957/)
2021-06-16 18:13:14 +08:00
William Wu
124b5f5927 usb: gadget: configfs: make sure to reactivate function on unbind
If a configs function sets bind_deactivated flag, upon removal it will be
left with an unbalanced deactivation. Let's make sure that we conditionally
call usb_function_activate() from purge_configs_funcs() and make sure
purge_configs_funcs() is called from configfs_composite_unbind().

Change-Id: Ibe91837fdb7754f8af343a18138556901a0e089f
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2021-06-16 18:13:14 +08:00
William Wu
2ae1313983 usb: gadget: f_uac1: add iad descriptor
According to the spec "USB Interface Association Descriptor Device
Class Code and Use Model"[1], the Interface Association Descriptor
(IAD) is needed for composite device which has multiple interfaces
controlled independently of each other. Without the IAD, the device
may not work as expected because the USB system software will not
properly bind the interfaces with drivers (e.g UAC1 && UVC composite
device not recognized in Win10).

[1] https://www.usb.org/sites/default/files/iadclasscode_r10.pdf

Change-Id: I446c771fe182bd556a054d9ae0ada1374442d1d0
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2021-06-16 18:13:14 +08:00
William Wu
c15a7cecb8 usb: gadget: uvc: support streaming bulk transfer
This patch adds bulk endpoint for uvc to be used as
video streaming transfer. By default, the uvc gadget
still uses isoc endpoint for video streaming.

The important difference between the bulk and isoc
method is that, alt-settings in a video streaming
interface are supported only for isoc endpoints as
there are different alt-settings for zero-bandwidth
and full-bandwidth use-cases, but the same is not
true for bulk endpoints, as they support only a single
alt-setting.

How to use:
1. Enable the bulk transfer:
   echo 1 >  /config/usb-gadget/g1/functions/uvc.name/streaming_bulk

2. Disable the bulk transfer:
   echo 0 >  /config/usb-gadget/g1/functions/uvc.name/streaming_bulk

3. Testing the uvc bulk function transfer:
   device: run the uvc-gadget program
   # uvc-gadget -b -u /dev/video<uvc video node #> -v /dev/video<vivid video node #>

   where uvc-gadget is this program:
        http://git.ideasonboard.org/uvc-gadget.git

   with these patches:

        http://www.spinics.net/lists/linux-usb/msg99220.html

Change-Id: Ifedfe3f5c4354dd2bdf07382290107e9bcc89f59
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2021-06-16 18:13:14 +08:00
William Wu
60767d93e5 usb: gadget: f_uac2: fix some issues for Windows recognized
We find that the UAC2 gadget can't be recognized on Windows 10.
It's because that the descriptors of UAC2 doesn't meet the
requirements of Windows.

According to the USB Audio 2.0 Drivers of Windows [1], if the
bmAttributes of OUT-EP in the audio stream interface is set
to asynchronous (use USB_ENDPOINT_SYNC_ASYNC), then a feedback
endpoint must be implemented in the respective alternate setting
of the AS interface. The Windows driver does not support implicit
feedback.

However, it's difficult to implement the feedback endpoint now.
So the patch changes the bmAttributes of OUT-EP to adaptive, and
changes the bmAttributes of IN-EP to synchronous at the same time.

This patch also sets the wTerminalType of terminal descriptor to
microphone and speaker by default.

With this patch, we also fix the wTotalLength of the ac_hdr_desc.

[1] https://docs.microsoft.com/en-us/windows-hardware/drivers/audio/usb-2-0-audio-drivers

Change-Id: I3597d5f321235fcbce56dbfbfe95172d02e58892
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2021-06-16 18:13:14 +08:00
William Wu
7ccab04742 usb: gadget: add compat_ioctl
This allows 32 bit owners of USB Class to make ioctls
into a 64 bit kernel.

Change-Id: Ia31b26147ab619f0673f94b6662eaf181a9eb5dd
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2021-06-16 18:13:14 +08:00
William Wu
4ac7546e3b usb: gadget: f_uvc: add extension unit descriptor
Add extension unit descriptor for uvc. Support 3
controls in this extension unit. The rockchip IQ
tool use it to transfer vendor specific control
data.

Change-Id: I219e12616629bc75548b30ce63d46136aeac6561
Signed-off-by: William Wu <william.wu@rock-chips.com>
2021-06-16 18:13:14 +08:00
William Wu
89f2299475 usb: gadget: f_uac1_legacy: set period size and buffer size
The default period size is only 64 frames, this
will cause usb audio playback with noise via
internal audio codec. This patch sets the period
size to (snd->rate / 10), and also sets the buffer
size to snd->rate.

Change-Id: I4a4eb1b4dd79aec65f5c44eacd8a2fa101dfbd1b
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2021-06-16 18:13:14 +08:00
William Wu
3ecb9e48f7 usb: gadget: f_uac1_legacy: disable ep in f_audio_disable()
The f_audio_disable() doesn't disable usb ep, and
this cause usb enumeration fail. So add usb ep
disable operation.

This patch also reinitializes the opts->bound flag
to false in f_audio_free(), and then it can setup
ALSA audio device again in f_audio_bind().

Change-Id: I7b10630f5085b1a03792bc4b9e7eabb02d2bd5a2
Signed-off-by: William Wu <william.wu@rock-chips.com>
2021-06-16 18:13:14 +08:00
Meng Dongyang
7f7344e617 usb: gadget: configfs: send connect detective event when get descriptor
In current code, the connect detective event will be send before the
connect state of controller change. The event is sent when receive
the first setup packet and the connect state of controller is changed
when receive set address command. So if disconnect interrupt trigger
between the first setup packet and set address command, the disconnect
process will not be done, while the application state has been changed
and keep in connected. As a result, the UI may still show the USB connect
option event if the device has been disconnect from PC. This patch send
the connect uevent when get descriptor of configuration which follow
set address command to make sure the application state change after
controller.

Change-Id: Icf2124327db93687b4b644672edb0dbecc8f127a
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
2021-06-16 18:13:14 +08:00
William Wu
ad74683094 usb: gadget: rndis: fix class definitions for windows
The RNDIS gadget function has USB class of 2 and subclass
of 2, which matches "USB\Class_02&SubClass_02" in the
usbser.inf file in the Windows system, so the device is
initially detected as a COM port instead of RNDIS. This
is why we need to install RNDIS manually.

Refer to Defined Class Codes [1] and rndis_host of Linux [2],
this patch sets the RNDIS gadget with base class of 0xE0h
(Wireless Controller) and subclass of 0x01h and protocol
of 0x03h.

[1] https://www.usb.org/defined-class-codes
[2] http://www.embedded-os.de/en/proto-rndis_host.shtml

Change-Id: Ida366749f378a0ce770d707b4ba56b87f9e188cf
Signed-off-by: William Wu <william.wu@rock-chips.com>
2021-06-16 18:13:14 +08:00
Jon Lin
f560bd4115 drivers: rkflash: Including rkflash source files
Change-Id: I09dea4be626bbe75575ef2de1a9c03277d06a155
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-06-16 17:28:09 +08:00
Jon Lin
3b695b24ad drivers: rkflash: Change to select CRYPTO_LIB_ARC4 and CRYPTO for sfc_nor
Change-Id: I94b59d07112f2f247d35702f5cb23bad9bd8ceab
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-06-16 17:13:06 +08:00
Jon Lin
786acb72f4 drivers: rkflash: Select the correct vendor storage drivers
Change-Id: Ieb0dd6eb148d08e390d5bdb2b3a402e1355a61ba
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-06-16 17:12:11 +08:00
Jon Lin
833d667cf4 drivers: rkflash: Change to use block mq framework
Change-Id: I25749a465d7871f9eb37839e37410323bfc2e055
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-06-16 17:11:36 +08:00
Jon Lin
5f683e621e drivers: rkflash: fix the problem of gcc compile error
Change-Id: Iacfbfdded28900f12cb6a8af9c0e781301fc88c9
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-06-16 17:10:45 +08:00
Jon Lin
4595ee887e drivers: rkflash: Rename the controller driveres
Change-Id: I22b6fadcbb2e74d04cbdd279afdc612dc4d6193d
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-06-16 17:10:13 +08:00
Jon Lin
8f5546c24f drivers: rkflash: Change to use SYNC_SKCIPHER_REQUEST_ON_STACK
According to commit b350bee5e, use SYNC_SKCIPHER_REQUEST_ON_STACK

Change-Id: I2f81640b39e2f9b9d38534dfe633196158dff89b
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-06-16 17:10:13 +08:00
Jon Lin
68d4a1830b drivers: rkflash: Enable DLL tuning
1.Support after SFC ver 4
2.If the io rate is high than 100MHz, enable SFC delay line in
default
3.Get id byte as data pattern

Change-Id: Ia405771c0bc94eddaa45e1d85c7fa10a85c40531
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-06-16 17:10:13 +08:00
Jon Lin
2c9c2b1b32 drivers: rkflash: Fix error in snor_resume
Change-Id: I18405c2c902e201e927049e9f876c9f5baf4ed62
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-06-16 17:10:13 +08:00
Shawn Lin
155e6d2f81 arm64: dts: rockchip: add disable-cqe for RK3399
Change-Id: I58cabc18a1f01e020b57ba980a0b8114eed4ba2a
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2021-06-15 12:57:30 +08:00
Shawn Lin
54649eec2b phy: phy-rockchip-snps-pcie3: Add sram_init_done check
From test, sram_init_done can be used as a indicator to
see if phy power and input clock work find. Let's yell out
error is anything wrong with phy.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I5493e32ec5a9a6a8f6fc45e95618a657d9a21a67
2021-06-15 11:18:36 +08:00
Shawn Lin
bae2dab105 arm64: dts: rockchip: remove all rockchip,txclk-tapnum for rk356x
We finally decide to set 16 for tx delay in driver, so no need for
dts to set it now.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I642ed3039db5410ca478b255166d07a035e971aa
2021-06-15 11:18:36 +08:00
Shawn Lin
6cb4a6eb7c mmc: sdhci-of-dwcmshc: Set default tx delay to 16
According to the new test result, set tx delay to 16
by default.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I8e0bacfbf14f8c5db60a4d56a624d63c49e23051
2021-06-15 11:18:36 +08:00
Frank Wang
448b1e499d mailbox: rockchip: code optimization
This change amends the below features.

 - Checked the mailbox channel status before send message.
 - Used the con_priv variable to handle the channel private data.
 - Added the spinlock cfg_lock to protect the register R/W.
 - Added shared channel irq support.
 - Optimized the interrupt handler can receive B2A message proactively.

Change-Id: If1939e51e821307788ab59dd4ef874a20a6568e2
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2021-06-11 14:34:06 +08:00
Elaine Zhang
641b5aad8b net: can: rockchip: fix up the CAN bus off
Fix up the rx\tx err cnt.
Support Auto Retransmission Mode.
Support rx frame clean.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: Ib5a226c975cb6cb4229f8a30995ce09740de749e
2021-06-09 16:19:36 +08:00
Elaine Zhang
cad2d1d5bd UPSTREAM: clk: rockchip: Optimize PLL table memory usage
Before the change: The sizeof rk3568_pll_rates = 2544
Use union: The sizeof rk3568_pll_rates = 1696

In future Soc, more PLL types will be added, and the
rockchip_pll_rate_table will add more members,
and the space savings will be even more pronounced
by using union.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Link: https://lore.kernel.org/r/20210511090726.15146-1-zhangqing@rock-chips.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit 23029150a0
 git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git v5.14-clk/next)
Change-Id: Ia8f038861c327feb41602cc9a997e82333fae67b
2021-06-09 16:18:49 +08:00
Elaine Zhang
3b0aeb9ade arm64: dts: rockchip: rk3568: add rockchip,clk-init for uboot
Change-Id: I6a8709a4263aa561bfd6f03f25230da05ca6d337
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-06-09 16:18:06 +08:00
Elaine Zhang
cf2e2135eb arm64: dts: rockchip: rk356x board: add init voltage for vdd_cpu
setting init voltage in uboot.

Change-Id: If1e23bb06790dcb3f9e4e9be4cc791cd394ca73a
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-06-09 15:32:46 +08:00
Elaine Zhang
189bd5bc2a arm64: dts: rockchip: rk3568: remove ARMCLK init frequency
Change-Id: I93888983b39acadfdb9ccbd94c3a61ff5a97f52f
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-06-09 15:32:27 +08:00
Cliff Chen
24dace7355 ANDROID: fuse: fix deadlock for reply of FUSE_CANONICAL_PATH
There is a deadlock when the reply of FUSE_CANONICAL_PATH from user-
space client, because the kern_path function will issue a new request
and wait the respond from client which has been in wait state. The ba-
cktrace is like this:

<6>[  518.977731] ntfs-3g         S    0  2138      1 0x04000000
<4>[  518.977745] Call trace:
<4>[  518.977757]  __switch_to+0x130/0x13c
<4>[  518.977767]  __schedule+0x740/0x964
<4>[  518.977777]  schedule+0x70/0x90
<4>[  518.977794]  __fuse_request_send+0x1a0/0x340
<4>[  518.977808]  fuse_simple_request+0x178/0x1c8
<4>[  518.977818]  fuse_lookup_name+0xfc/0x220
<4>[  518.977829]  fuse_lookup+0x48/0x134
<4>[  518.977842]  __lookup_slow+0xc8/0x154
<4>[  518.977853]  walk_component+0x1c0/0x728
<4>[  518.977863]  path_lookupat+0xa8/0x208
<4>[  518.977875]  filename_lookup+0x8c/0x190
<4>[  518.977887]  kern_path+0x30/0x3c
<4>[  518.977901]  fuse_dev_do_write+0x79c/0x114c
<4>[  518.977914]  fuse_dev_write+0x60/0x84
<4>[  518.977928]  do_iter_readv_writev+0x11c/0x158
<4>[  518.977941]  do_iter_write+0x7c/0x1b8
<4>[  518.977953]  vfs_writev+0x84/0xe8
<4>[  518.977966]  do_writev+0x78/0x114
<4>[  518.977979]  __arm64_sys_writev+0x1c/0x24
<4>[  518.977992]  el0_svc_common+0x98/0x160
<4>[  518.978005]  el0_svc_handler+0x5c/0x64
<4>[  518.978015]  el0_svc+0x8/0xc

Fixes: fa199896a3 ("ANDROID: fuse: Add support for d_canonical_path")
Signed-off-by: Cliff Chen <cliff.chen@rock-chips.com>
Change-Id: I13487e5c956c4537c2554a44208d6664653ef4f1
2021-06-08 09:38:35 +08:00
Cliff Chen
97a4cf0355 f2fs: Fix recovery is too slow when power fail on much fsync
By default fsync option, if fsync is called frequently, and suddenly
lost power, the POR will consume too much memory at mounting, this
process may be very slow due to a large number of swapping.

Change-Id: I8235098cca062d7ab58af4ebed414aed9aba6c75
Signed-off-by: Cliff Chen <cliff.chen@rock-chips.com>
Signed-off-by: Alex Wang <alex.wang@rock-chips.com>
2021-06-08 09:38:35 +08:00
Cliff Chen
4cde270453 f2fs: modify f_blocks for statfs
The f_blocks of statfs include file system overhead,it is not normal
usage of Posix.

Change-Id: If481626b08c05290626938586e2dc721690f1a91
Signed-off-by: Cliff Chen <cliff.chen@rock-chips.com>
2021-06-08 09:38:35 +08:00
Cliff Chen
0729de642e f2fs: add a new limit for reserve root
The reserved root blocks is not enough for booting Android due to
the limit of 0.2% if the fs size too small. so we add a new mini-
mum limit is 128MB.

Change-Id: I5af3b182001d27e4d18b4090c5270bbb2ac6253b
Signed-off-by: Cliff Chen <cliff.chen@rock-chips.com>
2021-06-08 09:38:35 +08:00
Simon Xue
773a33a1cc drm/rockchip: gem: reorder pages if page chunk less than 8
Change-Id: I03a91d2f9c017086b3cb35edeaf6b7913b147b9b
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2021-06-07 17:49:29 +08:00
Simon Xue
e381404955 PCI: rockchip: Add support for PCIe dma transfer function
Change-Id: Ie577d9816205c1e6d04ba666d68a6c7e57efa12d
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2021-06-07 17:41:54 +08:00
Simon Xue
23a286560b PCI: rockchip: Add Rockchip DW PCIe controller support
Change-Id: Ic6d638782d1f55f965d663f73eee14bafa392740
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2021-06-07 16:24:28 +08:00
Simon Xue
15d983e5b6 PCI: rockchip: rk: Add PCIe udma transfer support
Change-Id: I68b60192a90962e03fe52b907a17234e8567e4b4
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2021-06-07 11:59:26 +08:00