Commit graph

563985 commits

Author SHA1 Message Date
Sujeet Kumar
55a6f12e78 USB: f_fs: Fail stale read IOs after disconnect
After a USB disconnect, endpoints for adb are disabled.
After this no IO is allowed on the endpoints.
Since, adbd is not aware of this disconnect, it may
still perform read/writes IO. For adb writes, IOs are
failed, but for adb reads kernel waits untill endpoints
are enabled.

When a USB disconnect and adb read still queued
a buffer to kernel, ffs_epfile_io simply waits for
endpoint to be enabled. A next connect happens
and endpoints are enabled after set_alt, the adb
read stale buffer from previous session continues
and queues to endpoint.

All this time, adb did not close the epfile because
it did not get return status on the IOs which it
queued. This is an issue, because a new session
is not established and both userspace and kernel
goes out of sync.

To fix this issue, when endpoints are disbled
set epfile error. This epfile error is only cleared
in epfile open. This will ensure that after a USB
disconnect and connect, new session is established.

Also, return ENODEV if endpoints not enabled rather
than EINTR as EINTR case, and simply retries the
request. Incase usb_ep_queue failed, return -EIO
inspite of depend on return status from usb_ep_queue.

Change-Id: I6e677e98ec28e5462b372ed290acdde251286f48
Signed-off-by: Sujeet Kumar <ksujeet@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-03-22 11:10:01 -07:00
Sujeet Kumar
8b5f119fba USB: f_fs: Fix epfile crash during composition switch
epfile's ep pointer may be NULL during adb transfer
and composition switch happening in parallel. As part
of composition switch, first it is set to NONE. Setting
sys.usb.config to NONE stops adb and disables the composition.
stop adb is not blocking call and adb still might be doing
epfile read/write for some time when function unbind is
ongoing making the data structures NULL.

To fix this crash, call usb_ep_dequeue only if ep->ep is
valid. Similarly in success case, return ep->status only
if ep->ep is valid otherwise return -ENODEV.

Change-Id: Ic152fc1db31cad6f97b8d16d91350dad857a4bf9
Signed-off-by: Sujeet Kumar <ksujeet@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-03-22 11:10:00 -07:00
Vijayavardhan Vennapusa
61c08e8af6 USB: f_fs: Set ffs->func to NULL after disabling endpoint in set_alt()
When adb root is performed, userspace will close and open ffs_epsfile.
Closing this file will call ffs_functionfs_callback() which does call
remove_config(). This will call ffs_function_eps_disable to disable
endpoints and then calls ffs_func_unbind(). Unbind() will also call
endpoint disable which might lead to disabling endpoint which is already
disabled. Some of UDC driver throws WARN_ON() if same endpoint is being
disabled multiple time. Hence set ffs->func to NULL after disabling
endpoints in set_alt() to overcome WARN_ON().

Change-Id: I3052bdee74a1793d4e003de4b991d353e5d699b0
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-03-22 11:09:59 -07:00
Trilok Soni
ed7d0b670d arch: arm64: Enable UBSAN support for arm64
Enable UBSAN support for arm64.

CRs-Fixed: 969533
Change-Id: I03689e902195b901712ff5922af10fc127e96418
Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
2016-03-22 11:09:58 -07:00
Andrey Ryabinin
788349f659 UBSAN: run-time undefined behavior sanity checker
UBSAN uses compile-time instrumentation to catch undefined behavior
(UB).  Compiler inserts code that perform certain kinds of checks before
operations that could cause UB.  If check fails (i.e.  UB detected)
__ubsan_handle_* function called to print error message.

So the most of the work is done by compiler.  This patch just implements
ubsan handlers printing errors.

GCC has this capability since 4.9.x [1] (see -fsanitize=undefined
option and its suboptions).
However GCC 5.x has more checkers implemented [2].
Article [3] has a bit more details about UBSAN in the GCC.

[1] - https://gcc.gnu.org/onlinedocs/gcc-4.9.0/gcc/Debugging-Options.html
[2] - https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html
[3] - http://developerblog.redhat.com/2014/10/16/gcc-undefined-behavior-sanitizer-ubsan/

Issues which UBSAN has found thus far are:

Found bugs:

 * out-of-bounds access - 97840cb67f ("netfilter: nfnetlink: fix
   insufficient validation in nfnetlink_bind")

undefined shifts:

 * d48458d4a7 ("jbd2: use a better hash function for the revoke
   table")

 * 10632008b9 ("clockevents: Prevent shift out of bounds")

 * 'x << -1' shift in ext4 -
   http://lkml.kernel.org/r/<5444EF21.8020501@samsung.com>

 * undefined rol32(0) -
   http://lkml.kernel.org/r/<1449198241-20654-1-git-send-email-sasha.levin@oracle.com>

 * undefined dirty_ratelimit calculation -
   http://lkml.kernel.org/r/<566594E2.3050306@odin.com>

 * undefined roundown_pow_of_two(0) -
   http://lkml.kernel.org/r/<1449156616-11474-1-git-send-email-sasha.levin@oracle.com>

 * [WONTFIX] undefined shift in __bpf_prog_run -
   http://lkml.kernel.org/r/<CACT4Y+ZxoR3UjLgcNdUm4fECLMx2VdtfrENMtRRCdgHB2n0bJA@mail.gmail.com>

   WONTFIX here because it should be fixed in bpf program, not in kernel.

signed overflows:

 * 32a8df4e0b ("sched: Fix odd values in effective_load()
   calculations")

 * mul overflow in ntp -
   http://lkml.kernel.org/r/<1449175608-1146-1-git-send-email-sasha.levin@oracle.com>

 * incorrect conversion into rtc_time in rtc_time64_to_tm() -
   http://lkml.kernel.org/r/<1449187944-11730-1-git-send-email-sasha.levin@oracle.com>

 * unvalidated timespec in io_getevents() -
   http://lkml.kernel.org/r/<CACT4Y+bBxVYLQ6LtOKrKtnLthqLHcw-BMp3aqP3mjdAvr9FULQ@mail.gmail.com>

 * [NOTABUG] signed overflow in ktime_add_safe() -
   http://lkml.kernel.org/r/<CACT4Y+aJ4muRnWxsUe1CMnA6P8nooO33kwG-c8YZg=0Xc8rJqw@mail.gmail.com>

[akpm@linux-foundation.org: fix unused local warning]
[akpm@linux-foundation.org: fix __int128 build woes]
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Yury Gribov <y.gribov@samsung.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: Kostya Serebryany <kcc@google.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Git-repo: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/
Git-commit: c6d308534aef6c99904bf5862066360ae067abc4
[tsoni@codeaurora.org: trivial merge conflict resolution]
CRs-Fixed: 969533
Change-Id: I048b9936b1120e0d375b7932c59de78d8ef8f411
Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
[satyap@codeaurora.org: trivial merge conflict resolution]
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
2016-03-22 11:09:57 -07:00
Andrey Ryabinin
bbf900d8b6 kernel: printk: specify alignment for struct printk_log
On architectures that have support for efficient unaligned access struct
printk_log has 4-byte alignment.  Specify alignment attribute in type
declaration.

The whole point of this patch is to fix deadlock which happening when
UBSAN detects unaligned access in printk() thus UBSAN recursively calls
printk() with logbuf_lock held by top printk() call.

CRs-Fixed: 969533
Change-Id: Iee822667b9104a69c3d717caeded0fcde3f6d560
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Yury Gribov <y.gribov@samsung.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: Kostya Serebryany <kcc@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Git-repo: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/
Git-commit: 5c9cf8af2e77388f1da81c39237fb4f20c2f85d5
Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
[satyap@codeaurora.org: trivial merge conflict resolution]
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
2016-03-22 11:09:56 -07:00
Dov Levenglick
f80aca56b9 usb: dwc3-msm: Update timeout value for EP command
The previous timeout value was explained as being
based on trial and error. We saw a timeout
as high as 800[us]. In order to be on the safe-side,
the new timeout value is increased to allow such a
delay with room for error

Change-Id: I7bc953d9bd494b57dd5492b492d48b18994e6b8f
Signed-off-by: Dov Levenglick <dovl@codeaurora.org>
2016-03-22 11:09:56 -07:00
Mayank Rana
26f9c06e33 Revert "usb: dwc3: Allocate TRB pool upon enabling endpoint"
This reverts commit 55312d5442f147aa1a366e8ecb483b07e38961b3.
WARN_ON() is seen from dma mapping API while freeing TRBs on USB
cable disconnect (i.e usb endpoint disable  context) due interrupts
are disabled.

Change-Id: Ib5689cbd5a379a8d1dc1a734026174779202386b
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-03-22 11:09:55 -07:00
Tianyi Gou
5b047145cd net/ipv6/addrconf: IPv6 tethering enhancement
Added new procfs flag to toggle the automatic addition of prefix
routes on a per device basis. The new flag is accept_ra_prefix_route.
Defaults to 1 as to not break existing behavior.

CRs-Fixed: 435320
Change-Id: If25493890c7531c27f5b2c4855afebbbbf5d072a
Acked-by: Harout S. Hedeshian <harouth@qti.qualcomm.com>
Signed-off-by: Tianyi Gou <tgou@codeaurora.org>
[subashab@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-03-22 11:09:54 -07:00
Subash Abhinov Kasiviswanathan
4e3fe29e92 defconfig: arm64: msm: Enable Data features
Enable configurations needed for data functionality

Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-03-22 11:09:53 -07:00
Subash Abhinov Kasiviswanathan
9861e2d702 tun: Use IFF_NO_PI instead of TUN_NO_PI
Commit 40630b82c2 ("tun: drop most type defines") removes the
definition of TUN_NO_PI. Remove users of this flag.

Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-03-22 11:09:52 -07:00
Susheel Yadagiri
4d90c4302a netfilter: xt_HARDIDLETIMER: Fix null de-reference
added a null check to prevent a null pointer derefence of hard idle
timer

Change-Id: Id1e49d5b109d8c71947723b252f4d2b6f3ebc35f
CRs-Fixed: 880124
Signed-off-by: Susheel Yadav Yadagiri <syadagir@codeaurora.org>
2016-03-22 11:09:51 -07:00
Patrick Daly
2a38010e6c nf: IDLETIMER: Fix possible use before initialization in idletimer_resume
idletimer_resume() assumes that the PM_SUSPEND_PREPARE notifier is sent
before PM_POST_SUSPEND so that timer->last_suspend_time is initialized.
However, it is possible for PM_POST_SUSPEND to be sent first if there is an
error returned from another driver's PM_SUSPEND_PREPARE notifier.

Add a flag indicating whether the current value of timer->last_suspend is
valid.

Detected with CONFIG_SLUB_DEBUG & CONFIG_DEBUG_SPINLOCK in arm64. The
timestamp lock is held for more than a minute while
set_normalized_timespec() proceses the poisoned timer->last_suspend_time
argument.

Change-Id: I95328b0ac85dba819ff9cef751c3d07300c232f1
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
2016-03-22 11:09:50 -07:00
Patrick Daly
c14c7fbc13 netfilter: xt_HARDIDLETIMER: Fix use after free condition
Force any pending hardidletimer_tg_work() to complete before freeing
the associated work struct.

CRs-Fixed: 814707
Change-Id: I57b2f0dcd24f05ddb472d6007525d1722f9fe0b0
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
2016-03-22 11:09:49 -07:00
Bhavya Sokke Mallikarjunappa
469a150b74 netfilter: xtables: hardidletimer target implementation
This patch implements a hardidletimer Xtables target that can be used to
identify when interfaces have been idle for a certain period of time.

Timers are identified by labels and are created when a rule is set with a
new label. The rules also take a timeout value (in seconds) as an option.
If more than one rule uses the same timer label, the timer will be
restarted whenever any of the rules get a hit.

One entry for each timer is created in sysfs. This attribute contains the
timer remaining for the timer to expire. The attributes are located under
the xt_idletimer class:

/sys/class/xt_hardidletimer/timers/<label>

When the timer expires, the target module sends a sysfs notification to the
userspace, which can then decide what to do (eg. disconnect to save power)

Compared to xt_IDLETIMER, xt_HARDIDLETIMER can send notifications when CPU
is in suspend too, to notify the timer expiry

Change-Id: I1723d44e02df864d63da7550766ea7d763076de2
Signed-off-by: Bhavya Sokke Mallikarjunappa <bsokke@codeaurora.org>
2016-03-22 11:09:48 -07:00
Harout Hedeshian
d5f660635e net: sched: gracefully handle qdisc which don't support change()
tc_qdisc_flow_control() incorrectly assumes that all queue disciplines
implement the change() callback in Qdisc_ops. If the flow control function
is called a queue that does not implement change(), we try to jump to a
null function pointer resulting in a panic. The flow control function
does require that the queue discipline support change() in order to
enable/disable the queue. Now we will check if the queue to do flow
control on supports the required funcionality and will WARN_ONCE and
return if the requirements are not met.

[<ffffffc000c5c028>] panic+0x28c
[<ffffffc0000889f4>] die+0x238
[<ffffffc000088a6c>] arm64_notify_die+0x4c
[<ffffffc000088d00>] bad_mode+0xa8
[<ffffffc000ab9ab8>] tc_qdisc_flow_control+0x98
[<ffffffc000c506e8>] rmnet_vnd_ioctl+0x230
[<ffffffc000aac6fc>] dev_ifsioc+0x2a0
[<ffffffc000aacde8>] dev_ioctl+0x644
[<ffffffc000a7db4c>] sock_ioctl+0x4c
[<ffffffc0001af548>] do_vfs_ioctl+0x4b4
[<ffffffc0001af684>] SyS_ioctl+0x60
[<ffffffc0000854b0>] el0_svc_naked+0x24

Change-Id: I85ca324e57814b6c0eac48d2e076e861ab32c260
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:09:47 -07:00
Subash Abhinov Kasiviswanathan
457b02e709 tun: Set CHECKSUM_UNNECESSARY if userspace passes this indication
Userspace may already know that the checksum validation is already
completed prior to being passed to the TUN interface. As a result,
computing checksum again in network stack may be a redundant
operation.

Add support to read this information from the TUN header flags
to skip checksum validation for these packets only.

This is useful in cases where the packet checksum was computed by
hardware for IPv4 / IPv6 TCP / UDP packets. Since the packet
intergrity was already verified for packets over the wire, subsequent
validation within the network stack is redundant work.

Change-Id: I18ee3408c05910207b205d6205f282e6f3599156
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-03-22 11:09:46 -07:00
Harout Hedeshian
e9a33bcd2f net: add a per-cpu counter for the number of frames coalesced in GRO
A low cost method of determining GRO statistics is required. This
change introduces a new counter which tracks whenever GRO coalesces
ingress packets. The counter is per-CPU and exposed in
/proc/net/softnet_stat as the last column of data. No user space
impact is expected as a result of this change. However, this change
should be reverted if legacy tools have problems with the new column
in softnet_stat.

Change-Id: I05965c0cb150947935d5977884cc4d583b37131d
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
[subashab@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-03-22 11:09:45 -07:00
Subash Abhinov Kasiviswanathan
d04abc1ab2 net: Fail explicit bind to local reserved ports
Reserved ports may have some special use cases which are not suitable
for use by general userspace applications. Currently, ports specified
in ip_local_reserved_ports will not be returned only in case of
automatic port assignment.

Add a boolean sysctl flag 'reserved_port_bind'. Default value is 1
which preserves the existing behavior. Setting the value to 0 will
prevent userspace applications from binding to these ports even when
they are explicitly requested.

BUG=20663075
Change-Id: Ib1071ca5bd437cd3c4f71b56147e4858f3b9ebec
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-03-22 11:09:45 -07:00
Harout Hedeshian
63bb8bb2cc net: Indicate whether a socket is a transparent socket
Modify the printout functions for IPv4-TCP, IPv4-UDP, IPv6-TCP, IPv6-UDP,
such that the state for the socket is printed as state = state | 0x80.
The actual socket state is unmodified. This change is required for the
user space to determine whether a socket is a transparent socket, and
to determine if the socket holder intends to consume packets locally
or to forward them to an external processor.

Change-Id: I2ca403b4c2c74e7ddcdbda53e4ba43613bae9c42
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
[subashab@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-03-22 11:09:44 -07:00
Harout Hedeshian
a511f282c9 net: sockev: corrected sk_family filter logic
Commit 43e0e31e2d6e ("net: sockev: filtering non INET socket events")
from Krishnan introduced incorrect conditional logic which caused
the socket address families to be incorrectly filtered. This
patch corrects the logic.

CRs-Fixed: 830947
Cc: Krishnan Ramachandran <kramacha@qti.qualcomm.com>
Acked-by: Devesh Bisht <dbisht@qti.qualcomm.com>
Change-Id: I40a001a69d5aab25f7f97a7378aceae301fd762a
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:09:43 -07:00
Subash Abhinov Kasiviswanathan
e1f88edd76 net: Warn for cloned packets in ingress path
Cloned packets arriving in ingress path can cause issues with GRO
since the skb shared info is garbled.

Warn once if a cloned packet is queued up to the network stack.

CRs-Fixed: 823275
Change-Id: I049f04f39b3d1338838560e08c93a973de427fc0
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
[subashab@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-03-22 11:09:42 -07:00
Harout Hedeshian
04be6f96ac net: udp: Adjust UDP socket state for encapsulation sockets
UDP IPv4 encapsulation sockets will have their state printed as 0xF0
binary ORed with the actual state such that they can be distinguished
from regular UDP sockets in /proc/net/udp.

CRs-Fixed: 821341
Change-Id: I240ab1526a4280e5e996d9577a904581684fc84a
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
[subashab@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-03-22 11:09:41 -07:00
Harout Hedeshian
bf669ab2dd net: sockev: filtering non INET socket events
Too many socket events are generated by netlink socket. Filtering out
unwanted socket events.

Change-Id: I3a4d7e14843cf72d6af2d948113b27928ed01adb
Acked-by: Krishnan Ramachandran <kramacha@qti.qualcomm.com>
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:09:40 -07:00
Harout Hedeshian
c8234ce878 net: socket: make sure refs are not released on fd before calling sockev
Ensure that BIND and LISTEN syscalls do fput_light AFTER sockev notifier
callback has returned. Also, increase refcount on sock->sk (if available)
before invoking the notifier callback. Prevent crash due to use-after-free.

[<c0891d5c>] (sockev_client_cb+0xfc/0x1e4) from [<c0a273a4>] (notifier_cal
[<c0a273a4>] (notifier_call_chain+0x44/0x84) from [<c01422cc>] (__blocking
[<c01422cc>] (__blocking_notifier_call_chain+0x48/0x60) from [<c01422fc>]
[<c01422fc>] (blocking_notifier_call_chain+0x18/0x20) from [<c0865968>] (S
[<c0865968>] (SyS_bind+0xb0/0xe8) from [<c0105ba0>] (ret_fast_syscall+0x0/

CRs-Fixed: 787283
Change-Id: I2de65929b22c58637692cf582b6b46b11713494e
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:09:39 -07:00
Harout Hedeshian
274f3cfdd0 net: sockev: Initial Commit
Added module which subscribes to socket notifier events. Notifier events
are then converted to a multicast netlink message for user space
applications to consume.

CRs-Fixed:  626021
Change-Id: Id5c6808d972b69f5f065d7fba9094e75c6ad0b2c
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
[subashab@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-03-22 11:09:38 -07:00
Harout Hedeshian
d675b4b3d4 net: socket: Added notifier chains for socket administrative functions
Allows other areas in the kernel to register notifier callbacks which
get invoked whenever something performs an administrative action on a
socket. This patch adds hooks in socket(), bind(), listen(), accept(),
shutdown().

CRs-Fixed:  626021
Change-Id: I4ae99cb2206d7c4eddba69757335c18d10143045
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
[subashab@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-03-22 11:09:38 -07:00
Harout Hedeshian
1afe1dec58 net: core: add MAP support to RPS flow dissector
More efficiently utilize multiple cores when using MAP encoded frames.
RPS flow dissector now appropriately decodes IPv4 and IPv6 frames with
MAP headers prepended.

CRs-Fixed: 681280
Change-Id: Ia4dde47fcc0f3436dcaa71a5160c0a59fe7ed53a
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
[subashab@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-03-22 11:09:37 -07:00
Rohit Vaswani
7d052379ef Revert "net, lib: kill arch_fast_hash library bits"
This reverts commit 0cb6c969ed.
2016-03-22 11:09:36 -07:00
Tony Truong
2254e02d74 defconfig: msm: enable PCIe bus driver in defconfig for 4.4 kernel
Enable defconfig for PCIe bus driver on 4.4 kernel.

Signed-off-by: Tony Truong <truong@codeaurora.org>
2016-03-22 11:09:35 -07:00
Tony Truong
63d5bc81ee msm: pcie: support PCIe bus driver on msm-4.4
Update PCIe bus driver to be compatible with 4.4 kernel.

Signed-off-by: Tony Truong <truong@codeaurora.org>
2016-03-22 11:09:34 -07:00
Tony Truong
e64da3e4b8 msm: pcie: fix compilation erros if debugfs is disabled
This change fixes the compilation erros seen when DEBUG_FS is disabled.

Signed-off-by: Tony Truong <truong@codeaurora.org>
2016-03-22 11:09:33 -07:00
Tony Truong
6aa3ab6d1e msm: pcie: add QSERDES PHY support for mdmcalifornium
The current PHY sequence is not fully compatible with the
QSERDES PHY found on mdmcalifornium. Thus, add the new
sequence and other changes to support PCIe QSERDES PHY
on mdmcalifornium.

Change-Id: I5a5d0b115651a159612e17debf0d25d6f88dbee8
Signed-off-by: Tony Truong <truong@codeaurora.org>
2016-03-22 11:09:32 -07:00
Tony Truong
f6e207636c msm: pcie: add ARM32 support for mdmcalifornium
Currently, PCIe bus driver on mdmcalifornium does not
have support for ARM32. Thus, add the necessary changes
to support ARM32 for PCIe on mdmcalifornium.

Change-Id: I6c72debd9ea65b7abb70ce4d5568c972ba786c11
Signed-off-by: Tony Truong <truong@codeaurora.org>
2016-03-22 11:09:32 -07:00
Tony Truong
e1307ba7b7 msm: pcie: add support to handle aggregated interrupts
Not all targets will have a dedicated line for each PCIe
interrupt. On these targets, some PCIe interrupts will be
aggregated into one line. Thus, add support to handle
aggregated interrupts.

Change-Id: I4f5be73718d4a4ae8a3de142579f24a7113fe086
Signed-off-by: Tony Truong <truong@codeaurora.org>
2016-03-22 11:09:31 -07:00
Tony Truong
aedf29f7b6 msm: pcie: update PCIe PHY for MSM8996v3/v4 based on si learning
Based on si learning, new PCIe PHY settings improve the overall
stability of PCIe PHY on MSM8996 v3 and on v4. Thus, update the
PCIe PHY sequence for MSM8996 v3 and v4.

Change-Id: Ia1ab0af4c4dcf483d3b3dc05b7b13003de788f40
Signed-off-by: Tony Truong <truong@codeaurora.org>
2016-03-22 11:09:30 -07:00
Tony Truong
7a18379427 msm: pcie: add locks to protect PCIe common PHY init and deinit
The counter for the number of active root complexes
determines when PCIe common PHY should be powered on/off.
To avoid conflicts and a stale counter, add locks to protect
the access to PCIe common PHY.

Change-Id: I18ec54e52e804eb132f9c5c0270455dbc9187151
Signed-off-by: Tony Truong <truong@codeaurora.org>
2016-03-22 11:09:29 -07:00
Tony Truong
ab935b69aa msm: pcie: change PCIe WAKE support to be optional
Not all endpoints require PCIe WAKE support.
Therefore make PCIe WAKE GPIO optional.

Change-Id: Ifc5a84204cde42881a127b4715727c290ee24450
Signed-off-by: Tony Truong <truong@codeaurora.org>
2016-03-22 11:09:28 -07:00
Tony Truong
d9d95976d1 msm: pcie: update debugfs messages with new IPC label
In addition to having outputs to kernel log, PCIe
debugfs messages should also be captured in IPC logging.
Therefore, add a new IPC logging label and update the
existing calls to do so.

Change-Id: I2ab6a6549575c4e2de2f1ef0756328f4b6f6a178
Signed-off-by: Tony Truong <truong@codeaurora.org>
2016-03-22 11:09:27 -07:00
Tony Truong
d4eaaf3a8a msm: pcie: add support to distingush between PCIe PHY ver
PCIe bus driver can now use devicetree to help distingush
which PCIe QMP PHY version is being used. This will allow
PCIe bus driver to choose the correct PCIe PHY sequence.

Change-Id: I74c67431b75292bb1db3e4b97d89d69de9b6f11b
Signed-off-by: Tony Truong <truong@codeaurora.org>
2016-03-22 11:09:26 -07:00
Tony Truong
2fffc92925 msm: pcie: remove PCIe CX rail vote when releasing resources
Current PMIC API call to disable CX rail does not remove
PCIe power vote. Add another API call to successfully
remove vote when releasing this resource.

Change-Id: I5203203e10e8e690745768c241e92d298b87cc4b
Signed-off-by: Tony Truong <truong@codeaurora.org>
2016-03-22 11:09:25 -07:00
Tony Truong
c7d5843606 msm: pcie: add delay after power down write
To improve PCIe PHY stability, add a delay between
the write of power down and sw reset register on
MSM8996.

Change-Id: If09390bff59e0922cb891c7bac823c11361fca83
Signed-off-by: Tony Truong <truong@codeaurora.org>
2016-03-22 11:09:25 -07:00
Tony Truong
e4c1b74bb9 msm: pcie: slow down PCIe PHY RX clock for SVS mode
In order for PCIe to reliabily work in SVS mode,
the PCIe PHY RX clock needs to be slowed.

Change-Id: Ic6edf487011ef4ac71d486210b1f6176e2142551
Signed-off-by: Tony Truong <truong@codeaurora.org>
2016-03-22 11:09:24 -07:00
Tony Truong
e2c14b7033 msm: pcie: increase the wakeup delay time for aux clock
Increase the wakeup delay time for PCIe aux clock on MSM8996
to improve PCIe stability when waking up.

Change-Id: I2909e80a2c79b4f17ca39c39d899de08b67d4120
Signed-off-by: Tony Truong <truong@codeaurora.org>
2016-03-22 11:09:23 -07:00
Tony Truong
c32d34c1f1 msm: pcie: add support for RC to vote for CX rails
Each PCIe client requires different CX power levels
to maintain functionality. This change gives each
PCIe root complex the ability to vote for CX power
levels.

Change-Id: If027c79220253a60837c3d52202fb5ec4cc3451e
Signed-off-by: Tony Truong <truong@codeaurora.org>
2016-03-22 11:09:22 -07:00
Tony Truong
622427b3cc msm: pcie: update PCIe QMP PHY sequence on MSM8996
New QMP PHY sequence for 1MHz aux clk for PCIe
on MSM8996. Therefore, update the PCIe PHY
sequence.

Change-Id: I2b3746cc9d6ab6b491fa7404ae54fefbf36df905
Signed-off-by: Tony Truong <truong@codeaurora.org>
2016-03-22 11:09:21 -07:00
Tony Truong
3ca71575e3 msm: pcie: remove unnecessary cleanup code for Synopsys MSI
There are unnecessary cleanup code which alters the descriptor
of a Synposys MSI IRQ and this causes the IRQ to be unusable
afterwards. Remove the unnecessary cleanup code for Synopsys
MSI so that the IRQ will remain functional.

Change-Id: I87221f9a59d014df21af251277866c511c5375eb
Signed-off-by: Tony Truong <truong@codeaurora.org>
2016-03-22 11:09:20 -07:00
Tony Truong
856928e234 msm: pcie: add PCIe support for 3.18 kernel
Add PCIe support for 3.18 kernel. Added enumeration,
interrupts, and hardware configurations support for
PCIe.

Signed-off-by: Tony Truong <truong@codeaurora.org>
2016-03-22 11:09:19 -07:00
Tony Truong
4c2a99e089 msm: pcie: increase the Ipeaks for PCIe LDOs
Increase the Ipeak request for each PCIe LDO based
on updated settings.

Change-Id: Ie3af6462dac68252b339595e350e393079a89bb9
Signed-off-by: Tony Truong <truong@codeaurora.org>
2016-03-22 11:09:19 -07:00
Tony Truong
c27c02ee65 msm: pcie: add SMMU support to calculate SID for PCIe EP
SMMU requires PCIe to provide a SID for each of its endpoint
so that the endpoint can successful transaction on the bus.
This change adds the support for PCIe bus driver to calculate
a SID for its endpoint and give it to the SMMU driver.

Change-Id: I52099bbfed0a38c75b0277b0f58f45f6e6559695
Signed-off-by: Tony Truong <truong@codeaurora.org>
2016-03-22 11:09:18 -07:00