firefly-linux-kernel-4.4.55.git
14 years agoStaging: android: timed_gpio: Request gpios.
Arve Hjønnevåg [Thu, 7 Jan 2010 01:17:33 +0000 (17:17 -0800)]
Staging: android: timed_gpio: Request gpios.

Change-Id: I9e98250a04e5505ce2db2edd355e8fdf8391cabd
Signed-off-by: Arve Hjønnevåg <arve@android.com>
14 years agoStaging: android: ram_console: Start ram console earlier
Arve Hjønnevåg [Fri, 18 Dec 2009 07:42:08 +0000 (23:42 -0800)]
Staging: android: ram_console: Start ram console earlier

Change-Id: I15d809d8c3002e5bf397a2b154e3803ea0e73642
Signed-off-by: Arve Hjønnevåg <arve@android.com>
14 years agomisc: apanic: erase kpanic when no data
Tom Zhu [Thu, 24 Sep 2009 15:58:50 +0000 (10:58 -0500)]
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>
14 years agomisc: apanic: bad block handling
Tom Zhu [Mon, 21 Sep 2009 21:36:05 +0000 (16:36 -0500)]
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>
14 years agoramconsole/apanic: Ensure ramconsole does not get cluttered by apanic threads
San Mehat [Thu, 17 Sep 2009 21:27:41 +0000 (14:27 -0700)]
ramconsole/apanic: Ensure ramconsole does not get cluttered by apanic threads

Signed-off-by: San Mehat <san@google.com>
14 years agodrivers: apanic: Android kernel panic handler.
San Mehat [Tue, 1 Sep 2009 20:43:01 +0000 (13:43 -0700)]
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>
14 years agoproc: smaps: Allow smaps access for CAP_SYS_RESOURCE
San Mehat [Wed, 16 Sep 2009 19:39:10 +0000 (12:39 -0700)]
proc: smaps: Allow smaps access for CAP_SYS_RESOURCE

Signed-off-by: San Mehat <san@google.com>
14 years agokernel: printk: Add non exported function for clearing the log ring buffer
San Mehat [Thu, 6 Aug 2009 17:25:21 +0000 (10:25 -0700)]
kernel: printk: Add non exported function for clearing the log ring buffer

Signed-off-by: San Mehat <san@google.com>
14 years ago[ARM] process: Add display of memory around registers when displaying regs.
San Mehat [Tue, 25 Aug 2009 23:52:22 +0000 (16:52 -0700)]
[ARM] process: Add display of memory around registers when displaying regs.

This is extremely useful in diagnosing remote crashes, and is based heavily
on original work by <md@google.com>.

Signed-off-by: San Mehat <san@google.com>
Cc: Michael Davidson <md@google.com>
[ARM] process: Use uber-safe probe_kernel_address() to read mem when dumping.

This prevents the dump from taking pagefaults / external aborts.

Signed-off-by: San Mehat <san@google.com>
14 years agomtd: nand: Add naieve panic_write support for generic nand devices.
San Mehat [Thu, 20 Aug 2009 17:50:45 +0000 (10:50 -0700)]
mtd: nand: Add naieve panic_write support for generic nand devices.

Signed-off-by: San Mehat <san@google.com>
mtd: nand_base: fix nand_panic_wait

fix the problem of nand_panic_wait

Signed-off-by: Tom Zhu <a2289c@android-hal-04.(none)>
Signed-off-by: San Mehat <san@google.com>
14 years agodrivers: power: Add watchdog timer to catch drivers which lockup during suspend.
San Mehat [Thu, 13 Aug 2009 16:40:42 +0000 (09:40 -0700)]
drivers: power: Add watchdog timer to catch drivers which lockup during suspend.

Rather than hard-lock the kernel, we now BUG() when a driver takes
> 3 seconds to suspend. If the underlying platform supports panic dumps,
then the data can be collected for debug.

Signed-off-by: San Mehat <san@google.com>
14 years agoBluetooth: Hack: Do not use power_save feature.
Nick Pelly [Thu, 4 Feb 2010 17:06:57 +0000 (09:06 -0800)]
Bluetooth: Hack: Do not use power_save feature.

power_save is a feature to allow HID devices to control the sniff mode.
Unfortunately it also prevents us exiting sniff mode on some A2DP devices
that do not explicitly exit sniff mode themselves, resulting in skipping
audio.

Marcel is trying to finalize a setsockopt() API to control whether power_save
is enabled on a per socket basis. In the mean-time, turn off power_save for
Android, since we do not have official HID support, and this is causing
problems for A2DP which we do support.

(Note the power_save logic is reversed, 0 is on, 1 is off).

Change-Id: Ife4478055128b81669bf49308d2e2199e1aa11a1
Signed-off-by: Nick Pelly <npelly@google.com>
14 years agoBluetooth: Introduce L2CAP_LM_FLUSHABLE to allow flushing of ACL packets.
Nick Pelly [Wed, 9 Dec 2009 03:42:21 +0000 (19:42 -0800)]
Bluetooth: Introduce L2CAP_LM_FLUSHABLE to allow flushing of ACL packets.

With Bluetooth 2.1 ACL packets can be flushable or non-flushable. This changes
makes the default ACL packet non-flushable, and allows selection of flushable
packets on a per-L2CAP socket basis with L2CAP_LM_FLUSHABLE.

Note the HCI Write Automatic Flush Timeout command also needs to be issued
to set the flush timeout to non-zero.

Need to featurize this change to Bluetooth 2.1 chipsets only before pushing
upstream.

Signed-off-by: Nick Pelly <npelly@google.com>
14 years agoBluetooth: Add ACL MTU, available buffers and total buffers to hci_conn_info.
Nick Pelly [Wed, 9 Dec 2009 08:15:41 +0000 (00:15 -0800)]
Bluetooth: Add ACL MTU, available buffers and total buffers to hci_conn_info.

This provides userspace debugging tools access to ACL flow control state.

Signed-off-by: Nick Pelly <npelly@google.com>
14 years agoBluetooth: Enter active mode before establishing a SCO link.
Nick Pelly [Fri, 13 Nov 2009 22:16:32 +0000 (14:16 -0800)]
Bluetooth: Enter active mode before establishing a SCO link.

When in sniff mode with a long interval time (1.28s) it can take 4+ seconds to
establish a SCO link. Fix by requesting active mode before requesting SCO
connection. This improves SCO setup time to ~500ms.

Bluetooth headsets that use a long interval time, and exhibit the long SCO
connection time include Motorola H790, HX1 and H17. They have a CSR 2.1 chipset

Verified this behavior and fix with host Bluetooth chipsets: BCM4329 and
TI1271.

Signed-off-by: Nick Pelly <npelly@google.com>
14 years agoBluetooth: Fallback to SCO on error code 0x10 (Connection Accept Timeout).
Nick Pelly [Tue, 22 Sep 2009 22:19:46 +0000 (15:19 -0700)]
Bluetooth: Fallback to SCO on error code 0x10 (Connection Accept Timeout).

This is to support the Motorola HF850 carkit which reports the error code 0x10
for an eSCO attempt, even though it advertises eSCO support. Here is the
hcidump:

2009-09-22 15:40:24.492391 < HCI Command: Setup Synchronous Connection
(0x01|0x0028) plen 17
    handle 1 voice setting 0x0060
2009-09-22 15:40:24.493002 > HCI Event: Command Status (0x0f) plen 4
    Setup Synchronous Connection (0x01|0x0028) status 0x00 ncmd 1
2009-09-22 15:40:30.594869 > HCI Event: Synchronous Connect Complete (0x2c)
plen 17
    status 0x10 handle 257 bdaddr 00:50:CD:20:C6:84 type eSCO
    Error: Connection Accept Timeout Exceeded

With this patch we will retry with a SCO connection, which succeeds.

Unfortunately the Moto HF850 also takes 5 seconds to return the error for the
eSCO attempt, so it will still take 5 seconds to fallback to SCO with this
patch.

Signed-off-by: Nick Pelly <npelly@google.com>
14 years agoBluetooth: Do not call rfcomm_session_put() due to RFCOMM UA on closed socket.
Nick Pelly [Tue, 22 Sep 2009 01:20:03 +0000 (18:20 -0700)]
Bluetooth: Do not call rfcomm_session_put() due to RFCOMM UA on closed socket.

Processing a RFCOMM UA frame when the socket is closed and we were not the
RFCOMM initiator would cause rfcomm_session_put() to be called twice during
rfcomm_process_rx(). This would cause a kernel panic in rfcomm_session_close.

This could be easily reproduced during disconnect with devices such as
Motorola H270 that send RFCOMM UA followed quickly by L2CAP disconnect request.
This hcidump for this looks like:

2009-09-21 17:22:37.788895 < ACL data: handle 1 flags 0x02 dlen 8
   L2CAP(d): cid 0x0041 len 4 [psm 3]
     RFCOMM(s): DISC: cr 0 dlci 20 pf 1 ilen 0 fcs 0x7d
2009-09-21 17:22:37.906204 > HCI Event: Number of Completed Packets (0x13)
plen 5
   handle 1 packets 1
2009-09-21 17:22:37.933090 > ACL data: handle 1 flags 0x02 dlen 8
   L2CAP(d): cid 0x0040 len 4 [psm 3]
     RFCOMM(s): UA: cr 0 dlci 20 pf 1 ilen 0 fcs 0x57
2009-09-21 17:22:38.636764 < ACL data: handle 1 flags 0x02 dlen 8
   L2CAP(d): cid 0x0041 len 4 [psm 3]
     RFCOMM(s): DISC: cr 0 dlci 0 pf 1 ilen 0 fcs 0x9c
2009-09-21 17:22:38.744125 > HCI Event: Number of Completed Packets (0x13)
plen 5
   handle 1 packets 1
2009-09-21 17:22:38.763687 > ACL data: handle 1 flags 0x02 dlen 8
   L2CAP(d): cid 0x0040 len 4 [psm 3]
     RFCOMM(s): UA: cr 0 dlci 0 pf 1 ilen 0 fcs 0xb6
2009-09-21 17:22:38.783554 > ACL data: handle 1 flags 0x02 dlen 12
   L2CAP(s): Disconn req: dcid 0x0040 scid 0x0041

Avoid calling rfcomm_session_put() twice by skipping this call
in rfcomm_recv_ua() if the socket is closed.

Signed-off-by: Nick Pelly <npelly@google.com>
14 years agoBluetooth: Increase timeout for legacy pairing from 10 seconds to 40 seconds.
Nick Pelly [Sat, 19 Sep 2009 01:29:23 +0000 (18:29 -0700)]
Bluetooth: Increase timeout for legacy pairing from 10 seconds to 40 seconds.

Legacy pairing is a bit of a problem because on the incoming end it is
impossible to know pairing has begun:

2009-09-18 18:29:24.115692 > HCI Event: Connect Request (0x04) plen 10
    bdaddr 00:23:D4:04:51:7A class 0x58020c type ACL
2009-09-18 18:29:24.115966 < HCI Command: Accept Connection Request (0x01|0x0009) plen 7
    bdaddr 00:23:D4:04:51:7A role 0x00
    Role: Master
2009-09-18 18:29:24.117065 > HCI Event: Command Status (0x0f) plen 4
    Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1
2009-09-18 18:29:24.282928 > HCI Event: Role Change (0x12) plen 8
    status 0x00 bdaddr 00:23:D4:04:51:7A role 0x00
    Role: Master
2009-09-18 18:29:24.291534 > HCI Event: Connect Complete (0x03) plen 11
    status 0x00 handle 1 bdaddr 00:23:D4:04:51:7A type ACL encrypt 0x00
2009-09-18 18:29:24.291839 < HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
    handle 1
2009-09-18 18:29:24.292144 > HCI Event: Page Scan Repetition Mode Change (0x20) plen 7
    bdaddr 00:23:D4:04:51:7A mode 1
2009-09-18 18:29:24.293823 > HCI Event: Command Status (0x0f) plen 4
    Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 1
2009-09-18 18:29:24.303588 > HCI Event: Max Slots Change (0x1b) plen 3
    handle 1 slots 5
2009-09-18 18:29:24.309448 > HCI Event: Read Remote Supported Features (0x0b) plen 11
    status 0x00 handle 1
    Features: 0xff 0xff 0x2d 0xfe 0x9b 0xff 0x79 0x83
2009-09-18 18:29:24.345916 < HCI Command: Remote Name Request (0x01|0x0019) plen 10
    bdaddr 00:23:D4:04:51:7A mode 2 clkoffset 0x0000
2009-09-18 18:29:24.346923 > HCI Event: Command Status (0x0f) plen 4
    Remote Name Request (0x01|0x0019) status 0x00 ncmd 1
2009-09-18 18:29:24.375793 > HCI Event: Remote Name Req Complete (0x07) plen 255
    status 0x00 bdaddr 00:23:D4:04:51:7A name 'test'
2009-09-18 18:29:34.332190 < HCI Command: Disconnect (0x01|0x0006) plen 3
    handle 1 reason 0x13

There are some mainline patches such as "Add different pairing timeout for
Legacy Pairing" but they do not address the HCI sequence above.

I think the real solution is to avoid using CreateBond(), and instead make
the profile connection immediately. This way both sides will use a longer
timeout because there is a higher level connection in progress, and we will
not end up with the useless HCI sequence above.

Signed-off-by: Nick Pelly <npelly@google.com>
14 years agoBluetooth: Fallback from eSCO to SCO on error code 0x1a (unsupported feature).
Nick Pelly [Fri, 14 Aug 2009 18:36:19 +0000 (11:36 -0700)]
Bluetooth: Fallback from eSCO to SCO on error code 0x1a (unsupported feature).

GM carkits with LGE BT chipsets return this error code when eSCO is attempted.

Signed-off-by: Jaikumar Ganesh <jaikumar@google.com>
Acked-by: Nick Pelly <npelly@google.com>
14 years agoBluetooth: Do not attempt to send dlci disconnect when in BT_CONFIG.
Nick Pelly [Thu, 9 Jul 2009 19:23:44 +0000 (12:23 -0700)]
Bluetooth: Do not attempt to send dlci disconnect when in BT_CONFIG.

This fixes a bug where shutdown() and close() on a rfcomm socket during ACL
connection would not cause HCI Create Connection Cancel.

Signed-off-by: Nick Pelly <npelly@google.com>
14 years agoserial_core: Add wake_peer uart operation which is called before starting UART TX...
San Mehat [Thu, 30 Jul 2009 03:21:28 +0000 (20:21 -0700)]
serial_core: Add wake_peer uart operation which is called before starting UART TX. The idea here is to provide a mechanism where we can wakeup our peer before sending data.

Signed-off-by: San Mehat <san@google.com>
14 years agorfkill: Introduce CONFIG_RFKILL_PM and use instead of CONFIG_PM to power down
Nick Pelly [Fri, 5 Dec 2008 01:37:05 +0000 (17:37 -0800)]
rfkill: Introduce CONFIG_RFKILL_PM and use instead of CONFIG_PM to power down

Some platforms do not want to power down rfkill devices on suspend.

Change-Id: I62a11630521c636d54a4a02ab9037a43435925f5
Signed-off-by: Nick Pelly <npelly@google.com>
14 years agowl127x-rfkill: Add power control driver for TI WL127X Bluetooth chips
Nick Pelly [Thu, 11 Jun 2009 17:49:48 +0000 (10:49 -0700)]
wl127x-rfkill: Add power control driver for TI WL127X Bluetooth chips

Signed-off-by: Nick Pelly <npelly@google.com>
14 years agokernel_debugger_core: add interrupt-context debugger core
Brian Swetland [Wed, 9 Apr 2008 05:34:46 +0000 (22:34 -0700)]
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>
14 years agoprintk: Fix log_buf_copy termination.
Arve Hjønnevåg [Tue, 15 Apr 2008 04:35:25 +0000 (21:35 -0700)]
printk: Fix log_buf_copy termination.

If idx was non-zero and the log had wrapped, len did not get truncated
to stop at the last byte written to the log.

14 years agoRevert "printk: remove unused code from kernel/printk.c"
Arve Hjønnevåg [Fri, 16 Jan 2009 03:07:27 +0000 (19:07 -0800)]
Revert "printk: remove unused code from kernel/printk.c"

This reverts commit acff181d3574244e651913df77332e897b88bff4.

14 years agonet: Replace AID_NET_RAW checks with capable(CAP_NET_RAW).
Chia-chi Yeh [Tue, 30 Jun 2009 03:23:04 +0000 (11:23 +0800)]
net: Replace AID_NET_RAW checks with capable(CAP_NET_RAW).

Signed-off-by: Chia-chi Yeh <chiachi@android.com>
14 years agosecurity: Add AID_NET_RAW and AID_NET_ADMIN capability check in cap_capable().
Chia-chi Yeh [Thu, 18 Jun 2009 23:15:05 +0000 (07:15 +0800)]
security: Add AID_NET_RAW and AID_NET_ADMIN capability check in cap_capable().

Signed-off-by: Chia-chi Yeh <chiachi@android.com>
14 years agonet: PPPoPNS and PPPoLAC fixes.
Chia-chi Yeh [Fri, 12 Jun 2009 18:29:04 +0000 (02:29 +0800)]
net: PPPoPNS and PPPoLAC fixes.

net: Fix a bitmask in PPPoPNS and rename constants in PPPoPNS and PPPoLAC.

Signed-off-by: Chia-chi Yeh <chiachi@android.com>
net: Fix a potential deadlock while releasing PPPoLAC/PPPoPNS socket.

PPP driver guarantees that no thread will be executing start_xmit() after
returning from ppp_unregister_channel(). To achieve this, a spinlock (downl)
is used. In pppolac_release(), ppp_unregister_channel() is called after sk_udp
is locked. At the same time, another thread might be running in pppolac_xmit()
with downl. Thus a deadlock will occur if the thread tries to lock sk_udp.
The same situation might happen on sk_raw in pppopns_release().

Signed-off-by: Chia-chi Yeh <chiachi@android.com>
net: Force PPPoLAC and PPPoPNS to bind an interface before creating PPP channel.

It is common to manipulate the routing table after configuring PPP device.
Since both PPPoLAC and PPPoPNS run over IP, care must be taken to make sure
that there is no loop in the routing table.
Although this can be done by adding a host route, it might still cause
problems when the interface is down for some reason.

To solve this, this patch forces both drivers to bind an interface before
creating PPP channel, so the system will not re-route the tunneling sockets
to another interface when the original one is down. Another benefit is that
now the host route is no longer required, so there is no need to remove it
when PPP channel is closed.

Signed-off-by: Chia-chi Yeh <chiachi@android.com>
net: Avoid sleep-inside-spinlock in PPPoLAC and PPPoPNS.

Since recv() and xmit() are called with a spinlock held, routines which might
sleep cannot be used. This issue is solved by following changes:

Incoming packets are now processed in backlog handler, recv_core(), instead of
recv(). Since backlog handler is always executed with socket spinlock held, the
requirement of ppp_input() is still satisfied.

Outgoing packets are now processed in workqueue handler, xmit_core(), instead of
xmit(). Note that kernel_sendmsg() is no longer used to prevent touching dead
sockets.

In release(), lock_sock() and pppox_unbind_sock() ensure that no thread is in
recv_core() or xmit(). Then socket handlers are restored before release_sock(),
so no packets will leak in backlog queue.

Signed-off-by: Chia-chi Yeh <chiachi@android.com>
net: Fix msg_iovlen in PPPoLAC and PPPoPNS.

Although any positive value should work (which is always true in both drivers),
the correct value should be 1.

Signed-off-by: Chia-chi Yeh <chiachi@android.com>
14 years agonet: add PPP on PPTP Network Server (PPPoPNS) driver.
Chia-chi Yeh [Thu, 11 Jun 2009 17:09:30 +0000 (01:09 +0800)]
net: add PPP on PPTP Network Server (PPPoPNS) driver.

Signed-off-by: Chia-chi Yeh <chiachi@android.com>
14 years agonet: add PPP on L2TP Access Concentrator (PPPoLAC) driver.
Chia-chi Yeh [Thu, 7 May 2009 20:02:40 +0000 (04:02 +0800)]
net: add PPP on L2TP Access Concentrator (PPPoLAC) driver.

Signed-off-by: Chia-chi Yeh <chiachi@android.com>
14 years agocgroup: Add generic cgroup subsystem permission checks.
San Mehat [Thu, 21 May 2009 21:10:06 +0000 (14:10 -0700)]
cgroup: Add generic cgroup subsystem permission checks.

    Rather than using explicit euid == 0 checks when trying to move
tasks into a cgroup via CFS, move permission checks into each
specific cgroup subsystem. If a subsystem does not specify a
'can_attach' handler, then we fall back to doing our checks the old way.

    This way non-root processes can add arbitrary processes to
a cgroup if all the registered subsystems on that cgroup agree.

    Also change explicit euid == 0 check to CAP_SYS_ADMIN

Signed-off-by: San Mehat <san@google.com>
14 years agoyaffs: Better control over rename shadowing
Charles Manning [Mon, 7 Dec 2009 23:40:28 +0000 (12:40 +1300)]
yaffs: Better control over rename shadowing

The shadowing mechanism is used to ensure that the right
interlocking happens when an object is renamed over an existing object.

Extreme power fail stress testing revealed that garbage collection could
disrupt the shadowing process causing object loss.

This fixes the problem and has survived millions of simulated power failures.

Change-Id: I1c9c4365632c0f8be4ed6a4b41534a732ea81507
Signed-off-by: Charles Manning <cdhmanning@gmail.com>
14 years agoyaffs: Fix readdir hang.
Charles Manning [Mon, 16 Nov 2009 18:49:32 +0000 (07:49 +1300)]
yaffs: Fix readdir hang.

This aproach uses a search context iterator to allow yaffs to be
unlocked during the filldir. The search context stores the next
object to visited. If changes to the directory (ie unlinks) cause
the directory to be modified then a callback moves the iterator
to the next object if need be, thus preventing the iterator from
being corrupted.

Change-Id: Ia4735e42732f03a396ced7275e33facdc4f1beac
Signed-off-by: Charles Manning <cdhmanning@gmail.com>
14 years agoAdd handling for unrooted files
Charles Manning [Thu, 5 Nov 2009 00:15:21 +0000 (13:15 +1300)]
Add handling for unrooted files

Unrooted files should only happen due to a now fixed bug that
would rmdir non-empty directories.
Unrooted files are now re-rooted in lost_found.

This also introduces a mechanism to empty out lost and found at
mount, thus recaliming this space. This option may be controlled
via a compile flag and overridden with a mount option.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
14 years agoFix yaffs checkpoint out of space crash
Charles Manning [Thu, 29 Oct 2009 23:08:15 +0000 (12:08 +1300)]
Fix yaffs checkpoint out of space crash
An ealy return from checkpoint opening caused the writing flag
to be set incorrectly which caused the wrong execution path during
the close.

Also clean up space left behind by aborted checkpoints.

Also jsut neaten up NULL handling.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
14 years agoyaffs: Don't update page read and write counts from yaffs_mtdif2.
Arve Hjønnevåg [Thu, 17 Sep 2009 21:52:42 +0000 (14:52 -0700)]
yaffs: Don't update page read and write counts from yaffs_mtdif2.

These counters are now updated from yaffs_nand.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
14 years agoyaffs: Import yaffs from Wed Sep 9 03:03:01 2009 +0000
Arve Hjønnevåg [Thu, 17 Sep 2009 01:30:41 +0000 (18:30 -0700)]
yaffs: Import yaffs from Wed Sep 9 03:03:01 2009 +0000

Author: charles <charles>
Date:   Wed Sep 9 03:03:01 2009 +0000

    Rationalise stats gathering for nand access. Does not instrument mounting.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
14 years agoyaffs: Fix yaffs_file_write to not return -ENOSPC when there is nothing to write
Arve Hjønnevåg [Thu, 7 May 2009 00:37:10 +0000 (17:37 -0700)]
yaffs: Fix yaffs_file_write to not return -ENOSPC when there is nothing to write

yaffs_write_end may get called with copied == 0 if the requested write was
interrupted by a signal, but user-space will not restart the write if -ENOSPC
is returned.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
14 years agoyaffs: Update stats when using mtdif2.
Arve Hjønnevåg [Sat, 4 Apr 2009 02:05:50 +0000 (19:05 -0700)]
yaffs: Update stats when using mtdif2.

14 years agoyaffs: Pass through single bit errors from MTD.
Arve Hjønnevåg [Sat, 4 Apr 2009 01:58:31 +0000 (18:58 -0700)]
yaffs: Pass through single bit errors from MTD.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
14 years agoyaffs: Set YAFFS_IGNORE_TAGS_ECC if compiled without ECC support.
Arve Hjønnevåg [Sat, 18 Oct 2008 04:06:15 +0000 (21:06 -0700)]
yaffs: Set YAFFS_IGNORE_TAGS_ECC if compiled without ECC support.

14 years agoyaffs: Import yaffs from Tue Mar 17 01:12:00 2009 +0000
Arve Hjønnevåg [Sat, 4 Apr 2009 00:45:58 +0000 (17:45 -0700)]
yaffs: Import yaffs from Tue Mar 17 01:12:00 2009 +0000

Author: wookey <wookey>
Date:   Tue Mar 17 01:12:00 2009 +0000

    This file escaped copyright date update. Fixed.

14 years agofs: block_dump: Don't display inode changes if block_dump < 2
San Mehat [Sun, 22 Mar 2009 01:48:54 +0000 (18:48 -0700)]
fs: block_dump: Don't display inode changes if block_dump < 2

Signed-off-by: San Mehat <san@android.com>
14 years agoblock: block_dump: Add number of sectors to debug output
San Mehat [Sun, 22 Mar 2009 01:48:05 +0000 (18:48 -0700)]
block: block_dump: Add number of sectors to debug output

Signed-off-by: San Mehat <san@android.com>
14 years agotiwlan: Add abstract wifi control functions support
Dmitry Shmidt [Thu, 18 Dec 2008 17:55:20 +0000 (09:55 -0800)]
tiwlan: Add abstract wifi control functions support

14 years agoUSB: gadget: android: android USB gadget improvements:
Mike Lockwood [Tue, 12 Jan 2010 18:33:59 +0000 (10:33 -0800)]
USB: gadget: android: android USB gadget improvements:

usb: gadget: f_mass_storage: use dev_set_name()

Replacing strcpy() to device->bus_id which no longer exists in 2.6.32

Change-Id: Id978c881f457044c750bfd62f4c5bcc35bcd4fc5
Signed-off-by: Mike Lockwood <lockwood@android.com>
USB: gadget: f_adb: Claim endpoints so they are not reused by another function.

Change-Id: Ic9536cca800162e701c81cab36054f51ea759b72
Signed-off-by: Mike Lockwood <lockwood@android.com>
USB: gadget: f_acm: Fix crashes in acm_set_alt()

Change-Id: I91b761d392f8b1ca8784c69069b43e402b90d6a4
Signed-off-by: Mike Lockwood <lockwood@android.com>
USB: gadget: f_acm: Include android code only if CONFIG_USB_ANDROID_ACM is set.

Signed-off-by: Mike Lockwood <lockwood@android.com>
USB: gadget: Android support for RNDIS serial ethernet function.

Signed-off-by: Mike Lockwood <lockwood@android.com>
USB: gadget: android: Add function name to android_register_function printk.

Change-Id: I38bf79d9b544cdeaec9385f7482a131417fc4b23
Signed-off-by: Mike Lockwood <lockwood@android.com>
14 years agoUSB: gadget: adb: Queue read requests with length specified by client.
Mike Lockwood [Sat, 19 Dec 2009 23:22:09 +0000 (18:22 -0500)]
USB: gadget: adb: Queue read requests with length specified by client.

Previously we queued 4K requests rather than the count passed into read().

Signed-off-by: Mike Lockwood <lockwood@android.com>
14 years agoUSB: gadget: android: android USB gadget improvements:
Krishna, Vamsi [Wed, 11 Feb 2009 15:37:20 +0000 (21:07 +0530)]
USB: gadget: android: android USB gadget improvements:

USB: android gadget: add remote wakeup attribute to android function

Add remote wakeup attribute to configuration descriptor of android
function to advertise remote wakeup capability to host

Acked-by: Allam, Suresh Reddy <sallam@qualcomm.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
USB: gadget: android: Allow functions to handle setup requests.

Signed-off-by: Mike Lockwood <lockwood@android.com>
Support for specifying the list of USB functions from platform data.

The main android.c gadget driver no longer has hard coded references
to the mass_storage and adb functions.

Support for computing the product ID based on tables in platform data
and the currently enabled functions.

Moved the adb enable/disable logic from android.c to f_adb.c.

Change-Id: I6259d3fb1473ed973f700e55d17744956f3527bb
Signed-off-by: Mike Lockwood <lockwood@android.com>
14 years agoUSB: composite: Allow configurations to handle unhandled setup requests
Joe Swantek [Tue, 15 Dec 2009 12:17:40 +0000 (07:17 -0500)]
USB: composite: Allow configurations to handle unhandled setup requests

Signed-off-by: Mike Lockwood <lockwood@android.com>
14 years agoUSB: composite: Add flag to usb_function to hide its interface during enumeration
Mike Lockwood [Fri, 11 Dec 2009 16:24:07 +0000 (11:24 -0500)]
USB: composite: Add flag to usb_function to hide its interface during enumeration

Change-Id: Ie999b5190e3e2b6fd23015b8e796cdd178829929

Signed-off-by: Mike Lockwood <lockwood@android.com>
14 years agoUSB: composite: Fix USB WHQL Certification Issues
Jared Suttles [Fri, 7 Aug 2009 23:57:49 +0000 (18:57 -0500)]
USB: composite: Fix USB WHQL Certification Issues

Submitted on behalf of RaviKumar Vembu <ravi.v@motorola.com>
Signed-off-by: Jared Suttles <jared.suttles@motorola.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
14 years agodrivers: usb: gadget: Add helper function for installing ACM gadget function.
Joe Swantek [Thu, 23 Jul 2009 01:16:06 +0000 (20:16 -0500)]
drivers: usb: gadget: Add helper function for installing ACM gadget function.

Submitted on behalf of James Luan <James.Luan@motorola.com>

Signed-off-by: Joe Swantek <joseph.swantek@motorola.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
14 years agodrivers: usb: gadget: handle NULL descriptors in composite config_buf
Jared Suttles [Thu, 30 Jul 2009 21:13:27 +0000 (16:13 -0500)]
drivers: usb: gadget: handle NULL descriptors in composite config_buf

This fixes a problem in enumeration after a gadget function is removed.

Submitted on behalf of RaviKumar Vembu <ravi.v@motorola.com>

Signed-off-by: Jared Suttles <jared.suttles@motorola.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
14 years agoandroid_usb: Composite USB gadget driver for android.
Mike Lockwood [Wed, 3 Dec 2008 03:01:33 +0000 (22:01 -0500)]
android_usb: Composite USB gadget driver for android.

Signed-off-by: Mike Lockwood <lockwood@android.com>
USB: android gadget: add remote wakeup attribute to android function

Add remote wakeup attribute to configuration descriptor of android
function to advertise remote wakeup capability to host

Acked-by: Allam, Suresh Reddy <sallam@qualcomm.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
usb gadget: link fixes for android composite gadget

Signed-off-by: Mike Lockwood <lockwood@android.com>
usb gadget: Fix null pointer errors in android composite driver

Signed-off-by: Mike Lockwood <lockwood@android.com>
usb: gadget: android: Allow usb charging to draw up to 500mA instead of 250.

Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
usb gadget: android: Add helper function for usb_gadget_connect and disconnect.

Signed-off-by: Mike Lockwood <lockwood@android.com>
drivers: usb: gadget: call switch_dev_unregister in mass storage unbind callback

This fixes a problem unloading the android gadget driver when built as a module

Signed-off-by: Mike Lockwood <lockwood@android.com>
usb: gadget: android: Add dependency on switch driver.

Signed-off-by: Mike Lockwood <lockwood@android.com>
USB: gadget: android: Fix USB WHQL Certification Issues

Submitted on behalf of RaviKumar Vembu <ravi.v@motorola.com>
Signed-off-by: Jared Suttles <jared.suttles@motorola.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
drivers: usb: gadget: Add "usb_mass_storage" platform driver.

This will be used for configuring vendor, product and release from board file.

Submitted on behalf of RaviKumar Vembu <ravi.v@motorola.com>
Signed-off-by: Jared Suttles <jared.suttles@motorola.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
drivers: usb: gadget: Use usb_mass_storage platform device as parent for lun

If a platform device is specified for the f_mass_storage function, use it as the
parent driver for the lun files in sysfs.
This allows a platform independent file path for controlling USB mass storage
from user space.

Signed-off-by: Mike Lockwood <lockwood@android.com>
drivers: usb: gadget: Add platform data struct for usb_mass_storage device

Signed-off-by: Mike Lockwood <lockwood@android.com>
usb: gadget: mass_storage: Fix Mass Storage Panic during PC reboot

Submitted on behalf of RaviKumar Vembu <ravi.v@motorola.com>
Signed-off-by: Jared Suttles <jared.suttles@motorola.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
usb: gadget: f_mass_storage: Handle setup request correctly

Signed-off-by: Mike Lockwood <lockwood@android.com>
usb: gadget: f_mass_storage: Clean up wakelocks on error paths

Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
14 years agodrivers: mmc: Fix minimal frequency assignment
Dmitry Shmidt [Wed, 3 Feb 2010 20:44:21 +0000 (12:44 -0800)]
drivers: mmc: Fix minimal frequency assignment

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
14 years agommc: allow for MMC v4.4
Adrian Hunter [Fri, 8 Jan 2010 22:43:01 +0000 (14:43 -0800)]
mmc: allow for MMC v4.4

JEDEC eMMC specification version 4.4 (MMCA 4.4) defines Extended CSD
structure versions up to 5.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: San Mehat <san@google.com>
14 years agommc_block: fix queue cleanup
Adrian Hunter [Fri, 8 Jan 2010 22:43:00 +0000 (14:43 -0800)]
mmc_block: fix queue cleanup

The main bug was that 'blk_cleanup_queue()' was called while the block
device could still be in use, for example, because the card was removed
while files were still open.

In addition, to be sure that 'mmc_request()' will get called for all new
requests (so it can error them out), the queue is emptied during cleanup.
This is done after the worker thread is stopped to avoid racing with it.

Finally, it is not a device error for this to be happening, so quiet the
(sometimes very many) error messages.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Cc: <linux-mmc@vger.kernel.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: San Mehat <san@google.com>
14 years agommc_block: fix probe error cleanup bug
Jarkko Lavinen [Fri, 8 Jan 2010 22:42:59 +0000 (14:42 -0800)]
mmc_block: fix probe error cleanup bug

If mmc_blk_set_blksize() fails mmc_blk_probe() the request queue and its
thread have been set up and they need to be shut down properly before
putting the disk.

Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com>
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Cc: <linux-mmc@vger.kernel.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: San Mehat <san@google.com>
14 years agommc_block: add dev_t initialization check
Anna Lemehova [Fri, 8 Jan 2010 22:42:58 +0000 (14:42 -0800)]
mmc_block: add dev_t initialization check

When a card is removed before mmc_blk_probe() has called add_disk(), then
the minor field is uninitialized and has value 0.  This caused
mmc_blk_put() to always release devidx 0 even if 0 was still in use.  Then
the next mmc_blk_probe() used the first free idx of 0, which oopses in
sysfs, since it is used by another card.

Signed-off-by: Anna Lemehova <EXT-Anna.Lemehova@nokia.com>
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Cc: <linux-mmc@vger.kernel.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: San Mehat <san@google.com>
14 years agommc: sdio: Add high speed support to sdio_reset_comm()
Daniel Chen [Wed, 9 Dec 2009 17:45:36 +0000 (09:45 -0800)]
mmc: sdio: Add high speed support to sdio_reset_comm()

Signed-off-by: San Mehat <san@google.com>
14 years agommc: block: Resume multi-block reads after transient read errors.
David Ding [Fri, 9 Oct 2009 13:38:10 +0000 (06:38 -0700)]
mmc: block: Resume multi-block reads after transient read errors.

Signed-off-by: Bentao Zou <bzou1@motorola.com>
Signed-off-by: David Ding <david.j.ding@motorola.com>
Signed-off-by: San Mehat <san@google.com>
14 years agommc: sdio: Claim host in sdio_reset_comm()
Dmitry Shmidt [Wed, 29 Jul 2009 17:22:03 +0000 (10:22 -0700)]
mmc: sdio: Claim host in sdio_reset_comm()

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
14 years agommc: mmcblk: Add support for deferred SD bus resume
San Mehat [Thu, 30 Jul 2009 15:21:19 +0000 (08:21 -0700)]
mmc: mmcblk: Add support for deferred SD bus resume

Signed-off-by: San Mehat <san@google.com>
mmc: card: Add MMC_BLOCK_DEFERRED_RESUME option to Kconfig

Signed-off-by: San Mehat <san@google.com>
14 years agommc: core: Add deferred bus resume policy.
San Mehat [Thu, 30 Jul 2009 14:55:28 +0000 (07:55 -0700)]
mmc: core: Add deferred bus resume policy.

A card driver can now specify that the underlying bus should *not*
auto-resume with the rest of the system. This is useful for reducing resume
latency as well as saving power when the card driver is not using the
bus. In the future, we'll add support for manual suspend

Signed-off-by: San Mehat <san@google.com>
14 years agommc: core: Hold a wake lock accross delayed work + mmc rescan
San Mehat [Mon, 23 Mar 2009 19:20:37 +0000 (12:20 -0700)]
mmc: core: Hold a wake lock accross delayed work + mmc rescan

Signed-off-by: San Mehat <san@android.com>
mmc: core: Rework mmc_delayed_work wakelock so that the wakelock is only extended if a card is added or removed.

Signed-off-by: San Mehat <san@google.com>
14 years agommc: sd: Add retries in re-detection
San Mehat [Thu, 4 Dec 2008 19:18:00 +0000 (11:18 -0800)]
mmc: sd: Add retries in re-detection

Signed-off-by: San Mehat <san@android.com>
mmc: sd: Remove debugging printk

Signed-off-by: Dima Zavin <dima@android.com>
14 years agommc: sd: When resuming, try a little harder to init the card
San Mehat [Mon, 1 Dec 2008 16:52:34 +0000 (08:52 -0800)]
mmc: sd: When resuming, try a little harder to init the card

Signed-off-by: San Mehat <san@android.com>
14 years agommc: Add new API call 'sdio_reset_comm' for resetting communication with an SDIO...
San Mehat [Thu, 15 May 2008 16:15:37 +0000 (09:15 -0700)]
mmc: Add new API call 'sdio_reset_comm' for resetting communication with an SDIO device

Signed-off-by: San Mehat <san@android.com>
14 years agotrout: Add functions for WiFi
Dmitry Shmidt [Tue, 11 Nov 2008 19:22:38 +0000 (11:22 -0800)]
trout: Add functions for WiFi

14 years agommc: Add concept of an 'embedded' SDIO device.
San Mehat [Mon, 14 Apr 2008 22:22:49 +0000 (15:22 -0700)]
mmc: Add concept of an 'embedded' SDIO device.

This is required to support chips which use SDIO for signaling/
communication but do not implement the various card enumeration registers
as required for full SD / SDIO cards.

mmc: sdio: Fix bug where we're freeing the CIS tables we never allocated when using EMBEDDED_SDIO
mmc: Add max_blksize to embedded SDIO data

Signed-off-by: San Mehat <san@google.com>
14 years agommc: sd: Add new CONFIG_MMC_PARANOID_SD_INIT for enabling retries during SD detection
San Mehat [Tue, 11 Nov 2008 17:35:36 +0000 (09:35 -0800)]
mmc: sd: Add new CONFIG_MMC_PARANOID_SD_INIT for enabling retries during SD detection

Signed-off-by: San Mehat <san@google.com>
14 years agommc: Add status IRQ and status callback function to mmc platform data
San Mehat [Tue, 11 Nov 2008 00:29:50 +0000 (16:29 -0800)]
mmc: Add status IRQ and status callback function to mmc platform data

Signed-off-by: San Mehat <san@google.com>
14 years agoInput: synaptics_i2c_rmi: Add irqflags to platform data struct to pass them to driver
Rebecca Schultz Zavin [Mon, 30 Mar 2009 05:10:22 +0000 (22:10 -0700)]
Input: synaptics_i2c_rmi: Add irqflags to platform data struct to pass them to driver

Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Signed-off-by: Arve Hjønnevåg <arve@android.com>
14 years agoInput: synaptics_i2c_rmi: Send new multi touch events
Arve Hjønnevåg [Tue, 21 Jul 2009 03:11:31 +0000 (20:11 -0700)]
Input: synaptics_i2c_rmi: Send new multi touch events

Send both fingers using the new multitouch protocol in addition to
the old single finger event and second finger ABS_HAT* hack.

The new protocol does not specify how to report up events. To make
sure the user-space frameworks can generate up events, we send at
least one event where ABS_MT_TOUCH_MAJOR is zero before we stop
sending events for a finger.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
14 years agoInput: synaptics_i2c_rmi: Add sensitivity adjust option.
Arve Hjønnevåg [Wed, 15 Jul 2009 03:51:49 +0000 (20:51 -0700)]
Input: synaptics_i2c_rmi: Add sensitivity adjust option.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
14 years agoInput: synaptics_i2c_rmi: Add support for panels with has-no-relative-data property.
Arve Hjønnevåg [Thu, 9 Jul 2009 04:32:06 +0000 (21:32 -0700)]
Input: synaptics_i2c_rmi: Add support for panels with has-no-relative-data property.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
14 years agoInput: synaptics_i2c_rmi: Driver for Synaptics Touchscreens using RMI over I2C.
Arve Hjønnevåg [Wed, 22 Aug 2007 04:56:46 +0000 (21:56 -0700)]
Input: synaptics_i2c_rmi: Driver for Synaptics Touchscreens using RMI over I2C.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
Input: synaptics_i2c_rmi: disable_irq -> disable_irq_nosync

Also remove duplicate swap macro

Signed-off-by: Arve Hjønnevåg <arve@android.com>
14 years agoinput: keychord: Add keychord driver
Mike Lockwood [Mon, 15 Dec 2008 19:51:56 +0000 (14:51 -0500)]
input: keychord: Add keychord driver

This driver allows userspace to receive notification when client
specified key combinations are pressed.
The client opens /dev/keychord and writes a list of keychords
for the driver to monitor.
The client then reads or polls /dev/keychord for notifications.
A client specified ID for the keychord is returned from read()
when a keychord press is detected.

Signed-off-by: Mike Lockwood <lockwood@android.com>
keychord: fix to build without CONFIG_PREEMPT

Change-Id: I911f13aeda4224b6fa57863bc7e8972fec8837fb

14 years agoinput: Add keyreset driver.
Arve Hjønnevåg [Sat, 22 Nov 2008 05:47:23 +0000 (21:47 -0800)]
input: Add keyreset driver.

Add a platform device in the board file to specify a reset key-combo.
The first time the key-combo is detected a work function that syncs
the filesystems is scheduled. If all the keys are released and then
pressed again, it calls panic. Reboot on panic should be set for
this to work.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
14 years agoInput: gpio_input: disable_irq -> disable_irq_nosync
Arve Hjønnevåg [Sat, 18 Apr 2009 01:24:59 +0000 (18:24 -0700)]
Input: gpio_input: disable_irq -> disable_irq_nosync

Signed-off-by: Arve Hjønnevåg <arve@android.com>
14 years agoInput: gpio_event: Allow multiple input devices per gpio_event device
Arve Hjønnevåg [Fri, 24 Jul 2009 22:19:56 +0000 (15:19 -0700)]
Input: gpio_event: Allow multiple input devices per gpio_event device

This is needed to support devices that put non-keyboard buttons in
the keyboard matrix. For instance several devices put the trackball
button in the keyboard matrix. In this case BTN_MOUSE should be
reported from the same input device as REL_X/Y.

It is also useful for devices that have multiple logical keyboard in
the same matrix. The HTC dream has a menu key on the external keyboard
and another menu key on the slide-out keyboard. With a single input
device only one of these menu keys can be mapped to KEY_MENU.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
14 years agoInput: gpio_input: Fix keys with keycode 0x100-0x1ff
Arve Hjønnevåg [Wed, 15 Jul 2009 03:58:41 +0000 (20:58 -0700)]
Input: gpio_input: Fix keys with keycode 0x100-0x1ff

KEY_MAX is no longer a power of 2.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
14 years agoInput: Generic GPIO Input device.
Arve Hjønnevåg [Thu, 16 Oct 2008 01:23:47 +0000 (18:23 -0700)]
Input: Generic GPIO Input device.

Supports keyboard matrixces, direct inputs, direct outputs and axes connected to gpios.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Nick Pelly <npelly@google.com>
14 years agoGrants system server access to /proc/<pid>/oom_adj for Android applications.
Mike Chan [Thu, 24 Apr 2008 17:22:26 +0000 (10:22 -0700)]
Grants system server access to /proc/<pid>/oom_adj for Android applications.

Signed-off-by: Brian Swetland <swetland@google.com>
14 years agoFAT: Add new ioctl VFAT_IOCTL_GET_VOLUME_ID for reading the volume ID.
Mike Lockwood [Sat, 15 Mar 2008 17:29:36 +0000 (13:29 -0400)]
FAT: Add new ioctl VFAT_IOCTL_GET_VOLUME_ID for reading the volume ID.

Signed-off-by: Brian Swetland <swetland@google.com>
14 years agouidstat: Adding uid stat driver to collect network statistics.
Mike Chan [Wed, 7 Jan 2009 19:40:42 +0000 (11:40 -0800)]
uidstat: Adding uid stat driver to collect network statistics.

Signed-off-by: Mike Chan <mike@android.com>
14 years agosysfs_net_ipv4: Add sysfs-based knobs for controlling TCP window size
Robert Love [Thu, 31 Jul 2008 15:12:44 +0000 (11:12 -0400)]
sysfs_net_ipv4: Add sysfs-based knobs for controlling TCP window size

Add a family of knobs to /sys/kernel/ipv4 for controlling the TCP window size:

tcp_wmem_min
tcp_wmem_def
tcp_wmem_max
tcp_rmem_min
tcp_rmem_def
tcp_rmem_max

This six values mirror the sysctl knobs in /proc/sys/net/ipv4/tcp_wmem and
/proc/sys/net/ipv4/tcp_rmem.

Sysfs, unlike sysctl, allows us to set and manage the files' permissions and
owners.

Signed-off-by: Robert Love <rlove@google.com>
14 years agonet: socket ioctl to reset connections matching local address
Robert Love [Mon, 12 May 2008 21:08:29 +0000 (17:08 -0400)]
net: socket ioctl to reset connections matching local address

Introduce a new socket ioctl, SIOCKILLADDR, that nukes all sockets
bound to the same local address. This is useful in situations with
dynamic IPs, to kill stuck connections.

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

Signed-off-by: Dima Zavin <dima@android.com>
net: ipv4: Fix a spinlock recursion bug in tcp_v4_nuke.

We can't hold the lock while calling to tcp_done(), so we drop
it before calling. We then have to start at the top of the chain again.

Signed-off-by: Dima Zavin <dima@android.com>
net: ipv4: Fix race in tcp_v4_nuke_addr().

To fix a recursive deadlock in 2.6.29, we stopped holding the hash table lock
across tcp_done() calls. This fixed the deadlock, but introduced a race where
the socket could die or change state.

Fix: Before unlocking the hash table, we grab a reference to the socket. We
can then unlock the hash table without risk of the socket going away. We then
lock the socket, which is safe because it is pinned. We can then call
tcp_done() without recursive deadlock and without race. Upon return, we unlock
the socket and then unpin it, killing it.

Change-Id: Idcdae072b48238b01bdbc8823b60310f1976e045
Signed-off-by: Robert Love <rlove@google.com>
Acked-by: Dima Zavin <dima@android.com>
ipv4: disable bottom halves around call to tcp_done().

Signed-off-by: Robert Love <rlove@google.com>
Signed-off-by: Colin Cross <ccross@android.com>
ipv4: Move sk_error_report inside bh_lock_sock in tcp_v4_nuke_addr

When sk_error_report is called, it wakes up the user-space thread, which then
calls tcp_close.  When the tcp_close is interrupted by the tcp_v4_nuke_addr
ioctl thread running tcp_done, it leaks 392 bytes and triggers a WARN_ON.

This patch moves the call to sk_error_report inside the bh_lock_sock, which
matches the locking used in tcp_v4_err.

Signed-off-by: Colin Cross <ccross@android.com>
14 years agoParanoid network.
Robert Love [Wed, 15 Oct 2008 19:35:44 +0000 (15:35 -0400)]
Paranoid network.

With CONFIG_ANDROID_PARANOID_NETWORK, require specific uids/gids to instantiate
network sockets.

Signed-off-by: Robert Love <rlove@google.com>
paranoid networking: Use in_egroup_p() to check group membership

The previous group_search() caused trouble for partners with module builds.
in_egroup_p() is also cleaner.

Signed-off-by: Nick Pelly <npelly@google.com>
Fix 2.6.29 build.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
net: Fix compilation of the IPv6 module

Fix compilation of the IPv6 module -- current->euid does not exist anymore,
current_euid() is what needs to be used.

Signed-off-by: Steinar H. Gunderson <sesse@google.com>
14 years agoashmem for 2.6.27.
Robert Love [Tue, 14 Oct 2008 14:00:47 +0000 (10:00 -0400)]
ashmem for 2.6.27.

Forward port of ashmem to 2.6.27.

Signed-off-by: Robert Love <rlove@google.com>
ashmem: Don't install fault handler for private mmaps.

Ashmem is used to create named private heaps. If this heap is backed
by a tmpfs file it will allocate two pages for every page touched.
In 2.6.27, the extra page would later be freed, but 2.6.29 does not
scan anonymous pages when running without swap so the memory is not
freed while the file is referenced. This change changes the behavior
of private ashmem mmaps to match /dev/zero instead tmpfs.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
ashmem: Add common prefix to name reported in /proc/pid/maps

Signed-off-by: Arve Hjønnevåg <arve@android.com>
ashmem: don't require a page aligned size

This makes ashmem more similar to shmem and mmap, by
not requiring the specified size to be page aligned,
instead rounding it internally as needed.

Signed-off-by: Marco Nelissen <marcone@android.com>
14 years agoAdd android_aid.h
Robert Love [Wed, 15 Oct 2008 19:34:49 +0000 (15:34 -0400)]
Add android_aid.h

Add <linux/android_aid.h>, our mapping of AID defines to gid numbers.

Signed-off-by: Robert Love <rlove@google.com>
14 years agopmem: Add pmem driver
Rebecca Schultz [Thu, 24 Jul 2008 18:22:53 +0000 (11:22 -0700)]
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>
14 years agoswitch: switch class and GPIO drivers.
Mike Lockwood [Tue, 14 Oct 2008 16:50:16 +0000 (12:50 -0400)]
switch: switch class and GPIO drivers.

switch: Export symbol switch_set_state.

Signed-off-by: Mike Lockwood <lockwood@android.com>
switch: gpio: Don't call request_irq with interrupts disabled

Signed-off-by: Arve Hjønnevåg <arve@android.com>
switch: Use device_create instead of device_create_drvdata.

device_create_drvdata is obsolete.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
switch_gpio: Add missing #include <linux/interrupt.h>

Signed-off-by: Mike Lockwood <lockwood@android.com>
14 years agopower_supply: Hold a wake_lock while power supply change notifications are pending
Arve Hjønnevåg [Tue, 22 Sep 2009 00:26:47 +0000 (17:26 -0700)]
power_supply: Hold a wake_lock while power supply change notifications are pending

When connecting usb or the charger the device would often go back to sleep
before the charge led and screen turned on.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
14 years agoinput: evdev: Use unique wakelock names
Mike Chan [Wed, 28 Oct 2009 00:37:44 +0000 (17:37 -0700)]
input: evdev: Use unique wakelock names

wakelock names are now contain evdev->name and pid

Signed-off-by: Mike Chan <mike@android.com>
14 years agoInput: Use monotonic time for event time stamps.
Arve Hjønnevåg [Fri, 17 Oct 2008 22:28:08 +0000 (15:28 -0700)]
Input: Use monotonic time for event time stamps.

Since wall time can jump backwards, it cannot be used to determine if one
event occured before another or for how long a key was pressed.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
14 years agoInput: Hold wake lock while event queue is not empty.
Arve Hjønnevåg [Fri, 17 Oct 2008 22:20:55 +0000 (15:20 -0700)]
Input: Hold wake lock while event queue is not empty.

Allows userspace code to process input events while
the device appears to be asleep.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
14 years agoledtrig-sleep: Add led trigger for sleep debugging.
Arve Hjønnevåg [Mon, 31 Mar 2008 04:47:13 +0000 (21:47 -0700)]
ledtrig-sleep: Add led trigger for sleep debugging.

Signed-off-by: Brian Swetland <swetland@google.com>
14 years agortc: Try to prevent RTC errors from accumulating.
Arve Hjønnevåg [Sat, 26 Jul 2008 03:58:15 +0000 (20:58 -0700)]
rtc: Try to prevent RTC errors from accumulating.

When we resume we only know how many whole seconds has elapsed.
These errors would accumulate in delta. We now only set the delta
if it would change by more than two seconds. If we drift back by
by more than a second add one in resume.

Signed-off-by: Arve Hjønnevåg <arve@android.com>