Commit Graph

255796 Commits

Author SHA1 Message Date
Dima Zavin
f4aea2122a ARM: common: fiq_debugger: add suspend/resume handlers
Change-Id: If6eb75059fdf4867eb9a974d60b9d50e5e3350d4
Signed-off-by: Dima Zavin <dima@android.com>
2011-10-25 22:05:50 -07:00
Dima Zavin
efde655c8c ARM: common: fiq_debugger: add uart_enable/disable platform callbacks
This allows the platform specific drivers to properly enable
and disable the uart at the appropriate times. On some platforms, just
managing the clock is not enough.

Change-Id: I5feaab04cfe313a4a9470ca274838676b9684201
Signed-off-by: Dima Zavin <dima@android.com>
2011-10-25 22:05:49 -07:00
Dima Zavin
83b72704b0 ARM: common: fiq_debugger: add non-fiq debugger support
Add irq-only support to the debugger. This allows the debugger
to always run at irq context. This introduces limitations to
being able to debug certain kinds of issues, but it is still
very useful as a debugging tool.

Change-Id: I1e4223e886cb2d90ef5ed31419bdd5cdd7f904ca
Signed-off-by: Dima Zavin <dima@android.com>
2011-10-25 22:05:48 -07:00
Dima Zavin
b009275963 ARM: common: fiq_debugger: peek the 0th char in ringbuf
ringbuf_consume advances the tail ptr, so peek should always
just peek at offset 0

Change-Id: I8d3d22d2ec1e563d73b53ccbad302e6d74e64e53
Signed-off-by: Dima Zavin <dima@android.com>
2011-10-25 22:05:48 -07:00
Dima Zavin
0d5d8ecf75 ARM: common: fiq_debugger: fix the cleanup on errors in probe
Change-Id: I58bd0604c0520b13e11bf02836eb4ddbadba1372
Signed-off-by: Dima Zavin <dima@android.com>
2011-10-25 22:05:47 -07:00
Dima Zavin
48ef31abe4 ARM: common: fiq_debugger: do not disable debug when console is enabled
Change-Id: I5f8074a860f9b143ee0c87296683bbf2cffb5a36
Signed-off-by: Dima Zavin <dima@android.com>
2011-10-25 22:05:46 -07:00
Colin Cross
9e4ee8100f ram_console: pass in a boot info string
Allow the board file to pass a boot info string through the
platform data that is appended to the /proc/last_kmsg file.

Change-Id: I37065fafb09676085465c93384d8e176fdd942d6
Signed-off-by: Colin Cross <ccross@android.com>
2011-10-25 16:40:00 -07:00
Dmitry Shmidt
108376f4f4 net: wireless: bcmdhd: Fix crash in p2p OFF
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-10-20 13:49:26 -07:00
Thomas Gleixner
c8bfd7dd2b ARM: smpboot: Enable irqs on secondary CPU after marking it online/active
Patch is the last version from tglx on Oct 7.

Discussion is at: http://comments.gmane.org/gmane.linux.ports.arm.kernel/131919

The original commit message for the first patch version:

Frank Rowand reported:

 I have a consistent (every boot) hang on boot with the RT patches.
 With a few hacks to get console output, I get:

  rcu_preempt_state detected stalls on CPUs/tasks

 I have also replicated the problem on the ARM RealView (in tree) and
 without the RT patches.

 The problem ended up being caused by the allowed cpus mask being set
 to all possible cpus for the ksoftirqd on the secondary processors.
 So the RCU softirq was never executing on the secondary cpu.

 The problem was that ksoftirqd was woken on the secondary processors before
 the secondary processors were online. This led to allowed cpus being set
 to all cpus.

   wake_up_process()
      try_to_wake_up()
         select_task_rq()
            if (... || !cpu_online(cpu))
               select_fallback_rq(task_cpu(p), p)
                  ...
                  /* No more Mr. Nice Guy. */
                  dest_cpu = cpuset_cpus_allowed_fallback(p)
                     do_set_cpus_allowed(p, cpu_possible_mask)
                        #  Thus ksoftirqd can now run on any cpu...
</report>

The reason is that the ARM SMP boot code for the secondary CPUs enables
interrupts before the newly brought up CPU is marked online and
active.

That causes a wakeup of ksoftirqd or a wakeup of any other kernel
thread which is affine to the brought up CPU break that threads
affinity and therefor being scheduled on already online CPUs.

This problem has been observed on x86 before and the only solution is
to mark the CPU online and wait for the CPU active bit before the
point where interrupts are enabled.

Change-Id: If948ef52d434191579e1ca95d18d0c50e91a03b9
Signed-off-by: Dima Zavin <dima@android.com>
2011-10-20 13:45:55 -07:00
Dima Zavin
8b7fd32923 ARM: smp: implement arch_trigger_all_cpus_backtrace using IPI
Based on a rough patch by frank.rowand@am.sony.com

Since ARM doesn't have an NMI (fiq's are not always available),
send an IPI to all other CPUs (current cpu prints the stack directly)
to capture a backtrace.

Change-Id: I8b163c8cec05d521b433ae133795865e8a33d4e2
Signed-off-by: Dima Zavin <dima@android.com>
2011-10-20 13:45:55 -07:00
Todd Poynor
fe04aa151f power: cpufreq interactive governor: use default sample time 20ms
Lower the default time at which a higher speed is allowed to run
before lowering based on lower CPU load from 80ms to 20ms.  Most
Android devices should trade power for performance here,
although tablets and non-battery-powered devices may want to
override this default.

Change-Id: I1a4f7faeca12793c51d5b92db30a63cca8d4f1be
Signed-off-by: Todd Poynor <toddpoynor@google.com>
2011-10-20 11:59:03 -07:00
Dmitry Shmidt
b07882cade net: wireless: bcmdhd: Add wake_lock to dhd_open() and dhd_stop()
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-10-19 14:11:00 -07:00
Dmitry Shmidt
eef7ae49c5 net: wireless: bcmdhd: Fix bssid profile update
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-10-19 14:10:43 -07:00
Dmitry Shmidt
fdfcbc682a net: wireless: Fix CFG80211_ALLOW_RECONNECT option for disconnect
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-10-18 12:30:02 -07:00
Todd Poynor
2cc01eb245 cpufreq: interactive governor: default timer 10ms, maxspeed load 95%
Modify default timer from 30ms to 10ms, sampling 2 jiffies after
idle exit on ARM as in Honeycomb.

Modify default go_maxspeed_load from 85% loaded to 95% loaded, for
use in phones where power savings is more important (tablets may be
best served overriding this).

Change-Id: I3361a6279979bfae1df5262666a2e30ea7a44328
Signed-off-by: Todd Poynor <toddpoynor@google.com>
2011-10-16 22:53:53 -07:00
Dmitry Shmidt
0ba392a160 net: wireless: bcmdhd: Add proper cleaning for ap_info structure
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-10-16 17:19:16 -07:00
Dmitry Shmidt
b11ecb42c0 net: wireless: bcmdhd: Send cfg80211_disconnected() if fails to get rssi
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-10-16 17:18:48 -07:00
JP Abgrall
8493beb104 netfilter: xt_qtaguid: fix crash on ctrl delete command
Because for now the xt_qtaguid module allows procs to use tags without
having /dev/xt_qtaguid open, there was a case where it would try
to delete a resources from a list that was proc specific.
But that resource was never added to that list which is only
used when /dev/xt_qtaguid has been opened by the proc.

Once our userspace is fully updated, we won't need those exceptions.

Change-Id: Idd4bfea926627190c74645142916e10832eb2504
Signed-off-by: JP Abgrall <jpa@google.com>
2011-10-07 22:16:01 -07:00
Ashish Sharma
3bc18c7282 bridge: Have tx_bytes count headers like rx_bytes.
Since rx_bytes accounting does not include Ethernet Headers in
br_input.c, excluding ETH_HLEN on the transmit path for consistent
measurement of packet length on both the Tx and Rx chains.

The clean way would be for Rx to include the eth header, but the
skb len has already been adjusted by the time the br code sees the skb.
This is only a temporary workaround until we can completely ignore or
cleanly fix the skb->len handling.

Change-Id: I910de95a4686b2119da7f1f326e2154ef31f9972
Signed-off-by: Ashish Sharma <ashishsharma@google.com>
2011-10-07 17:54:30 -07:00
Ashish Sharma
ca37d833b0 netfilter: xt_qtaguid: Fix the stats info display order
Change-Id: I3bf165c31f35a6c7dc212f23df5eefaeb8129d0d
Signed-off-by: Ashish Sharma <ashishsharma@google.com>
2011-10-06 17:02:06 -07:00
Dmitry Shmidt
dd0675eed3 net: wireless: bcmdhd: Use spin_lock_irqsave instead of spin_lock_irq
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-10-06 10:39:55 -07:00
Dmitry Shmidt
0cd19f01a7 net: wireless: bcmdhd: Fix event thread termination in case of empty queue
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-10-06 10:39:55 -07:00
Dmitry Shmidt
23cbfabf0b net: wireless: bcmdhd: Improve join functionality
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-10-06 10:39:55 -07:00
Dmitry Shmidt
dbfa5aa0fa net: wireless: bcmdhd: Make sure that FW is UP after corresponding message
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-10-06 10:39:55 -07:00
Dmitry Shmidt
82b74f2353 net: wireless: bcmdhd: Fix profile update syncronization
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-10-06 10:39:55 -07:00
Dmitry Shmidt
6f6fe090c2 net: wireless: bcmdhd: Fix memory leak in wl_cfgp2p_down()
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-10-06 10:39:54 -07:00
Axel Haslam
3c053e150b cpufreq: interactive: fix possible Division by zero.
The following dump was seen sometimes while resuming,
the only division by zero on this function can happen after
delta_time is reassigned, since at the start of the
function, there is jump that protects against values
less than 1000.

After that, If delta_time and delta_idle == 0,
we will hit a div 0

Division by zero in kernel.
Backtrace:
[<c0057184>] (dump_backtrace+0x0/0x110) from [<c05d5ecc>] (dump_stack+0x18/0x1c)
r6:010f3000 r5:c113dfb0 r4:c004afb0 r3:c6ff0000
[<c05d5eb4>] (dump_stack+0x0/0x1c) from [<c00572cc>] (__div0+0x1c/0x20)
[<c00572b0>] (__div0+0x0/0x20) from [<c02195d4>] (Ldiv0+0x8/0x10)
[<c03dfd64>] (cpufreq_interactive_timer+0x0/0x2c0) from [<c00a7efc>] (run_timer_softirq+0x154/0x260)
[<c00a7da8>] (run_timer_softirq+0x0/0x260) from [<c00a0c8c>] (__do_softirq+0xc8/0x194)
[<c00a0bc4>] (__do_softirq+0x0/0x194) from [<c00a1008>] (irq_exit+0xb4/0xb8)
[<c00a0f54>] (irq_exit+0x0/0xb8) from [<c00584b4>] (ipi_timer+0x44/0x48)
r4:c004a040 r3:00000001
[<c0058470>] (ipi_timer+0x0/0x48) from [<c004c3e4>] (do_local_timer+0x68/0x84)
r5:c004ae2c r4:c07991e8
[<c004c37c>] (do_local_timer+0x0/0x84) from [<c0052948>] (__irq_svc+0x48/0xe0)

Change-Id: I639882db67b8d711c5710778ebc212f0f6a998e3

Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Axel Haslam <axelhaslam@ti.com>
2011-10-05 15:42:00 -07:00
Dima Zavin
183a1fcfd8 input: evdev: do not block waiting for an event if fd is nonblock
If there is a full packet in the buffer, and we overflow that buffer
right after checking for that condition, it would have been possible
for us to block indefinitely (rather, until the next full packet) even if
the file was marked as O_NONBLOCK.

Change-Id: Icd0f59f8cc98392be4c4d13bd45b5cf94317eb5a
Signed-off-by: Dima Zavin <dima@android.com>
2011-10-04 22:51:05 -07:00
Dima Zavin
587b1eb162 input: evdev: if no events and non-block, return EAGAIN not 0
Change-Id: I5f0da721f74e5de111cffc7e7b375b72dd80e530
Signed-off-by: Dima Zavin <dima@android.com>
2011-10-04 22:51:03 -07:00
Dima Zavin
4873193751 input: evdev: only allow reading events if a full packet is present
Without this, it was possible for the reader to get ahead of packet_head.
If the the input device generated a partial packet *right* after the
reader got ahead, then we can get into a situation where the device is
marked readable but read always returns 0 until the next packet is
finished (i.e a SYN is generated by the input driver).

This situation can also happen if we overflow the buffer while a reader
is trying to read an event out.

Change-Id: If01ab371bc7de1bf1f90c122dcc5a29242b01a09
Signed-off-by: Dima Zavin <dima@android.com>
2011-10-04 17:28:47 -07:00
JP Abgrall
4f3824a38c netfilter: ipv6: fix crash caused by ipv6_find_hdr()
When calling:
    ipv6_find_hdr(skb, &thoff, -1, NULL)
on a fragmented packet, thoff would be left with a random
value causing callers to read random memory offsets with:
    skb_header_pointer(skb, thoff, ...)

Now we force ipv6_find_hdr() to return a failure in this case.
Calling:
  ipv6_find_hdr(skb, &thoff, -1, &fragoff)
will set fragoff as expected, and not return a failure.

Change-Id: Ib474e8a4267dd2b300feca325811330329684a88
Signed-off-by: JP Abgrall <jpa@google.com>
2011-09-30 19:24:19 -07:00
JP Abgrall
5c35106592 netfilter: xt_qtaguid: add missing tracking for no filp case
In cases where the skb would have an sk_socket but no file, that skb
would not be counted at all. Assigning to uid 0 now.

Adding extra counters to track skb counts.

Change-Id: If049b4b525e1fbd5afc9c72b4a174c0a435f2ca7
Signed-off-by: JP Abgrall <jpa@google.com>
2011-09-29 19:14:27 -07:00
Dmitry Shmidt
f73747b051 net: wireless: bcmdhd: Fix get_noa() and set_noa() commands
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-09-28 17:12:02 -07:00
Dmitry Shmidt
8ee397dbb9 net: wireless: bcmdhd: Combined P2P fix
- Fix random kernel panic during p2p certification and change private
  command for set_ap_wps_ie of wpa_supplicant
- Fix problem for 5.1.18 discoverability exchange of P2P sigma
- Fix problem for 7.1.3 to change PM_FAST to PM_MAX (802.11 legacy power save)
- Change type of signal variable in wl_inform_single_bss from uint to int
- Fix crash on P2P interface removal
- Add new DHD_BLOC logic for our internal purposes to keep track of FW crashes
  and build info

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-09-27 12:26:09 -07:00
Todd Poynor
5d034bc430 usb: otg: Temporarily grab wakelock on charger and disconnect events
Change-Id: If995d4af4adcb08e8369009483f2956ad9627267
Signed-off-by: Todd Poynor <toddpoynor@google.com>
2011-09-26 23:36:48 -07:00
JP Abgrall
c843dede96 netfilter: xt_qtaguid: fix crash after using delete ctrl command
* Crash fix
The delete command would delete a socket tag entry without removing it
from the proc_qtu_data { ..., sock_tag_list, }.
This in turn would cause an exiting process to crash while cleaning up
its matching proc_qtu_data.

* Added more aggressive tracking/cleanup of proc_qtu_data
This should allow one process to cleanup qtu_tag_data{} left around from
processes that didn't use resource tracking via /dev/xt_qtaguid.

* Debug printing tweaks
Better code inclusion/exclusion handling,
and extra debug out of full state.

Change-Id: I735965af2962ffcd7f3021cdc0068b3ab21245c2
Signed-off-by: JP Abgrall <jpa@google.com>
2011-09-25 19:24:14 -07:00
Colin Cross
b1d0d5fe07 PM: runtime: add might_sleep to PM runtime functions
The list of functions that can be called in atomic context is
non-intuitive (pm_runtime_put_sync can not, but
pm_runtime_put_sync_suspend can, if pm_runtime_irq_safe has
been called?).  The code is actively misleading - the entry
points all start with spin_lock_irqsave, suggesting they
are safe to call in atomic context, but may later
enable interrupts.

Add might_sleep_if to all the __pm_runtime_* entry points
to enforce correct usage.

Also add pm_runtime_put_sync_autosuspend to the list of
functions that can be called in atomic context.

Change-Id: Icac17a10d77c64d44bd2761a91a588dfd1d0c6f0
Signed-off-by: Colin Cross <ccross@android.com>
2011-09-23 20:08:51 -07:00
Dmitry Shmidt
3e59ce0fde net: wireless: bcmdhd: Remove unnecessary rtnl_lock() calls
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-09-23 13:55:58 -07:00
Dmitry Shmidt
36cc2d0c3a net: wireless: bcmdhd: Fix SB address window caching
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-09-23 13:55:43 -07:00
Dmitry Shmidt
d72feaa3ce net: wireless: bcmdhd: Fix scan notification in case of scan abort
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-09-22 16:30:36 -07:00
Jaikumar Ganesh
6c6f91c533 HID: Add null check for hidinput.
Add null check for hidinput before calling input_register.

Change-Id: Ib3fc0507e4091192360f3395d13d489db9b5a4d2
Signed-off-by: Jaikumar Ganesh <jaikumarg@android.com>
2011-09-21 17:19:38 -07:00
Jaikumar Ganesh
786240ce3b HID: magicmouse: Add input_register callback.
The magicmouse driver needs to setup the input mapping
after reports are parsed but before device is registered.

Change-Id: Ic3a0ff4fc056f5d374bb7ea1bd831a175c690b0b
Signed-off-by: Jaikumar Ganesh <jaikumarg@android.com>
2011-09-21 13:52:27 -07:00
Jaikumar Ganesh
8bf44e90c8 HID: Add input_register callback.
Add input_register callback which gets called after
hid_configure_usage is called for all the reports
and before the input device is registered. This allows
individual drivers to do extra work like input mapping just
before device registration.

Based on discussions with David Herrmann <dh.herrmann@googlemail.com>

Change-Id: Idab6fb4f7b1e5e569bd0410967288717e9d34c98
Signed-off-by: Jaikumar Ganesh <jaikumarg@android.com>
2011-09-21 13:47:49 -07:00
Dmitry Shmidt
0eb5aac3aa net: wireless: bcmdhd: Update to Version 5.90.125.87
- Improve discovery of FW hanging
- Add WFD noa and power-safe related functions

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-09-21 13:22:10 -07:00
JP Abgrall
7007813a12 netfilter: xt_qtaguid: change WARN_ONCE into pr_warn_once
Make the warning less scary.

Change-Id: I0276c5413e37ec991f24db57aeb90333fb1b5a65
Signed-off-by: JP Abgrall <jpa@google.com>
2011-09-20 14:23:51 -07:00
JP Abgrall
1d1fa838dd netfilter: xt_qtaguid: provide an iface_stat_all proc entry
There is a
  /proc/net/xt_qtaguid/iface/<iface>/{rx_bytes,rx_packets,tx_bytes,...}
but for better convenience and to avoid getting overly stale net/dev stats
we now have
  /proc/net/xt_qtaguid/iface_stat_all
which outputs lines of:
  iface_name active rx_bytes rx_packets tx_bytes tx_packets
    net_dev_rx_bytes net_dev_rx_packets net_dev_tx_bytes net_dev_tx_packets

Change-Id: I12cc10d2d123b86b56d4eb489b1d77b2ce72ebcf
Signed-off-by: JP Abgrall <jpa@google.com>
2011-09-20 09:44:41 -07:00
Colin Cross
5ea3a7c6c6 ARM: cache-l2x0: update workaround for PL310 errata 727915
ARM errata 727915 for PL310 has been updated to include a new
workaround required for PL310 r2p0 for l2x0_flush_all, which also
affects l2x0_clean_all in my testing.  For r2p0, clean or flush
each set/way individually.  For r3p0 or greater, use the debug
register for cleaning and flushing.

Requires exporting the cache_id, sets and ways detected in the
init function for later use.

Change-Id: I215055cbe5dc7e4e8184fb2befc4aff672ef0a12
Signed-off-by: Colin Cross <ccross@android.com>
2011-09-19 23:35:45 -07:00
Colin Cross
5cd52e0502 cpuidle: governor: menu: don't use loadavg
get_loadavg doesn't work as intended.  According to the comments, it
should be returning an average over a few seconds, but it is actually
reading the instantaneous load.  It is almost always returning 0, but
can sometimes, depending on workload, spike very high into the hundreds
even when the average cpu load is under 10%.  Disable it for now.

Change-Id: I63ed100af1cf9463549939b8113ed83676db5f86
Signed-off-by: Colin Cross <ccross@android.com>
2011-09-19 16:56:40 -07:00
Dmitry Shmidt
9cbad3982d net: wireless: bcmdhd: Suppress dhd_pno_set message in case of success
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-09-19 12:37:49 -07:00
Dmitry Shmidt
9897481d97 net: wireless: bcmdhd: Enable P2P events only for P2P FW
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-09-18 16:15:19 -07:00