summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2011-06-14drivers: power: Add watchdog timer to catch drivers which lockup during suspend.San Mehat
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>
2011-06-14Bluetooth: Hack: Don't dereference null pointer.Nick Pelly
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>
2011-06-14Bluetooth: Add ACL MTU, available buffers and total buffers to hci_conn_info.Nick Pelly
This provides userspace debugging tools access to ACL flow control state. Signed-off-by: Nick Pelly <npelly@google.com>
2011-06-14Bluetooth: Fallback to SCO on error code 0x10 (Connection Accept Timeout).Nick Pelly
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>
2011-06-14Bluetooth: Increase timeout for legacy pairing from 10 seconds to 40 seconds.Nick Pelly
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>
2011-06-14Bluetooth: Do not attempt to send dlci disconnect when in BT_CONFIG.Nick Pelly
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>
2011-06-14serial_core: Add wake_peer uart operation which is called before starting ↵San Mehat
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>
2011-06-14rfkill: Introduce CONFIG_RFKILL_PM and use instead of CONFIG_PM to power downNick Pelly
Some platforms do not want to power down rfkill devices on suspend. Change-Id: I62a11630521c636d54a4a02ab9037a43435925f5 Signed-off-by: Nick Pelly <npelly@google.com>
2011-06-14wl127x-rfkill: Add power control driver for TI WL127X Bluetooth chipsNick Pelly
Signed-off-by: Nick Pelly <npelly@google.com>
2011-06-14kernel_debugger_core: add interrupt-context debugger coreBrian Swetland
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-14printk: Fix log_buf_copy termination.Arve Hjønnevåg
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.
2011-06-14Revert "printk: remove unused code from kernel/printk.c"Arve Hjønnevåg
This reverts commit acff181d3574244e651913df77332e897b88bff4.
2011-06-14net: Replace AID_NET_RAW checks with capable(CAP_NET_RAW).Chia-chi Yeh
Signed-off-by: Chia-chi Yeh <chiachi@android.com>
2011-06-14security: Add AID_NET_RAW and AID_NET_ADMIN capability check in cap_capable().Chia-chi Yeh
Signed-off-by: Chia-chi Yeh <chiachi@android.com>
2011-06-14net: PPPoPNS and PPPoLAC fixes.Chia-chi Yeh
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>
2011-06-14net: add PPP on PPTP Network Server (PPPoPNS) driver.Chia-chi Yeh
Signed-off-by: Chia-chi Yeh <chiachi@android.com> ppopns: dont include px_proto define in if_pppopns.h Change-Id: I27e687667db5b45182562f4a517a2e6cec6b1350 Signed-off-by: Dima Zavin <dima@android.com>
2011-06-14net: add PPP on L2TP Access Concentrator (PPPoLAC) driver.Chia-chi Yeh
Change-Id: I3ae3ee7520951ae24269db0ef2898c6455cf6bcc Signed-off-by: Chia-chi Yeh <chiachi@android.com> ppolac: dont include px_proto define in if_pppolac.h Change-Id: I55bc9cf91ea0e9e8f7bf5d6e241d188e1269343a Signed-off-by: Dima Zavin <dima@android.com>
2011-06-14cgroup: Add generic cgroup subsystem permission checks.San Mehat
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>
2011-06-14fs: yaffs: don't force YAFFS_TRACE_ALWAYS for all trace levelsDima Zavin
Change-Id: I9ddc676382d26aef7f12145d412fe670cb486317 Signed-off-by: Dima Zavin <dima@android.com>
2011-06-14fs: yaffs: Import yaffs from Thu Dec 23 13:31:37 2010 +1300Arve Hjønnevåg
commit ddf33fed15c2376bfb602d62dd018c63fce60df8 Author: Timothy Manning <tfhmanning@gmail.com> Date: Thu Dec 23 13:31:37 2010 +1300 yaffs updated direct/timothy_tests/quick_tests Signed-off-by: Timothy Manning <tfhmanning@gmail.com> Change-Id: I5bbe5a05277bdf8a6fe188bbe4c77725b3fa2aae Signed-off-by: Dima Zavin <dima@android.com>
2011-06-14fs: block_dump: Don't display inode changes if block_dump < 2San Mehat
Signed-off-by: San Mehat <san@android.com>
2011-06-14tiwlan: Add abstract wifi control functions supportDmitry Shmidt
2011-06-14usb: gadget: android: fix compilation on 2.6.37Dima Zavin
Change-Id: I9a99f007415c5be1bd1a86b138486eac51784e0d Signed-off-by: Dima Zavin <dima@android.com>
2011-06-14USB: gadget: composite: Use separate switches for connected and config stateMike Lockwood
Also remove disconnect debouncing, which didn't actually work on some platforms Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14USB: gadget: acm,rndis: IAD class, subclass & prot should match 1st ifaceJohn Michelau
Microsoft recommends that the class and subclass fields of an IAD match the same fields from the first interface in the collection that the IAD is grouping. In practice, we are also finding that the protocol fields should also match. Without this change, the default Microsoft composite driver may not group interfaces properly, which is what allows child function drivers with IAD's to load correctly. Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14USB: gadget: composite: Dynamically set IAD bFirstInterfaceJohn Michelau
bFirstInterface should be set equal to bInterfaceNumber of the first interface in a grouping. It's currently being set only when a composite device is bound, and it does not get updated when functions are enabled or disabled. Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14USB: gadget: android Fix gadget descriptor compliance for IAD'sJohn Michelau
USB-IF core team mandates that composite devices containing IAD's must use bDeviceClass=0xEF, bDeviceSubClass=0x02, & bDeviceProtocol=0x01 instead of the usual 0x00 in all fields. This is not a problem currently on Linux hosts, but it is a problem when connecting to Windows hosts. Without this change the default Microsoft composite driver will not group interfaces properly, which is what allows child function drivers with IAD's to load correctly. Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14usb: gadget: Multiple ACM gadget instancesJohn Michelau
- Added multiple ACM instance support in Android gadget - Fixed multiple instance naming issue in ACM function - Increased max instances from 4 to 8 Change-Id: I65f1b0be94da859bab7ec0ad7cd804b896c7c4c5 Signed-off-by: John Michelau <john.michelau@motorola.com>
2011-06-14usb: gadget: Fixed Android gadget function discovery & product matchingJohn Michelau
- Don't bind until all required functions have registered - Consider multi-instance functions when matching products Change-Id: I6fa10567db71d49cd81968c01d75e326ff9a17c8 Signed-off-by: John Michelau <john.michelau@motorola.com>
2011-06-14usb: gadget: rndis: don't use dev_get_statsBenoit Goby
Since 2.6.36, spin_lock_bh has been added to dev_txq_stats_fold. So dev_get_stats cannot be called from atomic context. Replaced it by netdev_stats_to_stats64 to copy the stats directly. This will work if the device driver does not need txq tx stats folding. http://lkml.org/lkml/2010/9/20/250 Change-Id: I715b00892beda56cc369139d6e2bdc9efb6bfe79 Signed-off-by: Benoit Goby <benoit@android.com>
2011-06-14USB: gadget: f_mtp: Zero length packet fixesMike Lockwood
Send zero length packets at end of transfers that are a multiple of the bulk max packet size as required by MTP. Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14USB: gadget: f_mtp: Support for file transfer length greater than 4 gigabytesMike Lockwood
For backward compatibility with PTP, MTP is limited to a 32-bit file size. When transferring files greater than 4 gig, MTP uses 0xFFFFFFFF as the file size and the receiver reads until it receives a short packet. Expanded size of mtp_file_range.length to 64 bits and added support for writing zero length packets. Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14USB: gadget: f_mtp: Return zero result for successful file transfer.Mike Lockwood
Returning number of bytes transfered does not work for files > 2 gig since ioctl() result is a signed integer. Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14USB: gadget: f_mtp: MTP driver cleanup:Mike Lockwood
Use a work queue instead of a separate thread for file transfer ioctls (note: the file transfer must be done on a kernel thread rather than in process context so vfs_read and vfs_write will use the correct address space for the buffers) Enforce requirement that only one ioctl call may be active at a time, and remove mutex in mtp_send_event that is now no longer necessary. Synchronize around use of shared variables to avoid SMP issues Fix mismatched calls to fget and fput Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14usb: gadget: android: Remove WAKEUP flag from bmAttributesBenoit Goby
Remove USB_CONFIG_ATT_WAKEUP from bmAttributes as we don't support remote wakeup. This fixes an issue with the USB 2.0 compliance test tool. Change-Id: Ic15e44710069f3f05ace6a82bbfa2b85a3649027 Signed-off-by: Benoit Goby <benoit@android.com>
2011-06-14USB: gadget: android: Disable MTP when RNDIS function is enabled.Mike Lockwood
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14USB: gadget: f_mtp: Add ioctl for sending events via the interrupt endpointMike Lockwood
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14drivers: usb: gadget: rndis: Fix section mismatch warningDmitry Shmidt
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-06-14drivers: usb: gadget: mass_storage: Fix section mismatch warningDmitry Shmidt
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-06-14drivers: usb: gadget: Fix section mismatch warningDmitry Shmidt
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-06-14USB: composite: Add usb_composite_force_reset utility to force enumerationMike Lockwood
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>
2011-06-14USB: gadget: android: Remove unused function android_usb_set_connected()Mike Lockwood
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14USB: gadget: composite: Move switch_set_state calls to a work queueMike Lockwood
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14USB: gadget: f_mtp: USB gadget function driver for MTP and PTP device support.Mike Lockwood
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14USB: composite: Add support for functions overriding USB_DT_STRING descriptorsMike Lockwood
Needed for MTP support. Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14USB: gadget: composite: Add userspace notifications for USB state changesMike Lockwood
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>
2011-06-14USB: gadget: f_mass_storage: Integrate android customizationsMike Lockwood
Integrate support for android composite driver and platform data within CONFIG_USB_ANDROID_MASS_STORAGE. Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14USB: android gadget: mass storage: Fix format issue for Vista HostVelempati Chiranjeevi
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>
2011-06-14USB: gadget: f_mass_storage: Defer handling interface changes until it is safe.Mike Lockwood
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>
2011-06-14USB: gadget: android: mass_storage: Use spin_lock_irqsave/spin_unlock_irqrestoreArve Hjønnevåg
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>