Commit graph

577980 commits

Author SHA1 Message Date
Linux Build Service Account
761768049f Merge "msm: sde: Fix SDE rotator context list locking" 2016-11-16 18:17:02 -08:00
Syed Rameez Mustafa
30fc774235 sched/hmp: Enhance co-location and scheduler boost features
The recent introduction of the schedtune cgroup controller has provided
the scheduler with added flexibility in terms of some of it's placement
features. In particular each cgroup under the schedtune controller can
now specify:

1) Whether it needs co-location along with other cgroups
2) Whether it is eligible for scheduler boost (sched_boost_enabled)
3) Whether the kernel can override the boost eligibility when necessary
   (sched_boost_no_override)

The scheduler now creates a reserved co-location group at boot. This
group is used to co-locate all tasks that form part of any one of the
cgroups that have co-location enabled. This reserved group can neither
be destroyed nor reused for other purposes. Furthermore, cgroups are
only allowed to indicate their co-location preference once at boot.
Further updates are disallowed.

Since we are now creating co-location groups for an extended period of
time, there are a few other factors to consider when determining the
preferred cluster for the group. We first exclude any tasks in the
group that have not been observed to be running for a significant
amount of time. Secondly we introduce the notion of group up and down
migrate tunables to allow different migration policies than individual
tasks. Lastly we break co-location if a single task in a group exceeds
up-migrate but the total load of the group does not exceed group
up-migrate.

In terms of sched_boost, the scheduler now supports multiple types of
boost. These are:

1) FULL_THROTTLE : Force up-migrate tasks belonging any cgroup that
                   has the sched_boost_enabled flag turned on. Little
                   CPUs will only be used when big CPUs can no longer
                   accommodate tasks. Also up-migrate all RT tasks.

2) CONSERVATIVE : Override the sched_boost_enabled flag for all cgroups
                  except those that have the sched_boost_no_override
                  flag set. Force up-migrate all tasks belonging to only
                  those cgroups that still remain eligible for boost.
                  RT tasks do not get force up migrated.

3) RESTRAINED : Start frequency aggregation for co-located tasks. This
                type of boost does not force up-migrate any task.

Finally the boost API removes ref-counting. This means that there can
only be a single entity using boost at any given time. If multiple
entities are managing boost, they are required to be well behaved so
that they don't interfere with one another. Even for a single client,
it is not possible to switch directly from one boost type to another.
Boost must be first turned off before switching over to a new type.

Change-Id: I8d224a70cbef162f27078b62b73acaa22670861d
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
2016-11-16 17:57:56 -08:00
Joonwoo Park
fd5b530593 sched: revise boost logic when boost_type is SCHED_BOOST_ON_BIG
At present HMP scheduler boost tends to pack tasks by taking into
account of power cost and cstate.  This is suboptimal to performance
as it can lead preemption and higher latency.

Revise logic to prefer the least loaded CPU among the big cluster CPUs
when boost type is SCHED_BOOST_ON_BIG.  New logic still honor the
behaviour that scheduler can place tasks on the little CPUs when the
big CPUs are all overcommitted.

Also, it's found that need_idle with boost can easily return previous
CPU when there is no idle CPU found.  Fix this issue by making
need_idle flag to take precedence over sched_boost.

CRs-fixed: 1074879
Change-Id: I470bcd0588e038b4a540d337fe6a412f2fa74920
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
2016-11-16 17:57:55 -08:00
Syed Rameez Mustafa
8b74c7eb5f sched: Remove thread group iteration from colocation
Iterating a leader task's thread group in order to add them to a
colocation group involves a complex locking chain that ends up
causing a deadlock. The deadlock is as follows when the same task
is being referenced on three different CPUs:

-----                     ------                      -----
CPU 0                     CPU 1                       CPU 2
-----                     ------                      -----
                          add_task_to_group(p)

__schedule(prev = p)      write_lock(                 ttwu(p)
                          related_thread_grp_lock)
                                                      lock(pi_lock)

idle_balance()                                        wait for
                                                      p->on_cpu
load_balance()            unable to acquire
                          p->pi_lock
send_notification()

wait for read_lock(
related_thread_grp_lock)

unable to set p->on_cpu

There are a couple of ways to resolve this deadlock in the kernel,
however, they are not trivial. For the sake of simplicity, move
the responsibility of thread group iteration back to userspace. This
would apply to both adding and removing the leader task from a
colocation group. The kernel would continue to automatically add
newly forked children of the colocated leader to the colocation
group.

This still leaves an issue with the locking order of the pi_lock and
the related_thread_group_lock. To solve all deadlocks, we need to avoid
taking the pi_lock in reset_all_task_stats() and instead rely on a more
heavy handed approach of taking all rq locks. The pi_lock was taken to
avoid a race between reset_all_task_stats() and sched_exit(). The race
can be avoided with rq locks as well.

Change-Id: I15323e3ef91401142d3841db59c18fd8fee753fd
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
2016-11-16 17:57:35 -08:00
Skylar Chang
76c28263ad msm: ipa3: linearize large skbs
IPA can support scatter-gather of skbs up to the size of the TLV fifo.
In case the skb has to many frags, IPA driver will linearize it.

Change-Id: I2f994ae0250ffc8f740ea633324815ae429c74be
CRs-Fixed: 1088658
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
2016-11-16 17:30:04 -08:00
Hemant Kumar
7b553e1abd USB: Allow skipping device resume during system resume
This allows xHC to remain in low power mode and not
resume the bus when system wide resume happens.
Controller comes out of low power mode only when usb
device issues a remote wakeup or if there is a host
initiated bus resume.

Change-Id: I96cdcb9e3642906b4afa08d9bde07e123d9b3977
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2016-11-16 10:58:00 -08:00
Zhen Kong
268b994d27 qseecom: improve error checks in qseecom_probe()
Make change in qseecom_probe() to improve the error return value
checks on some subfunctions, and free memory allocated within
qseecom_retrieve_ce_data.

CRs-fixed: 1075082
Change-Id: I971e555ec8d02ccf4382e83132a696b065a8ff12
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2016-11-16 10:21:28 -08:00
Harsh Sahu
a67bc21cea msm: mdss: hide additional kernel addresses from unprivileged users
Starting commit Ie49eee9478f4657cfb2a994ba60da1ec4c356339
("msm: mdss: hide kernel addresses from unprevileged users"),
display driver removes the %p and uses %pK instead for printing kernel
pointers. This change missed some of the prints in some places.
This change fixes this by modifying the remaining pointer prints.

CRs-Fixed: 987021
Change-Id: I0d1797a4df9ff67f3b162a1b5d26320ca989f54a
Signed-off-by: Harsh Sahu <hsahu@codeaurora.org>
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
2016-11-16 09:51:14 -08:00
Linux Build Service Account
61f26e3aa5 Merge "soc: qcom: secure_buffer: Fix an uninitialized variable" 2016-11-15 23:39:31 -08:00
Linux Build Service Account
123738ad00 Merge "defconfig: msm: update mmap randomness for all targets" 2016-11-15 23:39:30 -08:00
Linux Build Service Account
ef0a4e083c Merge "iommu/arm-smmu: Fix uninitialized use of variable error" 2016-11-15 23:39:30 -08:00
Linux Build Service Account
4d8f3d0afa Merge "ARM: dts: msm: Enable the haptics in QRD SKUK and vr1" 2016-11-15 23:39:29 -08:00
Linux Build Service Account
af9ecbbe5e Merge "ARM: dts: msm: enable RPM regulator device node for MSMFALCON" 2016-11-15 23:39:28 -08:00
Mukesh Kumar Savaliya
e75b50d38f ARM: dts: msm: specify I2C configuration for msmfalcon
Initial support for all BLSP I2Cs with default configuration
and disabled state such that clients can overwrite and enable
respective I2C instance as per need.

Change-Id: If08ff46e72d537254e90707f28c849a86f262853
Signed-off-by: Mukesh Kumar Savaliya <msavaliy@codeaurora.org>
2016-11-16 11:32:19 +05:30
Mukesh Kumar Savaliya
abcf426a00 ARM: dts: msm: specify UART configuration on msmfalcon.
Initial support for all BLSP UARTs with default configuration
and disabled state such that clients can overwrite and enable
respective UART instance as per need.

Change-Id: I15ef73049cee76c6ea5b3916d9281bbd9fdfc563
Signed-off-by: Mukesh Kumar Savaliya <msavaliy@codeaurora.org>
2016-11-16 11:22:16 +05:30
Abhijit Kulkarni
98ce3216dd msm: sde: remove secure camera ctrl_id definition
Remove the secure_camera ctrl_id unless the support is available
from the sde rotator driver. If this id is defined and functionality
is not present in the V4L2 driver it causes the rotator use cases
to fail.

CRs-Fixed: 1090525
Change-Id: I48c50bc320425c0db40cd4865e05c6b7a7fb5da3
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
2016-11-15 20:59:22 -08:00
Taniya Das
72609b4929 clk: qcom: Add support to be able to slew PLL
Few alpha PLLs would require to be able to slew in the same VCO mode, which
means the PLL would be able to update the new frequency L value without
turning it off. But to be support this feature the PLL needs to calibrated
at the mid of the VCO range and then enabled.

Change-Id: I24820bd6254002f8a8db9604d230dcbce59b1beb
Signed-off-by: Taniya Das <tdas@codeaurora.org>
2016-11-16 09:53:20 +05:30
Taniya Das
b5d4c54e33 clk: qcom: Add support for RCGs with dynamic and fixed sources
Some RCGSs could have sources with dynamic frequencies and fixed sources
where if the RCG has the flag of CLK_SET_RATE_PARENT set, it would try to
propagate the clock rate to the fixed source PLLs too. To identify sources
of the RCGs where the rate should propagate to parent PLL, add a member in
freq_tbl to represent source frequency. This would be used by the
_freq_tbl_determine_rate to set its parent frequency on the PLL.

Change-Id: I7f1c0d9d84607821893a1e5d17934dae5acef5f4
Signed-off-by: Taniya Das <tdas@codeaurora.org>
2016-11-15 20:20:10 -08:00
Taniya Das
e03bf33cb9 clk: qcom: Add support for debugfs support
Add the clock operation list_registers which would print the register
content of a clock. This is supported for PLL/RCG/Branch/Gate clocks.
Also add support for list_rate for the RCG clock which would list all the
frequencies/rates supported by the SW.

Change-Id: I3b4cf83e776750d993d53331142223109bf0862e
Signed-off-by: Taniya Das <tdas@codeaurora.org>
2016-11-16 09:16:52 +05:30
Taniya Das
b9b1975fe3 clk: Add support to allow client to print all enabled clocks
The clock api clock_debug_print_enabled would allow any client like low
power driver to print all the enabled clocks which include the
prepare_count/enable_count/rate/rate max vote.

Change-Id: I936496e553bc958c10e743fd8a225ffc7fbc0f79
Signed-off-by: Taniya Das <tdas@codeaurora.org>
2016-11-16 09:16:52 +05:30
Taniya Das
dba9af81b8 clk: Add support for list_rates ops for clocks
Add support for clocks debugfs to be able to display
 - rates_max which indicates the frequency to voltage mapping of a clock.
 - list_rates, the list of clock frequencies supported by root clocks.
 - Also display the rate_max associated with enabled clocks list.

Change-Id: I0a202af6f46c7cf164036d65487db5c40aab4063
Signed-off-by: Taniya Das <tdas@codeaurora.org>
2016-11-16 09:16:51 +05:30
Taniya Das
770f204fbd clk: add/modify debugfs support for clocks
Update clock debugfs to support the below functionalities.
 - Allow enable/disable a clock.
 - Allow set_rate on a clock.
 - Display the list of enabled_clocks along with prepare_count,
   enable_count and rate.
 - Display the register contents of all the clocks which support
  this clock operation.

Change-Id: Ib67b3a3409c9e7d8adb710bb524f54f543abf712
Signed-off-by: Taniya Das <tdas@codeaurora.org>
2016-11-16 09:16:51 +05:30
Jack Pham
f50e4f2412 usb: pd: Stop processing SVDM if handler found
If a client matching the SVID for an incoming SVDM is found,
assume it has handled the message completely and simply return.
This avoids the case when it handles an Attention message by
queuing another VDM request, only to have it inadvertently
deleted in the generic handling below.

But we also lose tracking of Discover/Enter/Exit Mode
exchanges though that was only used for informational purposes.

Change-Id: Ie23d473302d7fbda9b243a150e5c52d025007e4f
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-11-15 19:36:29 -08:00
Eric Dumazet
68b87a2b4a tcp: take care of truncations done by sk_filter()
With syzkaller help, Marco Grassi found a bug in TCP stack,
crashing in tcp_collapse()

Root cause is that sk_filter() can truncate the incoming skb,
but TCP stack was not really expecting this to happen.
It probably was expecting a simple DROP or ACCEPT behavior.

We first need to make sure no part of TCP header could be removed.
Then we need to adjust TCP_SKB_CB(skb)->end_seq

Many thanks to syzkaller team and Marco for giving us a reproducer.

CRs-Fixed: 1089895
Change-Id: I84185558fa6e80b13d7d0078bda9d75143680941
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Marco Grassi <marco.gra@gmail.com>
Reported-by: Vladis Dronov <vdronov@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Git-commit: ac6e780070e30e4c35bd395acfe9191e6268bdd3
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
[subashab@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-11-15 14:54:51 -07:00
Willem de Bruijn
f36f22a49d rose: limit sk_filter trim to payload
Sockets can have a filter program attached that drops or trims
incoming packets based on the filter program return value.

Rose requires data packets to have at least ROSE_MIN_LEN bytes. It
verifies this on arrival in rose_route_frame and unconditionally pulls
the bytes in rose_recvmsg. The filter can trim packets to below this
value in-between, causing pull to fail, leaving the partial header at
the time of skb_copy_datagram_msg.

Place a lower bound on the size to which sk_filter may trim packets
by introducing sk_filter_trim_cap and call this for rose packets.

CRs-Fixed: 1089895
Change-Id: Idc52737bc96097a9220dfe47bb76e94ff1026a05
Signed-off-by: Willem de Bruijn <willemb@google.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Git-commit: f4979fcea7fd36d8e2f556abef86f80e0d5af1ba
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[subashab@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-11-15 14:54:51 -07:00
Sreelakshmi Gownipalli
bddd67fc5c diag: Set the diag write buffers to busy state on channel close
Set the diag forward write buffers to busy state when glink
diag channel receives remote disconnected event.

Change-Id: I3c9422f3a790c0c1633ab64d4213a088faaeb9e5
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
2016-11-15 13:46:08 -08:00
Patrick Daly
16517bb150 ARM: dts: msm: Correct interrupt assignments for msmcobalt
Some smmu context banks are reserved for use by secure software. Do not
attempt to use the interrupts associated with those context banks.

Change-Id: I92e98ab46107fbcfd843898423b41716a204c2ae
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
2016-11-15 12:48:02 -08:00
Tony Truong
f7f2185840 ARM: dts: msm: ensure contiguous MSI for PCIe on msmcobalt
PCIe MSI have to be contiguous by spec. Relocated
PCIe node so that it receives contiguous MSIs from
GIC driver.

Change-Id: Ia73ab1ba51df7b501d246bb45141018409496d01
Signed-off-by: Tony Truong <truong@codeaurora.org>
2016-11-15 10:01:55 -08:00
Tony Truong
ef48989c47 ARM: dts: msm: enable QGIC MSI for PCIe on msmcobalt
Add all SPIs for MSI, the base address, and the base SPI
to PCIe node to support and enable QGIC MSI on msmcobalt.

Change-Id: I1e74f1b03c3e15880efdac7ff07aca2f628de99d
Signed-off-by: Tony Truong <truong@codeaurora.org>
2016-11-15 09:41:32 -08:00
Asutosh Das
9931a7ca47 ARM: dts: msm: Add ufs regulators for msmfalcon interposer
Add device tree support for msmcobalt interposer platform
for regulators of UFS.

Change-Id: I78d2c27743d30b90a96e3d8df60859f67db7ddb8
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
2016-11-15 18:04:45 +05:30
Linux Build Service Account
1e17007652 Merge "msm: ipa3: retry on IPA_HW_CONS_DISABLE_CMD_GSI_STOP_FAILURE" 2016-11-15 04:07:58 -08:00
Linux Build Service Account
76fb91705e Merge "pinctrl: qcom: msmfalcon: Split function groups based on mirrors" 2016-11-15 04:07:57 -08:00
Linux Build Service Account
e8d37e0204 Merge "pinctrl: qcom: Add all the gpios to pingroups for msmfalcon" 2016-11-15 04:07:56 -08:00
Linux Build Service Account
5c2a834f84 Merge "msm: pcie: support configurable wr halt size for PCIe" 2016-11-15 04:07:55 -08:00
Linux Build Service Account
2db8e29779 Merge "iio: adc: qcom-tadc: cast raw ADC readings before conversion" 2016-11-15 04:07:54 -08:00
Linux Build Service Account
adb38b4519 Merge "ARM: dts: msm: update TADC ibatt scale for MSMCOBALT" 2016-11-15 04:07:54 -08:00
Linux Build Service Account
bda0cf17e9 Merge "usb: gadget: f_mtp: Increase default TX buffer size" 2016-11-15 04:07:53 -08:00
Linux Build Service Account
126f773020 Merge "qcom-cpufreq: skip frequencies that round to same rate" 2016-11-15 04:07:52 -08:00
Linux Build Service Account
276980d3e2 Merge "ARM: dts: msm: Remove min svs level for A540 in msmcobaltv2" 2016-11-15 04:07:51 -08:00
Linux Build Service Account
8ca1dae0da Merge "Revert "clk: msm: clock-gpu-cobalt: Update the graphics core clock frequency"" 2016-11-15 04:07:50 -08:00
Linux Build Service Account
16a21bcd77 Merge "ARM: dts: msm: update APC0/APC1/GFX aging allowed revisions for msm8998v2" 2016-11-15 04:07:50 -08:00
Linux Build Service Account
2ce4f26719 Merge "core_ctl: Export boost function" 2016-11-15 04:07:49 -08:00
Linux Build Service Account
86060df701 Merge "msm: pcie: support QGIC MSI for multiple clients" 2016-11-15 04:07:48 -08:00
Linux Build Service Account
21a0144d38 Merge "msm: mdss: Avoid accessing pipe out of the boundaries" 2016-11-15 04:07:47 -08:00
Linux Build Service Account
abd62e397f Merge "msm: mdss: fix logic to enable secure display/camera" 2016-11-15 04:07:46 -08:00
Linux Build Service Account
7e6b3ca920 Merge "qpnp-fg-gen3: add support to show time to full and empty" 2016-11-15 04:07:45 -08:00
Linux Build Service Account
24eb8e0963 Merge "iommu/arm-smmu: support mapping before enabling S1 translations" 2016-11-15 04:07:44 -08:00
Linux Build Service Account
126f5e5e99 Merge "nf: IDLETIMER: Fix use after free condition during work" 2016-11-15 04:07:44 -08:00
Linux Build Service Account
316debf36c Merge "net: rmnet_data: Handle buffer bloat for TCP scenarios" 2016-11-15 04:07:43 -08:00
Linux Build Service Account
a8bcbb0330 Merge "msm: vidc: Allow clients to suggest I-frame sizes" 2016-11-15 04:07:42 -08:00