Commit Graph

649459 Commits

Author SHA1 Message Date
nengwen.chen
cb0e99b47d atv_demod: tm2: atv demod basic functin bringup [1/1]
PD#SWPL-6731

Problem:
atv demod basic functin bringup.

Solution:
atv demod basic functin bringup.

Verify:
Verified by ab301 and ab309.

Change-Id: Ie2d92aad9d2ebf2493f26c50ff7ded57cd040b1c
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
2020-06-29 11:45:35 +09:00
nengwen.chen
6ad87a6ca1 atv_demod: fix BG/DK sound output power [1/1]
PD#TV-6012

Problem:
fix BG/DK sound output power.

Solution:
1.fix BG/DK sound output power.

Verify:
Verified by x301

Change-Id: I428d8a1ed97c8da5fdfe55f8dd7ac2fda9200814
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
2020-06-29 11:45:35 +09:00
nengwen.chen
8078be9b47 atv_demod: fix atbm2040 tuner channel scanning [1/1]
PD#TV-5499

Problem:
fix atbm2040 tuner channel scanning.

Solution:
1.fix atbm2040 tuner channel scanning.
2.modify tune interface.

Verify:
Verified by x301

Change-Id: Id135bcdca797ab93e8a2902476157b2ce324a2ce
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
2020-06-29 11:45:35 +09:00
nengwen.chen
0013eb6e2b atv_demod: add atbm2040 tuner support [1/3]
PD#TV-5499

Problem:
add atbm2040 tuner support.

Solution:
add atbm2040 tuner support.

Verify:
Verified by x301.

Change-Id: I89f82727c7c11f5fc6377584d519a17fe3449c4a
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
2020-06-29 11:45:35 +09:00
nengwen.chen
2ed11e94e1 atv_demod: add atv demod tune interface [1/2]
PD#TV-4499

Problem:
add atv demod tune interface.

Solution:
add atv demod tune interface.

Verify:
Verified by x301.

Change-Id: I4b62ee8b87d218bf639c02a34ba7e1c116a22249
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
2020-06-29 11:45:35 +09:00
nengwen.chen
8ff6518095 atv_demod: optimize the stereo audio recognition [1/1]
PD#TV-3569

Problem:
optimize the stereo audio recognition.

Solution:
1.optimize the stereo audio recognition.
2.remove redundant code.
3.atv demod version: V2.10.

Verify:
verified by x301.

Change-Id: If8933bdd897a7c3e6b6ff9753d7ff971a0432ef9
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
2020-06-29 11:45:35 +09:00
nengwen.chen
4bd63b2275 atv_demod: fix audio output when adjust the input amplitude [1/1]
PD#TV-4901

Problem:
fix audio output when adjust the input amplitude.

Solution:
fix audio output when adjust the input amplitude.

Verify:
verified by x301

Change-Id: If08e4adff6f4d0355448687ebe6756fa2e155704
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
2020-06-29 11:45:35 +09:00
nengwen.chen
ca0814f267 atv_demod: fix audio config (PAL_M, NTSC_M) when video is PAL [1/1]
PD#TV-4274

Problem:
fix audio config (PAL_M, NTSC_M) when video is PAL.

Solution:
fix audio config (PAL_M, NTSC_M) when video is PAL

Verify:
verified by x301.

Change-Id: I9be8d71d52a226b6422317be0b77ca6331f23147
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
2020-06-29 11:45:35 +09:00
Nian Jing
9b63ffb463 tvafe: lower shutdown power for tl1 [1/1]
PD#SWPL-6165

Problem:
TL1 vdee power too high when shutdown

Solution:
close bandgap when shut down for tl1
close vafe ctrl
close adc pll

Verify:
X301

Change-Id: I374bbe09ecdd456ea07f1fda3391acd4ab0bc949
Signed-off-by: Nian Jing <nian.jing@amlogic.com>

Conflicts:
	drivers/amlogic/media/vout/vdac/vdac_dev.c
2020-06-29 11:45:35 +09:00
nengwen.chen
c120aa81ed atv_demod: modify atv demod support multi tuner load [1/3]
PD#TV-1539

Problem:
modify atv demod support multi tuner load.

Solution:
1.add fine tune.
2.add set/get if info.
3.add tuner type set/get.
4.add multi tuner config in dts.
5.atv demod ver: V2.09.

Verify:
verified by x301

Change-Id: I23328bfab3d3508db67cef3e327002563eb1a87e
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
2020-06-29 11:45:35 +09:00
nengwen.chen
7513077a2d atv_demod: Fix ATV audio output noise when switching channels to play [1/1]
PD#SWPL-2297, PD#SWPL-5450, PD#TV-2311

Problem:
Fix ATV audio output noise when switching channels to play.

Solution:
1.Add the judgment of SNR to prevent the weak signal
  from entering the OV mode.
2.Wait for the signal to be completely stable before OV detection.
3.OV detection is turned off by default,
  and will be turned on again when non-standard signals are encountered.
4.The OV detection moves from afc timer to monitor.
5.Optimize detection of A2/FM.
6.atv demod ver: V2.08.

Verify:
verified by x301

Change-Id: I3064230472ce51e1192a2d08ef6cc6f4ba10abaa
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
2020-06-29 11:45:34 +09:00
nengwen.chen
2437137b48 atv_demod: Fix non standard for analog signal [1/1]
PD#TV-1549, PD#TV-2829, PD#TV-2830

Problem:
Fix non standard for analog signal.

Solution:
1.Add non standard config 3 for analog signal.
2.Fix non standard default value.
3.Fix audio control register an bits.
4.After correcting the frequency offset success,
 reset tuner to prevent audio from identifying errors.

Verify:
verified by x301

Change-Id: I65335dbe9ce9dc66d4ccaae3c1ff591660790616
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
2020-06-29 11:45:34 +09:00
Nian Jing
45a51a5728 tvafe: fix pali recognize for palcn [1/1]
PD#SWPL-3395

Problem:
recognized fsc358 flag when signal weak

Solution:
increase fsc358-flag recognized threshold
avoid fsc443 be recognized as fsc358

Verify:
verify on x301

Change-Id: I7b759bd0621c153e5abd3dee8fdf55a2426400a7
Signed-off-by: Nian Jing <nian.jing@amlogic.com>
2020-06-29 11:45:34 +09:00
nengwen.chen
c8438a3a79 atv_demod: Tuner crashes easily when fast finetune [1/1]
PD#SWPL-4421

Problem:
Tuner crashes easily when fast fine tune

Solution:
Delay afc work to prevent tuner crash

Verify:
verified by x301

Change-Id: I011f7c3f71a30f95a9b7aa371d5fabe71f249051
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
2020-06-29 11:45:34 +09:00
nengwen.chen
1e94a666b4 atv_demod: Add audio carrier offset detect [1/1]
PD#TV-2564

Problem:
Torture room teset report SND0810 sound carrier deviation

Solution:
Add audio carrier offset detect

Verify:
verified by x301

Change-Id: I2d715891fb268452f95e05f998864e9b7321ff38
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
2020-06-29 11:45:34 +09:00
nengwen.chen
6d51e6415e atv_demod: Optimizing ATV auto scan Speed. [1/2]
PD#SWPL-4123

Problem:
Optimizing ATV auto scan Speed.

Solution:
optimizing the step of scanning.

Verify:
verified by x301

Change-Id: I0f616f14488be49be67c40eca7fc9f30108545b8
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
2020-06-29 11:45:34 +09:00
nengwen.chen
dc911319b2 atv_demod: modify atv demod code [1/1]
PD#SWPL-3469

Problem:
1.add mono audio only config.
2.fix offset -0.5M lose channel when scanning.
3.fix a2 audio mono mode detection threshold.
4.add audio detection when scanning.
5.Ver: V2.06.

Solution:
add mono audio only config

Verify:
verified by einstein

Change-Id: I774d7aa42ffbfcbec58b9b21f05368c5166331c8
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
2020-06-29 11:45:34 +09:00
Xing Wang
a3975b6783 audio: fix no sound when atv switch to other source [1/1]
PD#SWPL-3440

Problem:
ATV switch to other source, such as DTV/HDMI/AV, no sound

Solution:
ATV switch to other source, atv demond is disabled when
audio is reading data, so it's blocked.
In normal, ATV sends audio data to FRATV,
then FRATV sends data to audio fifo, then to DDR.
If ATV stops to send audio data, no interrupt from FRATV to fifo,
no data is updated to DDR.
When exit from audio atv patch, it's a block signal to
wait in_read finished, but ATV is disabled
TimeCheckThread will check any routine is blocked,
if there is one, signal SIGABRT would rise and cause audio server restart
So we  make a delay before ATV is disabled to waiting audio data is readed.

Verify:
x301

Change-Id: I47dc88d2c8565c16c739ffea69a88152fa4d5f13
Signed-off-by: Xing Wang <xing.wang@amlogic.com>
2020-06-29 11:45:34 +09:00
nengwen.chen
a8fcbb728d atv_demod: atv demod code optimization for audio [1/1]
PD#TV-1448

Problem:
1.atv demod code optimization for audio
2.amlogic-4.9-dev

Solution:
atv demod code optimization for audio

Verify:
verified by einstein

Change-Id: Ic1c6a26ef97fbaf288ae37f2761c0df83ec7cf1e
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
2020-06-29 11:45:34 +09:00
nengwen.chen
9ba7c8f814 atv_demod: reduce atv demod debug info when searching. [1/1]
PD#SWPL-2712

Problem:
reduce atv demod debug info when searching.

Solution:
reduce atv demod debug info when searching.

Verify:
verified by r311

Change-Id: I01f1cebabdacdea4bb7695c2133b99157d8db19d
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
2020-06-29 11:45:34 +09:00
nengwen.chen
f54861b2ff atv_demod: modify atv demod code [1/1]
PD#SWPL-2295

Problem:
1.modify atv demod code for coverity.
2.add ntsc-m ring filter for t962x2.
3.merge code optimization from android l.
4.add tuner compatible info in dts for tuner debug.

Solution:
1.modify atv demod code for coverity.
2.add ntsc-m ring filter for t962x2.
3.merge code optimization from android l.
4.add tuner compatible info in dts for tuner debug.

Verify:
verified by einstein

Change-Id: I9696aa628315ee11f0c9dd279c7cc03797f04331
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
2020-06-29 11:45:34 +09:00
nengwen.chen
ed47de1158 atv_demod: add atv demod support for tl1 [1/1]
PD#172587

Problem:
1.add atv demod driver and dts config for tl1.
2.merge from bringup/amlogic-4.9/tl1-20181111.

Solution:
add atv demod driver and dts config for tl1

Verify:
verified by t962x2_x301

Change-Id: Ibbc00f9d478a9f5e52c6333b9a819aac381894ec
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
2020-06-29 11:45:34 +09:00
Dianzhong Huo
0e013d8f9b ipc: add ircut driver for ipc camera [1/1]
PD#SWPL-4078

Problem:
Need porting ircut driver for ipc camera.

Solution:
Add ircut driver.
ircut auto on/off by light in sensor.

Verify:
Verify on W411 platform.

Change-Id: I4f20f0a1e117e8e4e7f94dead6a65f243169827f
Signed-off-by: Dianzhong Huo <dianzhong.huo@amlogic.com>
2020-06-29 11:45:33 +09:00
Lei Qian
d14d9e5f7d fix compile error
PD#SWPL-15312
2020-06-29 11:45:33 +09:00
Viresh Kumar
a330ef9cff PM / wakeup: Rework wakeup source timer cancellation
commit 1fad17fb1b upstream.

If wakeup_source_add() is called right after wakeup_source_remove()
for the same wakeup source, timer_setup() may be called for a
potentially scheduled timer which is incorrect.

To avoid that, move the wakeup source timer cancellation from
wakeup_source_drop() to wakeup_source_remove().

Moreover, make wakeup_source_remove() clear the timer function after
canceling the timer to let wakeup_source_not_registered() treat
unregistered wakeup sources in the same way as the ones that have
never been registered.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: 4.4+ <stable@vger.kernel.org> # 4.4+
[ rjw: Subject, changelog, merged two patches together ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Change-Id: Iae10e0d836e4933ef0311c72508c5cf246bbe437
2020-06-29 11:45:33 +09:00
Qiufang Dai
c1d043ac2c suspend: fix freeze hangup which caused by insmod [1/1]
PD#TV-10472

Problem:
When system on, enter freeze mode lead to flush deferd probe.
Init.rc also run insmod in parallel, if insmod task
atomic_inc(&probe_count), and this task is freezed,
deadlock happends.

Solution:
Move flush deferd probe action before freeze task

Verify:
X32A0-T972

Change-Id: I8949db32aea14e2da37e77658a9c999af39e2c83
Signed-off-by: Qiufang Dai <qiufang.dai@amlogic.com>
2020-06-29 11:45:33 +09:00
Martijn Coenen
de02da7990 Android Security Bulletin - November 2019-11 - Kernel components binder driver - CVE-2019-2214 [1/1]
PD#OTT-6799

Problem:
In case the target node requests a security context, the
extra_buffers_size is increased with the size of the security context.
But, that size is not available for use by regular scatter-gather
buffers;

Solution:
make sure the ending of that buffer is marked correctly.

Verify:
Raven

Change-Id: I896f86a92a4b937a7a731ce9839ff53a700b298a
Signed-off-by: Martijn Coenen <maco at android.com>
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2020-06-29 11:45:33 +09:00
Todd Kjos
99effa825b RAVENPLAT 2652: RAVEN - Android Security Bulletin - September 2019-09 - Kernel components binder driver - CVE-2019-2181 [1/]
PD#OTT-5999

[Problem]
In binder_transaction of binder.c, there is a possible out of bounds
write due to an integer overflow. This could lead to local escalation of
privilege with noadditional execution privileges needed. User interaction
is needed for exploitation.
The fix is designed to check for the integer overflow.

[Solution]
UPSTREAM: binder: check for overflow when alloc for security context

commit 0b0509508b upstream.

When allocating space in the target buffer for the security context,
make sure the extra_buffers_size doesn't overflow. This can only
happen if the given size is invalid, but an overflow can turn it
into a valid size. Fail the transaction if an overflow is detected.

Bug: 130571081
Change-Id: Ibaec652d2073491cc426a4a24004a848348316bf
Signed-off-by: Todd Kjos <tkjos@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2020-06-29 11:45:33 +09:00
Aaro Koskinen
5741242073 net: stmmac: use correct DMA buffer size in the RX descriptor
PD#TV-11316

[ Upstream commit 583e636141 ]

We always program the maximum DMA buffer size into the receive descriptor,
although the allocated size may be less. E.g. with the default MTU size
we allocate only 1536 bytes. If somebody sends us a bigger frame, then
memory may get corrupted.

Fix by using exact buffer sizes.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>

Change-Id: I32f3f0758ee6df0217dd9d1275c08b04163d811b
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
2020-06-29 11:45:33 +09:00
Aaro Koskinen
2c43efce4c net: stmmac: don't stop NAPI processing when dropping a packet
PD#TV-11316

[ Upstream commit 07b3975352 ]

Currently, if we drop a packet, we exit from NAPI loop before the budget
is consumed. In some situations this will make the RX processing stall
e.g. when flood pinging the system with oversized packets, as the
errorneous packets are not dropped efficiently.

If we drop a packet, we should just continue to the next one as long as
the budget allows.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>

Change-Id: Ib13615c2e413af86519c1cec0a6638b88ceaf4de
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
2020-06-29 11:45:33 +09:00
qi duan
74fa5c3141 ETH: add eth reset bit when resume. [1/1]
PD#SWPL-12602

Problem:
omni phy can not connect network probably
after long stress suspend test
for gxl/txl/txlx

Solution:
In suspend/resume sequeue, add eth reset

Verify:
verify on p212/r311

Change-Id: I4b6ab34eb2eae40533f4a33db8fb40a00f5b3d51
Signed-off-by: qi duan <qi.duan@amlogic.com>

Conflicts:
	arch/arm/boot/dts/amlogic/axg_s400_v03gva_sbr.dts
	arch/arm/boot/dts/amlogic/axg_s400_v03sbr.dts
	arch/arm/boot/dts/amlogic/gxl_p281_1g.dts
	arch/arm/boot/dts/amlogic/gxl_p281_2g.dts
	arch/arm64/boot/dts/amlogic/axg_s400_v03gva_sbr.dts
	arch/arm64/boot/dts/amlogic/axg_s400_v03sbr.dts
	arch/arm64/boot/dts/amlogic/gxl_p212_2g_drm_buildroot.dts
	arch/arm64/boot/dts/amlogic/gxl_p281_1g.dts
	arch/arm64/boot/dts/amlogic/gxl_p281_2g.dts
2020-06-29 11:45:33 +09:00
Tao Zeng
4b8aa1d903 reserved_memory: change print of all reserved memory [1/1]
PD#SWPL-16049

Problem:
When boot, print information of all reserved memory is not nice
for reading.

Solution:
Change print format of reserved memory like:
        07400000 - 07500000,     1024 KB, ramoops@0x07400000
        05000000 - 05400000,     4096 KB, linux,secmon
        3f800000 - 40000000,     8192 KB, linux,meson-fb
        31c00000 - 3f800000,   225280 KB, linux,codec_mm_cma
        31c00000 - 31c00000,        0 KB, linux,codec_mm_reserved
        2e000000 - 30000000,    32768 KB, linux,ion-dev
        30800000 - 31c00000,    20480 KB, linux,vdin1_cma
        30000000 - 30800000,     8192 KB, linux,demod_cma
        2b800000 - 2e000000,    40960 KB, linux,di_cma
        2b400000 - 2b800000,     4096 KB, linux,emp_cma

Verify:
TL1 X301

Change-Id: I5a010118665a886896c7db8be2bb911813647e9e
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
2020-06-29 11:45:33 +09:00
Yue Wang
6d76b270cc usb: detect stop endpoint race using pending timer instead of counter. [1/1]
PD#SWPL-13177

Problem:
stop endpoint race

Solution:
A counter was used to find out if the stop endpoint completion raced with
the stop endpoint timeout timer. This was needed in case the stop ep
completion failed to delete the timer as it was running on anoter cpu.

The EP_STOP_CMD_PENDING flag was not enough as a new stop endpoint command
may be queued between the command completion and timeout function, which
would set the flag back.

Instead of the separate counter that was used we can detect the race by
checking both the STOP_EP_PENDING flag and timer_pending in the timeout
function.

Verify:
franklin

Change-Id: Ie958ffd530a6bd176d0cf451894a5bd4dece38da
Signed-off-by: Yue Wang <yue.wang@amlogic.com>
2020-06-29 11:45:33 +09:00
Yue Wang
d6bff5638e usb: bringup TM2 usb3 [2/2]
PD#SWPL-5609

Problem:
bringup TM2 usb3.

Solution:
bringup TM2 usb3.

Verify:
TM2

Change-Id: Ib2c80e7e586ddbe6f85a6d046efdbd650b81b030
Signed-off-by: Yue Wang <yue.wang@amlogic.com>
2020-06-29 11:45:32 +09:00
Greg Kroah-Hartman
91bda24fc8 Revert "USB: core: only clean up what we allocated"
commit cf4df407e0 upstream.

This reverts commit 32fd87b3bb.

Alan wrote a better fix for this...

Cc: Andrey Konovalov <andreyknvl@google.com>
Cc: stable <stable@vger.kernel.org>
Cc: Nathan Chancellor <natechancellor@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-29 11:45:32 +09:00
Hanjie Lin
81f9f4946c RAVENPLAT-252: Kernel components USB - CVE-2017-17558[1/1]
PD#SWPL-15901

Problem:
In usb_destroy_configuration of config.c, there is a possible
out of bounds write due to a missing bounds check. This could
lead to local escalation of privilege with no additional execution
privileges needed. User interaction is not needed for exploitation.

Solution:
The fix is designed to make sure the driver only frees as many
configurations and interfaces as it could have allocated.

Platform:
Raven

Verify:
Raven

Change-Id: I4a3d2ad27d09e606d4e363a75ce09a2e2fcf0070
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2020-06-29 11:45:32 +09:00
he.he
09ba5865c8 usb: xHCI host not responding to stop endpoint command [1/1]
PD#SWPL-14053

Problem:
Read and write simultaneously on two disks on a hub,
and then the XHCI controller would halted.

Solution:
Set the GUCTL1 BIT 17 to 1 for disable park mode.

Verify:
test pass on u200, ODROID-N2

Change-Id: I007804fa6b97a103da4a05be12c1193b9dd422cb
Signed-off-by: he.he <he.he@amlogic.com>
2020-06-29 11:45:32 +09:00
Yue Wang
7a662b734e usb: usb warning [1/1]
PD#SWPL-7031

Problem:
usb warning.

Solution:
delete usb warning.

Verify:
TM2

Change-Id: I70cf1f71bfaed0e7b9b53118259e86806933281f
Signed-off-by: Yue Wang <yue.wang@amlogic.com>
2020-06-29 11:45:32 +09:00
Mathias Payer
370c6a76ff RAVENPLAT 2390:OSS vulnerability found in [boot.img]:[linux_kernel] (CVE-2018-20169) Risk:[] [1/1]
PD#OTT-5679

[Problem]

[Solution]
USB: check usb_get_extra_descriptor for proper size

When reading an extra descriptor, we need to properly check the minimum
and maximum size allowed, to prevent from invalid data being sent by a
device.

Change-Id: Ie3dbdb24bebc0f2813b0bedd2261f8246ddd71d3
Reported-by: Hui Peng <benquike@gmail.com>
Reported-by: Mathias Payer <mathias.payer@nebelwelt.net>
Co-developed-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Hui Peng <benquike@gmail.com>
Signed-off-by: Mathias Payer <mathias.payer@nebelwelt.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2020-06-29 11:45:32 +09:00
he.he
7c71ad46f9 usb: CtsVerifier.apk usb device test failed [1/1]
PD#SWPL-13498

Problem:
The printing may delay the usb_disconnect processing, result to
USB transfer error during reconnecting.

Solution:
Moving the print in proc_setconfig of devio.c .

Verify:
test pass on sm1

Change-Id: I5c45abb2d5d640e2e02dc3e0c08b10ca7a294eeb
Signed-off-by: he.he <he.he@amlogic.com>
2020-06-29 11:45:32 +09:00
Yue Wang
7684acd7ee usb: dma-mapping: prevent writeback deadlock in CMA allocator [1/1]
PD#SWPL-11362

Problem:
A deadlock happens when a task initiates a CMA allocation that triggers
a page migration *AND* the tasks holding the subsequent pages have to
writeback their pages using CMA allocations.

In such a situation, the task that has triggered the page migration
holds a mutex that prevents other tasks from migrating their pages using
that same CMA allocator. This leads to a deadlock.

Solution:
The CMA is incapable of honoring the NOIO flags in some scenario, thus
cannot be used for writeback. The fix allows the code that chooses which
allocator to use in the ARM platform to avoid the CMA case for that
scenario.

The ARM DMA layer checks for allow blocking flag (_GFP_BDEV) to decide
whether to go for CMA or not. That test is not sufficient to cover the
case of writeback (GFP_NOIO).

The fix consists in adding a gfp_allow_writeback helper that tests for
the __GFP_IO flag. Then, the DMA layer uses it to decide not to go for
CMA in case of writeback.

Verify:
TL1

Change-Id: I175eb94de588234d3de2dc7f65dafe980e2636af
Signed-off-by: Yue Wang <yue.wang@amlogic.com>
2020-06-29 11:45:32 +09:00
Hanjie Lin
f05e89c411 perf_event: fix pmu deadlock issue [1/1]
PD#SWPL-3088

Problem:
smp_call_function_single() may cause deadlock.

Solution:
modify

Verify:
u200 w400

Change-Id: I86e9f67ed292245c5fe649e6750a6a406261552f
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2020-06-29 11:45:32 +09:00
Bichao Zheng
44de0a9996 pwm: meson: add relative_duty interface in pwm sysfs [1/1]
PD#SWPL-4225

Problem:
This interface is added to facilitate debugging the voltage-
table in pwm regulator, which can output different percentages
of waveforms in a fixed pwm cycle.
example:
echo 50 100 > sys/class/pwm/pwmchipx/pwmx/relative_duty
output 50% duty pwm

Solution:
add relative_duty interface in pwm sysfs

Verify:
test pass on tl1_X301_v1 tl1_skt_v1

Change-Id: Icd01e681694b81f3790f7cce8c326db02674a48c
Signed-off-by: Bichao Zheng <bichao.zheng@amlogic.com>
2020-06-29 11:45:32 +09:00
Shunzhou Jiang
c045252a9d bl40: g12a/sm1: add m4 bringup path [1/3]
PD#SWPL-12964

Problem:
bring up m4

Solution:
add kernel driver

Verify:
U209+S905D3

Change-Id: Iaa57f24c919af013581b8e3faffb0b57f5af10ed
Signed-off-by: Shunzhou Jiang <shunzhou.jiang@amlogic.com>
2020-06-29 11:45:32 +09:00
Tao Zeng
5e1ec0d89d bandwidth: add min bandwidth read in usage_stat [1/1]
PD#SWPL-7960

Problem:
There is no min ddr bandwidth data

Solution:
Add this value in sysfs

Verify:
p212

Change-Id: I9d90476d30c0ca7789046d8d205f0802de2b4acf
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
2020-06-29 11:45:31 +09:00
Ville Syrjälä
0899d02319 drm/atomic: Make private objs proper objects
Make the atomic private object stuff less special by introducing proper
base classes for the object and its state. Drivers can embed these in
their own appropriate objects, after which these things will work
exactly like the plane/crtc/connector states during atomic operations.

v2: Reorder to not depend on drm_dynarray (Daniel)

Change-Id: I475f3c46440934b8d6f461935b6413624b7d34c7
Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> #v1
Signed-off-by: Ville Syrj?l? <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170712155102.26276-3-ville.syrjala@linux.intel.com
Signed-off-by: Ao Xu <ao.xu@amlogic.com>
2020-06-29 11:45:31 +09:00
Keith Packard
0fd3ffc68f drm: Reorganize drm_pending_event to support future event types [v2]
PD#SWPL-4863

Place drm_event_vblank in a new union that includes that and a bare
drm_event structure. This will allow new members of that union to be
added in the future without changing code related to the existing vbl
event type.

Assignments to the crtc_id field are now done when the event is
allocated, rather than when delievered. This way, delivery doesn't
need to have the crtc ID available.

v2:
 * Remove 'dev' argument from create_vblank_event

	It wasn't being used anyways, and if we need it in the future,
	we can always get it from crtc->dev.

 * Check for MODESETTING before looking for crtc in queue_vblank_event

	UMS drivers will oops if we try to get a crtc, so make sure
	we're modesetting before we try to find a crtc_id to fill into
	the event.

(cherry picked from commit dc695b85fde88eca3ef3b03fcd82f15b6bc6e462)

Change-Id: I6f0feabcba9373fcc434b148752d9cd28bea67e6
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Ao Xu <ao.xu@amlogic.com>
2020-06-29 11:45:31 +09:00
Ao Xu
5a1002d132 drm: Pass CRTC ID in userspace vblank events
PD#SWPL-4863

With the atomic API, it is possible that a single commit affects
multiple crtcs. If the user requests an event with that commit, one
event will be sent for each CRTC, but it is not possible to distinguish
which crtc an event is for in user space. To solve this, the reserved
field in struct drm_vblank_event is repurposed to include the crtc_id
which the event is for.

The DRM_CAP_CRTC_IN_VBLANK_EVENT is added to allow userspace to query if
the crtc field will be set properly.

[daniels: Rebased, using Maarten's forward-port.]

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Daniel Stone <daniels@collabora.com>
Cc: Maarten Lankhorst <maarten.lankhorst@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170404165221.28240-2-daniels@collabora.com

Change-Id: Ide7657bdc38563d2de91edc2d649b53262002c39
Signed-off-by: Ao Xu <ao.xu@amlogic.com>
2020-06-29 11:45:31 +09:00
Maarten Lankhorst
98c268c8ed drm/vblank: Pass crtc_id to page_flip_ioctl.
PD#SWPL-4863

We added crtc_id to the atomic ioctl, but forgot to add it for vblank
and page flip events. Commit bd386e5180 ("drm: Reorganize
drm_pending_event to support future event types [v2]") added it to
the vblank event, but page flip event was still missing.

Correct this and add a test for making sure we always set crtc_id correctly.

Change-Id: Idd1070005d88529500a8be868f714c8bb345ddee
Fixes: bd386e5180 ("drm: Reorganize drm_pending_event to support future event types [v2]")
Fixes: 5db06a8a98 ("drm: Pass CRTC ID in userspace vblank events")
Cc: Daniel Stone <daniels@collabora.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: dri-devel@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v4.12+
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> #irc
Testcase: igt/kms_vblank/crtc_id
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171123103737.47138-1-maarten.lankhorst@linux.intel.com
Signed-off-by: Ao Xu <ao.xu@amlogic.com>
2020-06-29 11:45:31 +09:00
Luke Go
8d89b3c1eb Partial revert: emmc: gp0 is not closed when suspend [1/1]
- Sync to old g12 status.

Change-Id: Ia73840915cbcb4c391b3bffd2f0d7d1430595187
2020-06-29 11:45:31 +09:00