Commit Graph

596778 Commits

Author SHA1 Message Date
Shawn Lin
663a5ea88b UPSTREAM: PCI/ASPM: Remove redundant check of pcie_set_clkpm
Without supporting clock PM capable, if we want to disable
clkpm, we don't need this extra check as it already be zero for
the enable argument. And it's the same for enabling clkpm here.
So let's remove this check.

Change-Id: I0dc251e5dea940a2288fbb31a58336dea83f2515
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
(cherry picked from git.kernel.org/cgit/linux/kernel/git/next/linux-next.git
commit a6c1c6f354)
2016-10-18 15:57:49 +08:00
Rajat Jain
f8218978f0 UPSTREAM: PCI: rockchip: Increase the Max Credit update interval.
This increases the likelihood of link state to automatically go to L1
and save some power.

The default credit update interval of 7.5 us results in the rootport
sending UpdateFC-P and UpdateFC-NP packets too often, thus resulting
in the link never going to L1, and always staying in L0/L0s. The
value 24 us was chosen after some experiments and peeking over the
PCIe bus to see that we do enter L1 substate when there is not enough
traffic on the PCIe bus.

Change-Id: I23eccba98f6fe731bcacec80349dc05bd7baf9c1
Signed-off-by: Rajat Jain <rajatja@google.com>
Acked-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
(cherry picked from git.kernel.org/cgit/linux/kernel/git/next/linux-next.git
commit 277743ef61)
2016-10-18 15:57:26 +08:00
Shawn Lin
3eb2a3f613 UPSTREAM: PCI: rockchip: cleanup for rockchip pcie driver
Bjorn did some cleanup for rockchip pcie driver after
mereging the drivers. So let's backport it entirely
to keep consisten with the upstream kernel.

[bhelgaas: fold in Brian's rockchip_pcie_client_irq_handler() OR fix, other
fixes and cleanups from Guenter Roeck <linux@roeck-us.net> and me,
uninitialized variable fix from Arnd Bergmann <arnd@arndb.de>]

Change-Id: If680b9c2264cd89561427180b146c34eb8549511
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2016-10-18 15:57:13 +08:00
Zorro Liu
b2f89d4c5a driver,iio,inv_mpu_i2c: driver set i2c clientdata twice, remove err one
Change-Id: I506d924121b7abe57659815b356a3cbab887f869
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
2016-10-17 20:03:33 +08:00
Huang Jiachai
3d60483b18 video: rockchip: vop: 3399: fix win2/win3 csc mode error
Change-Id: I34275fda827446dbdebbe3a13e18ceaacd6bba2c
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
2016-10-17 20:02:38 +08:00
Yakir Yang
87043b406b rk: arm: support build kernel.img and resource.img
Change-Id: I651bb208c4304a2aeb7a03516238ac81cdc957d2
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
2016-10-17 20:00:46 +08:00
Yakir Yang
9182cedd03 drm/rockchip: dw_hdmi: support 4K@60Hz output
The pixel clock of 4K@60Hz is 594MHz, let's enable it for HDMI.

Change-Id: I6097c8a452ba8259c1d8d01fb793cd7cc55cafb3
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
2016-10-17 19:59:33 +08:00
Yakir Yang
287df96af0 ARM: dts: rk3288-evb: force VOP Big to hdmi, and VOP Little to edp
The max output resolution of VOP Little is 2K, but VOP Big could support
4K output. For now we need support HDMI 4K display, so let force VOP Big
to HDMI, and VOP Little to eDP

Change-Id: Ic493fcb2ee29c3deda0fe5437aab46e271f3689b
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
2016-10-17 19:58:39 +08:00
Jianhong Chen
9c812075fd power: rk818-battery: restore coffset when update fail
Change-Id: Ia1d02a0d340819bbca14e4f0931f9e94230cef78
Signed-off-by: Jianhong Chen <chenjh@rock-chips.com>
2016-10-17 15:04:53 +08:00
zzc
9be9e8f5f3 net: rkwifi: fix ap6330 sdio write/read abnormal when doing stress test
Change-Id: I7c353cd4cabb24425aa0bdef243adb293e7c2829
Signed-off-by: zzc <zzc@rock-chips.com>
2016-10-17 14:41:39 +08:00
Wu Liang feng
cfe5a90196 usb: rockchip-inno-usb2: check EXTCON_USB_VBUS_EN state in otg sm work
If extcon cable state is EXTCON_USB_VBUS_EN, it also means
that otg host connected, don't need to do charge detection.

Change-Id: Ie7c97c4cd0cfd2688edbfb3bbff93d2f58e9ef9a
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
2016-10-16 14:39:59 +08:00
Wu Liang feng
e90169f79e mfd: fusb302: correct extcon cable state when enable vbus
Set extcon cable state to EXTCON_USB_VBUS_EN instead of
EXTCON_USB_HOST when enable vbus 5v. Because EXTCON_USB_HOST
state means that fusb302 has detected Type-C mode and the
orientation. However, enable vbus is prior to Type-C mode
and orientation detection. If we set EXTCON_USB_HOST state
when power on vbus, it may cause usb controller driver to
receive the state prematurely, and do tcphy orientation init
improperly.

Change-Id: Id65072dc8235693db44667ee5d2ceac74dc94920
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
2016-10-16 14:39:59 +08:00
wjh
278b8d48d4 drivers: video: rockchip: hdmi: add RAYKEN5.46" lcd for discret vr device
Change-Id: Ica15b530c565b3c61fe1b1cb6ef1e8944a7e7607
Signed-off-by: wjh <wjh@rock-chips.com>
2016-10-14 19:42:59 +08:00
Wu Liang feng
4070b4498d usb: dwc3: rockchip: add pm runtime control for dwc3 parent
In usb3 tcphy init, it will access usb3 module to set
usb3 working on USB3.0 mode or USB2.0 only mode, and
usb3 pd must be enabled before do this operation. So
we add pm runtime control for dwc3 parent in extcon
evt work. If plug in usb device, resume dwc3 parent
first to enable usb3 pd and then do phy init.

Change-Id: I90dd762d7f76e5f1722c95611e440eacd3afcdc9
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
2016-10-14 17:41:26 +08:00
wenping.zhang
54160fc81f arm64: dts: rockchip: add dts node for dp 4 lanes + usb2.0 function.
Change-Id: Ia45dd31ebfe2c0c038a6102920eefb50fd512f36
Signed-off-by: wenping.zhang <wenping.zhang@rock-chips.com>
2016-10-14 17:40:22 +08:00
wenping.zhang
10a5f48285 phy: phy-rockchip-typec: add dp 4 lane + usb2.0 support.
Change-Id: I7b67959a1bd05694f929d1d437d55d2b7b015b46
Signed-off-by: wenping.zhang <wenping.zhang@rock-chips.com>
2016-10-14 17:39:51 +08:00
Zikim,Wei
e7fb8841a0 rockchip/rga: add rga flush data cache
If the buffer alloced from the ion, user can flush
it by ion apis, but if the buffer was alloced by
other apis like malloc, user space is not easy to
flush the data cache. So rga flush the data cache
for cache coherence.

Change-Id: I5fcfc3e00c6a8f6b12ed66043b37b0c7c840e7ee
Signed-off-by: Zikim,Wei <wzq@rock-chips.com>
2016-10-14 17:11:35 +08:00
Meng Dongyang
84343348fe Revert "usb: dwc3: rockchip: fix otg plug out error before resume"
This reverts commit ccc954ee9f.
In current code, the dwc3 controller will not process notify when it is
in suspend state and this forbid extcon remove hcd before xhci resume, so
we do not need to forbid remove hcd by the hcd runtime flag and it is
difficult to deal with different process when connected with some special
usb storage.

Change-Id: I987862cceb4ffbe8deefb503f6bc4009770e87bd
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
2016-10-14 17:09:05 +08:00
Bin Yang
ecaa873d5a arm64: dts: rockchip: set hall-sensor interrupt gpio pull up for rk3399-mid
Change-Id: I72c8df9abdd6f173bc33d907794afc4ac2eb8b6b
Signed-off-by: Bin Yang <yangbin@rock-chips.com>
2016-10-14 16:40:54 +08:00
xubilv
4111e98f6e drm/rockchip: mipi: dsi: Decrease the value of Ths-prepare
Change-Id: Ia3912004f3799465102c36e5faefa6238e52af83
Signed-off-by: xubilv <xbl@rock-chips.com>
2016-10-14 14:26:11 +08:00
Nickey Yang
da51c393a9 ARM: dts: rk3288-miniarm: force VOP Big to hdmi
The max output resolution of vopl is 2K, but vopb could support
4K output. For now we need support HDMI 4K display, so let force
VOP Big to HDMI.

Change-Id: Id095d3659554988f7647fb27d415652fbf510b14
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2016-10-14 14:10:40 +08:00
xubilv
1975117c61 drm/rockchip: mipi: dsi: add non-burst mode macro definition
Change-Id: Ief47d18825afa0d0116a940336dfe1116238cdb7
Signed-off-by: xubilv <xbl@rock-chips.com>
2016-10-14 13:57:03 +08:00
xubilv
0113511f34 drm/rockchip: mipi: dsi: add send mipi command function
Change-Id: If0699d8d5a42320ba064b698486a912794dfbfb7
Signed-off-by: xubilv <xbl@rock-chips.com>
2016-10-14 13:56:49 +08:00
xiaoyao
3aba2997c9 arm64: dts: rk3399: workaround: remove sd-uhs-sdr104 for sd cards
Change-Id: Ic9d1f6f0e1ff81025b8b8d8d04f98026301c900f
Signed-off-by: xiaoyao <xiaoyao@rock-chips.com>
2016-10-14 10:10:39 +08:00
lanshh
00fa31cc1b hid: rkvr: add touch panel support
Change-Id: Icc4393db25f4def8ac663dd7e4cb7779a80446cc
Signed-off-by: lanshh <lsh@rock-chips.com>
2016-10-14 09:53:31 +08:00
lanshh
0e59ab1e2b hid: rkvr: change sync implement
Change-Id: I2c18d79339f067e8b567be0568ff3de8a8934a27
Signed-off-by: lanshh <lsh@rock-chips.com>
2016-10-14 09:53:22 +08:00
Meng Dongyang
25a6f3608b usb: rockchip-inno-usb2: use EXTCON_USB_VBUS_EN to control vbus
Add EXTCON_USB_VBUS_EN cable and change EXTCON_USB_HOST to
EXTCON_USB_VBUS_EN cable to control vbus.

Change-Id: I2e7c6111f723e425bd4c156e803cb6a1a9f17511
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
2016-10-13 16:16:18 +08:00
Meng Dongyang
fb3805a55a usb: dwc3: rockchip: force dwc3 suspend immediately after disconneted
When usb device or host reconnect quickly, the dwc3 controller still
in the state of resume and can not resume again after receive connect
notify. So we need to suspend dwc3 controller immediately when
receive the notify of disconnect. This patch fix the bug "set device
address fail" when resume or quick reconnect.

Change-Id: Iaef6363cdece497f8d7be745017674e119fe3529
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
2016-10-13 16:15:34 +08:00
Meng Dongyang
a43c9c3095 usb: dwc3: rockchip: set dwc3 enter runtime suspend immediately
In current code, the dwc3 controller is active when system start
and change to suspend when auto suspend, while the dwc3 controller
will receive connected notify before auto suspend and fail to change
the state of dwc3 controller from active state to resume if dwc3
controller is connected when system start. So we can change async
suspend to sysc suspend to make sure that the dwc3 controller could
finish suspend process before receive connect notify and fix "set
address fail" error when system start.

Change-Id: Ida8760004da06275d667e33b887b8dde87cd9520
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
2016-10-13 16:09:40 +08:00
Meng Dongyang
4221c07f2c power: rk818_charger: get cable state when usb charge function init
RK818 will miss the notify of charge type changing because
the charge cable state is init when u2phy probe but rk818 probe after
u2phy. So we need to get the charge cable state when rk818 probe.

Change-Id: I3682d764ae3f9a56a1ba85ba8b81ea7f1aacdf49
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
2016-10-13 16:08:41 +08:00
Meng Dongyang
454181a86d usb: rockchip-inno-usb2: init cable state when u2phy probe
Id pin interrupt not occur when system start, so we need to check
id pin value when u2phy probe and set cable to host if the value
is high.

Change-Id: I333d5cae2463a159a18b455550a76ebcac704c44
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
2016-10-13 15:18:20 +08:00
Meng Dongyang
1a1e029209 usb: dwc3: rockchip: enable dwc3 to be a wakeup source
Enable dwc3 to be wakeup source in runtime resume callback function
and disable dwc3 to be wake up source in runtime suspend. Change pd
in order to control usb pd base on the connect state of usb controller
and fix the detect fail bug of otg port after suspend and resume.

Change-Id: Ic204a82952eb5dd626945189e18a3d2cc40aa6d9
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
2016-10-13 14:56:51 +08:00
Wu Liang feng
d873933338 arm64: dts: rockchip: set dwc3 dr_mode as otg for rk3399-android-next
rk3399 Type-C0 USB can support both peripheral mode
and host mode, so we set dr_mode as otg.

Change-Id: Ifb6e64920cecf27e41f801809d560bdd302a880b
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
2016-10-13 14:50:45 +08:00
Wu Liang feng
499fcb657a usb: dwc3: rockchip: fix xhci NULL pointer dereference
If DWC3 works as peripheral only mode, XHCI HCD will
not be created and added, so we should only get XHCI
HCD in host mode.

Change-Id: Iefb02431d6a973050986963bbabe0a943283f4b3
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
2016-10-13 14:50:29 +08:00
Wu Liang feng
3300229ada arm64: dts: rockchip: add USB3 an DP child nodes for tcphy
Since the commit a2be4bc ('FIXUP: UPSTREAM: phy: Add USB
Type-C PHY driver for rk3399') has created 2 PHY devices
separately for tcphy USB3 and DisplyPort, and registered
them under the child node, we should also add the USB3
and DP child nodes to dts.

Change-Id: Iffe5dc961dc96b2b41476b1db2949e95c275e19f
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
2016-10-13 14:21:11 +08:00
Wu Liang feng
fbd80840b0 FIXUP: UPSTREAM: phy: Add USB Type-C PHY driver for rk3399
This patch aims to make code sync with upstream[1]. And it
can fix the following issues:

1. Introduce the EXTCON_PROP_USB_SS property to support both
   DP 2*lanes + USB3.0 and DP 4*lanes + USB2.0 mode;
2. Fix the bug that the USB3 phy power on should not return
   err when no USB attached, since the USB3 controller will
   power_on phy at probe/resume, even though there is no USB3
   super speed device attached. At this case, return 0 and do
   nothing is better.
3. Create 2 PHY devices separately for USB3 and DisplyPort,
   and registers them under the child node.

[1] git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
commit <e96be45cb84e29e58f35ed460a859b61e8bf28c5>

Change-Id: Ib388a072f11d80624ec6e16291eab497a3dcb0e1
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
2016-10-13 14:21:03 +08:00
Mark Yao
4afab6ba7b drm/rockchip: vop: support afbdc
Change-Id: If22924904f6d0362ba2abef0ddfe715684aca58a
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-10-13 11:28:52 +08:00
Meng Dongyang
ccc954ee9f usb: dwc3: rockchip: fix otg plug out error before resume
ID dig disconnect interrupt will happen and notify dwc3 controller
to remove hcd as soon as resume, and release root hub, but the hcd
has not resume, so there is a logic error and it may result in NULL
pointer, this patch forbid remove hcd when the state of hcd is suspend.

Change-Id: Ia5673848a23528cd053d75910c0fdbddf0927a40
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
2016-10-13 10:22:27 +08:00
Mark Yao
22e5631e63 FROMLIST: drm/bridge: analogix: protect power when get_modes or detect
The drm callback ->detect and ->get_modes seems is not power safe,
they may be called when device is power off, do register access on
detect or get_modes will cause system die.

Here is the path call ->detect before analogix_dp power on
[<ffffff800843babc>] analogix_dp_detect+0x44/0xdc
[<ffffff80083fd840>] drm_helper_probe_single_connector_modes_merge_bits+0xe8/0x41c
[<ffffff80083fdb84>] drm_helper_probe_single_connector_modes+0x10/0x18
[<ffffff8008418d24>] drm_mode_getconnector+0xf4/0x304
[<ffffff800840cff0>] drm_ioctl+0x23c/0x390
[<ffffff80081a8adc>] do_vfs_ioctl+0x4b8/0x58c
[<ffffff80081a8c10>] SyS_ioctl+0x60/0x88

Change-Id: Ica3fda1f22f903ee9ba2f0caed40cdae9bdfa32b
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
(am from https://patchwork.kernel.org/patch/9374135)
2016-10-13 10:13:26 +08:00
Mark Yao
ec6b18cab9 FROMLIST: drm: add ARM vendor format afbc
AFBC is arm vendor format, it's a compressed format.

The AFBC format is supported by rk3399 vop big.

We know little about AFBC layout, hope to some guys can
fixme about the afbc comment.

Change-Id: I9b3edaeb8cc7ffb792820c2f9a60d91fd0c6c28b
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
(am from https://patchwork.kernel.org/patch/9324667/)
2016-10-13 10:08:07 +08:00
Mark Yao
32748ef4a5 arm64: rockchip_defconfig: enable drm display drivers
enable ROCKCHIP_ANALOGIX_DP, ROCKCHIP_INNO_HDMI and ROCKCHIP_LVDS

Change-Id: I2bd0836bdb04b2c560834e8de31b37ce7a4fae79
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-10-13 10:07:47 +08:00
William wu
b67d7743ec usb: dwc3: rockchip: remove unused NULL pointer handle otg_work
We make sure that get drvdata dwc before register extcon
notifier and schedule otg_work, so we can remove the dwc
NULL pointer handle safely.

Also, change the WARN_ON to dev_warn, and avoid log noise.

Change-Id: Icececf3bb5ad510b91d2c3a50e2126225673605e
Signed-off-by: William wu <wulf@rock-chips.com>
2016-10-13 09:51:58 +08:00
William wu
0d9cd7338b CHROMIUM: usb: dwc3: rockchip: Fix race conditions involving extcon
Use a lock to ensure that the extcon callback only runs after probe()
has finished. In suspend() we unregister the extcon handler to prevent
it from being executed when the controller is suspended, which might
lead to crashes or unexpected behavior.

TEST=build and boot on 3399 board; plug in a USB device and verify
whether it is enumerated; suspend the DUT; resume the DUT; unplug
and re-plug the USB device and verify it is enumerated.

Change-Id: I965e66631a2d0f4d6cc53917d6a6e80bf8774fe1
Signed-off-by: William wu <wulf@rock-chips.com>
2016-10-13 09:51:35 +08:00
William wu
cbdcfea9e3 CHROMIUM: usb: dwc3: rockchip: fix otg reset problem
We need to ensure the dwc controller stay in P2 state prior
to phy init. In order to set dwc controller in P2 state,
there're two methods:

1. Hold dwc controller in reset while initialize phy.
2. Do OTG reset before phy init, one thing to note here is
   that we can't reinit dwc controller again prior to phy init.

We choose the second mothod now. Because asserting the OTG
reset may affect dwc chip operation. The reset will clear all
of the dwc controller registers, and there are no synchronization
primitives, meaning the dwc3 core code could at least in theory
access chip registers while the reset is asserted, with unknown
impact. So we need to deassert the OTG reset as soon as possible.
Since phy init may take a long time, we can't hold the reset while
initialize phy.

Also, we add otg reset if dwc controller works as peripheral mode.

Change-Id: I54fec922308f62bfc7ebdde3e07ede9347e8f70a
Signed-off-by: William wu <wulf@rock-chips.com>
2016-10-13 09:51:27 +08:00
Mark Yao
8d1a3aabd9 arm64: dts: rk3399: add evb3 support for android drm
Change-Id: I014dac7e2993d12795d7da9732703319fb56faef
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-10-12 17:10:34 +08:00
Wu Liang feng
c69d99a174 arm64: dts: rockchip: add the 4th cell for u2phy1_otg interrupts for rk3399
The ARM GICv3 #interrupt-cells need 4 cells to encode an interrupt source.
According to Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.txt,
the 4th cell is a phandle to a node describing a set of CPUs this interrupt
is affine to. The interrupt must be a PPI, and the node pointed must be a
subnode of the "ppi-partitions" subnode. For interrupt types other than PPI
or PPIs that are not partitionned, this cell must be zero. So we just add
0 for the 4th cell of u2phy1_otg interrupts.

Change-Id: I16ff4e4296064716fe4f7ea35946085e0473f049
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
2016-10-12 17:09:12 +08:00
wuliangqing
872c8a93c8 arm64: dts: rk3399-vr: adjust temperature
Change-Id: I0bbfdc2a5541d381cd784efd3532c702ef925339
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2016-10-12 14:38:50 +08:00
wuliangqing
c5fda54b3c arm64: dts: rk3399-vr: redefine vr key
Change-Id: I15134f71acb93613702f21959857f85c3a3e49dc
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2016-10-12 14:38:37 +08:00
Douglas Anderson
886a7d9ca9 FROMLIST: timers: Fix usleep_range() in the context of wake_up_process()
Users of usleep_range() expect that it will _never_ return in less time
than the minimum passed parameter.  However, nothing in any of the code
ensures this.  Specifically:

usleep_range() => do_usleep_range() => schedule_hrtimeout_range() =>
schedule_hrtimeout_range_clock() just ends up calling schedule() with an
appropriate timeout set using the hrtimer.  If someone else happens to
wake up our task then we'll happily return from usleep_range() early.

msleep() already has code to handle this case since it will loop as long
as there was still time left.  usleep_range() had no such loop.

The problem is is easily demonstrated with a small bit of test code:

  static int usleep_test_task(void *data)
  {
    atomic_t *done = data;
    ktime_t start, end;

    start = ktime_get();
    usleep_range(50000, 100000);
    end = ktime_get();
    pr_info("Requested 50000 - 100000 us.  Actually slept for %llu us\n",
      (unsigned long long)ktime_to_us(ktime_sub(end, start)));
    atomic_set(done, 1);

    return 0;
  }

  static void run_usleep_test(void)
  {
    struct task_struct *t;
    atomic_t done;

    atomic_set(&done, 0);

    t = kthread_run(usleep_test_task, &done, "usleep_test_task");
    while (!atomic_read(&done)) {
      wake_up_process(t);
      udelay(1000);
    }
    kthread_stop(t);
  }

If you run the above code without this patch you get things like:
  Requested 50000 - 100000 us.  Actually slept for 967 us

If you run the above code _with_ this patch, you get:
  Requested 50000 - 100000 us.  Actually slept for 50001 us

Presumably this problem was not detected before because:
- It's not terribly common to use wake_up_process() directly.
- Other ways for processes to wake up are not typically mixed with
  usleep_range().
- There aren't lots of places that use usleep_range(), since many people
  call either msleep() or udelay().

Change-Id: Ibb93ce0dd9fb9688d4a8d10447c098c1dfbd7a1d
Reported-by: Tao Huang <huangtao@rock-chips.com>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Andreas Mohr <andim2@users.sf.net>
(am from https://patchwork.kernel.org/patch/9369963/)
2016-10-12 10:34:40 +08:00
Frank Wang
c1c0358a1c arm: dts: add no-relinquish-port property for rk3288-miniarm
This adds support no relinquishing port from ehci to ohci.

Change-Id: I153a85df7407b8e546e75018d71e3763c8f41a10
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2016-10-11 17:23:53 +08:00