Commit Graph

211328 Commits

Author SHA1 Message Date
Mike Lockwood
35ee07a4df USB: composite: Add usb_composite_force_reset utility to force enumeration
Use this rather than calling usb_gadget_disconnect and usb_gadget_connect
directly to avoid sending USB disconnect events to userspace when resetting
the bus.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:39 -07:00
Dmitry Shmidt
1ee6838659 network: wireless: bcm4329: Set special OUI: 02:1A:11:FH:HH:HH for SoftAP
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:39 -07:00
Mike Lockwood
d620052f3e USB: gadget: android: Remove unused function android_usb_set_connected()
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:39 -07:00
Mike Lockwood
136826b4f1 USB: gadget: composite: Move switch_set_state calls to a work queue
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:39 -07:00
Mike Lockwood
140277b8f7 USB: gadget: f_mtp: USB gadget function driver for MTP and PTP device support.
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:38 -07:00
Mike Lockwood
b3a4a18a4c USB: composite: Add support for functions overriding USB_DT_STRING descriptors
Needed for MTP support.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:38 -07:00
Mike Lockwood
a9946e705c USB: gadget: composite: Add userspace notifications for USB state changes
Add switch to notify current USB configuration.  This can be used to detect
USB connect and disconnect events.

Broadcast a change via the usb_composite class when a USB function is
enabled or disabled.

Rename usb_function.hidden to usb_function.disabled.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:38 -07:00
Mike Lockwood
ff9cdcd465 USB: gadget: f_mass_storage: Integrate android customizations
Integrate support for android composite driver and platform data
within CONFIG_USB_ANDROID_MASS_STORAGE.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:38 -07:00
Bjorn Bringert
7dc0be13b0 Implement read(2) in ashmem driver
Bug: 2595601
Change-Id: I47c0016f594f9354fb8658ccb26e3d395bcb137b
Signed-off-by: Bjorn Bringert <bringert@android.com>
2010-09-29 17:49:38 -07:00
Greg Goldman
8ad3de415d network: wireless: bcm4329: Reduce driver loading time
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:38 -07:00
Arve Hjønnevåg
56ab3d0a00 network: wireless: bcm4329: Add 2.6.35 compatibility and fix memory leak in set_multicast_list
Signed-off-by: Dmitry Shmidt <dimitrysh@android.com>
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:37 -07:00
Dmitry Shmidt
1c57305e18 net: wireless: bcm4329: Add SoftAP MAC address randomization
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:37 -07:00
Mike Chan
12b0cec7ba 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>
2010-09-29 17:49:37 -07:00
Greg Goldman
3ddaed49e7 network: wireless: bcm4329: Update to Version 4.218.239
Add reading mac address from platform data
    Add dhd_os_proto_block protection for dhd_preinit_ioctls
    Revert dhdsdio_clk() changes

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:37 -07:00
Dmitry Shmidt
3e82dd2356 network: wireless: bcm4329: Fix wlan card removal
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:37 -07:00
Greg Goldman
a1eb0b3d9f network: wireless: bcm4329: Fix MAC address import
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:36 -07:00
Greg Goldman
7c82d4484a network: wireless: bcm4329: Update to Version 4.218.238
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:36 -07:00
Dmitry Shmidt
18cde38642 network: wireless: Add get_mac_addr functionality to platform
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:36 -07:00
Dmitry Shmidt
4d1deab06b network: wireless: bcm4329: Remove unnecessary set_freezable() calls
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:36 -07:00
Howard Harte
0946fa3463 network: wireless: bcm4329: Add "HANG" event and console monitoring
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:36 -07:00
Dmitry Shmidt
653767f92b network: wireless: bcm4329: Add bcm4329 driver
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:36 -07:00
San Mehat
84e65f0b90 staging: android: lowmemorykiller: Remove bitrotted codepath
Now that we're murder-synchronous, this code path will never be
called (and if it does, it doesn't tell us anything useful other
than we killed a task that was already being killed by somebody
else but hadn't gotten its' signal yet)

Signed-off-by: San Mehat <san@google.com>
2010-09-29 17:49:35 -07:00
San Mehat
7054bf4b53 staging: android: lowmemorykiller: Fix task_struct leak
As it turns out, the CONFIG_PROFILING interfaces leak a
task struct if the notifier chain returns NOTIFY_OK.. doh.

This patch reworks lowmemkiller to use the new generic task
free notifier chain.

Signed-off-by: San Mehat <san@google.com>
2010-09-29 17:49:34 -07:00
San Mehat
e79ef44016 sched: Add a generic notifier when a task struct is about to be freed
This patch adds a notifier which can be used by subsystems that may
be interested in when a task has completely died and is about to
have it's last resource freed.

  The Android lowmemory killer uses this to determine when a task
it has killed has finally given up its goods.

Signed-off-by: San Mehat <san@google.com>
2010-09-29 17:49:34 -07:00
Christopher Lais
9f69ebbf40 binder: Fix memory corruption via page aliasing
binder_deferred_release was not unmapping the page from the buffer
before freeing it, causing memory corruption.  This only happened
when page(s) had not been freed by binder_update_page_range, which
properly unmaps the pages.

This only happens on architectures with VIPT aliasing.

To reproduce, create a program which opens, mmaps, munmaps, then closes
the binder very quickly.  This should leave a page allocated when the
binder is released.  When binder_deferrred_release is called on the
close, the page will remain mapped to the address in the linear
proc->buffer.  Later, we may map the same physical page to a different
virtual address that has different coloring, and this may cause
aliasing to occur.

PAGE_POISONING will greatly increase your chances of noticing any
problems.

Change-Id: I6941bf212881b8bf846bdfda43d3609c7ae4892e

Signed-off-by: Christopher Lais <chris+android@zenthought.org>
2010-09-29 17:49:34 -07:00
San Mehat
28633d10f9 staging: android: lowmemkiller: Substantially reduce overhead during reclaim
This patch optimizes lowmemkiller to not do any work when it has an outstanding
kill-request. This greatly reduces the pressure on the task_list lock
(improving interactivity), as well as improving the vmscan performance
when under heavy memory pressure (by up to 20x in tests).

Note: For this enhancement to work, you need CONFIG_PROFILING

Signed-off-by: San Mehat <san@google.com>
2010-09-29 17:49:34 -07:00
Dima Zavin
16483f51c7 [ARM] Do not call flush_cache_user_range with mmap_sem held
We can't be holding the mmap_sem while calling flush_cache_user_range
because the flush can fault. If we fault on a user address, the
page fault handler will try to take mmap_sem again. Since both places
acquire the read lock, most of the time it succeeds. However, if another
thread tries to acquire the write lock on the mmap_sem (e.g. mmap) in
between the call to flush_cache_user_range and the fault, the down_read
in do_page_fault will deadlock.

Also, since we really can't be holding the mmap_sem while calling
flush_cache_user_range AND vma is actually unused by the flush itself,
get rid of vma as an argument.

Change-Id: If55409bde41ad1060fa4fe7cbd4ac530d4d9a106
Signed-off-by: Dima Zavin <dima@android.com>
2010-09-29 17:49:33 -07:00
Velempati Chiranjeevi
c600bd3a24 USB: android gadget: mass storage: Fix format issue for Vista Host
As part of formating the mass storage device, Host sends the INQUIRY
scsi command. As per the standard, the command length for this
command should be 6 bytes, whereas the Vista host sends 12 bytes.

When the command length of the command is not equal to the standard
length, the device sends a phase error as part of the status phase.
When the host receives a phase error, it re-enumerates, hence the
error.

If the command is INQUIRY, and the command length is 12 bytes,
treating this as a good command and not sending the phase error
to the host fixes this issue.

Signed-off-by: Velempati Chiranjeevi <c_cvelem@qualcomm.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:33 -07:00
San Mehat
fdcec72817 lowmemorykiller: Don't try to kill the same pid over and over
Under certain circumstances, a process can take awhile to
handle a sig-kill (especially if it's in a scheduler group with
a very low share ratio). When this occurs, lowmemkiller returns
to vmscan indicating the process memory has been freed - even
though the process is still waiting to die. Since the memory
hasn't actually freed, lowmemkiller is called again shortly after,
and picks the same process to die; regardless of the fact that
it has already been 'scheduled' to die and the memory has already
been reported to vmscan as having been freed.

  Solution is to check fatal_signal_pending() on the selected
task, and if it's already pending destruction return; indicating
to vmscan that no resources were freed on this pass.

Signed-off-by: San Mehat <san@google.com>
2010-09-29 17:49:33 -07:00
Arve Hjønnevåg
3c455b7767 Staging: android: binder: Create dedicated workqueue for binder deferred work
Some drivers flush the global workqueue when closed. This would deadlock if
the last reference to the file was released from the binder.

Change-Id: Ifdabc0b383fecb20836d1bbb9786c632402a14e1
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2010-09-29 17:49:33 -07:00
Mike Lockwood
8ae1b091c3 Staging: android: timed_gpio: Properly discard invalid timeout values.
The timed output device never previously checked the return value of sscanf,
resulting in an uninitialized int being passed to enable() if input value
was invalid.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:33 -07:00
Mike Lockwood
e2dd99e8e2 USB: gadget: f_mass_storage: Defer handling interface changes until it is safe.
Pulling in some code from file_storage.c, we now handle interface changes
in do_set_config(), which is now not called until any pending requests have
been successfully completed or cancelled.

This fixes a race condition that resulted in usb_ep_free_request() being called
while the request is still busy.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:33 -07:00
Arve Hjønnevåg
0274cdc300 android-common: include linux/slab.h
Change-Id: Ib9655177bfaf00bd5682e1ac0d7e813e16a47eea
2010-09-29 17:49:32 -07:00
Colin Cross
8db6b353ae android-common: Fix slab.h includes for 2.6.34-rc4 2010-09-29 17:49:32 -07:00
Arve Hjønnevåg
cf23783c7a rtc: alarm: Don't use save_time_delta.
Change-Id: Iaefeca497de02fe36b7f5d79075912f6e349ec53
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2010-09-29 17:49:32 -07:00
Arve Hjønnevåg
bcb0d01510 binder: Move debugging information from procfs to debugfs
Change-Id: Ia0f9c8cec68054c6600a799ef864ebf1185c93ab
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2010-09-29 17:49:32 -07:00
Arve Hjønnevåg
a0cc646e7e binder: Use seq_file for debug interface.
Change-Id: I6e9c064ba024329099cb833b2ae9ab43c2ad8c6d
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2010-09-29 17:49:32 -07:00
Colin Cross
0f1d4d7437 fs: partitions: Fix warnings in fs/partitions/check.c
Change-Id: I4398ace0c55d4833b1fcbb7a4e71ab8f0b1b044a
Signed-off-by: Colin Cross <ccross@android.com>
2010-09-29 17:49:32 -07:00
Nick Pelly
a43d3f835f Bluetooth: Hack: Don't dereference null pointer.
This avoids the S305 panic during incoming connection.

S305 sends PSM 25 L2CAP connection request before the L2CAP info response.
When we receive that info response we crash on null pointer here.

Bug: 2127637
Change-Id: Ib637516251f46fa9a9c87ac015dc2f27df5a27fd
Signed-off-by: Nick Pelly <npelly@google.com>
2010-09-29 17:49:31 -07:00
Arve Hjønnevåg
372a94c2ed USB: gadget: android: mass_storage: Use spin_lock_irqsave/spin_unlock_irqrestore
The old code did not allways disable interrupts when called from thread
context, but tried to lock the same spinlock from interrupt context.

This was merged from a change to drivers/usb/function/mass_storage.c
in the android-msm-2.6.29 branch.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:31 -07:00
Dmitry Shmidt
2673694e6e wlan: Extract generic wlan platform data from tiwlan specific header
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:31 -07:00
Mike Lockwood
437ae6a946 USB: gadget: android: check for null _android_dev in android_register_function()
This fixes a load ordering issue that occurred if a function driver loads before
the android gadget driver is initialized.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:31 -07:00
Iliyan Malchev
fcf1d6043f apanic: make APANIC_LABEL depend on APANIC
Signed-off-by: Iliyan Malchev <malchev@google.com>
2010-09-29 17:49:31 -07:00
Mike Lockwood
b0d8ef8a45 USB: gadget: f_mass_storage: Flush writes after every 4 MB.
This avoids excessive caching at the block level layer when copying large
files to the storage device.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:31 -07:00
Mike Lockwood
82c7dd9e74 USB: gadget: f_rndis: Add platform data for RNDIS vendor ID and MAC address.
This fixes a kernel panic in rndis.c when receiving the
OID_GEN_VENDOR_DESCRIPTION command.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:30 -07:00
Nick Pelly
e4772bff4a Bluetooth: Use non-flushable pb flag by default for ACL data on capable chipsets.
With Bluetooth 2.1 ACL packets can be flushable or non-flushable. This commit
makes ACL data packets non-flushable by default on compatible chipsets, and
adds the L2CAP_LM_FLUSHABLE socket option to explicitly request flushable ACL
data packets for a given L2CAP socket. This is useful for A2DP data which can
be safely discarded if it can not be delivered within a short time (while
other ACL data should not be discarded).

Note that making ACL data flushable has no effect unless the automatic flush
timeout for that ACL link is changed from its default of 0 (infinite).

Change-Id: Ie3d4befdeaefb8c979de7ae603ff5ec462b3483c
Signed-off-by: Nick Pelly <npelly@google.com>
2010-09-29 17:49:30 -07:00
Nick Pelly
a573f82deb Revert "Bluetooth: Introduce L2CAP_LM_FLUSHABLE to allow flushing of ACL packets."
This reverts commit d7897fd1e9.

Change-Id: I3401550b6dc97b683104e9fdac30a617a2db8c8e
Signed-off-by: Nick Pelly <npelly@google.com>
2010-09-29 17:49:30 -07:00
Dima Zavin
d5fb3c725b pmem: Add cache flush ioctl for pmem buffers
Change-Id: I9156bad829e8c65087f122b48cc57638902fab12
Signed-off-by: Dima Zavin <dima@android.com>
2010-09-29 17:49:30 -07:00
Mike Lockwood
d3d0cbff72 USB: gadget: composite: Don't increment interface number for alt settings.
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:30 -07:00
Mike Lockwood
af1f674f09 USB: gadget: composite: Don't call set_alt() on functions that are hidden.
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:30 -07:00