Commit Graph

1058 Commits

Author SHA1 Message Date
Sachin Shah
545fbfa16e tzcom: Set buffer address to NULL when alloc fails
Signed-off-by: Sachin Shah <sachins@codeaurora.org>
2011-10-04 17:13:34 -07:00
Sachin Shah
d7e02d4d60 tzcom: Implement abort and cleanup of driver
Add a new IOCTL call to the driver to properly
abort all threads blocked on wait queues. Updated
release call for proper cleanup.

CRs-fixed: 303637, 304152
Signed-off-by: Sachin Shah <sachins@codeaurora.org>
2011-10-03 16:21:33 -07:00
Sachin Shah
bae4ec0ec5 tzcom: Add more error checks and safe operations
Use safe list iterator where needed, check return
value for scm_call and add condition check for
different input buffer lengths.

Signed-off-by: Sachin Shah <sachins@codeaurora.org>
2011-10-03 16:21:08 -07:00
Mohan Pallaka
73787fae48 misc: isa1200: Add regulator support
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
2011-10-03 16:20:56 -07:00
Matt Wagantall
640e5fd06d msm: tsif: Register device with clock driver and rename clocks
Rename the clocks per the new naming convention under which
similarly named clocks are distinguished between using their
associated device's name and ID.

Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2011-10-03 16:18:12 -07:00
Joel Nider
5578bdb65d tsif: tsif1 initialization bug fix
When using CONFIG_MSM_USE_TSIF1 to enable the second tsif instance,
the device initialization failed because of a errant device ID. The
check has been updated to accept the correct device ID range (0..1)

Signed-off-by: Joel Nider <jnider@codeaurora.org>
2011-10-03 16:17:16 -07:00
Sachin Shah
f0b51cd8ba tzcom: Turn some debug messages to error and warning
Signed-off-by: Sachin Shah <sachins@codeaurora.org>
2011-10-03 16:15:45 -07:00
Sachin Shah
f3b54abcce tzcom: Fix resp calculation
Response buffer is always an offset in input shared buffer.
Can't rely on the sb_in_rsp_addr as that value is not filled
from TZ side. This also makes it consitent with the response
buffer calculation in tzcom_send_cmd().

Signed-off-by: Sachin Shah <sachins@codeaurora.org>
2011-10-03 16:15:19 -07:00
Sachin Shah
c3f8dd345d tzcom: Zero out input shared buffer
- Zero out SB input buffer after a request is
  successfully fulfilled to meet security
  requirements.
- Remove redundant check for response length.

Signed-off-by: Sachin Shah <sachins@codeaurora.org>
2011-10-03 16:15:18 -07:00
Naveen Ramaraj
189f188d29 PMEM: Pre reserve virtual address range for on demand devices.
Since the PMEM driver establishes ioremaps on the fly for
on demand devices it is possible for the virtual address space
to become quickly fragmented. For such devices, pre-reserve the
virtual address range and only set up page table mappings when
required.

CRs-Fixed: 299510
Signed-off-by: Naveen Ramaraj <nramaraj@codeaurora.org>
2011-10-03 16:15:12 -07:00
Willie Ruan
965072ee65 misc: pm8058-pwm: change a variable name to match its struct name
Signed-off-by: Willie Ruan <wruan@codeaurora.org>
2011-10-03 16:14:27 -07:00
Willie Ruan
7bd1819099 misc: pm8058-pwm: select higher resolution if possible
More bits in PWM size means higher resolution, which is preferred
if we have such choice without sacrificing accuracy.

Signed-off-by: Willie Ruan <wruan@codeaurora.org>
2011-10-03 16:14:27 -07:00
Willie Ruan
368db79940 misc: pm8058-pwm: add two APIs
These two new APIs allow a driver to specify its PWM period
and duty cycle separately using PM8058 chip specific parameters
or raw values. The API to program a duty cycle uses hardware
module's LUT (LookUpTable) to output PWM value, which can be
used to alleviate potential glitches using direct writing to
PWM register.

Signed-off-by: Willie Ruan <wruan@codeaurora.org>
2011-10-03 16:14:26 -07:00
Willie Ruan
8a08b966fe misc: pm8058-pwm: bypass period calculation if no change
If a period is the same as before, there is no need to recalculate
it. This patch is adding such optimizations.

Signed-off-by: Willie Ruan <wruan@codeaurora.org>
2011-10-03 16:14:26 -07:00
Willie Ruan
efc2fa44f6 misc: pm8058-pwm: use small functions to replace bigger ones
Add small functions to replace bigger ones for better readability
and error checking.

Signed-off-by: Willie Ruan <wruan@codeaurora.org>
2011-10-03 16:14:25 -07:00
Willie Ruan
d3337ed9e3 misc: pm8058-pwm: split pw8058_pwm_config to smaller structs
A big struct of pw8058_pwm_config is not easy to manage. Split it
to smaller structs and make the period struct public.

Signed-off-by: Willie Ruan <wruan@codeaurora.org>
2011-10-03 16:14:25 -07:00
Anirudh Ghayal
fcfbea6273 drivers: misc: Add pm8xxx based vibrator driver
This driver uses the timed output framework to
support the vibrator functionality.

Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2011-10-03 10:28:13 -07:00
Vikram Mulukutla
f98205f74a pmic8058-vibrator: Do not call hrtimer_cancel when preemption is disabled
The hrtimer_cancel logic exposes a possible spinlock live-lock
situation, if this call is made when preemption is disabled.
Fix the code to avoid this situation.

CRs-Fixed: 299333
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
2011-10-03 10:28:05 -07:00
Laura Abbott
6b3eb1abf1 pmem: Correctly account for aligned blocks
when finding an aligned chunk, the allocator cannot assume that
bit 0 will point to an aligned block. The only way to guarantee
a block will be aligned is to pass in the starting bit of a block
that is aligned. if t is the start bit which points to an aligned
block, and s is the spacing, bit t+n*s is guaranteed to be aligned
to spacing s for positive integer values of n.

CRs-Fixed: 288000
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-03 10:27:48 -07:00
Laura Abbott
1e36a02967 pmem: ensure SMI correctness
Due to hardware constraints, the SMI should not be mapped
in the kernel space when not in use. Unmap the SMI from
the kernel address space when the last allocation is freed.
Vote for bus bandwidth as well while the SMI is allocated.

CRs-Fixed: 281723
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-03 10:27:04 -07:00
Willie Ruan
0d9acd9735 misc: pm8058-pwm: add pr_fmt to simplify debug messages
Adding pr_fmt with __func__ to simplify the debug messages which
need to print out __func__.

Signed-off-by: Willie Ruan <wruan@codeaurora.org>
2011-10-03 10:26:02 -07:00
Bryan Huntsman
3f2bc4d6eb Initial Contribution
msm-2.6.38: tag AU_LINUX_ANDROID_GINGERBREAD.02.03.04.00.142

Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
2011-10-03 09:57:10 -07:00
Colin Cross
9abd59b0df Merge commit 'v3.0.1' into android-3.0 2011-08-10 18:07:59 -07:00
Philip A. Prindeville
cb83d9f784 geode: reflect mfgpt dependency on mfd
commit 703f03c896fdbd726b809066ae279df513992f0e upstream.

As stated in drivers/mfd/cs5535-mfd.c, the mfd driver exposes the BARs
which then make the GPIO, MFGPT, ACPI, etc.  all visible to the system.

So the dependencies of the MFGPT stuff have changed, and most people
expect Kconfig to bring in the necessary dependencies.  Without them, the
module fails to load and most people don't understand why because the
details of the rewrite aren't captured anywhere most people who know to
look.

This dependency needs to be reflected in Kconfig.

Signed-off-by: Philip A. Prindeville <philipp@redfish-solutions.com>
Acked-by: Alexandros C. Couloumbis <alex@ozo.com>
Acked-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-04 21:58:38 -07:00
Dima Zavin
814cdea670 Merge commit 'v3.0-rc6' into android-3.0 2011-07-07 17:55:44 -07:00
Colin Cross
e55d4fa967 Merge commit 'v3.0-rc5' into android-3.0 2011-06-29 13:54:42 -07:00
Linus Torvalds
c89b857ce6 Merge branch 'driver-core-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* 'driver-core-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6:
  Connector: Correctly set the error code in case of success when dispatching receive callbacks
  Connector: Set the CN_NETLINK_USERS correctly
  pti: PTI semantics fix in pti_tty_cleanup.
  pti: ENXIO error case memory leak PTI fix.
  pti: double-free security PTI fix
  drivers:misc: ti-st: fix skipping of change remote baud
  drivers/base/platform.c: don't mark platform_device_register_resndata() as __init_or_module
  st_kim: Handle case of no device found for ID 0
  firmware: fix GOOGLE_SMI kconfig dependency warning
2011-06-28 11:15:36 -07:00
Ralf Baechle
1fc6e987d8 drivers/misc/ioc4.c: fix section mismatch / race condition
Fix this section mismatch:

  WARNING: drivers/misc/ioc4.o(.data+0x144): Section mismatch in reference from the variable ioc4_load_modules_work to the function .devinit.text:ioc4_load_modules()
  The variable ioc4_load_modules_work references
  the function __devinit ioc4_load_modules()
  If the reference is valid then annotate the
  variable with __init* or __refdata (see linux/init.h) or name the variable:
  *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

This one is potentially fatal; by the time ioc4_load_modules is invoked
it may already have been freed.  For that reason ioc4_load_modules_work
can't be turned to __devinitdata but also because it's referenced in
ioc4_exit.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Acked-by: Brent Casavant <bcasavan@sgi.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-06-27 18:00:13 -07:00
Josh Hunt
aa2c96d6f3 drivers/misc/lkdtm.c: fix race when crashpoint is hit multiple times before checking count
We observed the crash point count going negative in cases where the
crash point is hit multiple times before the check of "count == 0" is
done.  Because of this we never call lkdtm_do_action().  This patch just
adds a spinlock to protect count.

Reported-by: Tapan Dhimant <tdhimant@akamai.com>
Signed-off-by: Josh Hunt <johunt@akamai.com>
Acked-by: Ankita Garg <ankita@in.ibm.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-06-27 18:00:13 -07:00
Linus Torvalds
a64227b085 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc:
  mmc: queue: bring discard_granularity/alignment into line with SCSI
  mmc: queue: append partition subname to queue thread name
  mmc: core: make erase timeout calculation allow for gated clock
  mmc: block: switch card to User Data Area when removing the block driver
  mmc: sdio: reset card during power_restore
  mmc: cb710: fix #ifdef HAVE_EFFICIENT_UNALIGNED_ACCESS
  mmc: sdhi: DMA slave ID 0 is invalid
  mmc: tmio: fix regression in TMIO_MMC_WRPROTECT_DISABLE handling
  mmc: omap_hsmmc: use original sg_len for dma_unmap_sg
  mmc: omap_hsmmc: fix ocr mask usage
  mmc: sdio: fix runtime PM path during driver removal
  mmc: Add PCI fixup quirks for Ricoh 1180:e823 reader
  mmc: sdhi: fix module unloading
  mmc: of_mmc_spi: add NO_IRQ define to of_mmc_spi.c
  mmc: vub300: fix null dereferences in error handling
2011-06-27 14:55:43 -07:00
James Hogan
e9e8bcb817 mmc: cb710: fix #ifdef HAVE_EFFICIENT_UNALIGNED_ACCESS
HAVE_EFFICIENT_UNALIGNED_ACCESS is a config option, therefore it needs
the CONFIG_ before it when used by the preprocessor.

Signed-off-by: James Hogan <james@albanarts.com>
Acked-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Chris Ball <cjb@laptop.org>
2011-06-25 18:52:24 -04:00
Linus Torvalds
6e158d2198 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (40 commits)
  pxa168_eth: fix race in transmit path.
  ipv4, ping: Remove duplicate icmp.h include
  netxen: fix race in skb->len access
  sgi-xp: fix a use after free
  hp100: fix an skb->len race
  netpoll: copy dev name of slaves to struct netpoll
  ipv4: fix multicast losses
  r8169: fix static initializers.
  inet_diag: fix inet_diag_bc_audit()
  gigaset: call module_put before restart of if_open()
  farsync: add module_put to error path in fst_open()
  net: rfs: enable RFS before first data packet is received
  fs_enet: fix freescale FCC ethernet dp buffer alignment
  netdev: bfin_mac: fix memory leak when freeing dma descriptors
  vlan: don't call ndo_vlan_rx_register on hardware that doesn't have vlan support
  caif: Bugfix - XOFF removed channel from caif-mux
  tun: teach the tun/tap driver to support netpoll
  dp83640: drop PHY status frames in the driver.
  dp83640: fix phy status frame event parsing
  phylib: Allow BCM63XX PHY to be selected only on BCM63XX.
  ...
2011-06-20 20:10:18 -07:00
Eric Dumazet
44da29d26b sgi-xp: fix a use after free
Its illegal to dereference skb after dev_kfree_skb(skb)

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Robin Holt <holt@sgi.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-06-19 16:28:03 -07:00
Geert Uytterhoeven
ec8f9ceace drivers/misc/apds990x.c: apds990x_chip_on() should depend on CONFIG_PM || CONFIG_PM_RUNTIME
Fixes this warning:

  drivers/misc/apds990x.c: At top level:
  drivers/misc/apds990x.c:613: warning: `apds990x_chip_on' defined but not used

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Samu Onkalo <samu.p.onkalo@nokia.com>
Cc: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-06-15 20:04:02 -07:00
Christian Gmeiner
4bbd61fb97 drivers/misc/cs5535-mfgpt.c: fix wrong if condition
Fix the wrong `if' condition for the check if the requested timer is
available.

The bitmap avail is used to store if a timer is used already.  test_bit()
is used to check if the requested timer is available.  If a bit in the
avail bitmap is set it means that the timer is available.

The runtime effect would be that allocating a specific timer always fails
(versus telling cs5535_mfgpt_alloc_timer to allocate the first available
timer, which works).

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-06-15 20:04:00 -07:00
Axel Lin
5a1e6f7583 drivers/misc/spear13xx_pcie_gadget.c: fix a memory leak in spear_pcie_gadget_probe error path
In the case of goto err_kzalloc, we should kfree target.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Pratyush Anand <pratyush.anand@st.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-06-15 20:04:00 -07:00
Dmitry Shmidt
e64be6fb7c misc: kernel_debugger: Add help command
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-06-14 09:09:39 -07:00
Erik Gilling
1fb6e37f9d misc: kernel_debugger: fix handle_sysrq call
Change-Id: I58376b7de56751fd57a038fb8f908f36fe60dda1
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Author:    Erik Gilling <konkers@android.com>
2011-06-14 09:09:38 -07:00
Colin Cross
c1dbe304b2 misc: add akm8975 compass driver
Originally written by HTC. Contributions by Motorola and AKM.
  misc: Import akm8975 from Motorola

Major style and code cleanups by Praveen Bharathi <pbharathi@motorola.com>
  misc: akm8975: clean up code violations in akm8975.c
  misc: akm8975: Clean up coding style, add suspend and resume

Change-Id: I4196913f15aec2dfbed47506d3dc085aada8e92d
Signed-off-by: Dima Zavin <dima@android.com>
2011-06-14 09:09:33 -07:00
Mike Chan
df8bfc3d77 net: activity_stats: Add statistics for network transmission activity
When enabled, tracks the frequency of network transmissions
(inbound and outbound) and buckets them accordingly.
Buckets are determined by time between network activity.

Each bucket represents the number of network transmisions that were
N sec or longer apart. Where N is defined as 1 << bucket index.

This network pattern tracking is particularly useful for wireless
networks (ie: 3G) where batching network activity closely together
is more power efficient than far apart.

New file: /proc/net/stat/activity

output:

Min Bucket(sec) Count
              1 7
              2 0
              4 1
              8 0
             16 0
             32 2
             64 1
            128 0

Change-Id: I4c4cd8627b872a55f326b1715c51bc3bdd6e8d92
Signed-off-by: Mike Chan <mike@android.com>
2011-06-14 09:09:31 -07:00
Iliyan Malchev
97f59a17e9 apanic: make APANIC_LABEL depend on APANIC
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-06-14 09:09:28 -07:00
Tom Zhu
310cd14451 misc: apanic: erase kpanic when no data
erase kpanic partition when there is no data(console and thread)

Signed-off-by: Tom Zhu <a2289c@android-hal-04.(none)>
Signed-off-by: San Mehat <san@google.com>
2011-06-14 09:09:19 -07:00
Tom Zhu
d2e9d64b77 misc: apanic: bad block handling
Add bad block handling in apanic

Signed-off-by: Tom Zhu <ling.zhu@motorola.com>
Signed-off-by: San Mehat <san@google.com>

misc: apanic: Improved bad-block / watchdog handling

1. handle cases that there is no more good blocks
2. touch softlockup watchdog at the start of apanic
3. change unsigned char get_bb() to unsigned int get_bb()
4. return idx instead of rc2, to keep the previous written pages.

Signed-off-by: Tom Zhu <ling.zhu@motorola.com>
Signed-off-by: San Mehat <san@google.com>
2011-06-14 09:09:18 -07:00
San Mehat
e3af8d4fce ramconsole/apanic: Ensure ramconsole does not get cluttered by apanic threads
Signed-off-by: San Mehat <san@google.com>
2011-06-14 09:09:18 -07:00
San Mehat
01c99685db drivers: apanic: Android kernel panic handler.
This driver triggers when the kernel panics and attempts to
write critical debug data to the flash.

Signed-off-by: San Mehat <san@google.com>

drivers: apanic: checkpatch fixes

Signed-off-by: San Mehat <san@google.com>

apanic: Fix a few cases of calling non-atomic things from atomic

We need to pay special care to not enrage cond_resched(), and the
base nand bb stuff calls schedule() so thats out.

Signed-off-by: San Mehat <san@google.com>
2011-06-14 09:09:18 -07:00
Nick Pelly
24087d74f5 wl127x-rfkill: Add power control driver for TI WL127X Bluetooth chips
Signed-off-by: Nick Pelly <npelly@google.com>
2011-06-14 09:09:15 -07:00
Brian Swetland
3e3d03562f kernel_debugger_core: add interrupt-context debugger core
This provides kernel_debugger() which can be called from an interrupt
context low level debugger wedge to execute commands that inspect
kernel state.  It doesn't do much on its own.

Signed-off-by: Brian Swetland <swetland@google.com>

kernel_debugger_core: Add sysrq command.

sysrq <c> will run the sysrq command <c> and dump what
was added to the kernel log while the command ran.

Signed-off-by: Brian Swetland <swetland@google.com>
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2011-06-14 09:09:15 -07:00
Mike Chan
807e5f6486 misc: uidstat: Adding uid stat driver to collect network statistics.
Signed-off-by: Mike Chan <mike@android.com>
2011-06-14 09:08:47 -07:00
Rebecca Schultz
a4ff0e8444 pmem: Add pmem driver
Signed-off-by: Rebecca Schultz <rschultz@google.com>

pmem: Use the thread group leader insted of the current thread.

Instead of keeping track of the current thread, use the thread group leader

Signed-off-by: Rebecca Schultz <rschultz@google.com>

pmem: Add some apis to reference and flush pmem files by file struct

The api to refer to pmem files by fd should be depricated, it can
cause problems if a processes fd table changes while the kernel is processing
data in a pmem file.  This change adds the safer api.

Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

pmem: Remove unused depricated fd api to pmem.

Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

pmem: Remove error message when calling get_pmem_addr

This call is used from the mdp driver to determine if the memory
is in pmem or in the fb.  We will encounter this case during normal operation
so this error message should be removed.

Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

pmem: Add include sched.h to fix compile errors

Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

pmem: remove HW3D_* ioctls

Signed-off-by: Dima Zavin <dima@android.com>

pmem: Expose is_pmem_file to the in-kernel users.

Signed-off-by: Dima Zavin <dima@android.com>

pmem: Make the exposed functions be noops if CONFIG_ANDROID_PMEM is not set.

Signed-off-by: Dima Zavin <dima@android.com>

misc: pmem: don't flush if file was opened with O_SYNC

Change-Id: I067218658a0d7f7ecc1fe73e9ff6b0c3b3054653
Signed-off-by: Dima Zavin <dima@android.com>

pmem: Add cache flush ioctl for pmem buffers

Change-Id: I9156bad829e8c65087f122b48cc57638902fab12
Signed-off-by: Dima Zavin <dima@android.com>

Allow multiple pmem master mmap()s.

Signed-off-by: Jamie Gennis <jgennis@google.com>
Change-Id: Icbe619c92e0ebb391f0a93f81937705452a67d87

pmem: convert data_list_sem to a mutex

Also rename a function that now conflicts with a new
define in asm/pgtable.h

Change-Id: I4798048cb8dece1bc03604e7d0b03d86e0c0ef7f
Signed-off-by: Dima Zavin <dima@android.com>
2011-06-14 09:08:46 -07:00
J Freyensee
1312ba40c0 pti: PTI semantics fix in pti_tty_cleanup.
This patch fixes a semantics issue in the pti_tty_cleanup()
routine.

Signed-off-by: J Freyensee <james_p_freyensee@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 10:01:20 -07:00