Diag driver on Apps opens the remote DCI channels on remote ASICs
irrespective of the remote side support. Add a handshaking
mechanism that closes the DCI channel if handshaking fails.
Change-Id: I92bb0c6f2c8363bc3fd45d3c60bd9e79e7a216f0
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
When multiple channels are opened from same process, free
contexts associated only with the current channel when the
device is released.
Change-Id: Iaa1f06ee00f3b9420ef5b00995bdf8186cb83283
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Certain objects in the diag driver can be flagged falsely as
memory leaks. These objects will be freed when the driver exits.
This patch marks these objects as non-leaks.
Change-Id: Idcb3f97f5ec499ebb2da3ab6e1579128cad87c00
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Certain objects in the diag driver can be flagged falsely as
memory leaks. These objects will be freed when the driver exits.
This patch marks these objects as non-leaks.
Change-Id: I7c3ac8ac1fb9b54d8f1da62eed518669b7c663b0
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Currently while writing data to the peripherals over dci channel,
invalid channel access may happen. This patch add an error check
for such case.
Change-Id: I6a7bdb9c75c4863394dcab12b41387b081c2329f
Signed-off-by: Katish Paran <kparan@codeaurora.org>
Ensure that the buffer being passed to remote processor is
always from ADSP ION heap. Passing buffers from other ION
heaps would result in a copy operation into the ADSP ION
heap before the buffer is passed over.
Change-Id: I0cf53887d4ec18b81a1c35f8c7c9dc4f1ca4e97f
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Scan the non-ion buffers for overlapping memory and only copy each
segment once.
Change-Id: I5cacb0f821f217038cb0b2f7c407bb09ed6a362d
Acked-by: Anatoly Yakovenko <anatolyy@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
This patch adds support for Diag with MHI as the transport layer
in fused ASICs.
Change-Id: I3781cf632711e778b75a7a24db373226464f9201
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Currently the size of the buffer table in diag memory device mode
is set to a predefined value. This patch makes the size of the
buffer table consistent with the maximum number of buffers
possible.
Change-Id: I51313499f7bbe85b589605b7c3b27e27573d1684
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
If an SMD device is closed while the device is active and then
immediately re-opened, then a delayed work item may get processed while
data structures are in the process of being re-initialized.
Move initialization of data structures to device creation which happens
once during module initialization.
CRs-Fixed: 698603
Change-Id: Ida85d8452f32b62fd848c706ba046f1a9a08bc85
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
Dumping userspace read/write buffers without first copying the data may
lead to a kernel panic if the buffer is unmapped after the buffer has
been validated but before the VFS call returns.
Remove the debug code to print the data using userspace buffers.
CRs-Fixed: 730626
Change-Id: I95c0d751121812fd5d5f30e2b4ee221b1fc36083
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
Rename all device tree files and usages of msmferrum
to its official name msm8909.
Change-Id: Ie17e62046ed8b9626a59e393076a3ff00934c0fe
Signed-off-by: Kishan Kumar <kishank@codeaurora.org>
Add kmemleak_not_leak check in diagchar initialization to
avoid memleaks since this is not a leak case.
Change-Id: I72e208ec88f75d549458508e9f83d6af07c49a78
Signed-off-by: Katish Paran <kparan@codeaurora.org>
This change prevents a possible null pointer
dereference in msm_rng.c by moving the function
call under if block.
Change-Id: I481b39c91e495692e575a90b392095e95eb1f367
Acked-by: Saurabh Sabnis <ssabnis@qti.qualcomm.com>
Signed-off-by: Dinesh K Garg <dineshg@codeaurora.org>
commit 8e54caf407b98efa05409e1fee0e5381abd2b088 upstream.
Some Atmel TPMs provide completely wrong timeouts from their
TPM_CAP_PROP_TIS_TIMEOUT query. This patch detects that and returns
new correct values via a DID/VID table in the TIS driver.
Tested on ARM using an AT97SC3204T FW version 37.16
[PHuewe: without this fix these 'broken' Atmel TPMs won't function on
older kernels]
Signed-off-by: "Berg, Christopher" <Christopher.Berg@atmel.com>
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
[bwh: Backported to 3.10:
- Adjust filename, context
- s/chip->ops->/chip->vendor./]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 3e14d83ef94a5806a865b85b513b4e891923c19b upstream.
Regression in 41ab999c. Call to tpm_chip_put is missing. This
will cause TPM device driver not to unload if tmp_get_random()
is called.
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diag driver sets the flag for usb connection irrespective of the
different logging modes. This patch sets the usb connection flag
only when Diag is streaming in USB mode.
Change-Id: I23f66c09242ca74b38f06700f21398f748856b41
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag driver was setting the value of item number for a log equipment
id incorrectly. The item number should be set to the minimum of
the number of supported items and the requested items.
Change-Id: I558d4af14c2eefb0c53e432ed9056ca15406aa7d
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag driver is currently checking the length of the received packet
incorrectly in callback mode. This patch fixes this issue.
Change-Id: I0544e1e0a665d9f764a88a19285abdccd7477714
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
If any of userpsace component invokes smd_pkt functions in an undesired
manner, it may result in signification number of error logs.
As a result system might be watchdogged leading to a crash.
To minimize the number of error logs, pr_err is replaced with
pr_err_ratelimited to print error logs in a controlled manner.
This is only updated in fops functions which are called by
user space functions. This fix only reduces the likelyhood
of an errant user space program causing a watchdog. It is always
advisable to invoke smd_pkt functions in appropriate manner.
CRs-Fixed: 716604
Change-Id: I753afd83c3cd626f90ec9bfba1e227d85adbab42
Signed-off-by: Atish Kumar Patra <apatra@codeaurora.org>
On receiving the response from peripherals for the sent command
DCI traverses and deletes from the list. The list is not lock
protected while traversal or deletion. This patch resolves the
same.
Change-Id: Ie93f3e035b35c4d39f1e19f9c42a48f4147fe145
CRs-Fixed: 715663
Signed-off-by: Katish Paran <kparan@codeaurora.org>
The new ioctl exposes mechanism for user processes to create
a new process on the remote end when the device is opened.
Change-Id: Id27c7572d3bdd5ecfb899ac20dd237ab25f5a161
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Liam Mark <lmark@codeaurora.org>
* commit 'v3.10.49': (529 commits)
Linux 3.10.49
ACPI / battery: Retry to get battery information if failed during probing
x86, ioremap: Speed up check for RAM pages
Score: Modify the Makefile of Score, remove -mlong-calls for compiling
Score: The commit is for compiling successfully.
Score: Implement the function csum_ipv6_magic
score: normalize global variables exported by vmlinux.lds
rtmutex: Plug slow unlock race
rtmutex: Handle deadlock detection smarter
rtmutex: Detect changes in the pi lock chain
rtmutex: Fix deadlock detector for real
ring-buffer: Check if buffer exists before polling
drm/radeon: stop poisoning the GART TLB
drm/radeon: fix typo in golden register setup on evergreen
ext4: disable synchronous transaction batching if max_batch_time==0
ext4: clarify error count warning messages
ext4: fix unjournalled bg descriptor while initializing inode bitmap
dm io: fix a race condition in the wake up code for sync_io
Drivers: hv: vmbus: Fix a bug in the channel callback dispatch code
clk: spear3xx: Use proper control register offset
...
In addition to bringing in upstream commits, this merge also makes minor
changes to mainitain compatibility with upstream:
The definition of list_next_entry in qcrypto.c and ipa_dp.c has been
removed, as upstream has moved the definition to list.h. The implementation
of list_next_entry was identical between the two.
irq.c, for both arm and arm64 architecture, has had its calls to
__irq_set_affinity_locked updated to reflect changes to the API upstream.
Finally, as we have removed the sleep_length member variable of the
tick_sched struct, all changes made by upstream commit ec804bd do not
apply to our tree and have been removed from this merge. Only
kernel/time/tick-sched.c is impacted.
Change-Id: I63b7e0c1354812921c94804e1f3b33d1ad6ee3f1
Signed-off-by: Ian Maund <imaund@codeaurora.org>
This patch ratelimits printing of smd write failure dmesg for diag
commands that cannot be sent to the peripherals.
Change-Id: I68937ca6ccf9f1a5a49bbfac3779d3d530dbc78a
CRs-Fixed: 707938
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
If the renamed symbol is defined lib/iomap.c implements ioport_map and
ioport_unmap and currently (nearly) all platforms define the port
accessor functions outb/inb and friend unconditionally. So
HAS_IOPORT_MAP is the better name for this.
Consequently NO_IOPORT is renamed to NO_IOPORT_MAP.
The motivation for this change is to reintroduce a symbol HAS_IOPORT
that signals if outb/int et al are available. I will address that at
least one merge window later though to keep surprises to a minimum and
catch new introductions of (HAS|NO)_IOPORT.
The changes in this commit were done using:
$ git grep -l -E '(NO|HAS)_IOPORT' | xargs perl -p -i -e 's/\b((?:CONFIG_)?(?:NO|HAS)_IOPORT)\b/$1_MAP/'
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Git-commit: ce816fa88cca083c47ab9000b2138a83043a78be
[joonwoop@codeaurora.org: fixed trivial merge conflict.]
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Diag on the peripherals has support to buffer diag data and drain
them as and when required. This patchset adds support on the apps
processor to enable different buffering modes on the peripherals.
Change-Id: I07b9ffe36dfc5c90ac0d8a8da91922e1127aed58
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag driver reads mask table control packets from peripherals and
does a length check against an incorrect value. This can result in
dropping the last entry in those control packets.
Change-Id: I5092c6a7322c96bf7f6db51613b13d0b66977ffd
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag driver reallocates its buffer when the data read from SMD is
greater than IN_BUF_SIZE. It uses the old pointer even after
reallocating the buffer resulting in dangling pointer access. This
patch fixes this issue.
Change-Id: I21322f161df51accd0464a47ab0cf469fbb2959f
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Changing the type from long to u32 of the buffer that is used to
read data from the RNG hardware to reflect the size of the HW
register
Change-Id: I54e8eeae40a66c8033637044e627023150d6c411
Acked-by: Baranidharan Muthukumaran <bmuthuku@qti.qualcomm.com>
Signed-off-by: Dinesh K Garg <dineshg@codeaurora.org>
Diag driver has an ability to log diag data to USB or to the user
space clients. Make changes to modularize different modes of
logging schemes.
Change-Id: I91c95ce4ec8117f6926d8e6dfa164fd6cb07dc4b
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Refactor diagfwd_bridge to make it scalable and to communicate
with the remote devices in a much cleaner fashion. Also make
changes to DCI to reflect the changes in the bridge.
Change-Id: Ica5a3552ec94c5543518698390c910518da04f3b
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
The entropy argument to add_hwgenerator_randomness() is passed
directly to credit_entropy_bits() so we should be passing the
number of bits, not bytes.
Change-Id: I068c1073245944dddf0cbf7e69f1c0f1d96010e2
Fixes: 646d838eef81 "hwrng: create filler thread"
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
This can be viewed as the in-kernel equivalent of hwrngd;
like FUSE it is a good thing to have a mechanism in user land,
but for some reasons (simplicity, secrecy, integrity, speed)
it may be better to have it in kernel space.
This patch creates a thread once a hwrng registers, and uses
the previously established add_hwgenerator_randomness() to feed
its data to the input pool as long as needed. A derating factor
is used to bias the entropy estimation and to disable this
mechanism entirely when set to zero.
Change-Id: I2bda706d8791e8e7016d89e3df4c5f0339ff321c
Signed-off-by: Torsten Duwe <duwe@suse.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Git-commit: be4000bc4644d027c519b6361f5ae3bbfc52c347
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
This patch adds an interface to the random pool for feeding entropy
in-kernel.
Change-Id: Id9031d6b615877ea957ee2d2aba1f8150ec699b9
Signed-off-by: Torsten Duwe <duwe@suse.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Git-commit: c84dbf61a7b322188d2a7fddc0cc6317ac6713e2
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
[sboyd@codeaurora.org: Bring in ENTROPY_BITS() define,
s/random_write_wakeup_bits/random_write_wakeup_thresh/, and pass
NULL to mix_pool_bytes last parameter]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Resolve race condition between initializing the mutex vs hwrng
register.
Remove the HWRNG FIFO, not required in Software.
Change-Id: I9fa3e5c7e2e9e14feb88a4656dcfab7dec3cbd67
Signed-off-by: Dinesh K Garg <dineshg@codeaurora.org>
Diag driver resets the SMD buffers when USB write fails which can
result in data from SMD being dropped on the Apps side. Do not
reset the SMD buffers if the write fails so that the peripherals
can restrict sending more data.
Change-Id: I81a87bf828102bd33342ba31836fee9808024352
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
This patch adds calls to enable and disable bus bandwidth
for every RNG Read call.
Change-Id: Ia1ac31ffa79a8be2761c243eee9bf87f25422c24
Signed-off-by: Dinesh K Garg <dineshg@codeaurora.org>
Diag driver forms the response to log on demand request and sends
the response to the tools without forwarding to the peripherals.
Make changes to send the request to the peripherals first before
sending the response in both regular usb and dci channels.
Change-Id: I22cd826d82b03b23e41113f73c1099e8f36275ef
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag USB structures are deeply coupled with diag drivers. Each
instance of USB channel is used explicitly. Make changes to
modularize USB channels designated for Diag.
Change-Id: Id408e227e7e92178afa847064afe18bb6c0dd019
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag driver was setting the status of the event mask responses
incorrectly. Make changes to set the status in the event mask
commands correctly.
Change-Id: I1cf325311f8a880004a07d4d486d72e42105eab7
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag driver was initializing memory pools only if there is at least
one diag client. Make changes to initialize memory pools related to
USB irrespective of diag userspace clients.
Change-Id: I052798a27b86c007bbe1fc49fbf2c2d87f0bf592
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Add diag support on the apps to communicate with diag on sensors
processor.
Change-Id: I14632cdf55d917316f72153324a445553839e531
Signed-off-by: sgownipa <sgownipa@codeaurora.org>
Diag event mask size should hold one byte more than the maximum
events allowed. This patch increases the default event mask size
by 1.
Change-Id: I4716c86d872e7f802b5bc7c71d76ec43c75b7b40
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag driver is deeply coupled with SMUX structures. Make changes
to remove references of SMUX from diag core files.
Change-Id: I2abc6b98659fea5b5b429467af9ccf5ed3d37eaf
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag driver is currently using USB structures internally for
data transfers. Refactor the code by removing these structures.
Change-Id: I9e283af0f99cfb732fe74371dcbeae9c15e83b64
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
The current design of Diag memory pools makes it difficult to scale.
Diag HSIC structures maintain their own memory pools. Make changes
to bring all memory pools together.
Change-Id: I08acbd2ea35438637f875fdc5c2ab896d9db3dd9
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
MSMFERRUM is a new device. Add diag support for sending
appropriate model number for MSMFERRUM so that QPST
can display the appropriate string.
Change-Id: I1a75b705e606d6e4ef7480760a47871a1a9f2bce
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
Currently, if multiple responses comes over peripheral and the
user space client haven't read the last response or in middle
of reading the last response there is a possibility of
overwriting the last response. This patch ensures that the
offset is increased accordingly if multiple responses are
appended to same buffer.
Change-Id: I145756776b8902ab0819515b4192eb18d26949df
CRs-Fixed: 683417
Signed-off-by: Katish Paran <kparan@codeaurora.org>
Diag driver on the apps processor should be responding to the
mask requests from tools. Make changes to the driver to centralize
diag log, event, msg build time and run time masks on the apps
processor.
Change-Id: I14b4119343d2b5def1ef203f26215511bc3cd465
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
commit 8bab797c6e5724a43b7666ad70860712365cdb71 upstream.
This is a static checker fix. The "dev" variable is always NULL after
the while statement so we would be dereferencing a NULL pointer here.
Fixes: 819a3eba42 ('[PATCH] applicom: fix error handling')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
FIPS140-2 certification asks to do a Power on Known Answer tests on each
algorithm which is getting certified. This patch implements the self tests
and hardcoded test vectors. Also, we need to verify the integrity of
kernel as soon as it boots up. This patch also adds an ioctl for
integrity test along with ioctl to query FIPS status (pass / fail) from
user land.
also, The piece of code is added for FIPS compliance DRBG under
drivers/char/hw_random
Change-Id: Ib5f4872e7c88161b29ac526eef7e3fbc674456f7
Signed-off-by: Dinesh K Garg <dineshg@codeaurora.org>
When a client switches from callback mode to USB mode explicitly,
there is a possibility that the last response is not drained to the
user space. Reset the rsp_buf_busy flag in such scenarios so that
we don't hold on to the response buffer forever.
Change-Id: I0be80174e8193174eb53a768c5ed3a4e322d50ec
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag driver was sending all mode commands to the apps processor while
only mode reset command was handled on the apps processor. This patch
makes an exception for mode reset command.
Change-Id: I51e4971cbffcc8fedd68090cb5a15c4c67363c57
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag message, log and event masks were formatted uniquely. Refactor
code to change the design of all diag masks.
Change-Id: Ic1516591088404204ad11187487b96690706f17a
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
After writing packet to SMD, diag driver is returning
wrong error status even in case of success which
leads to failure of dci client. This patch returns
correct error status to dci clients.
Change-Id: I1a9967c68c1e0a642b44f1d0ee1cc49f33f7ac91
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
* commit 'v3.10.40': (203 commits)
Linux 3.10.40
ARC: !PREEMPT: Ensure Return to kernel mode is IRQ safe
drm: cirrus: add power management support
Input: synaptics - add min/max quirk for ThinkPad Edge E431
Input: synaptics - add min/max quirk for ThinkPad T431s, L440, L540, S1 Yoga and X1
lockd: ensure we tear down any live sockets when socket creation fails during lockd_up
dm thin: fix dangling bio in process_deferred_bios error path
dm transaction manager: fix corruption due to non-atomic transaction commit
Skip intel_crt_init for Dell XPS 8700
mtd: sm_ftl: heap corruption in sm_create_sysfs_attributes()
mtd: nuc900_nand: NULL dereference in nuc900_nand_enable()
mtd: atmel_nand: Disable subpage NAND write when using Atmel PMECC
tgafb: fix data copying
gpio: mxs: Allow for recursive enable_irq_wake() call
rtlwifi: rtl8188ee: initialize packet_beacon
rtlwifi: rtl8192se: Fix regression due to commit 1bf4bbb
rtlwifi: rtl8192se: Fix too long disable of IRQs
rtlwifi: rtl8192cu: Fix too long disable of IRQs
rtlwifi: rtl8188ee: Fix too long disable of IRQs
rtlwifi: rtl8723ae: Fix too long disable of IRQs
...
Change-Id: If5388cf980cb123e35e1b29275ba288c89c5aa18
Signed-off-by: Ian Maund <imaund@codeaurora.org>
The subsystem restart handler aborts all pending transactions and
propagates the error back to the user for it to take appropriate
recovery actions. Once the subsystem restart notification is
received, iommu driver calls are skipped for all pending
transactions to avoid bus errors due to unclocked access.
Change-Id: I16465e5f82e01bab1ba32be2574be9734ed3e247
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Liam Mark <lmark@codeaurora.org>
Diag driver can miss sending responses to clients in Memory Device
Mode due to a race condition. Check and correct the condition and
send responses in those cases.
Change-Id: Id4b4f51272e97ae741eb146845d6889a66205a8a
CRs-Fixed: 667453
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Refactor handling of diag control packets and make them robust
by adding more error handling.
Change-Id: I90d0212a10269ac00cc1bd3731f38f20e3918b2e
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag driver calls smd_write at different places. Make all writes
consistent and reduce code size.
Change-Id: Ie3b1cef2117c7a37e3341ed1a0ffd5be0884a1fe
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag user space clients sends an IOCTL to get the real time value
from the driver. The driver was setting this value incorrectly. This
patch fixes this issue.
Change-Id: Ia9ff16e5b1affc05bb0f99b32e97fa80ec25aa14
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
commit eb6d78ec213e6938559b801421d64714dafcf4b2 upstream.
The OBF timer in KCS was not reset in one situation when error recovery
was started, resulting in an immediate timeout.
Reported-by: Bodo Stroesser <bstroesser@ts.fujitsu.com>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 48e8ac2979920ffa39117e2d725afa3a749bfe8d upstream.
With recent changes it is possible for the timer handler to detect an
idle interface and not start the timer, but the thread to start an
operation at the same time. The thread will not start the timer in that
instance, resulting in the timer not running.
Instead, move all timer operations under the lock and start the timer in
the thread if it detect non-idle and the timer is not already running.
Moving under locks allows the last timeout to be set in both the thread
and the timer. 'Timer is not running' means that the timer is not
pending and smi_timeout() is not running. So we need a flag to detect
this correctly.
Also fix a few other timeout bugs: setting the last timeout when the
interrupt has to be disabled and the timer started, and setting the last
timeout in check_start_timer_thread possibly racing with the timer
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Bodo Stroesser <bstroesser@ts.fujitsu.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
APQ8026 is a new device. Add diag support for sending
appropriate model number for APQ8026 so that QPST
can display the appropriate string.
Change-Id: I337693fba4222d2605aa4d489d7c24bebcbd07bf
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag driver prevents HSIC from suspending if it is in Memory Device
Mode. Make changes to remove this condition and allow suspend in
all logging modes.
Change-Id: Ia1f43b881f1ea247ba17e067d6ac1a1da021ad9e
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Reduce the diag drain timer to 200ms to drain the diag traffic
soon. Some tools expect the diag traffic in 200ms.
Change-Id: Ieb6cfa57bd1e72a53f0d3eb16b0a1d3928230327
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
msm_ion_client_create doesn't actually do anything with its heap_mask
parameter. Remove it. Also remove the extra argument from an audio
function that wraps msm_ion_client_create.
The following semantic patch was used to generate this patch:
@@
expression E1, E2;
@@
msm_ion_client_create(
- E1,
E2)
@@
expression E1, E2;
@@
msm_audio_ion_client_create(
- E1,
E2)
Change-Id: I403a125a1715b29a3db1f27c993abe0bc6d3fb11
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
If clients use custom serialization functions, then they may need to
define a version for deserialization support for log extraction.
Add client version support.
Change-Id: Id135f06d4142de39275b5d0caab88708d5496b5e
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
MSM8994 is a new device. Add diag support for sending
appropriate model number for MSM8994 so that QPST
can display the appropriate string.
Change-Id: I91dd988ebea8c98d04dbcc5afd6a36f83b4283c6
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
Diag driver can let apps processor go to suspend when receiving
data from remote processors and peripherals. This can result in
diag data being dropped on the apps processor. This patch ensures
that the apps processor is awake till the data is copied to the
user space.
Change-Id: Id3c46c66675d3b5632721dede5e59420b69c568e
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Add kmemleak_not_leak call in diagmem_alloc to avoid
memleaks since these are not leak cases.
Change-Id: I003d7b4f5bd1492f649031056c550b3633ff3036
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
Update the data types to handle 64 bit address space and
communicate 64 bit addresses to remote processor. Provide
compat ioctl call to allow for 32 bit user space to call
into the driver.
Change-Id: I954f07382bbc9998aed574a7bf74fab9299f0b45
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
The SSIDs, event IDs and log codes have fallen out of date.
Bring the SSIDs, event IDs and log codes up to date.
Change-Id: I8e6a2af8baba359f32a489ddc06f619de826f97b
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
commit a94cdd1f4d30f12904ab528152731fb13a812a16 upstream.
In read_all_bytes, we do
unsigned char i;
...
bt->read_data[0] = BMC2HOST;
bt->read_count = bt->read_data[0];
...
for (i = 1; i <= bt->read_count; i++)
bt->read_data[i] = BMC2HOST;
If bt->read_data[0] == bt->read_count == 255, we loop infinitely in the
'for' loop. Make 'i' an 'int' instead of 'char' to get rid of the
overflow and finish the loop after 255 iterations every time.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Reported-and-debugged-by: Rui Hui Dian <rhdian@novell.com>
Cc: Tomas Cech <tcech@suse.cz>
Cc: Corey Minyard <minyard@acm.org>
Cc: <openipmi-developer@lists.sourceforge.net>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Socinfo has renamed MSM_CPU_8936 to MSM_CPU_8939.
This patch adds corresponding changes in diag.
Change-Id: I12164b2a6476425295a68c33f8cb400d8bf508c9
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
Currently in diag driver invalid proc id may lead to accessing
invalid array elements. This patch fixes the issue.
Change-Id: I4bcf3eb610537c589d0b66903df1e79a88127b93
CRs-fixed: 629864
Signed-off-by: Katish Paran <kparan@codeaurora.org>
Correct kernel configuration dependency for remote debugger driver
to get rid of earlier listed dependency since driver compilation
succeeds even without it.
Change-Id: I668bb5181db2457e450c894b0f59e4e470813767
Acked-by: Vivek Iyer <viyer@qti.qualcomm.com>
Acked-by: Mahesh Rohera <mrohera@qti.qualcomm.com>
Acked-by: Jay Jayanna <jjayanna@qti.qualcomm.com>
Signed-off-by: Aparna Das <adas@codeaurora.org>
When handling a DCI packet response, the uid information is
being obtained from data that is already freed. Make changes
so that the information is not obtained using a dangling pointer.
Also, adding the header information to the DCI packet response is
very unreadable. Make changes to improve the readability of
adding the header information to the DCI packet response.
Change-Id: Ida3d3dac26d0961080fd39576183b6af7fb6551e
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
When diag switches from Memory device mode to any other mode,
buffers are not freed for Local Diag data. This can lead to memory
pool exhaustion resulting in Diag packet drops.
Change-Id: Icfeb00dd6c11091a7b9106fbefcdcc9d028782c8
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Currently diag doesn't send response for download command.
This patch resolves that issue.
Change-Id: I365612fdfb010597d4e75cd56cc78361ac09e7de
Signed-off-by: Katish Paran <kparan@codeaurora.org>
The following commits have been reverted from this merge, as they are
known to introduce new bugs and are currently incompatible with our
audio implementation. Investigation of these commits is ongoing, and
they are expected to be brought in at a later time:
86e6de7 ALSA: compress: fix drain calls blocking other compress functions (v6)
16442d4 ALSA: compress: fix drain calls blocking other compress functions
This merge commit also includes a change in block, necessary for
compilation. Upstream has modified elevator_init_fn to prevent race
conditions, requring updates to row_init_queue and test_init_queue.
* commit 'v3.10.28': (1964 commits)
Linux 3.10.28
ARM: 7938/1: OMAP4/highbank: Flush L2 cache before disabling
drm/i915: Don't grab crtc mutexes in intel_modeset_gem_init()
serial: amba-pl011: use port lock to guard control register access
mm: Make {,set}page_address() static inline if WANT_PAGE_VIRTUAL
md/raid5: Fix possible confusion when multiple write errors occur.
md/raid10: fix two bugs in handling of known-bad-blocks.
md/raid10: fix bug when raid10 recovery fails to recover a block.
md: fix problem when adding device to read-only array with bitmap.
drm/i915: fix DDI PLLs HW state readout code
nilfs2: fix segctor bug that causes file system corruption
thp: fix copy_page_rep GPF by testing is_huge_zero_pmd once only
ftrace/x86: Load ftrace_ops in parameter not the variable holding it
SELinux: Fix possible NULL pointer dereference in selinux_inode_permission()
writeback: Fix data corruption on NFS
hwmon: (coretemp) Fix truncated name of alarm attributes
vfs: In d_path don't call d_dname on a mount point
staging: comedi: adl_pci9111: fix incorrect irq passed to request_irq()
staging: comedi: addi_apci_1032: fix subdevice type/flags bug
mm/memory-failure.c: recheck PageHuge() after hugetlb page migrate successfully
GFS2: Increase i_writecount during gfs2_setattr_chown
perf/x86/amd/ibs: Fix waking up from S3 for AMD family 10h
perf scripting perl: Fix build error on Fedora 12
ARM: 7815/1: kexec: offline non panic CPUs on Kdump panic
Linux 3.10.27
sched: Guarantee new group-entities always have weight
sched: Fix hrtimer_cancel()/rq->lock deadlock
sched: Fix cfs_bandwidth misuse of hrtimer_expires_remaining
sched: Fix race on toggling cfs_bandwidth_used
x86, fpu, amd: Clear exceptions in AMD FXSAVE workaround
netfilter: nf_nat: fix access to uninitialized buffer in IRC NAT helper
SCSI: sd: Reduce buffer size for vpd request
intel_pstate: Add X86_FEATURE_APERFMPERF to cpu match parameters.
mac80211: move "bufferable MMPDU" check to fix AP mode scan
ACPI / Battery: Add a _BIX quirk for NEC LZ750/LS
ACPI / TPM: fix memory leak when walking ACPI namespace
mfd: rtsx_pcr: Disable interrupts before cancelling delayed works
clk: exynos5250: fix sysmmu_mfc{l,r} gate clocks
clk: samsung: exynos5250: Add CLK_IGNORE_UNUSED flag for the sysreg clock
clk: samsung: exynos4: Correct SRC_MFC register
clk: clk-divider: fix divisor > 255 bug
ahci: add PCI ID for Marvell 88SE9170 SATA controller
parisc: Ensure full cache coherency for kmap/kunmap
drm/nouveau/bios: make jump conditional
ARM: shmobile: mackerel: Fix coherent DMA mask
ARM: shmobile: armadillo: Fix coherent DMA mask
ARM: shmobile: kzm9g: Fix coherent DMA mask
ARM: dts: exynos5250: Fix MDMA0 clock number
ARM: fix "bad mode in ... handler" message for undefined instructions
ARM: fix footbridge clockevent device
net: Loosen constraints for recalculating checksum in skb_segment()
bridge: use spin_lock_bh() in br_multicast_set_hash_max
netpoll: Fix missing TXQ unlock and and OOPS.
net: llc: fix use after free in llc_ui_recvmsg
virtio-net: fix refill races during restore
virtio_net: don't leak memory or block when too many frags
virtio-net: make all RX paths handle errors consistently
virtio_net: fix error handling for mergeable buffers
vlan: Fix header ops passthru when doing TX VLAN offload.
net: rose: restore old recvmsg behavior
rds: prevent dereference of a NULL device
ipv6: always set the new created dst's from in ip6_rt_copy
net: fec: fix potential use after free
hamradio/yam: fix info leak in ioctl
drivers/net/hamradio: Integer overflow in hdlcdrv_ioctl()
net: inet_diag: zero out uninitialized idiag_{src,dst} fields
ip_gre: fix msg_name parsing for recvfrom/recvmsg
net: unix: allow bind to fail on mutex lock
ipv6: fix illegal mac_header comparison on 32bit
netvsc: don't flush peers notifying work during setting mtu
tg3: Initialize REG_BASE_ADDR at PCI config offset 120 to 0
net: unix: allow set_peek_off to fail
net: drop_monitor: fix the value of maxattr
ipv6: don't count addrconf generated routes against gc limit
packet: fix send path when running with proto == 0
virtio: delete napi structures from netdev before releasing memory
macvtap: signal truncated packets
tun: update file current position
macvtap: update file current position
macvtap: Do not double-count received packets
rds: prevent BUG_ON triggered on congestion update to loopback
net: do not pretend FRAGLIST support
IPv6: Fixed support for blackhole and prohibit routes
HID: Revert "Revert "HID: Fix logitech-dj: missing Unifying device issue""
gpio-rcar: R-Car GPIO IRQ share interrupt
clocksource: em_sti: Set cpu_possible_mask to fix SMP broadcast
irqchip: renesas-irqc: Fix irqc_probe error handling
Linux 3.10.26
sh: add EXPORT_SYMBOL(min_low_pfn) and EXPORT_SYMBOL(max_low_pfn) to sh_ksyms_32.c
ext4: fix bigalloc regression
arm64: Use Normal NonCacheable memory for writecombine
arm64: Do not flush the D-cache for anonymous pages
arm64: Avoid cache flushing in flush_dcache_page()
ARM: KVM: arch_timers: zero CNTVOFF upon return to host
ARM: hyp: initialize CNTVOFF to zero
clocksource: arch_timer: use virtual counters
arm64: Remove unused cpu_name ascii in arch/arm64/mm/proc.S
arm64: dts: Reserve the memory used for secondary CPU release address
arm64: check for number of arguments in syscall_get/set_arguments()
arm64: fix possible invalid FPSIMD initialization state
...
Change-Id: Ia0e5d71b536ab49ec3a1179d59238c05bdd03106
Signed-off-by: Ian Maund <imaund@codeaurora.org>
If modem proc has registered for the polling command and is up,
in that case Apps diag should not respond for the 0x7C command.
The 0x7C response should come from modem.
Change-Id: If1f79d19647988d4d909d1a079c46699c7b3ddab
CRs-fixed: 605172
Signed-off-by: Katish Paran <kparan@codeaurora.org>
Diag was sending the responses only to USB with the change
9d92106b2b - 'diag: Create separate
buffer for command responses'. Make changes to send responses
to user space clients in non-USB modes and to USB in USB mode.
Change-Id: I6e36da23cb4ec99774fb5e4d72e4ab7cb1acb575
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
MSM8939 is a new device. Add diag support for sending
appropriate model number for MSM8939 so that QPST
can display the appropriate string.
Change-Id: If25f790e330bef89fc332b9595833be7df30c719
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
Diag over STM command protocol currently supported is version 1
protocol. The protocol has been changed and labeled as version
2. Make modifications to support version 2 Diag over STM command
protocol.
Change-Id: I6853d8d2a6ed35166a9be28a464aa7c0dfe844b0
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
Diag driver checks for a particular error value when it tries
to read from the HSIC channel. However, there is a possibility
for HSIC driver to return any error code.
Change-Id: I9f9f2680fbb86cb7ea1eb58b472f2a9bfb150226
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag clients can issue IOCTLs to get the next delayed response
id from the Diag driver. This patch removes unnecessary data
being copied from and to the user space.
Change-Id: I13cf17252d2a85b999fd4645714ee1d8143e5ccc
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag driver queues a read to diag_bridge even if the read
complete for the previous read has an error status. This
leads to continuous reads resulting in waking up the
system.
Change-Id: I59bb1f59e715611f7397ae7a7d3fb6c5bed56ea5
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
The diag driver is required to work in 32 bit as well as
64 bit mode. This includes running with a 64 bit kernel
and 32 bit userspace. Make changes to support both 32 and
64 bit operation.
Change-Id: Ib37269203ac2e38d887e8fd650fc407ff604f2ac
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>