Commit Graph

599404 Commits

Author SHA1 Message Date
wenping.zhang
ef889ee1e6 arm64: rockchip_linux_defconfig: add CONFIG_KEYBOARD_ADC for rk3399 linux project.
Change-Id: Ieb8c8bf311202119a31798a9a39883fc5e121f02
Signed-off-by: wenping.zhang <wenping.zhang@rock-chips.com>
2017-01-16 14:12:45 +08:00
Jacob Chen
237768a86b ARM: rockchip_linux_defconfig: add some config for wifi AP function
Change-Id: I082b22858e0ded5055484ad0f1fdd04e23e01113
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-01-13 19:44:51 +08:00
zzc
c6f8bf17a8 arm64: rockchip_linux_defconfig: add some config for wifi AP function
Change-Id: I6884fb9335d3f035f3ea8f530dcb8422e96c73c2
Signed-off-by: zzc <zzc@rock-chips.com>
2017-01-13 19:44:39 +08:00
Meng Dongyang
3e4bb69e4a usb: dwc3: rockchip: add force dr_mode function
In current code, the mode of usb is control by extcon or
define in the dts. So in the case of none extcon, we can't
change the usb mode. This patch add a node in debug file
system for the application to change usb mode even if the
extcon is not exist. (P.S. The extcon property must not be
set and dr_mode must be otg if you want to use
rk_usb_force_mode.)

usage:
config host dr_mode:
echo host > sys/kernel/debug/usb@fe800000/rk_usb_force_mode
config peripheral dr_mode:
echo peripheral > sys/kernel/debug/usb@fe800000/rk_usb_force_mode
config otg dr_mode:
echo otg > sys/kernel/debug/usb@fe800000/rk_usb_force_mode

Change-Id: I9cb3b14b7a365fe74e4aa253f0e3f680f45e0f9f
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
2017-01-13 19:43:11 +08:00
Meng Dongyang
8d612d6dbb phy: rockchip-inno-usb2: add u2phy set mode function
The usb controller may need to disconnect vbus to trigger disconnect
process or connect vbus to trigger connect interrupt by software. But
current code does not realize the interface. This patch add set mode
function in usb2 phy driver, connect vbus in device mode and disconnect
in other mode.

Change-Id: I49b4180af2f47156a3f4d31f4539f3e444f89a62
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
2017-01-13 19:43:01 +08:00
Alexandre Belloni
48d04301b6 UPSTREAM: Input: add ADC resistor ladder driver
A common way of multiplexing buttons on a single input in cheap devices is
to use a resistor ladder on an ADC. This driver supports that configuration
by polling an ADC channel provided by IIO.

Change-Id: I110d95d7787a3ad42b5d4040d73b01efe2ca76e4
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 680772647d)
2017-01-13 19:41:22 +08:00
Laxman Dewangan
e7cc4165ae UPSTREAM: iio: core: Add devm_ APIs for iio_channel_{get,release}
Some of kernel driver uses the IIO framework to get the sensor
value via ADC or IIO HW driver. The client driver get iio channel
by iio_channel_get() and release it by calling iio_channel_release().

Add resource managed version (devm_*) of these APIs so that if client
calls the devm_iio_channel_get() then it need not to release it explicitly,
it can be done by managed device framework when driver get un-binded.

This reduces the code in error path and also need of .remove callback in
some cases.

Change-Id: Ia00f42dab2f66aefa0b26523db849e75927003af
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 8bf872d8d2)
2017-01-13 19:40:57 +08:00
Huang, Tao
e153106fca arm64: rockchip_defconfig: Enable QUOTA related configs
af5c611fce ("ANDROID: android-base: Enable QUOTA related configs")

Change-Id: Ieb37babe6417ac7fe7abec696c28384b461ca1c2
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2017-01-13 18:46:00 +08:00
Huang, Tao
8934f6857a arm64: rockchip_defconfig: disable AIO
3ff793f3db ("disable aio support in recommended configuration")

Change-Id: I13ec4505e7f51ccdf46bf828360a6fbf206c567d
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2017-01-13 15:05:51 +08:00
wuliangqing
1f5cca7006 ARM64: dts: rk3399: sapphire: type-c add vbus-5v-gpios ctrl
Change-Id: I5cc9ad7cf8710723708526f3fc95a1739dc8f78e
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2017-01-13 14:52:26 +08:00
chenzhen
7f166ae12d Revert "MALI: rockchip: upgrade midgard DDK to r14p0-01rel0"
This reverts commit d1637ff809.

Change-Id: Ib99bae99fe7246142bfa7369b8e79ebbfae1e736
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2017-01-13 11:56:19 +08:00
Shawn Lin
09c6498051 FROMLIST: arm64: dts: rockchip: add aspm-no-l0s for rk3399
Per the discussion of bug fix[1], we now actually
leaves the default clock choice for pcie phy is
derived from 24MHz OSC to guarantee the least BER.
So let's add aspm-no-l0s here and folks could delete
this property from their dts.

Change-Id: I5ee57a2e27d3751f6541fdf059e6745c26d0a6ef
[1] https://patchwork.kernel.org/patch/9470519/
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
(cherr picked from https://patchwork.kernel.org/patch/9477651/)
2017-01-13 10:02:19 +08:00
Shawn Lin
01f4eaa6a4 UPSTREAM: PCI: rockchip: Disable RC's ASPM L0s based on DT "aspm-no-l0s"
Rockchip's RC produces a 100MHz reference clock but there are two
methods for the PHY to generate it:

(1) Use the system PLL to generate a 100MHz clock.  The PHY will relock
    it, filter signal noise, and output the reference clock.  ASPM L0s
    works correctly, but circuit noise issues make it difficult to pass
    the TX compatibility test.

(2) Share the SoC's 24MHZ crystal oscillator with the PHY and force the
    PHY's PLL to generate 100MHz internally.  In this case, exit from
    ASPM L0s sometimes fails due to a design error in the RC receiver
    circuit.  Even if we use extended-synch, the PHY sometimes fails to
    relock the bits from FTS, which will hang the system.

We want the flexibility to use both clocking methods, so add a DT
property, "aspm-no-l0s".  If that's present, disable L0s to avoid the
issues with case (2).

Change-Id: Iefbac055dc9d916815aace25f3558e0642e3522b
[bhelgaas: changelog]
Reported-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
(cherry picked from git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git
commit afc9595ea4)
2017-01-13 10:02:08 +08:00
Shawn Lin
d3f2a4ef9e Revert "UPSTREAM: PCI: rockchip: Add quirk to disable RC's ASPM L0s"
This reverts commit 6c71bcdab9.
As it was dropped from pci-next and we have another rework there.

Change-Id: Icaf9d7a7fbdca5ab39b550dd0a5031fd0d3770d0
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2017-01-13 10:01:57 +08:00
Jacob Chen
69db1b5308 MALI: rockchip: linux: upgrade to DDK r13p0-00rel0
Since r9p0 can't recover form  error "DATA_INVALID_FAULT",
we have to update to r13p0.

Change-Id: Iac820870159def15dd4c214d0d98f81f81480340
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-01-12 14:26:39 +08:00
Mark Yao
e2c7c934b3 drm/rockchip: vop: wait for completion with timeout
Wait for completion forever is very dangerous, make system
die is very bad.

Change-Id: Ib447b9bbf3564b5107b33edec331d4925241fc45
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-01-12 14:21:45 +08:00
Mark Yao
594b635e8c drm/rockchip: vop: fixup afbc flags on vop
Change-Id: Ia6ce813a1eb9f6aa1b9a76a0437e2cf11b1b403d
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-01-12 14:21:27 +08:00
Mark Yao
c0f18a3985 drm/rockchip: mipi: move mode_set/commit to enable ops
enable/disable ops is more compatile to drm atomic framework.

fix mipi driver crash when resume:
[  195.399833] PC is at drm_mode_vrefresh+0x0/0x78
[  195.400249] LR is at dw_mipi_dsi_encoder_commit+0x2ec/0x424
[  195.400749] pc : [<ffffff800845ee7c>] lr : [<ffffff800846f190>] pstate: 20000145
[  195.529911] [<ffffff800845ee7c>] drm_mode_vrefresh+0x0/0x78
[  195.530421] [<ffffff80084441e0>] drm_atomic_helper_commit_modeset_enables+0x168/0x190
[  195.531126] [<ffffff80084733b4>] rockchip_atomic_commit_complete+0x3c/0x14c
[  195.531753] [<ffffff8008473540>] rockchip_drm_atomic_commit+0x7c/0x9c
[  195.532336] [<ffffff8008467b60>] drm_atomic_commit+0x6c/0x84
[  195.532849] [<ffffff80084447fc>] drm_atomic_helper_connector_dpms+0xf4/0x154
[  195.533481] [<ffffff800845d21c>] drm_mode_obj_set_property_ioctl+0x148/0x204
[  195.534113] [<ffffff800845d318>] drm_mode_connector_property_set_ioctl+0x40/0x60
[  195.534778] [<ffffff800844dba4>] drm_ioctl+0x270/0x3fc
[  195.535249] [<ffffff80081b9180>] do_vfs_ioctl+0x4d0/0x5bc
[  195.535739] [<ffffff80081b92cc>] SyS_ioctl+0x60/0x88
[  195.536194] [<ffffff80080826f0>] el0_svc_naked+0x24/0x28

Change-Id: Ic80f364a4297e7318c3f0316dd4100737ad7ff6e
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-01-12 14:21:11 +08:00
Mark Yao
5ce649ed79 drm/rockchip: vop: support overscan setting
Change-Id: I2213c7da45fd625d154a9bf11c79ec5608b06a0e
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-01-12 14:21:00 +08:00
Jacob Chen
d05454aafc mali: utgard: Fix build issue
The following statement doesn't have consistent behaviour on all machines.
Since the driver is in-tree, we can assume GPL compliance

Change-Id: I5d993ba8f1b4002a1bcd20b8ac40f442269897a8
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-01-12 11:56:00 +08:00
Jacob Chen
81b6be2968 ARM: rockchip: clean folder
Change-Id: I5ab0d917dc79976a944b380ca3a77d823b6cae98
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-01-12 11:52:50 +08:00
Jacob Chen
3e9a1bd440 ARM: dts: rockchip: sort rk3288 dts by base adress
Change-Id: Ibfd497cd8a2dbdbfe4ccb6a35501451926e4fe7e
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-01-12 09:19:30 +08:00
Jacob Chen
44bba29c07 ARM: dts: rockchip: add ddr related node for rk3288
Add dmc,sram,noc nodes which are used for ddr function

Change-Id: I5798f7a2c444adf6940b44fe0cdadca8655e534e
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-01-12 09:19:30 +08:00
Jacob Chen
9e9a903f9e ARM: rockchip: Convert resume code to C
This CL introduces the concept of "embedded blobs" for Rockchip, which
allows you to compile some C code into a binary blob that is linked
into the kernel.  This binary blob is self contained and is intended
to run in cases where SDRAM (and thus the rest of Linux) isn't
available.  Resume is a prime candiate for this as is the planned
DDRFreq code.

We convert the existing assembly resume code into C as proof that this
works and to prepare for linking in SDRAM reinit code.

Change-Id: I0ff109766cfd4b25bf65de9258631a07d2ebe1d5
Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-01-11 20:41:18 +08:00
Jacob Chen
580ad3d371 rockchip: pm: add deep sleep support for rk3288
This adds deep sleep support for rk3288 suspend & resume
It can suspend by "echo 1 >  /sys/module/pm/parameters/deep_sleep &&
echo mem > /sys/power/state", and resume by power

Change-Id: Iff55f17dc74e27e37db8c8417a08d931f2767afe
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-01-11 20:40:29 +08:00
Jacob Chen
1ddb400778 arm: dts: rockchip: increase vdd log for rk3288-evb-act8846
1v is too low for ddr 533, gpu 600

Change-Id: I7dc4744b578573dd772803bc4f772f6a8ed0a133
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-01-11 20:37:46 +08:00
xubilv
855e4ba023 video: rockchip: edp: Solve the bug of asymmetric pd enable and disable
Change-Id: I626210fc3e63c076e402563393a388cbd25fdd74
Signed-off-by: xubilv <xbl@rock-chips.com>
2017-01-11 20:26:18 +08:00
Randy Li
6c3361486c UPSTREAM: phy: Add reset callback for not generic phy
I forget to add a dummy function in case the CONFIG_GENERIC_PHY
is disabled.

Change-Id: Ic324387058ef260473fd4ad20ed43eff79044dfe
Signed-off-by: Randy Li <ayaka@soulik.info>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
(cherry picked from 98430c7aad)
2017-01-11 18:00:53 +08:00
wjh
f995fedfd8 HID: hid-rkvr: update TP input events
Change-Id: I9c72693ff6db1beccc4ed79fc01b33616fd8931d
Signed-off-by: wjh <wjh@rock-chips.com>
2017-01-11 16:01:20 +08:00
sean.huang
f7b87e8de9 OP-TEE: update optee_linuxdriver to match updated optee_os & optee_client
Match the optee_os version 1.5 or later.

Main update features:
1.Support 32-bit client working with 64-bit linux kernel.
2.Fix Shared Memory protection.
3.Add mutex to serialize tee-supplicant request.
4.Revert "rename tee-supplicant to tee_supplicant".

cherry-pick from 3.10
commit id:5f6467dc09e8c00f7fa6a621b3aad7046ae84d48

Change-Id: I5c77ed85aa56e36d346be7c4462c5a15120df439
Signed-off-by: sean.huang <sean.huang@rock-chips.com>
2017-01-11 11:25:40 +08:00
Shawn Lin
17f6cd3459 arm64: dts: rockchip: clean up emmc_phy
freq-sel, dr-sel and opdelay are obsolete now, so we
should remove them from the DT files to prevent the
spread of unused code.

Change-Id: Ibfa4fa225231a004913aa31aac475eb252e329c6
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2017-01-11 09:28:27 +08:00
Shawn Lin
297636b597 arm64: dts: rockchip: replace clkreqn with new cpm GPIO for rk3399-evb
We should convert to use cpm mode instead of L1 substate.
Fix it anyway.

Change-Id: I50fd43a1b15df6b8dc617783a1525ba0579b6a92
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2017-01-10 18:52:15 +08:00
Shawn Lin
3760ecde55 arm64: dts: rockchip: add pcie clkreq for cpm mode in rk3399.dtsi
Since we don't support L1 substate due to the errata of TRM,
let's instead add cpm mode if possible. Note that in cpm mode,
clkreq should be a GPIO and the EP will take over the ownship
of it and de-assert it when exiting from the low power mode.

Change-Id: I4d5542289c0118ba8702ad6b2783e6fad64828a1
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2017-01-10 18:52:07 +08:00
Frank Wang
34c6ed3777 arm64: configs: rockchip_linux: enable usb-otg related config
This adds select below config for usb-otg:
CONFIG_USB_DWC2_DUAL_ROLE
CONFIG_USB_GADGET_DEBUG_FILES
CONFIG_USB_GADGET_VBUS_DRAW=500
CONFIG_USB_CONFIGFS_UEVENT

Change-Id: Ic4765eb59e187dbf4e20d26a76722a309021122c
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2017-01-10 18:51:00 +08:00
Frank Wang
f088da5611 arm64: dts: rockchip: enable usb2-otg as peripheral for rk3328-evb
This adds set dwc2 mode as peripheral and enable for rk3328-evb.

Change-Id: Ic00e784ff4fdb466883689f8bfde995be13c20ce
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2017-01-10 18:50:31 +08:00
Frank Wang
e677ec1195 arm64: dts: rockchip: add usb2-otg nodes for rk3328
This patch adds usb2-otg nodes to support dwc2 driver for rk3328.

Change-Id: I23367ee116f1ac9a028ca6d60bdde68f9d71df72
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2017-01-10 18:50:19 +08:00
Frank Wang
596e8972fd usb: dwc2: add multiple clock handling
Originally, dwc2 just handle one clock named otg, however, it may have
two or more clock need to manage for some new SoCs, so this adds
change clk to clk's array of dwc2_hsotg to handle more clocks operation.

Change-Id: I661297ef908d9eace2215205018fa94d12cea128
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2017-01-10 18:49:49 +08:00
Huang, Tao
b0b686cdb7 arm64: rockchip_defconfig: update by savedefconfig
Change-Id: Iba75aa98d0188c9edc62c59cbf0af8f3b2c71dff
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2017-01-10 17:57:03 +08:00
Huang, Tao
7b2f394bb8 Merge branch 'linux-linaro-lsk-v4.4-android' of git://git.linaro.org/kernel/linux-linaro-stable.git
* linux-linaro-lsk-v4.4-android: (199 commits)
  Linux 4.4.41
  net: mvpp2: fix dma unmapping of TX buffers for fragments
  sg_write()/bsg_write() is not fit to be called under KERNEL_DS
  kconfig/nconf: Fix hang when editing symbol with a long prompt
  target/user: Fix use-after-free of tcmu_cmds if they are expired
  powerpc: Convert cmp to cmpd in idle enter sequence
  powerpc/ps3: Fix system hang with GCC 5 builds
  nfs_write_end(): fix handling of short copies
  libceph: verify authorize reply on connect
  PCI: Check for PME in targeted sleep state
  Input: drv260x - fix input device's parent assignment
  media: solo6x10: fix lockup by avoiding delayed register write
  IB/cma: Fix a race condition in iboe_addr_get_sgid()
  IB/multicast: Check ib_find_pkey() return value
  IPoIB: Avoid reading an uninitialized member variable
  IB/mad: Fix an array index check
  fgraph: Handle a case where a tracer ignores set_graph_notrace
  platform/x86: asus-nb-wmi.c: Add X45U quirk
  ftrace/x86_32: Set ftrace_stub to weak to prevent gcc from using short jumps to it
  kvm: nVMX: Allow L1 to intercept software exceptions (#BP and #OF)
  ...

Change-Id: I8c8467700d5563d9a1121c982737ff0ab6d9cdc9
2017-01-10 16:07:06 +08:00
Zhou weixin
4221b1d0fd arm64: rockchip_defconfig: add alps trackpad support
Change-Id: Icbf54f457642b2541b441b9d74c18d1854e0f9d2
Signed-off-by: Zhou weixin <zwx@rock-chips.com>
2017-01-10 14:26:34 +08:00
Zhou weixin
96e5e11ce3 HID: hid-alps: add alps hid support
Change-Id: Id3eba69f18f0f6f3548a4be0430fee3ce8cce021
Signed-off-by: Zhou weixin <zwx@rock-chips.com>
2017-01-10 14:05:23 +08:00
Alex Shi
7785301d92 Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2017-01-10 12:01:14 +08:00
Alex Shi
f02e043c5e Merge tag 'v4.4.41' into linux-linaro-lsk-v4.4
This is the 4.4.41 stable release
2017-01-10 12:01:08 +08:00
Huang Jiachai
e389b399ab video: rockchip: fb: fix switch screen lead to splash screen
Change-Id: Ie4fe5d3d3dc010ee7c7c8b15b24f435798c5bc46
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
2017-01-09 17:49:19 +08:00
Huang Jiachai
b5910762f5 video: rockchip: fb: fix switch screen lead to splash screen
Change-Id: Ie4fe5d3d3dc010ee7c7c8b15b24f435798c5bc46
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
2017-01-09 17:48:59 +08:00
Shunqing Chen
950c85b054 power_supply: bq25700: set default input voltage ane current when shutdown
Change-Id: Ibeeab7bf882e232be7285deee995c5a0dc3f641c
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2017-01-09 15:55:24 +08:00
Zhou weixin
da478f1140 mfd: fusb302: fix connect adapter failed when reboot with adapter
The fusb PD should be reset to sync adapter PD signal after fusb
sent hard reset cmd.

Change-Id: Iad5f27cf4c017639c24000e73dc831a36dbb55ec
Signed-off-by: Zhou weixin <zwx@rock-chips.com>
2017-01-09 15:54:54 +08:00
wenping.zhang
ac19946f3c arm64: dts: rockchip: add usb2 phy tuning for rk3399 discrete vr.
add usb2 phy tuning function to enhance the usb signal for discrete vr device.

Change-Id: Iab4911610ccf488be723ce462527ecaeafe7e446
Signed-off-by: wenping.zhang <wenping.zhang@rock-chips.com>
2017-01-09 15:44:47 +08:00
Greg Kroah-Hartman
cdd86b9722 Linux 4.4.41 2017-01-09 08:08:10 +01:00
Thomas Petazzoni
9f11a0ab6a net: mvpp2: fix dma unmapping of TX buffers for fragments
commit 8354491c9d upstream.

Since commit 71ce391dfb ("net: mvpp2: enable proper per-CPU TX
buffers unmapping"), we are not correctly DMA unmapping TX buffers for
fragments.

Indeed, the mvpp2_txq_inc_put() function only stores in the
txq_cpu->tx_buffs[] array the physical address of the buffer to be
DMA-unmapped when skb != NULL. In addition, when DMA-unmapping, we use
skb_headlen(skb) to get the size to be unmapped. Both of this works fine
for TX descriptors that are associated directly to a SKB, but not the
ones that are used for fragments, with a NULL pointer as skb:

 - We have a NULL physical address when calling DMA unmap
 - skb_headlen(skb) crashes because skb is NULL

This causes random crashes when fragments are used.

To solve this problem, we need to:

 - Store the physical address of the buffer to be unmapped
   unconditionally, regardless of whether it is tied to a SKB or not.

 - Store the length of the buffer to be unmapped, which requires a new
   field.

Instead of adding a third array to store the length of the buffer to be
unmapped, and as suggested by David Miller, this commit refactors the
tx_buffs[] and tx_skb[] arrays of 'struct mvpp2_txq_pcpu' into a
separate structure 'mvpp2_txq_pcpu_buf', to which a 'size' field is
added. Therefore, instead of having three arrays to allocate/free, we
have a single one, which also improve data locality, reducing the
impact on the CPU cache.

Fixes: 71ce391dfb ("net: mvpp2: enable proper per-CPU TX buffers unmapping")
Reported-by: Raphael G <raphael.glon@corp.ovh.com>
Cc: Raphael G <raphael.glon@corp.ovh.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-09 08:07:53 +01:00