Commit Graph

5956 Commits

Author SHA1 Message Date
Linux Build Service Account 683b63ae6d Merge "diag: Do not prevent HSIC suspend in special cases" 2014-06-06 18:54:54 -07:00
Linux Build Service Account fd521aa7a1 Merge "diag: Reduce diag drain timer to 200ms" 2014-06-06 06:06:07 -07:00
Ravi Aravamudhan 84d3076776 diag: Add support for APQ8026 QPST string
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>
2014-06-03 11:55:35 -07:00
Ravi Aravamudhan 9460a1758a diag: Do not prevent HSIC suspend in special cases
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>
2014-06-03 11:21:05 -07:00
Linux Build Service Account 3b0fd94938 Merge "msm: ipc_logging: add client version support" 2014-05-31 19:42:47 -07:00
Sreelakshmi Gownipalli 63a3ab8406 diag: Reduce diag drain timer to 200ms
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>
2014-05-29 13:27:26 -07:00
Mitchel Humpherys 61b82c2113 ion: msm: remove superfluous function argument
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>
2014-05-27 15:28:48 -07:00
Eric Holmberg 9f4800553d msm: ipc_logging: add client version support
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>
2014-05-27 13:56:54 -06:00
Linux Build Service Account bc25172140 Merge "diag: Prevent suspend while reading data from SMD and HSIC" 2014-05-25 05:44:41 -07:00
Sreelakshmi Gownipalli f426479850 diag: Add support for MSM8994 QPST string
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>
2014-05-22 17:19:20 -07:00
Ravi Aravamudhan 734dfd57e0 diag: Prevent suspend while reading data from SMD and HSIC
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>
2014-05-21 13:35:40 -07:00
Sreelakshmi Gownipalli 1a26dacb89 diag: Add kmemleak_not_leak checks to avoid memleaks
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>
2014-05-14 13:19:58 -07:00
Linux Build Service Account 448aae7016 Merge "msm: ADSPRPC: Changes to support 64 bit address space" 2014-05-13 20:28:25 -07:00
Mitchel Humpherys d776655a24 msm: ADSPRPC: Changes to support 64 bit address space
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>
2014-05-05 15:21:03 -07:00
Linux Build Service Account 16296e0178 Merge "Merge upstream linux-stable v3.10.36 into msm-3.10" 2014-05-05 15:09:00 -07:00
Ravi Aravamudhan d8d4ab5dc3 diag: Update SSIDs, event ids and log codes
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>
2014-04-30 18:57:21 -07:00
Jiri Slaby 96a405de04 Char: ipmi_bt_sm, fix infinite loop
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>
2014-04-26 17:15:34 -07:00
Ian Maund 356fb13538 Merge upstream linux-stable v3.10.36 into msm-3.10
* commit 'v3.10.36': (494 commits)
  Linux 3.10.36
  netfilter: nf_conntrack_dccp: fix skb_header_pointer API usages
  mm: close PageTail race
  net: mvneta: rename MVNETA_GMAC2_PSC_ENABLE to MVNETA_GMAC2_PCS_ENABLE
  x86: fix boot on uniprocessor systems
  Input: cypress_ps2 - don't report as a button pads
  Input: synaptics - add manual min/max quirk for ThinkPad X240
  Input: synaptics - add manual min/max quirk
  Input: mousedev - fix race when creating mixed device
  ext4: atomically set inode->i_flags in ext4_set_inode_flags()
  Linux 3.10.35
  sched/autogroup: Fix race with task_groups list
  e100: Fix "disabling already-disabled device" warning
  xhci: Fix resume issues on Renesas chips in Samsung laptops
  Input: wacom - make sure touch_max is set for touch devices
  KVM: VMX: fix use after free of vmx->loaded_vmcs
  KVM: x86: handle invalid root_hpa everywhere
  KVM: MMU: handle invalid root_hpa at __direct_map
  Input: elantech - improve clickpad detection
  ARM: highbank: avoid L2 cache smc calls when PL310 is not present
  ...

Change-Id: Ib68f565291702c53df09e914e637930c5d3e5310
Signed-off-by: Ian Maund <imaund@codeaurora.org>
2014-04-23 16:23:49 -07:00
Mohit Aggarwal d29ac67377 diag: Rename MSM8936 to MSM8939
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>
2014-04-20 22:52:04 -07:00
Linux Build Service Account 27bba8951a Merge "msm: modify build dependency for remote debugger" 2014-04-18 13:42:17 -07:00
Linux Build Service Account e5b2a80e59 Merge "diag: Make DCI change not to access info from a dangling pointer" 2014-04-15 18:04:39 -07:00
Linux Build Service Account 9ae21283de Merge "diag: Send response for download mode command" 2014-04-03 19:26:19 -07:00
Linux Build Service Account e191323452 Merge "diag: Check for valid proc id while querying real time status" 2014-04-03 19:26:11 -07:00
Linux Build Service Account 029a389a18 Merge "diag: Add support for MSM8939 QPST string" 2014-04-02 10:22:08 -07:00
Katish Paran d8c26e52ff diag: Check for valid proc id while querying real time status
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>
2014-04-02 16:26:00 +05:30
Aparna Das 5677be8d3d msm: modify build dependency for remote debugger
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>
2014-03-31 15:17:04 -07:00
Dixon Peterson 92a75946d8 diag: Make DCI change not to access info from a dangling pointer
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>
2014-03-28 19:54:14 -07:00
Linux Build Service Account cf0b97587c Merge "diag: Prevent memory leak when switching from Memory Device Mode" 2014-03-28 06:31:27 -07:00
Linux Build Service Account b198cb9af1 Merge "Merge upstream linux-stable v3.10.28 into msm-3.10" 2014-03-26 23:36:07 -07:00
Ravi Aravamudhan b89a95759c diag: Prevent memory leak when switching from Memory Device Mode
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>
2014-03-26 18:40:52 -07:00
Linux Build Service Account ea9550798c Merge "diag: Fix incorrect checks in diag driver" 2014-03-26 07:44:58 -07:00
Linux Build Service Account 64ffd8e594 Merge "diag: Copy limited data from and to the user space" 2014-03-26 07:44:42 -07:00
Katish Paran 45c1dc1a70 diag: Send response for download mode command
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>
2014-03-26 16:13:06 +05:30
Ian Maund f1b32d4e47 Merge upstream linux-stable v3.10.28 into msm-3.10
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>
2014-03-24 14:28:34 -07:00
Katish Paran 7f4272bf39 diag: Response for 0x7C command
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>
2014-03-24 11:28:25 +05:30
Linux Build Service Account e5708ab26f Merge "diag: Fix for sending responses in all modes" 2014-03-17 18:22:59 -07:00
Linux Build Service Account 1fe7c4164d Merge "diag: Update Diag over STM to support new command protocol" 2014-03-17 15:27:23 -07:00
Ravi Aravamudhan 04b773be39 diag: Fix for sending responses in all modes
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>
2014-03-17 11:32:38 -07:00
Mohit Aggarwal 84c2650865 diag: Add support for MSM8939 QPST string
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>
2014-03-17 15:05:31 +05:30
Linux Build Service Account 7a2b539ced Merge "diag: Remove invalid check for payload" 2014-03-12 20:10:40 -07:00
Linux Build Service Account e78d0510cc Merge "diag: Mode reset command has to be handled on APPS proc" 2014-03-12 20:10:06 -07:00
Dixon Peterson 9f8fdf1443 diag: Update Diag over STM to support new command protocol
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>
2014-03-11 20:20:10 -07:00
Linux Build Service Account 950f7be0de Merge "diag: Initialize SMD buffers only when needed" 2014-03-11 19:30:18 -07:00
Linux Build Service Account e9b7727683 Merge "diag: dci: Don't read from HSIC if previous read fails" 2014-03-11 19:28:48 -07:00
Ravi Aravamudhan fc9b6d6ea8 diag: Fix incorrect checks in diag driver
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>
2014-03-07 16:31:14 -08:00
Ravi Aravamudhan 90c7ecf3bc diag: Copy limited data from and to the user space
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>
2014-03-07 11:46:26 -08:00
Ravi Aravamudhan dfb6efa643 diag: dci: Don't read from HSIC if previous read fails
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>
2014-03-06 17:07:24 -08:00
Linux Build Service Account 6f4627c5f1 Merge "diag: Add changes to support 64 bit" 2014-03-06 07:39:28 -08:00
Dixon Peterson 823f0ce6e6 diag: Add changes to support 64 bit
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>
2014-03-04 17:35:11 -08:00
Linux Build Service Account 3575752ee4 Merge "diag: Create separate buffer for command responses" 2014-03-04 09:01:11 -08:00
Linux Build Service Account 0ce4968694 Merge "msm: ADSPRPC: Free interrupted contexts on device close" 2014-02-28 19:26:47 -08:00
Linux Build Service Account 7c14deb171 Merge "msm: ADSPRPC: Fix offset for input and output buffers" 2014-02-28 19:26:35 -08:00
Katish Paran 42f0e4a86c diag: Remove invalid check for payload
Call back data type does support commands which is less than
4 bytes in size. This patch removes the unnecessary check for
the call back data type.

Change-Id: Ie70196d8dd0b0b3d023bc2505fbb1cb3e582a1af
CRs-fixed: 623552
Signed-off-by: Katish Paran <kparan@codeaurora.org>
2014-02-27 17:43:12 +05:30
Ravi Aravamudhan 46f341037d diag: Initialize SMD buffers only when needed
Diag driver initializes SMD buffers during driver initialization
irrespective of the peripheral being present. Defer buffer
initialization to the channel probe function.

Change-Id: I251e705bc68b4f5fd9e698725b7a958dde8ce7fc
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2014-02-26 17:13:07 -08:00
Ravi Aravamudhan 9d92106b2b diag: Create separate buffer for command responses
Diag driver was using an exisiting SMD Modem buffer for encoding
command responses. Make changes to add a new buffer to avoid
stomping on modem data.

Change-Id: I88ad0a2785dd8eef74f7a866bf9b3525d371e1f7
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2014-02-26 16:50:42 -08:00
Mitchel Humpherys 75e174d326 msm: ADSPRPC: Free interrupted contexts on device close
The interrupted context list keeps track of all requests made
to the remote processor for which a response has not been
received and were interrupted by APPS processor. Free saved
contexts from interrupt list on device close to avoid memory leaks.

Change-Id: I5e4515b8d06d981a066a812a57242662b5bb82b9
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2014-02-26 14:04:38 -08:00
Mitchel Humpherys cc64d0e6b7 msm: ADSPRPC: Fix offset for input and output buffers
The buffers being passed to remote processor did not have
the right offset into the IOMMU VA for cases where the offset
was greater than 4K.

Change-Id: I32360a337ecbb9ebe3d33e5a6d680b1033945641
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2014-02-26 14:03:58 -08:00
Katish Paran 78176387eb diag: Mode reset command has to be handled on APPS proc
Mode reset command is handled by APPS proc. If the apps process
has not registered with diag for handling the mode reset command,
diag has to send error response code back. This patch fixes
that issue.

Change-Id: Id4d99f0e909fa3a78e8682825984a99042021bad
Signed-off-by: Katish Paran <kparan@codeaurora.org>
2014-02-26 12:53:16 +05:30
Sujeet Kumar af110c4d33 USB: mach: Move the mach headers to common location
As part of moving the headers from mach directory
to a common location compilation issues are arising.

Make the changes which are relevant for USB with
its own header files and also dependent header
files.

Change-Id: Ieef7d04ffdfda249f434e0676fec6da8d8b9cf2c
Signed-off-by: Sujeet Kumar <ksujeet@codeaurora.org>
2014-02-25 05:53:32 +05:30
Paul Bolle 5f32e4632c raw: test against runtime value of max_raw_minors
commit 5bbb2ae3d6f896f8d2082d1eceb6131c2420b7cf upstream.

bind_get() checks the device number it is called with. It uses
MAX_RAW_MINORS for the upper bound. But MAX_RAW_MINORS is set at compile
time while the actual number of raw devices can be set at runtime. This
means the test can either be too strict or too lenient. And if the test
ends up being too lenient bind_get() might try to access memory beyond
what was allocated for "raw_devices".

So check against the runtime value (max_raw_minors) in this function.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-22 12:41:27 -08:00
Linux Build Service Account 8ddd83e4f4 Merge "diag: Initialize Diag userspace client DCI masks on startup" 2014-02-22 04:29:30 -08:00
Linux Build Service Account 12ea28c725 Merge "diag: Remove diag sdio code references" 2014-02-22 04:29:18 -08:00
Linux Build Service Account ea3ffc28ef Merge "diag: Add status functionality to Diag over STM command" 2014-02-22 04:28:16 -08:00
Dixon Peterson a1b9379926 diag: Add status functionality to Diag over STM command
The Diag over STM command has been enhanced to include a
status capability. Add this functionality to Diag over
STM processing.

Also, the command code for Diag over STM has changed. Make
modifications to support the newly assigned command code.

Change-Id: I4314ea38b9feb5055a75a692b1b49dbd03a3211d
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
2014-02-21 11:30:41 -08:00
Linux Build Service Account 65bf875355 Merge "char: msm_smd_pkt: Add warning to driver removal function" 2014-02-19 19:57:07 -08:00
Dixon Peterson a8bc2f58a6 diag: Initialize Diag userspace client DCI masks on startup
Currently, when a diag userspace client app starts up, the
Diag kernel driver will update the app with the message, log
and event masks. However, the DCI log and event masks are not
updated in the app on startup. Make changes to ensure the DCI
log and event masks are updated in the app on startup.

Change-Id: I0ab6cf466c641b5e868024027d9d1c84474bd41f
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
2014-02-19 19:56:41 -08:00
Sreelakshmi Gownipalli 8fc2933007 diag: Remove diag sdio code references
Remove sdio code references from diag since sdio is not being used

Change-Id: I233bff6c180f0b2a121a8df8df4b5f899acb0835
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
2014-02-19 16:04:37 -08:00
Linux Build Service Account a735d5e147 Merge "msm: restart-header: support multiplatform" 2014-02-14 03:56:02 -08:00
Linux Build Service Account 20347c3a11 Merge "diag: Add checks in initialization functions" 2014-02-14 03:56:00 -08:00
Eric Holmberg 15e46a1c87 char: msm_smd_pkt: Add warning to driver removal function
The current implementation of smd_pkt_remove_driver does
not check to see if it has found the driver to be removed
in the module's list of drivers before attempting removal.

Add a flag that indicates whether or not the driver
was found in the list before removal is attempted. If
no driver is found, an error message is logged, and the
removal is not attempted.

Change-Id: If8bab26dc5f06ce9c4027945200d62a1a2902eeb
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
2014-02-13 18:41:58 -07:00
Linux Build Service Account 526b8cba65 Merge "Merge branch '8916-dev-phase2' into msm-3.10." 2014-02-13 17:19:37 -08:00
Abhimanyu Kapur 7282d50d1c msm: restart-header: support multiplatform
Upstream prefers existing drivers be converted to support
multiplatform kernels.  This requires drivers to be located
in generic functionality directories instead of specific
mach directories.

Move restart header to include/soc/qcom/restart.h to support multiplatform
and perform general cleanup.

Change-Id: I125f9ec67f9846919d00c0e0e89867cbb5f71702
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
2014-02-13 12:47:18 -08:00
Linux Build Service Account 63a8b922c7 Merge "diag: Add mutex protection while writing to smd" 2014-02-13 02:18:22 -08:00
Michael Bohan e61e87e40d Merge branch '8916-dev-phase2' into msm-3.10.
Merge the second phase of support needed for the 8916
target into msm-3.10. This includes a couple hundred upstream
patches for ARM64 support, as well as 8916 specific driver
development.

* origin/tmp-branch: (211 commits)
  ARM: dts: msmplutonium: Update the cpu release address
  Revert "arm64: Fix memory shareability attribute for ioremap_wc/cache"
  clocksource: arch_timer: Do not register arch_sys_counter twice
  xtensa: adjust boot parameters address when INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX is selected
  sched_clock: Add support for >32 bit sched_clock
  sched_clock: Use an hrtimer instead of timer
  sched_clock: Use seqcount instead of rolling our own
  clocksource: Extract max nsec calculation into separate function
  ARM: sched_clock: Load cycle count after epoch stabilizes
  sched_clock: Make ARM's sched_clock generic for all architectures
  of: move of_get_cpu_node implementation to DT core library
  of: introduce common FDT machine related functions
  of: Introduce common early_init_dt_scan
  mm: allow pgtable_page_ctor() to fail
  of: only include prom.h on sparc
  mm: introduce helper function mem_init_print_info() to simplify mem_init()
  mm: use a dedicated lock to protect totalram_pages and zone->managed_pages
  KVM: Move gfn_to_index to x86 specific code
  ARM: KVM: move GIC/timer code to a common location
  arm64: mm: Fix PMD_SECT_PROT_NONE definition
  ...

Conflicts:
	arch/arm/mach-msm/board-8226.c
	arch/arm/mach-msm/board-8610.c
	arch/arm64/kernel/asm-offsets.c
	arch/arm64/kernel/fpsimd.c
	arch/arm64/kernel/setup.c

Change-Id: I289996bc18d8a2782906e7db1171b48e3ee46a73
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
2014-02-12 19:06:33 -08:00
Ravi Aravamudhan 1cd84079b3 diag: Add checks in initialization functions
Diag driver has a set of services to initialize during driver
initialization. These initializations can fail leading to
incoherent state. Add checks to make sure that all the
services are initialized properly.

Change-Id: I831254894a69d1be1d388a6cc587a7f3bfc838d3
CRs-Fixed: 610301
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2014-02-12 12:34:58 -08:00
Jeff Hugo e432f9a642 msm: smd: Support multiplatform
Upstream prefers existing drivers be converted to support multiplatform
kernels.  This requires drivers to be located in generic functionality
directories instead of specific mach directories.

Move the smd and smsm drivers to the drivers/soc/qcom location to support
multiplatform.

Change-Id: I7f2e990341f0f34e336e71bd3b06a7c2a46d8bc1
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
2014-02-12 09:31:06 -07:00
Sreelakshmi Gownipalli 2429014a97 diag: Add mutex protection while writing to smd
Add mutex protection to diag ctrl channel to avoid concurrency
issues with smd_write() to the diag ctrl channel.

Change-Id: Ief0867584da558a7952e68757da324430af3c58a
CRs-Fixed: 587775
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
2014-02-12 16:33:28 +05:30
Martin Schwidefsky ac7df0d7c4 Remove GENERIC_HARDIRQ config option
After the last architecture switched to generic hard irqs the config
options HAVE_GENERIC_HARDIRQS & GENERIC_HARDIRQS and the related code
for !CONFIG_GENERIC_HARDIRQS can be removed.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Git-commit: 0244ad004a54e39308d495fee0a2e637f8b5c317
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[imaund@codeaurora.org: resolve merge conflicts]
Signed-off-by: Ian Maund <imaund@codeaurora.org>
2014-02-07 13:49:47 -08:00
AnilKumar Chimata 3ecdecf6ff hw_random: Add 64bit support for msm_rng driver
Add 64bit support for QUALCOMM random number generator driver.

Change-Id: I519ae5a79bf5df0ebbb5fbe810d8edcda87a2836
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
2014-02-07 13:48:03 -08:00
Ravi Aravamudhan a59ba3093c diag: Add reverse dependency to CRC_CCITT
Diag needs to select CRC_CCITT as it may not always be
explicitly enabled.

Change-Id: Ic9e71876261255f9d2ec9bf7f6010afbd2054f02
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2014-02-07 12:48:51 -08:00
Michael Bohan ccfeb3cba9 Merge commit 8916-dev into msm-3.10
Merge support needed for the ARM64 8916 target into msm-3.10.

* origin/tmp-b7dbbd5: (289 commits)
  arm: add pdev_archdata for dma_mask
  thermal: tsens: fix compilation warning
  msm: sps: remove sps header file
  defconfig: arm64: msm: enable gpio sysfs reporting
  arm64: Align CMA sizes to PAGE_SIZE
  msm: ipa: add 64-bit support for IPA
  defconfig: msm: Enable IPC Router and QMI kernel interface
  msm: kgsl: Implement ioctl_rb_issueibcmds for compat
  msm: rndis_ipa: add support for 64 bit
  msm: ecm_ipa: add support for 64 bit
  ARM: dts: msm: Add SPI clocks for QUP1 on plutonium.
  ARM: dts: msm: Configure SPI on plutonium QUP1.
  msm: ipa: set dma mask of IPA device
  msm: ipa: add support for compat_ioctl
  msm: ipa: move out of mach tree
  arm: dts: msm8916: Change property for CMA regions
  arm64: Change type of dma_{alloc,free}_from_contiguous
  msm: kgsl: manage active count for perfcounter read compat ioctl
  ion: msm: Add custom compat ioctl
  ion: Add custom_compat_ioctl
  ...

Conflicts:
	arch/arm/mach-msm/Kconfig
	drivers/platform/msm/ipa/teth_bridge.c

Change-Id: I2e5ebfd104d72a91191fef6de33e107399c17938
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
2014-02-06 13:29:57 -08:00
Peter Huewe 2e59688b75 tpm/tpm_ppi: Do not compare strcmp(a,b) == -1
commit 747d35bd9bb4ae6bd74b19baa5bbe32f3e0cee11 upstream.

Depending on the implementation strcmp might return the difference between
two strings not only -1,0,1 consequently
 if (strcmp (a,b) == -1)
might lead to taking the wrong branch

-> compare with < 0  instead,
which in any case is more canonical.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-06 11:08:15 -08:00
Peter Huewe 9bf4d6c3c3 tpm/tpm_i2c_stm_st33: Check return code of get_burstcount
commit 85c5e0d451125c6ddb78663972e40af810b83644 upstream.

The 'get_burstcount' function can in some circumstances 'return -EBUSY' which
in tpm_stm_i2c_send is stored in an 'u32 burstcnt'
thus converting the signed value into an unsigned value, resulting
in 'burstcnt' being huge.
Changing the type to u32 only does not solve the problem as the signed
value is converted to an unsigned in I2C_WRITE_DATA, resulting in the
same effect.

Thus
-> Change type of burstcnt to u32 (the return type of get_burstcount)
-> Add a check for the return value of 'get_burstcount' and propagate a
potential error.

This makes also sense in the 'I2C_READ_DATA' case, where the there is no
signed/unsigned conversion.

found by coverity
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-06 11:08:15 -08:00
Jeff Hugo e038f1f962 char: msm_smd_pkt: Add compat ioctl support
Add compat ioctl support for userspace applications that require it.

Change-Id: I14caffb126e10c508b8e5fb888bab8c6ef5bbf2a
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
2014-02-05 09:34:04 -08:00
Mohit Aggarwal ce9bbd5d9b diag: Add support for MSM8916 QPST string
MSM8916 is a new device. Add diag support for sending
appropriate model number for MSM8916 so that QPST
can display the appropriate string.

Change-Id: Ie19cd3893ebbf8f9419a4a4b40833c51553ae527
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
2014-02-05 09:33:42 -08:00
Ravi Aravamudhan bf19cefde2 diag: Change data type of DCI client ID
Make changes to change the type of DCI client id from uint32 to
int as it can now take negative values.

Change-Id: I2e3e76b0188d9504c9a7f82007fbc6f944fc155f
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2014-02-04 13:08:03 -08:00
Jeff Hugo 087d698af7 msm: smd: Add probe deferral support
SMD APIs may be called before probe() has a had a chance to initialize
the driver.  In such cases, EPROBE_DEFER should be returned to the caller
to indicate SMD needs more time to probe.

Change the public APIs to detect the current status of probe() and return
EPROBE_DEFER if necessary.

Change-Id: I243f56c3aa6afdce22192f17bcbae9377242d116
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
2014-02-03 15:09:10 -07:00
Linux Build Service Account 07cfe2e325 Merge "diag: Change format used for printing pointers" 2014-01-31 18:14:24 -08:00
Linux Build Service Account 0c19dfd38e Merge "diag: dci: Add dci bridge information to debugfs" 2014-01-31 18:14:15 -08:00
Xiaocheng Li 5f441c883e msm: socinfo: Support multiplatform
Upstream prefers existing drivers be converted to support multiplatform
kernels.  This requires drivers to be located in directories that
contain generic functionality instead of specific mach directories.
Move the socinfo driver into drivers/soc/qcom and update the initcall
levels to satisfy dependencies.

Change-Id: If195cd793d84867d371f25136a88f2a7ce239500
Signed-off-by: Xiaocheng Li <lix@codeaurora.org>
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
2014-01-30 19:08:34 -08:00
Linux Build Service Account 2101193482 Merge "diag: Add new polling command" 2014-01-28 23:38:11 -08:00
Linux Build Service Account d250855f84 Merge "diag: Change switch logging ioctl to use a pointer" 2014-01-28 23:36:51 -08:00
Linux Build Service Account e6171f8378 Merge "msm: Move PIL and SSR headers" 2014-01-28 23:35:35 -08:00
Ravi Aravamudhan cc64a1ef0d diag: dci: Add dci bridge information to debugfs
DCI bridge contains information about the DCI HSIC channels. Add
DCI HSIC channel statistics to debugfs

Change-Id: I42c69577bf891768ea0ea2cff87e867697e5a975
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2014-01-28 16:54:10 -08:00
Dixon Peterson ae92f0b235 diag: Change switch logging ioctl to use a pointer
Currently the switch logging ioctl passes the requested mode
by value. change the passing of the requested mode to use a pointer.

Change-Id: I58302e2faaa714d2cf394a6f52a731a3e3645485
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
2014-01-28 11:27:21 -08:00
Vikram Mulukutla bd91122223 msm: Move PIL and SSR headers
Architectural changes in the ARM Linux kernel require moving
some MSM specific headers related to the peripheral image
loader and the subsystem restart drivers to include/soc/qcom.

subsystem_restart.h is used by external modules and thus
leave a proxy in include/soc/qcom for now. Once external modules
switch over to this new include path, the header in the
old location can be deleted.

Change-Id: I0680dc34481d09170ce2609259c5318a9e6dbf37
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
2014-01-27 19:08:06 -08:00
Ravi Aravamudhan be4ccae9ca diag: Change format used for printing pointers
Currently, when printing a pointer address the format does not
take advantage of using the pointer conversion specifier. Make
changes to use the pointer conversion specifier.

Change-Id: I27fd10c33952de9e44066c15256c7f29df6c4dd8
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2014-01-27 16:17:21 -08:00
Ravi Aravamudhan c0607e385e diag: Add new polling command
Diag driver should now support a new polling command for the tools
to recognize the target.

Change-Id: Ia7966cc74c5c74693cebfd64b178831e5ca6f2dd
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2014-01-27 16:06:29 -08:00
Ravi Aravamudhan ad2844d8ff diag: dci: Extend DCI support to remote processors
DCI is now supported on the remote processors. Make changes to
the DCI logic in diag driver to allow clients to register with
remote processors for diag data.

Change-Id: I15dc4b63f2d8fa4e7a1f4f2307b25a5dcddfaa1a
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2014-01-27 11:55:46 -08:00
Linux Build Service Account 2dc179c82f Merge "diag: Fix for diag debugfs buffer overflow" 2014-01-25 16:23:39 -08:00
Ravi Aravamudhan 92395bbf90 diag: dci: Add support for new HSIC channel for DCI data
A new HSIC channel was created to handle DCI traffic between the
Apps processor and the remote processors. This patch adds support
to utilize this new channel for DCI data.

Change-Id: I0764ffb430c5b6b1ffe12e94b165d7b1cfab575f
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2014-01-23 18:43:34 -08:00
Linux Build Service Account 04f75bd446 Merge "msm: ADSPRPC: Change driver initialization to late_initcall" 2014-01-23 03:23:26 -08:00
Linux Build Service Account 479e357319 Merge "msm: ADSPRPC: Add MSM SMD dependency" 2014-01-23 03:23:24 -08:00
Mitchel Humpherys 52c4c97021 msm: ADSPRPC: Change driver initialization to late_initcall
The driver depends on MSM IOMMU subsystem driver to be initialized
first to get the domain information. Move the initialization phase
of the driver to late_initcall so that the dependent drivers get
initialized first.

Change-Id: Id9524f09f21110aa7539434e9febdd2b84361f9d
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2014-01-21 10:19:44 -08:00
Mitchel Humpherys 426711262b msm: ADSPRPC: Add MSM SMD dependency
Update the dependency where communication to remote processors
happen over SMD channels.

Change-Id: I77d24058906f4560d5c9819021bf40cbcd49e249
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2014-01-21 10:19:44 -08:00
Jeff Hugo 3006e5bb92 char: msm_smd_pkt: Use correct printk format specifier for size_t
%zu is the correct printk format specifier when printing size_t types.

Update printks to use %zu for size_t type variables.

Change-Id: Iac5d30ee4873c0e660a5166068d17ef4c459df0e
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
2014-01-18 13:56:05 -07:00
Jiang Liu a771213d2f ACPI / TPM: fix memory leak when walking ACPI namespace
commit df45c712d1f4ef37714245fb75de726f4ca2bf8d upstream.

In function ppi_callback(), memory allocated by acpi_get_name() will get
leaked when current device isn't the desired TPM device, so fix the
memory leak.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-15 15:28:52 -08:00
Sreelakshmi Gownipalli 36503d639c diag: Fix for diag debugfs buffer overflow
Diag debugfs buffer has potential buffer overflow scenario which can cause
memory corruption. Added safeguard to prevent this.

Crs-fixed: 585147
Change-Id: Ie1f099bb4bb626adff99ae225966aef70c1bc15e
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
2014-01-15 12:41:13 -08:00
Mitchel Humpherys 975b1bb5c6 msm: ADSPRPC: Always map buffers into IOMMU if one is present
If the buffers are not mapped into IOMMU and the physical address
is passed to remote processor, then it could result in IOMMU faults
if the passed physical address falls in the IOMMU virtual address
range. Map all buffers into IOMMU if one is present and do not pass
the physical address directly to the remote processor.

Change-Id: Id567ac4bff16f49487439d1d505dd25b88ed2868
Acked-by: Sathish Ambley <sambley@qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2014-01-13 14:26:25 -08:00
Linux Build Service Account 091bff5fb2 Merge "diag: Safeguard for bound checks and integer underflow" 2014-01-09 10:33:41 -08:00
Linux Build Service Account 476d3b16b5 Merge "diag: dci: Index DCI client table by client ID" 2014-01-09 06:23:07 -08:00
Linux Build Service Account ed8b523eeb Merge "char: msm_smd_pkt: Return correct error code for bad ioctls" 2014-01-08 16:42:39 -08:00
Ravi Aravamudhan 2c9dd037e1 diag: dci: Index DCI client table by client ID
Diag driver maintains a table of all DCI clients. This table
is currently indexed by the PID of the clients. Make changes to
index the table based on an unique client ID.

Change-Id: I28a95aac3aa47b1c35190f3048bbd9103c884adb
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2014-01-08 16:09:12 -08:00
Katish Paran 75eac48a48 diag: Safeguard for bound checks and integer underflow
At certain point in diag driver there can be integer underflow
and thus can lead to memory leak. Bound checks are placed to
ensure correct behavior of condition statements.

Change-Id: I47e02f764c2c7412db6f90fd42192fee32a761d3
CRs-fixed: 549470
Signed-off-by: Katish Paran <kparan@codeaurora.org>
2014-01-07 11:02:52 -08:00
Linux Build Service Account f3d051330c Merge "diag: dci: Add DCI command response support on APSS" 2014-01-07 08:50:30 -08:00
Jeff Hugo 9660d3f810 char: msm_smd_pkt: Return correct error code for bad ioctls
Unsupported ioctl commands should return -ENOIOCTLCMD which is translated
to -ENOTTY for userspace.  msm_smd_pkt incorrectly returns -EPERM for bad
ioctls.  Correct the return code for bad ioctls to -ENOIOCTLCMD.

Change-Id: I6d60f4dfc99d4e381ee8105dfb7bd1b9a3ee320b
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
2014-01-06 16:08:33 -07:00
Ravi Aravamudhan ac10fd2a59 diag: dci: Add DCI command response support on APSS
Add support to enable clients to send command requests registered
on the Apps processor through DCI. It also handles dedicated
commands that are handled exclusively by the Apps processor.

Change-Id: I8bea5cbe9f787ef7213bb4d995bb0ab68a06dab2
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2014-01-06 10:54:33 -08:00
Linux Build Service Account 08a9c39ed8 Merge "diag: dci: Preventing uninitialized stack memcpy operation" 2014-01-06 09:00:13 -08:00
Linux Build Service Account dbb60eb7dd Merge "diag: dci: Filter commands for DCI clients" 2013-12-27 14:24:21 -08:00
Linux Build Service Account 9ef6275479 Merge "usb: gadget: Remove usb_diag_free_req() API" 2013-12-27 02:30:10 -08:00
Asish Bhattacharya de06bb1c13 msm: qdsp6v2: reorganize kernel driver under misc drivers.
This is needed as the drivers are registering under misc driver
but exists under arch/arm/mach

Change-Id: I9cd75901184a4fdff6f796019152bc6e29eed6c3
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
2013-12-24 11:11:10 +05:30
Linux Build Service Account 009db33574 Merge "diag: Fix incorrect smd_info check" 2013-12-23 15:42:35 -08:00
Saket Saurabh 55efcddef2 usb: gadget: Remove usb_diag_free_req() API
Freeing USB requests either as part of cable disconnect or in unbind
case, both doesn't depends on diag driver to initiate usb free request
using usb_diag_free_req(). Freeing of USB request as part of cable
disconnect is handled in the code by freeing the USB requests in next
cable connect. In unbind case, usb requests are freed in usb driver
before releasing reference to usb diag device context.

Although freeing of usb request is taken care in usb driver, but it
is seen in few regression testing that calling usb_diag_free_req()
from diag is leading to synchronization issues. As USB doesn't depend
on the diag driver to initiate usb free request using API
usb_diag_free_req(), hence remove API usb_diag_free_req() from code.

CRs-Fixed: 583730
Change-Id: I990f6c07ef28e767040cc959d0addf8ab413d1d1
Signed-off-by: Saket Saurabh <ssaurabh@codeaurora.org>
2013-12-23 17:36:51 +05:30
Linux Build Service Account 186d3862bb Merge "Revert "diag : Safeguard for bound checks and integer underflow"" 2013-12-20 17:00:07 -08:00
Ravi Aravamudhan 9aec7640a3 diag: Fix incorrect smd_info check
Diag driver checks if the smd_info object is NULL in an incorrect
way. This patch adds the proper check.

Change-Id: I8385b38005ddd32d13a2876f82ffa569d84ff882
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-12-20 11:07:05 -08:00
Ravi Aravamudhan 00b7d94c5d Revert "diag : Safeguard for bound checks and integer underflow"
This reverts commit bd379d7c08 in
which Diag driver is trying to access a variable incorrectly when
reading data from userspace.

Change-Id: I95f1f94ec0f2caf789f969325d343d1052ee9dc8
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-12-19 16:04:04 -08:00
Jeff Hugo 8c6ad7740d msm: smd: Remove dead code
Remove the following dead functionality:

Package configuration (MSM_SMD_PKG3/MSM_SMD_PKG4)
	All supported targets are Package 4 based, making Package 3
	unsupported and any code depending on it.

MSM_N_WAY_SMD
	All supported targets are n-way SMD.  This config is always true.

MSM_N_WAY_SMSM
	All supported targets are n-way SMSM.  This config is always true.

Legacy loopback
	Legacy loopback is unsupported and unused.

Legacy initialization (static and platform data)
	All supported targets use DT based initialization.

SMD wait until readable/writable API
	Unsupported and always excluded with a "#if 0" compiler statement

Unused SMSM bit definitions

SMSM/SMD interrupt muxing
	Muxing SMSM and SMD interrupts on the same irq line is unsupported
	and unused.

Legacy modem reset
	Legacy modem reset is unsupported and replaced by Subsystem Restart.

DEM support
	DEM is unsupported and unused.

Legacy SMD channel types
	All SMD channels are explictly identified as streaming or packet
	mode.

Change-Id: I358f0d084d61c01731ad6006ea2e6e4f9e6915a9
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
2013-12-19 08:54:50 -08:00
Jeff Hugo acd001a746 msm: smd_pkt: Support multiplatform
Upstream prefers existing drivers be converted to support multiplatform
kernels.  This requires drivers to be located in generic functionality
directories instead of specific mach directories.

Move the smd_pkt driver to the drivers/char location to support
multiplatform.

Change-Id: I0a05d27171a47a985cb5934d0df1d982b7cbc139
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
2013-12-13 16:22:03 -07:00
Linux Build Service Account bb1d811314 Merge "diag : Safeguard for bound checks and integer underflow" 2013-12-13 03:27:55 -08:00
Linux Build Service Account 521bc983c1 Merge "diag: Fix improper handling of Diag real time vote IOCTL" 2013-12-12 17:38:10 -08:00
Ravi Aravamudhan d57929369a diag: dci: Filter commands for DCI clients
Mask configuration commands shouldn't be allowed through DCI. Add
checks in the diag driver to filter those commands.

Change-Id: I3092586fc375cb11340a08855d5a96d87ab81872
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-12-12 14:41:48 -08:00
Katish Paran bd379d7c08 diag : Safeguard for bound checks and integer underflow
At certain point in diag driver there can be integer underflow
and thus can lead to memory leak. Bound checks are placed to
ensure correct behaviour of condition statements.

Change-Id: I461aafe20d641766dddec86d86793b1aa2f2ab6b
CRs-fixed: 549470
Signed-off-by: Katish Paran <kparan@codeaurora.org>
2013-12-13 00:35:36 +05:30
Linux Build Service Account 1e1facfd90 Merge "diag: dci: Remove the cap on number of delayed rsp registrations" 2013-12-12 00:09:41 -08:00
Linux Build Service Account 74533b8859 Merge "iommu: msm: Move iommu_domains out of mach-msm" 2013-12-12 00:08:56 -08:00
Alan Cox c899b3f0e2 drivers/char/i8k.c: add Dell XPLS L421X
commit 9aa5b0181bdf335f0b731d8502e128a862884bcd upstream.

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=60772

Signed-off-by: Alan Cox <alan@linux.intel.com>
Reported-by: Leho Kraav <leho@kraav.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-11 22:36:29 -08:00
Katish Paran 9a54e123fa diag: dci: Preventing uninitialized stack memcpy operation
At certain point in diag driver there can be memcpy operation
for the uninitialized stack. Due to uninitilization of memory
user can obtain valuable information on accessing this stack
in userspace. This patch fixes that issue.

Change-Id: I4bfcf156300132dc426dcadce325e0c76c1d0357
CRs-fixed: 565808
Signed-off-by: Katish Paran <kparan@codeaurora.org>
2013-12-11 15:42:27 +05:30
Ravi Aravamudhan 4d28dff2fd diag: Fix improper handling of Diag real time vote IOCTL
Diag driver continues to process data copied from user space even
when it is invalid. Make changes to return from the function when
this happens.

Change-Id: Ieae335c908615dc63b977b7253b0d219e7db600e
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-12-10 20:07:23 -08:00
Laura Abbott 3bd8ec73d4 iommu: msm: Move iommu_domains out of mach-msm
The iommu_domain code isn't really MSM specific and is better suited
to live in the iommu directory. Move it accordingly.

Change-Id: Ie88b4aba6901722166bb180275d352b745821772
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-12-10 18:18:45 -08:00
Ravi Aravamudhan ae7170bae2 diag: dci: Remove the cap on number of delayed rsp registrations
Currently, diag driver allows a definite number of command
registrations. This limit can be reached easily since we don't
delete delayed rsp cmd registrations. Make changes to allow
any number of cmd-rsp registrations and to remove delayed rsp
cmd registrations after receiving its corresponding last rsp.

Change-Id: Ia62bb3cf8a1359568c2579acee490ec2b246ee75
CRs-Fixed: 583922
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-12-09 19:04:54 -08:00
Mitchel Humpherys 9b58eaab6c msm: ADSPRPC: Save and restore contexts when interrupted
While a RPC session is in progress, wait could get interrupted
as a result of device entering power collase and the system call
retried once the device leaves power collapse. This requires that
the RPC session context is saved and restored across these
interrupts to avoid duplicate invocations being sent across to
the remote processor.

Change-Id: I71141c13da7be3d33e13305e0744148921123160
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2013-12-06 17:56:11 -08:00
Mitchel Humpherys 6e97416653 msm: ADSPRPC: Add mappings to IOMMU for remote heap
The remote heap buffers need to be mapped and unmapped in
the IOMMU when SMMU is present on the remote processor.

Change-Id: I9d78e1098a4163109dbde4c23681be4cfb8a353a
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2013-12-06 17:55:32 -08:00
Linux Build Service Account fb5d34bcc6 Merge "diag: Send non real time control packet to all peripherals" 2013-12-04 19:31:02 -08:00
Linux Build Service Account b8b36756eb Merge "diag: Change format used for printing pointers" 2013-12-04 06:48:33 -08:00
Linux Build Service Account 8811f94761 Merge "diag: dci: DCI setting event_config variable incorrectly" 2013-12-04 06:48:15 -08:00
Linux Build Service Account 210f6faee0 Merge "diag: Do not write to USB when usb is disconnected" 2013-12-04 04:27:52 -08:00
Linux Build Service Account b39223f9be Merge "diag: Fix get event mask command response" 2013-12-04 04:27:41 -08:00
Ravi Aravamudhan 6dc2e287b2 diag: Send non real time control packet to all peripherals
Non real time mode of logging data was earlier supported on limited
peripherals. It is now supported on all peripherals. Diag driver
now sends the switching information to all ther peripherals.

Change-Id: I28cd83a14e86a561bacc14bc0435fc4be9bfe810
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-12-03 18:19:12 -08:00
Dixon Peterson 0911ca4da7 diag: Change format used for printing pointers
Currently, when printing a pointer address the format does
not take advantage of using the pointer conversion specifier.
Make changes to use the pointer conversion specifier.

Also, the read and write of the file_operations structure
is not returning the correct data type. Make changes so these
functions return the appropriate data type.

Change-Id: I921a4db21ad833439f5bf8994fa42974e2d70c96
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
2013-12-03 16:48:07 -08:00
Mohit Aggarwal 471046e49c diag: diag over uart not working for QSC
On executing diag_uart_log app with QSC option
switching is not happening. On the other hand, MSM
switching is working fine. Added changes in order
to allocate memory to user space data type buffer
during diag char initialization.

Change-Id: I8afd79017e543b088381fd70c2a585f6c0c2ca1e
CRs-Fixed: 576830
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
2013-12-03 14:23:56 +05:30
Ravi Aravamudhan 090ec8dd64 diag: Do not write to USB when usb is disconnected
Diag driver tries to write to the USB from different workqueues.
The connect and the disconnect events happen in a different
workqueue. This can lead to a race conditon in setting the SMD
in_busy variables resulting in continuous reads, thereby queueing
up a lot USB writes. This patch protects the SMD in_busy
variables and reduces the latency of USB connect and disconnect
events.

Change-Id: Ia09a67c963749237c5e7471a5a9d3e2736c09c06
CRs-Fixed: 564562
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-12-02 19:17:32 -08:00
Mohit Aggarwal 661f80316c diag: dci: DCI setting event_config variable incorrectly
Diag driver is always setting event_config variable to 1
on DCI channel due to which diag_masks_enabled API is
returning TRUE even when all the event masks are 0. This
patch sets event_config variable to 0 when all the event
masks are 0.

Change-Id: Iafe20c5b785ef6e31db531ad4fc5663f54dceb48
CRs-Fixed: 572884
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
2013-11-28 11:09:35 +05:30
Linux Build Service Account 4e001b3686 Merge "msm: reap unused kernel files" 2013-11-22 21:09:56 -08:00
Dixon Peterson ede2862df9 diag: Fix get event mask command response
Currently, the response to the get event mask command returns
all 0's in its mask portion of the response. Fix the get event
mask response so that it returns the correct data.

Change-Id: Ie398e6a5c77c47aea10c05b9a5a28508559b2556
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
2013-11-22 18:30:37 -08:00
Ian Maund f06163e6d0 msm: reap unused kernel files
This change removes source files from the kernel tree that
were not being used during make. The list of used files
was generated using an annotated make log and was then
compared with new files added since the public release of
kernel version 3.10.00. New files which were added but
not used have been removed from the tree.

A diff was also run to determine the list of files that had
been modified since the release of kernel version 3.10.00.
These files were then scrubbed based on the current kernel
configuration, removing invalid and unused conditionals.

Some files which support planned functionality or are
useful in debugging have been excluded from this reap.

Change-Id: Ia44a224d3cea7bc78dd45e8a8279860d35d4b008
Signed-off-by: Ian Maund <imaund@codeaurora.org>
2013-11-21 17:45:28 -08:00
Jeff Hugo 985046c4e3 msm: smem: Rename smem_find_to_proc() to smem_find()
smem_find_to_proc() is the preferred function for locating SMEM items,
but its name is quite verbose with little added benefit to clients.  Rename
smem_find_to_proc() to smem_find() as smem_find() succinctly describes
the purpose of the function.

Change-Id: I8d7a78a6f6226d9e15e9f69e8194fcdaf5c7d8fe
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
2013-11-20 22:09:26 -07:00
Jeff Hugo fce9f5df5f msm: rdbg: Use smem_find_to_proc()
smem_find() is deprecated.  Use the replacement function,
smem_find_to_proc(), instead.

Change-Id: Ie491c019e6a38de7c9eaaa1f59edaeed048db552
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
2013-11-20 22:06:28 -07:00
Mitchel Humpherys 7d1e7b4275 msm: ADSPRPC: Support for RPC to multiple DSP processors
Open separate channels to each DSP processor based on the
file descriptor to support remote procedure calls to
multiple DSP processors.

Change-Id: I9c51d15b38eef67ccc38fc6dd0867d8256fbbdf6
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2013-11-15 11:01:44 -08:00
Mitchel Humpherys dcd264cf1a msm: ADSPRPC: Remove scatterlist validation
The buffers allocated by ION for ADSP/AUDIO heap would be
physically contiguous and no additional checks are required
to validate this.

Change-Id: Ib54aaf6c18448d18d0a22dac0ddab50a0ab4f493
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2013-11-15 11:01:43 -08:00
Mitchel Humpherys 588ff4da81 msm: ADSPRPC: Update driver to be part of kernel image
Remove the default to enable the driver to be built as
part of the kernel image.

Change-Id: I3e18aa5bc34cf1451a982bdc4c3f717e905793c8
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2013-11-15 11:01:43 -08:00
Mitchel Humpherys 2f754b5fcd msm: ADSPRPC: Close SMD channel after RPC session ends
The SMD channel open request needs to be delayed as the
remote processor may not be up early on when the driver
is initialized. The SMD channel is opened when the first
RPC session is opened and closed when the last RPC
session ends.

Change-Id: I0bbff2956c3e367312d4344107340feb29e643ab
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2013-11-15 11:01:42 -08:00
Laura Abbott d07d023c19 gpu: ion: Remove mach/ion.h
This file is now mostly useless. Move the remaining defintions elsewhere
and cleanup the cruft.

Change-Id: Icc19f9138a0d9d24a466511d69bc0eed45789fb9
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-11-13 09:33:05 -08:00
Linux Build Service Account 6f27f0a60a Merge "msm: rdbg: Use smem_find()" 2013-11-12 19:50:57 -08:00
Linux Build Service Account 6c6caea706 Merge "diag: dci: Retrieve limited information for registration" 2013-11-11 22:15:45 -08:00
Linux Build Service Account 1c62c3f91a Merge "diag: dci: Extend DCI support to LPASS" 2013-11-11 22:15:42 -08:00
Linux Build Service Account f37fcd74d3 Merge "diag: dci: Add additional buffers to process DCI data" 2013-11-11 22:15:41 -08:00
Linux Build Service Account a80d496d67 Merge "msm: remove include of <asm/mach-types.h> and <asm/system.h>" 2013-11-11 16:20:46 -08:00
Ravi Aravamudhan f215543990 diag: dci: Retrieve limited information for registration
Diag driver copies registration information from userspace clients.
This patch limits the data that is copied from the user space.

Change-Id: Ida9c0fa74cb022e8202dc752685ce47211e81417
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-11-08 13:35:43 -08:00
Ravi Aravamudhan b558593f3f diag: dci: Extend DCI support to LPASS
Diag on LPASS has added support for DCI. Add support for DCI logs,
events and command response to the clients on the APSS.

Change-Id: I1b72de1a942f0965e5c75f9059e66ab61e8d7c91
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-11-08 13:35:33 -08:00
Jeff Hugo dfd546c34c msm: rdbg: Use smem_find()
smem_alloc() is deprecated.  Use the replacement function, smem_find(),
instead.

Change-Id: I8274072f04dff62d84377831840c4ca547860009
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
2013-11-08 13:21:58 -07:00
Linux Build Service Account 9954a938fb Merge "diag: Handle Mutexes correctly in the case of Callback data" 2013-11-08 02:49:13 -08:00
Linux Build Service Account ec0ef7cba2 Merge "diag: Change implementation of diag log masks" 2013-11-08 02:47:54 -08:00
Linux Build Service Account 5617ea30f8 Merge "diag: dci: Use smd_named_open_on_edge()" 2013-11-08 00:01:00 -08:00
Ravi Aravamudhan 751eca2667 diag: Change implementation of diag log masks
Currently, the structure of diag log masks can lead to buffer
corruption when there is huge different between the log masks
of the Apss processor and the peripherals. Make changes to
log masks to be of constant size.

Change-Id: I9920bbcc19e75c10ec7267808c9fc4afaafeff5b
CRs-Fixed: 556401
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-11-07 13:52:01 -08:00
Ravi Aravamudhan 7d848ce349 diag: dci: Add additional buffers to process DCI data
DCI clients have only one buffer to store the data and the copy to
user space is synchronous. Have multiple buffers to process incoming
DCI data and copy it to the user space asynchronously. Also generalize
the buffer handling for different DCI processors.

Change-Id: I74db4d49167b4a7e1febd857a5bb49fe77486bb7
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-11-06 16:52:41 -08:00
Jeff Hugo 08781af6f9 diag: dci: Use smd_named_open_on_edge()
smd_open is depreciated.  Use the replacement function,
smd_named_open_on_edge(), instead.

Change-Id: I668273e2e611f1b3a85245e150254c4d3ccfd923
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
2013-11-05 16:01:11 -07:00
Kumar Gala f629ba6d5b msm: remove include of <asm/mach-types.h> and <asm/system.h>
Upstream has removed <asm/system.h> so remove it from legacy uses.  As all
the platforms we support utilize device tree we no longer need to include
<asm/mach-types.h>.

Change-Id: I8e53b1fd96ad26711fae59f081a8892f8bb184b7
Signed-off-by: Kumar Gala <galak@codeaurora.org>
2013-11-04 13:59:18 -06:00
Linux Build Service Account 7ed0de699e Merge "diag: dci:Safeguard to prevent Integer Underflow and Memory Leak" 2013-11-04 11:56:20 -08:00
Linux Build Service Account d76bb18b83 Merge "diag: dci: Safeguard to prevent Integer overflow" 2013-11-01 20:47:58 -07:00
Linux Build Service Account 926dc4afb1 Merge "msm: ADSPRPC: Do not release rpc session when interrupted" 2013-11-01 20:47:41 -07:00
Linux Build Service Account b84a0e2db1 Merge "msm: ADSPRPC: Add checks for erroneous values" 2013-11-01 20:47:40 -07:00
Katish Paran 144dc50c75 diag: dci: Safeguard to prevent Integer overflow
At certain point in diag driver there can be integer overflow
thus can lead to memory leak. Added a safeguard for it.

Change-Id: I80a9cd0623ebb84d82cf74de132211b1dd60c7d4
CRs-fixed: 565160
Signed-off-by: Katish Paran <kparan@codeaurora.org>
2013-10-30 14:53:49 +05:30
Linux Build Service Account 3557a24a7e Merge "diag: NRT read wakelocks held for very long time" 2013-10-29 17:25:59 -07:00
Linux Build Service Account d52907feb4 Merge "diag: Potential Null Pointer Dereference of user buf" 2013-10-29 04:29:03 -07:00
Linux Build Service Account 9d6f5b3d9c Merge "msm: add support for remote debugger driver" 2013-10-28 15:37:57 -07:00
Linux Build Service Account eefbff7003 Merge "msm: ADSPRPC: Use module specific class name" 2013-10-28 15:37:52 -07:00
Mohit Aggarwal 42cf0a9542 diag: NRT read wakelocks held for very long time
During on-device logging with '-b' option,
NRT read wakelocks i.e. diag_nrt_modem_read
and diag_nrt_wcnss_read were held for more than
a day's time. This patch releases the wakelocks
even if SMD channel will be closed.

Change-Id: I7d211aaeaeb8d59369a191c5eef54c02a1b4a61d
CRs-Fixed: 513309
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
2013-10-28 12:28:13 +05:30
Mitchel Humpherys a30d8d0424 msm: ADSPRPC: Do not release rpc session when interrupted
Release the RPC session only when the file handle is closed
and not release it when interrupted. It is possible for the
completion to be interrupted in power collapse scenarios
when the tasks are frozen.

Change-Id: Ib507c6ada624bb68c0e6aa798f0ca76c3213af65
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2013-10-25 12:18:22 -07:00
Mitchel Humpherys 89f2bcf1ac msm: ADSPRPC: Add checks for erroneous values
Check for invalid parameters passed in user invocation
and validate the return values using appropriate macros.

Change-Id: If529873d025ac0c13725efbedda5a58fae327722
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2013-10-25 12:18:00 -07:00
Mitchel Humpherys 74a622d66a msm: ADSPRPC: Use module specific class name
Update the class name passed during class creation to match the module
rather than use a generic one. If another driver uses this same generic
name then the class creation would fail.

Change-Id: I33d7527e27c56fd943c93f823d99d244e2348319
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2013-10-25 12:17:08 -07:00
Aparna Das 903f97d074 msm: add support for remote debugger driver
The Remote Debugger Driver allows a debugger running on host PC to
communicate with a remote stub running on peripheral subsystems by
implementing a shared memory based transport mechanism. Add support
for the driver.

Change-Id: I0c8a498682d224ee5d5a275c228a75939675095b
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>
2013-10-25 08:15:13 -07:00
Katish Paran 0fb58b671e diag: dci:Safeguard to prevent Integer Underflow and Memory Leak
At certain point in diag driver there can be integer underflow
thus can lead to memory leak. Added a safeguard for that.

Change-Id: Ic4d97df62d3f65566ffa6d2d7daa35f4485e3f2c
CRs-fixed: 556860
Signed-off-by: Katish Paran <kparan@codeaurora.org>
2013-10-25 13:20:31 +05:30
Dixon Peterson c0dc9a562d diag: Fix feature mask received check
Currently, there is an array index out of bounds condition when
checking if the feature mask has been received from a peripheral
yet. Fix the check to prevent array index out of bounds.

CRs-Fixed: 564309
Change-Id: I38ea1584cdd3121c0981c247fe9ded37881b7f7a
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
2013-10-24 21:12:43 -07:00
Ravi Aravamudhan c2149c7f8e diag: Handle Mutexes correctly in the case of Callback data
Diag driver grabs a mutex incorrectly when processing data from the
callback process leading to a deadlock. This patch fixes this
problem.

Change-Id: I759d702b5da93661f3f75a95c176e5dc59d46eed
CRs-Fixed: 565082
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-10-24 16:07:16 -07:00
Theodore Ts'o b7a52f5111 random: run random_int_secret_init() run after all late_initcalls
commit 47d06e532e95b71c0db3839ebdef3fe8812fca2c upstream.

The some platforms (e.g., ARM) initializes their clocks as
late_initcalls for some unknown reason.  So make sure
random_int_secret_init() is run after all of the late_initcalls are
run.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-18 07:45:44 -07:00
Linux Build Service Account 8fbba86498 Merge "diag: Fix for CRC check for Control byte" 2013-10-18 00:46:40 -07:00
Ravi Aravamudhan a56061cbc7 diag: Set Diag mode correctly when USB is disconnected
Diag driver sets the mode on the peripherals to Non real time mode
when USB is disconnected. This should happen only when there are
DCI clients and/or On Device Logging process are active. The mode
should be real time otherwise. This patch adds logic to set the
mode to realtime when there are no active processes.

Change-Id: I3a7c08d5a74acecbe4150913c5e8cca6a599edf5
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-10-15 19:14:48 -07:00
Linux Build Service Account 00767ff791 Merge "char: dcc_tty: Remove CONFIG_DCC_TTY driver" 2013-10-13 00:59:38 -07:00
Linux Build Service Account 10016a79a0 Merge "diag: Correct the minimum dci packet length" 2013-10-12 02:25:02 -07:00
Dixon Peterson 6f544080c0 diag: Correct the minimum dci packet length
Diag currently has the minuimum dci packet length set to 8. Correct
the valid minimum packet size to 5.
CRs-Fixed: 538425
Change-Id: Ie1d6becda3f1be292524051e9d6d9a7cd1f5fbe7
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
2013-10-11 15:39:20 -07:00
Trilok Soni e82a5bcb45 char: dcc_tty: Remove CONFIG_DCC_TTY driver
CONFIG_DCC_TTY driver is now superseded by CONFIG_HVC_DCC
driver and it is falling behind in terms of upstream
tty API changes. Remove it since everyone should use
HVC_DCC driver now.

Change-Id: I2ea72466d3fc119f931cb27da4c88522a624d4dc
Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
2013-10-12 01:46:04 +05:30
Katish Paran 692015fcec diag: Fix for CRC check for Control byte
0x7E packets can be sent twice in a row.The first 0x7E
is the terminator of the previous command and the next
is a null frame that we should ignore. This patch treats
the 0x7E bytes as packet end only.

Change-Id: I2c02240eead9c61ad8aa6bcf9e920bc63a0574cd
CRs-fixed: 549971
Signed-off-by: Katish Paran <kparan@codeaurora.org>
2013-10-11 15:15:28 +05:30
Linux Build Service Account d25bf364d4 Merge "diag: dci: Reduce dci table memory foot print" 2013-10-10 21:28:39 -07:00
Ravi Aravamudhan 6e110a1a96 diag: dci: Reduce dci table memory foot print
Diag driver uses a table of definite size to maintain information about
the DCI clients. This is allocated when the driver comes up. This memory
is relatively large and is allocated irrespective of the number of
dci clients. This patch changes the implementation from a table to a list.
This allocates a table entry for a client only when they register for DCI.

Change-Id: I7a22536a49c3e640e3e6d86c9731df02c8f04b58
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-10-04 18:27:38 -07:00
Mitchel Humpherys 544dbc1622 msm: ADSPRPC: Set the rpc mode via ioctl.
Set the rpc mode to either serial or parallel via an ioctl, and ensure
that output buffers are invalidated in serial mode before calling into
the dsp.

Change-Id: I565faba24106cd7e3bba5368b06c4036bb468483
Acked-by: Anatoly Yakovenko <anatolyy@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2013-10-04 11:59:34 -07:00
=Katish Paran 5d87a0bcc6 diag: Potential Null Pointer Dereference of user buf
Currently there is no check for the buf coming from
the user side,thus no way of knowing whether the buf
is null or not. This may lead to potential null
pointer dereference. This patch will fix that
possibility.

Change-Id: I9a66f3354c98bf03f9f5439a66078f247698d31c
CRs-fixed: 540570
Signed-off-by: Katish Paran <kparan@codeaurora.org>
2013-10-03 14:33:03 +05:30
Ravi Aravamudhan f5f2de410c diag: Forward pkts to peripherals only after receiving feature mask
Diag feature masks are exhanged between the Apps processor and the
peripherals during boot up that contains the information about the
channel used for transmitting/receiving command responses. Do not
process any command until we receive the feature masks from the
peripherals. Also continue to process the ctrl pkt even if the
registration table count is 0 to process the feature mask at the end
of the ctrl pkt.

Change-Id: Iabd6e7dfe803e3f6ae08b287d68a023cef40f6cc
CRs-Fixed: 550023
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-10-02 08:06:48 -07:00
Dixon Peterson 63626b3ecd diag: Enable APSS diag hdlc encoding
Currently, the hdlc encoding of data is performed on the peripherals.
Enable APSS diag hdlc encoding so that the data will be encoded on
the apps for the peripherals that support this feature.

Change-Id: Ie5c8f39b59c544c9b91c3693c32a90560c0ae329
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
2013-09-30 17:04:46 -07:00
Laura Abbott 9ab48181c1 msm: Update Ion and IOMMU APIs to use dma_addr_t
The current APIs for Ion and the custom IOMMU mapping assume that
many parameters are unsigned long. This type is not big enough to
hold physical addresses on LPAE systems. Update the APIs to accomodate
these types. Because we are updating the APIs, all clients need to be
updated as well, either by using the correct type or using a cast
where necessary.

Change-Id: I12e6fb6ec8a8481a7eef374cb9316e5ccbc29090
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-09-21 13:28:54 -07:00
Linux Build Service Account d272dc74cd Merge "diag: Add support for APQ8084 QPST string" 2013-09-19 14:51:18 -07:00
Dixon Peterson 7b225760d8 diag: Add support for APQ8084 QPST string
APQ8084 is a new device. Add diag support for sending
appropriate model number for APQ8084 so that QPST
can display the appropriate string.

Change-Id: I51b1b3201d96e2462d75f087d169b5c2a5882d6a
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
2013-09-17 16:02:01 -07:00
Ravi Aravamudhan b71031dd9f diag: Check correct status variable to send log mask
Diag driver was incorrectly checking the message mask status to
send the log mask control packet to the peripherals. This patch
checks the correct status variable to send the log mask to the
peripherals.

Change-Id: I6733c930e66cabc77c6cfe62b9aa7cd48b9fe13d
CRs-Fixed: 542074
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-09-16 19:05:26 -07:00
Mitchel Humpherys c4a3abc2a0 msm: ADSPRPC: Allocate cached memory for ADSP RPC buffers
Pass ION_FLAG_CACHED flag to allocate cached memory for ADSP
RPC buffers that are flushed before being passed to the remote
processor.

Change-Id: I5faa2c074157efcdc3d859090c046b6a700e52a4
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2013-09-11 10:42:09 -07:00
Linux Build Service Account 713b390519 Merge "diag: dci: Check if the DCI client is valid before signaling" 2013-09-10 19:40:37 -07:00
Linux Build Service Account d7d065dbe0 Merge "diag: Add support for APQ8074 QPST string" 2013-09-10 19:40:03 -07:00
Ravi Aravamudhan 051ed2c5b1 diag: dci: Check if the DCI client is valid before signaling
Diag driver signals the DCI clients whenever there is a change in
the DCI channel status. This patch adds a check to see if the client
is valid before signaling.

Change-Id: I5b2be3a56494b259d76979167d1aae034c4b277a
CRs-Fixed: 535604
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-09-09 11:39:04 -07:00
Ravi Aravamudhan 1567dbf30b diag: Add support for APQ8074 QPST string
This patch adds tools id for APQ8074 that QPST uses to display
the device name

Change-Id: I1b5a9603dc7dc3b799d309b67cf227c9da990e8c
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-09-09 10:46:57 -07:00
Dixon Peterson 73b3a68b02 diag: Fix support for resizing buffers used in reading smd data
When an oversized packet is being read from an smd
channel we resize the buffer into which the data is being
read. The current implementation does not correctly use
and reassign the resized buffer. Make modifications to correctly
reassign the resized buffer so that it can be used properly.

CRs-Fixed: 532167
Change-Id: I224208a519ed365c7b4204646cda77eed967a304
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
2013-09-08 21:37:26 -07:00
Ravi Aravamudhan 8d4c0643b5 diag: dci: Handle incoming dci buffers correctly
The incoming dci packets contain the length of the response, log or
event expected. This patch adds checks to the size of the packet received
to be greater or equal to the length mentioned in the packet.

Change-Id: I308d3fc369c6117dd8ca024e60e044f0047bb679
CRs-Fixed: 530487
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-09-05 14:55:02 -07:00
Mohit Aggarwal 4307f3e795 diag: Command registration does not happen properly
Some CM command registrations do not happen properly
on apps side. This is due to some smd events miss
for control type. Make changes in order to read pending
SMD packets for control type.

Change-Id: I0fe25455275f6169bee91d151d8657330081c104
CRs-Fixed: 516718
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
2013-09-05 14:54:31 -07:00
Hariprasad Dhalinarasimha c96fc4f73a kernel: rng: Add IOCTL support to disable bus bandwidth
QRNG bus scale is set to high before qrng_read & set to
low after qrng_read, this impacts the performance during
boot-up, as there are various clients using qrng during
bootup. Inorder to fix this problem, a daemon is introduced
which calls into kernel module (that sets low bandwidth).
This change supports the IOCTL call to disable the bus bandwidth.

Change-Id: I386d1eb4c50c057ae2852e7f9d47c8db8e522ca5
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
2013-09-05 14:53:02 -07:00
Dixon Peterson dd839c3bcd diag: dci: Add DCI support for APSS logs and events
Currently, Diag DCI only supports modem. Add DCI functionality
to support logs and events generated on the APSS processor.

Change-Id: I7b5dfe96240338b43761de00b59a25a85d0aadb6
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
2013-09-05 14:52:19 -07:00
Ravi Aravamudhan 9fb889742f diag: Increase the maximum number of SSIDs per msg mask range
Diag was using a max ssid range of 100. This has increased due
to addition of new SSIDs. This patch increases the range to 200
and adds checks to limit the SSID masks to this range. This
changes the order of sending the feature masks, sending it before
the msg masks to let the peripherals know the features Apps
support.

Change-Id: Id913712b29208054ab036743ffc4122699501bc3
CRs-Fixed: 530659
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-09-04 17:28:59 -07:00
Stephen Boyd eeebda2cc0 char: dcc_tty: Update for TTY layer API changes
The TTY API changed in v3.10, update this driver for similar
changes.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-09-04 17:23:35 -07:00
Ravi Aravamudhan be8e8e1b3e diag: Perform CRC check on incoming HDLC encoded packet
Diag driver receives HDLC encoded data from the tools and decodes
them. This patch adds checks to the received data. It discards the
packet if the CRC is not correct.

Change-Id: Ie53056844d6d1e6777d15a339896bf6842cfae64
CRs-Fixed: 519902
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-09-04 17:21:26 -07:00
Ravi Aravamudhan ed51198297 diag: Fix log, event and msg mask status in control packets
The status field in the logs, events and msg mask update control
packets is set incorrectly to a defaul t value. This patch adds
the correct status value in the control packet sent from Apps
to peripherals.

Change-Id: I7850db055b5c4aad0d3e6ffceb6411be03090091
CRs-Fixed: 524134
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-09-04 17:20:28 -07:00
Dixon Peterson cda66a8354 diag: Remove unsupported smd control channel code
The diag smd control channel implementation only supports
a single data buffer for processing data. Remove stale code
that tries to access a second buffer.

CRs-Fixed: 521621
Change-Id: I9dc0224d9f4d0b9cb0a836cf2bd33459c15cc2a7
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
2013-09-04 17:19:19 -07:00
Ravi Aravamudhan b6c07b7853 diag: Fix incorrect handling of diag polling command
During SSR, diag driver clears its command registration table and
rescans the table for polling command. It sets a flag after taking
into consideration the table entries that are zeroed out leading
to an incorrect registration status. This patch ignores the table
entries that are zeroed out and compares against the correct
polling commands to set the flag.

Change-Id: Ida2b2ee4f3ec03ae17c800ef64d19c2bf2732a79
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-09-04 17:18:40 -07:00
Ravi Aravamudhan 24316f27f9 diag: dci: Fix timestamps on dci events
The first event generated by diag on the peripherals will have a
valid timestamp bytes and the subsequent events generated at the
same time will have reduced timestamp bytes to conserve
space in the buffer. Diag driver zeroed out the timestamp bytes
when it encounters DCI events with reduced timestamp bytes. This
patch adds the valid timestamp for those events.

Change-Id: I80b1a7450f605af9bfd8959ea1f26bc9d83b370e
CRs-Fixed: 521415
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-09-04 17:17:07 -07:00
Ravi Aravamudhan 4c509376b0 diag: dci: Handle dci mutex correctly
diag driver uses dci_mutex to protect the global buffer for dci.
While sending a packet to the peripheral, this mutex is not
released on error. This patch release the mutex on error.

Change-Id: Idd84e6533b2c8e748d9761e061d06e188a5a4bac
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-09-04 17:17:02 -07:00
Ravi Aravamudhan 481305a8c1 diag: Fix race condition in diag mempool
Diag driver manages memory using memory pools. Allocation and
de-allocation of memory depends on global count variables. This
patch adds lock in allocation/free functions to protect those
global variables.

Change-Id: I908687c0ccb51c7901dfb3559262046abd2e8e27
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-09-04 17:14:01 -07:00
Ravi Aravamudhan f7881cc570 diag: Add checks before allocating and freeing memory
Diag driver uses memory pool for internal  buffers. This patch adds
checks for freeing the buffer in a specific mode and while allocating
buffer in all modes.

Change-Id: Ib04f4d722c5cd27e5ef39a1ae65dc74bfe0d136e
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-09-04 17:14:00 -07:00
Dixon Peterson 1aa09a7a94 diag: Add hdlc encoding support for diag data sent from peripherals
Diag running on the peripherals currently hdlc encodes the diag
data prior to being sent to the APPS processor over the diag data
smd channels. To offload the peripherals of this workload, add support
to accept non-hdlc encoded diag data from the peripherals and
hdlc encode that data on the APPS processor. Maintain the backwards
compatability to accept and properly process hdlc encoded data.
Add ability to determine at run-time whether a peripheral is sending
hdlc or non-hdlc encoded data and process the data appropriately.

Change-Id: I09e1dce0118011e52b1634f1eac402de16a999f6
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
2013-09-04 17:13:44 -07:00
Dixon Peterson cd5e1e5df3 diag: Add separate read threads for SMD data channels
Currently, diag uses a single thread for reading the data from
the SMD data channels. Make changes in diag so that there is a
separate thread used in reading each SMD data channel.

Change-Id: Ia14efb7f4feb73d832536f0c16be77cd70352bef
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
2013-09-04 17:13:39 -07:00
Ravi Aravamudhan 48e7cbba1a diag: dci: Add dci channel information to debugfs
Diag uses two smd channels for dci data - one for req/rsp and the
other for logs and events. This patch adds channel information
while recording data received from these channels.

Change-Id: If07ce047fed444696259d201bef18f769d98b83a
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-09-04 17:13:38 -07:00
Ravi Aravamudhan e138fcad4a diag: Change maximum size of error response
Diag currently allows error responses of length 490 bytes. This is
outdated as we support 4K responses on the Apps. This patch changes
the Apps buffer size to 4K and also the limit on the error response
length.

Change-Id: I8212bf000a7493b756b5ac0e428c3b2e4be9e9c6

CRs-Fixed: 512035
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-09-04 17:11:59 -07:00
Mitchel Humpherys 2a6a6061d8 msm: ADSPRPC: Fix uninitialized variable warnings
Fix uninitialized variable warnings seen during compilation.

Change-Id: I3ef2bb359a632a3bd442725e7771b8cdde1a940b
Acked-by: Sathish Ambley <sambley@qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2013-09-04 17:11:21 -07:00
Ravi Aravamudhan c23b3396f4 diag: Skip checking diag bridge for SMUX when it is not enabled
Diag driver using SMUX over diag_bridge. When SMUX is not enabled,
it checks the other channels during initialization. This patch
skips checking other channels when SMUX is not enabled.

Change-Id: Ia155bc91d0332eae0a1341ce450ffe49aa7b9e1a
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-09-04 17:10:25 -07:00
Dixon Peterson c0a4c39232 diag: Add wake_up when HSIC driver is finished writing
When the HSIC driver calls the write complete callback function
in the diag kernel driver, diag does not make a wake_up_interuptible
call. There is a chance that the thread in the corresponding
wait_event_interuptible may not be woken up. Make changes to ensure
that the thread that may be waiting is woken up.

Change-Id: I52032913291aec5c775cc2ff7ca69fe78481ea7a
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
2013-09-04 17:10:21 -07:00
Mitchel Humpherys 39c333588a msm: ADSPRPC: Allow mapping of IOMMU heap buffers
Map / unmap the IOMMU heap buffers based on SMMU presence so as
to allow for these buffers to be passed to the remote processor
with zero-copy.

Change-Id: I95b3bdd46a8fa6eb3bca660a3900b5d690c12617
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2013-09-04 17:10:06 -07:00
Ravi Aravamudhan df1022c28a diag: dci: Prevent apps proc from sleeping while processing DCI data
This change prevents apps processor from going to power collapse while
receiving data from the DCI channels. The driver now activates wakeup
sources on arrival of data and releases them upon copying the data
to the user space. This ensures the DCI clients get data while apps
processor is in deep sleep.

Change-Id: Id92d9a5bedc0618efec0d38c850b1ed3977cf08b
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-09-04 17:09:37 -07:00
Ravi Aravamudhan b062db9963 diag: Handle diag memory pool correctly in diagchar_write
Memory allocated from the diag memory pool was not freed
correctly and mutexes were not unlocked properly. This
change adds fixes the memory leak and the mutex unlocking
issues.

Change-Id: If7bf45586e8bc66ce85ad42ace2397bcb0294801
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-09-04 17:08:28 -07:00
Dixon Peterson 15c472c617 diag: Add apps diag support for STM
Add apps diag support for recording of apps diag
data (F3s, logs, and events) to STM.

Change-Id: I3753033c70d92e0d581eb2827c6efa342166c120
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
2013-09-04 17:07:06 -07:00
Ravi Aravamudhan b2944e18a0 diag: Fix incorrect handling of buffers
In diag driver, processing dci transaction takes place even if the
incoming buffer is invalid. Also, we are handling the memory pools
incorrectly. This patch fixes these two issues

Change-Id: Ibdcc9759e3e1030f34f82c4e6b0315a8e5c79ab7
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-09-04 17:06:44 -07:00
Ravi Aravamudhan bc6cc4653a diag: Ignore connecting to invalid hsic channel
Diag currently has support for 4 hsic channels. Added checks to
discard connections to invalid hsic channel in diag driver.

Change-Id: I3536cc94839bcaa97ccd21d4a0423b98634fd660
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-09-04 17:05:42 -07:00
Ashay Jaiswal c43990875e diag: Fix race condition in diagchar driver
diag driver maintains socket logging process in global driver
structure which is manipulated in switch_logging and in close
file_operation.
There is a possibility of race while clearing the socket logging
process in close operation and sending signal in switch_logging
operation. Adding lock to serialize the two operations.

CRs-Fixed: 495063
Change-Id: I0064509c9ace18a8ff40c5a744363546a9021612
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
2013-09-04 17:05:22 -07:00
Ravi Aravamudhan de72d5e9e0 diag: Add Support to switch between real time modes
Adding support to switch mode of Diag on peripherals between
real time and non real time modes while using DCI/Memory Device.
Also added changes to record debug information related to
DCI in debugfs.

Change-Id: I8aecf63681094b2cd47759702f6cbb225afda40d
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-09-04 17:05:19 -07:00
Ravi Aravamudhan e6af4e2431 diag: dci: Add dci-smd debug information
This patch adds dci debug information to diag debugfs. We now
store the information about the last few dci smd reads - including
the size of data and the timestamp of data arrival.

Change-Id: I3ab18a3727d03d145d7d3e600fcbf4268481278e
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-09-04 17:02:20 -07:00
Ravi Aravamudhan 198f51630f diag: Add memory pool information to debugfs
This change adds the address of different diag memory pools to
debugfs to check for corruption.

Change-Id: Ie37083cd0b7f3513efc6a3fc5b2690d9a7994d59
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-09-04 17:02:19 -07:00
Hariprasad Dhalinarasimha 2b172cc5ca mms: rng: Add bus bandwidth support to PRNG
PRNG has to use pnoc clock, but pnoc is a bus clock & clients cannot
directly call pnoc apis, so prng calls bus bandwidth api to get the
clock cycles.

Change-Id: Ib3cd075097b4b70f82ec6325535e6e39808c6408
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
2013-09-04 17:00:10 -07:00
Ravi Aravamudhan acac504196 diag: dci: Protect dci client's data buffer with mutex
Data coming from smd is processed and written into client's data
buffer. The read thread reads the data from the buffer and resets
the length of the data in the buffer. This change fixes the
concurrency problem.

Change-Id: I52b8ed8c930ff0f0a978e9ccc3a34479ad253f0b
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2013-09-04 16:59:45 -07:00