Read the hi-power power-supply property in the
get_property callback to avoid warnings from the
power-supply framework.
Change-Id: I5a9bb9b625ceb308afab915db9ac784a567ffbfb
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Temperature sensor (TSENS) driver provides clients to
read on die temperature sensors and set temperature
thresholds for thermal mitigation.
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
This snapshot is taken as of msm-3.18 commit dbdb6776f
(Merge "msm: camera: Add dummy sub module in sensor pipeline")
Commit 0b46b8a7 (clocksource: arch_timer: Fix code to use
physical timers when requested) introduces the use of
physical counters and requires clients to use api
arch_counter_get_cntvct(). Accordingly update tsens_poll()
to the new API to prevent a BUG_ON() during bootup.
Fixup TSENS to use supported int type for temperature value.
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
batterydata-lib.h limits function declarations to certain CONFIGs and
provides stub function definitions for everyone else. Remove the function
defintions and provide function declarations to everyone.
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
QTI charger drivers have outgrown thier home in power and deserve their
own sub-directory. Move all QTI charger drivers and their depedencies to
a new sub-directory of power called qcom-charger.
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Many of the older SMB charger drivers are no longer present therefore
remove the config entries for them.
Duplicate config entries are present. Remove them.
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Embedded power measurement (EPM) driver allows
clients to read supported current and voltage
channels for power measurements.
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
This snapshot is taken as of msm-3.18 commit dbdb6776f
(Merge "msm: camera: Add dummy sub module in sensor pipeline")
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Currently, the CPU_STARTING notifiers would observe an incorrect sibling
mask since the notifier chain is called before the topology masks are
updated for the new cpu.
Update the topology masks before calling the notifier chain to fix this
problem.
Change-Id: I3f698d777af3bb8e324019619b4c1c4de85e7b2c
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
In case of a kernel panic, only the panicking CPU does an entire
cache flush. This means that certain dirty cache lines in the
caches of the other CPUs may never get flushed. This gives us
improper RAM dumps. Add cache flushing for all the online CPUs.
The outer domain is not flushed since it is already being done by
the panicking CPU.
Change-Id: I03cf14f49334e45c145a17b06d0c623575b653e8
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
[satyap: trivial merge conflict resolution]
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Add a call to secondary start kernel for cpus which have been
onlined via the hotplug path for wfi based hotplug solution
where the return path from cpu_die should not return to the
idle thread. Update the cpu_die definition with a __ref to
allow referencing a __cpuinit call (secondary_start_kernel)
from it.
Change-Id: I7c083effda3928b562ea0d601833ceb8d5178d43
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
Convert deprecated smp_mb__*() barriers.
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
[joshc: fixup other uses around the kernel during the 3.14 upgrade]
Signed-off-by: Josh Cartwright <joshc@codeaurora.org>
Since ARM64 doesn't have an NMI, send an IPI to all other CPUs
(current cpu prints the stack directly) to capture a backtrace.
Change-Id: Ib90494123205b3bbaa0b244ccde6c7e40a560199
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
[satyap: trivial merge conflict resolution & compilation fixes]
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
"This snapshot is taken as of msm-3.18 commit dbdb6776f
(Merge "msm: camera: Add dummy sub module in sensor pipeline")
Use regulator_set_load() to specify the load required
while issuing VADC requests on the VADC LDO and fixup
compilation for qpnp_vadc_read() from thermal sysfs.
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Add support for IPI_WAKEUP which is used by hotplug code
path to wake up CPU from low power states.
Change-Id: I258d05e109a377613064624a5bfda21ab8ea9869
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
[satyap@codeaurora.org: trivial merge conflict resolution]
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Squash and apply following u_serial driver changes taken from
msm-3.10 kernel as of commit
ec18e1c5aed (Merge "mmc: card: set dma_mask as the queue bounce limit")
feb56a3 usb: gadget: Fix bug in serial driver RX path
2ff1b9a USB: Gadget: u_serial: Debugfs for endpoint buffer monitoring
272d2fd USB: gadget: u_serial: free read/write requests upon queue failure
950a3a3 USB: Gadget: u_serial: Freeing usb requests as a part of gs_close
e4e6bc4 USB: u_serial: Don't allow UDC to append and send a zero length
packet
4bd2646 usb: gadget: serial: Limit write permissions to root
13e7219 USB: Fix multiple issues found by static analysis tool
505294c USB: Debugfs: Fix compilation issues when debugfs is disabled
0e7633e usb: gadget: Fix code quality issues when accessing port
607dbeb USB: u_serial: Don't free usb_requests in gs_close and reuse them
4aebedc usb: u_serial: Fix NULL pointer dereference in u_serial tty
callbacks
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Squash and apply following f_serial driver changes taken
from msm-3.10 kernel as of commit
ec18e1c5aed (Merge "mmc: card: set dma_mask as the queue bounce limit")
d98217e USB: android gadget: queue the request only when serial is online
b8bd483 USB: android gadget: Add interrupt ep and modem support in f_serial
7b56862 USB: Add super speed descriptors for android functions
c5a7f7f gadget: u_serial: Add tiocmset/tiocmget functionality
2a821c8 usb: gadget: Add debug message to print the control line state
information
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Correct the the __iomem decorations in __raw_write_logged()
and __raw_read_logged().
Change-Id: If4a4f7aff09537772a5f9e386c3c6ada95512457
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Due to USB cable disconnect, ADBD closes its epfiles and re-opens the same.
In normal operation the sequence is:
ffs_func_eps_disable() setting epfile->error to 1
ffs_epfile_release() setting epfile->error to 1
ffs_epfile_open() setting epfile->error to 0
In some cases when above sequeunce gets changed, epfile->error is set to 1.
Hence there is no data transfer happening on ep-IN endpoint. Fix this by
not allowing opening of epfiles until it has being successfully released.
Change-Id: I26b9ec1b6218d00cc0965ce3e71fcea49f9bf567
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
config_ep_by_speed() configures endpoint based on speed and
uses already available endpoint descriptors. Here it overrides
maxpacket field based on selected descriptor for endpoint. maxpacket
field is used by some of UDC driver to resize TXFIFO for IN endpoint.
Due to maxpacket is not being configured with selected endpoint
descriptor, UDC driver uses previously stale maxpacket value which
results into wrong TXFIFO calculated for used IN endpoint. Fix this
issue by calling config_ep_by_speed() for ADB endpoints to make sure
that proper value is updated with maxpacket field based on descriptor.
Change-Id: I9121f4df898de1455f9be4333ca8d0e744f4eb9e
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
f_fs uses only one request per ep and driver is trying to queue
same request again before it completed. This is seen in following
scenario, as part of system suspend wait_for_completion was
interrupted by -ERESTARTSYS, and driver tried to dequeue this
request, as USB was in LPM it was unable to dequeue this and
later on system resume ffs_epfile_read tried to queue same
request again which was never dequeued or completed. ep_queue
will return error if same request is queued again while it is in
progress. User space considers this ep_queue failure as halt and
try to clear halt condition that never happened. When User space
is trying to clear halt by that time USB has entered LPM again
leading to crash.
Avoid this by making sure same request is not queued again until
it is completed.
Change-Id: I6e9f357b9b8a47753b1323b4308e60844d7dec94
Signed-off-by: Tarun Gupta <tarung@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
In few instances, it is observed that multiple adbd instances are
running on device causing condition BUG_ON(ffs->gadget) to be true.
ffs->opened and ffs->ref atomic variables are used here to make
decision for checking ffs->gadget. These atomic variable operations
requires expilict memory barrier to make sure that update to
ffs->gadget is visible to other CPUs before updated atomic variable
based value is seen. This change also adds explicit memory barriers
before reading or modified any atomic varaiables.
Change-Id: I3c846eb6bbb53663892e05d51ebac8439aac957a
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
As part of ffs_ep0_open(), atomic variable ffs.opened is set and as part
of ffs_ep0_release() it is cleared. Also as part of release operation, in
ffs_data_clear() ffs->gadget is set to NULL.
If two adb daemons are running in parallel, then BUG ON is observed as part
of release operation as ffs->gadget is not set to NULL.
To fix the issue add check for ffs->opened to allow only one adb daemon
perform device open. This ensures open and release operation are performed
in serialized way and avoids any race.
Also add debug print for dumping the ffs gadget.
Change-Id: Ifccdfa6068f506bb7dfdc9945b60591da530df8f
Signed-off-by: Saket Saurabh <ssaurabh@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Add print message in case of error scenarios which will
be useful for debugging adb offline issues.
Change-Id: I75bc136eab05151abb187c1fa1e5956b6f507297
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
done completion variable is local stack variable to ffs_epfile_io().
It is being used to unblock ffs_epfile_io() from USB request
completion context where done is accessed through req->context. If
ffs_epfile_io() is unblocked or interrupted due to epfile close or
any signal before USB request completion is handled, req->context is
having stale "done" reference causing invalid access. Fix this issue
by storing done completion reference with epfile structure instead of
having it on stack to have valid req->context in completion handler.
Change-Id: I15102538d1b5bee14dfa3c7b3fa1f8e3f767cf71
Signed-off-by: Sujeet Kumar <ksujeet@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
F_FS function driver allocated ffs_eps and updates ffs_ep->ep
to corresponding usb_ep during func->bind and never clears it.
On bind it also saves ffs_ep context in epfile->ep.
During func->disable, it clears only ffs_ep context in epfile->ep
and on func->unbind it frees ffs_eps memory.
ffs_epfile_io routine currently relies on ffs_ep->ep (which is
never cleared and ffs_ep could be freed on unbind) to detect any
disconnect during active IO. This can result in various issues e.g.
use after free use of ffs_ep if unbind finished before epfile_io
could resume or "stop adbd" trying to dequeue a freed USB request
when epfile_io could execute only after F_FS got disabled as
'if (ep->ep)' check would be TRUE.
Fix this by checking stored ffs_ep context against latest epfile->ep
to figure out if endpoint got disabled or changed before acquiring
spin_lock.
Change-Id: I6bdcdf0dff0813ed7b2af8c24f544a22796b0369
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Set error status before disabling endpoint during function
disable and also check error status before handling I/O. If error
status is set, return error status to read/write calls made by
userspace. Also set file's private data to NULL during epfile
release.
Change-Id: I14b5ee541dfc18a7802ef4a8033878a7729d9adb
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
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>
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>
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>
Enable UBSAN support for arm64.
CRs-Fixed: 969533
Change-Id: I03689e902195b901712ff5922af10fc127e96418
Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>