cascardo/linux.git
11 years agoUPSTREAM: USB: Ignore port state until reset completes.
Sarah Sharp [Thu, 15 Nov 2012 22:58:04 +0000 (14:58 -0800)]
UPSTREAM: USB: Ignore port state until reset completes.

commit 4f43447e62b37ee19c82a13f72f35b1ca60a74d3 upstream.

The port reset code bails out early if the current connect status is
cleared (device disconnected).  If we're issuing a hot reset, it may
also look at the link state before the reset is finished.

Section 10.14.2.6 of the USB 3.0 spec says that when a port enters the
Error state or Resetting state, the port connection bit retains the
value from the previous state.  Therefore we can't trust it until the
reset finishes.  Also, the xHCI spec section 4.19.1.2.5 says software
shall ignore the link state while the port is resetting, as it can be in
an unknown state.

The port state during reset is also unknown for USB 2.0 hubs.  The hub
sends a reset signal by driving the bus into an SE0 state.  This
overwhelms the "connect" signal from the device, so the port can't tell
whether anything is connected or not.

Fix the port reset code to ignore the port link state and current
connect bit until the reset finishes, and USB_PORT_STAT_RESET is
cleared.

Remove the check for USB_PORT_STAT_C_BH_RESET in the warm reset case,
because it's redundant.  When the warm reset finishes, the port reset
bit will be cleared at the same time USB_PORT_STAT_C_BH_RESET is set.
Remove the now-redundant check for a cleared USB_PORT_STAT_RESET bit
in the code to deal with the finished reset.

This patch should be backported to all stable kernels.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 870826a75318bfee80967140ce3eb6b55e1e9759)

BUG=None
TEST=Together with other cherry-picks: run BVT trybots on all platforms,
manually confirm that USB network/storage/input devices still work
(including across suspend/resume)

Change-Id: I2699fe3afa20155dcbb7b3eb3b2bfffca9eab2ed
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46069
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoUPSTREAM: USB: Allow USB 3.0 ports to be disabled.
Sarah Sharp [Thu, 15 Nov 2012 00:42:32 +0000 (16:42 -0800)]
UPSTREAM: USB: Allow USB 3.0 ports to be disabled.

commit 41e7e056cdc662f704fa9262e5c6e213b4ab45dd upstream.

If hot and warm reset fails, or a port remains in the Compliance Mode,
the USB core needs to be able to disable a USB 3.0 port.  Unlike USB 2.0
ports, once the port is placed into the Disabled link state, it will not
report any new device connects.  To get device connect notifications, we
need to put the link into the Disabled state, and then the RxDetect
state.

The xHCI driver needs to atomically clear all change bits on USB 3.0
port disable, so that we get Port Status Change Events for future port
changes.  We could technically do this in the USB core instead of in the
xHCI roothub code, since the port state machine can't advance out of the
disabled state until we set the link state to RxDetect.  However,
external USB 3.0 hubs don't need this code.  They are level-triggered,
not edge-triggered like xHCI, so they will continue to send interrupt
events when any change bit is set.  Therefore it doesn't make sense to
put this code in the USB core.

This patch is part of a series to fix several reports of infinite loops
on device enumeration failure.  This includes John, when he boots with
a USB 3.0 device (Roseweil eusb3 enclosure) attached to his NEC 0.96
host controller.  The fix requires warm reset support, so it does not
make sense to backport this patch to stable kernels without warm reset
support.

This patch should be backported to kernels as old as 3.2, contain the
commit ID 75d7cf72ab9fa01dc70877aa5c68e8ef477229dc "usbcore: refine warm
reset logic"

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: John Covici <covici@ccs.covici.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit a723a6cf79aa2e283d5134adf2787b8a35e0b8f3)

BUG=None
TEST=Together with other cherry-picks: run BVT trybots on all platforms,
manually confirm that USB network/storage/input devices still work
(including across suspend/resume)

Change-Id: Ib0c7bdbed2ea1369cb01a4b3448054b7e54800ca
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46068
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoUPSTREAM: USB: Ignore xHCI Reset Device status.
Sarah Sharp [Thu, 15 Nov 2012 00:10:49 +0000 (16:10 -0800)]
UPSTREAM: USB: Ignore xHCI Reset Device status.

commit 8b8132bc3d1cc3d4c0687e4d638a482fa920d98a upstream.

When the USB core finishes reseting a USB device, the xHCI driver sends
a Reset Device command to the host.  The xHC then updates its internal
representation of the USB device to the 'Default' device state.  If the
device was already in the Default state, the xHC will complete the
command with an error status.

If a device needs to be reset several times during enumeration, the
second reset will always fail because of the xHCI Reset Device command.
This can cause issues during enumeration.

For example, usb_reset_and_verify_device calls into hub_port_init in a
loop.  Say that on the first call into hub_port_init, the device is
successfully reset, but doesn't respond to several set address control
transfers.  Then the port will be disabled, but the udev will remain in
tact.  usb_reset_and_verify_device will call into hub_port_init again.

On the second call into hub_port_init, the device will be reset, and the
xHCI driver will issue a Reset Device command.  This command will fail
(because the device is already in the Default state), and
usb_reset_and_verify_device will fail.  The port will be disabled, and
the device won't be able to enumerate.

Fix this by ignoring the return value of the HCD reset_device callback.

This commit should be backported to kernels as old as 3.2, that contain
the commit 75d7cf72ab9fa01dc70877aa5c68e8ef477229dc "usbcore: refine
warm reset logic".

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 36f037316ff169ca111917d6b1d2546d243a2f78)

BUG=None
TEST=Together with other cherry-picks: run BVT trybots on all platforms,
manually confirm that USB network/storage/input devices still work
(including across suspend/resume)

Change-Id: I1a841c3e85b81bec2c7d957e82e1ebec30193033
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46067
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoUPSTREAM: USB: Handle auto-transition from hot to warm reset.
Sarah Sharp [Wed, 14 Nov 2012 23:58:52 +0000 (15:58 -0800)]
UPSTREAM: USB: Handle auto-transition from hot to warm reset.

commit 1c7439c61fa6516419c32a9824976334ea969d47 upstream.

USB 3.0 hubs and roothubs will automatically transition a failed hot
reset to a warm (BH) reset.  In that case, the warm reset change bit
will be set, and the link state change bit may also be set.  Change
hub_port_finish_reset to unconditionally clear those change bits for USB
3.0 hubs.  If these bits are not cleared, we may lose port change events
from the roothub.

This commit should be backported to kernels as old as 3.2, that contain
the commit 75d7cf72ab9fa01dc70877aa5c68e8ef477229dc "usbcore: refine
warm reset logic".

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 98e5587b9abe155e356d9eef3be6b1472c508c96)

BUG=None
TEST=Together with other cherry-picks: run BVT trybots on all platforms,
manually confirm that USB network/storage/input devices still work
(including across suspend/resume)

Change-Id: I6ad1fa529a0e4a30a881dd2a07f4958f5947835c
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46066
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoUPSTREAM: xHCI: Fix TD Size calculation on 1.0 hosts.
Sarah Sharp [Thu, 25 Oct 2012 22:56:40 +0000 (15:56 -0700)]
UPSTREAM: xHCI: Fix TD Size calculation on 1.0 hosts.

commit 4525c0a10dff7ad3669763c28016c7daffc3900e upstream.

The xHCI 1.0 specification made a change to the TD Size field in TRBs.
The value is now the number of packets that remain to be sent in the TD,
not including this TRB.  The TD Size value for the last TRB in a TD must
always be zero.

The xHCI function xhci_v1_0_td_remainder() attempts to calculate this,
but it gets it wrong.  First, it erroneously reuses the old
xhci_td_remainder function, which will right shift the value by 10.  The
xHCI 1.0 spec as of June 2011 says nothing about right shifting by 10.
Second, it does not set the TD size for the last TRB in a TD to zero.

Third, it uses roundup instead of DIV_ROUND_UP.  The total packet count
is supposed to be the total number of bytes in this TD, divided by the
max packet size, rounded up.  DIV_ROUND_UP is the right function to use
in that case.

With the old code, a TD on an endpoint with max packet size 1024 would
be set up like so:
TRB 1, TRB length = 600 bytes, TD size = 0
TRB 1, TRB length = 200 bytes, TD size = 0
TRB 1, TRB length = 100 bytes, TD size = 0

With the new code, the TD would be set up like this:
TRB 1, TRB length = 600 bytes, TD size = 1
TRB 1, TRB length = 200 bytes, TD size = 1
TRB 1, TRB length = 100 bytes, TD size = 0

This commit should be backported to kernels as old as 3.0, that contain
the commit 4da6e6f247a2601ab9f1e63424e4d944ed4124f3 "xhci 1.0: Update TD
size field format."

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reported-by: Chintan Mehta <chintan.mehta@sibridgetech.com>
Reported-by: Shimmer Huang <shimmering.h@gmail.com>
Tested-by: Bhavik Kothari <bhavik.kothari@sibridgetech.com>
Tested-by: Shimmer Huang <shimmering.h@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit ceb58b9ffa579690f6124fd49dc1734071544f50)

BUG=None
TEST=Together with other cherry-picks: run BVT trybots on all platforms,
manually confirm that USB network/storage/input devices still work
(including across suspend/resume)

Change-Id: I8d33194d1fd45b3efe00545fa526966154bf93ac
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46065
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoUPSTREAM: xhci: Fix conditional check in bandwidth calculation.
Sarah Sharp [Thu, 25 Oct 2012 20:44:12 +0000 (13:44 -0700)]
UPSTREAM: xhci: Fix conditional check in bandwidth calculation.

commit 392a07ae3316f2b90b39ce41e66d6f6b5c95de90 upstream.

David reports that at drivers/usb/host/xhci.c:2257:

static bool xhci_is_sync_in_ep(unsigned int ep_type)
{
    return (ep_type == ISOC_IN_EP || ep_type != INT_IN_EP);
}

The static analyser cppcheck says

[linux-3.7-rc2/drivers/usb/host/xhci.c:2257]: (style) Redundant condition: If ep_type == 5, the comparison ep_type != 7 is always true.

Maybe the original programmer intention was something like

static bool xhci_is_sync_in_ep(unsigned int ep_type)
{
    return (ep_type == ISOC_IN_EP || ep_type == INT_IN_EP);
}

Fix this.

This patch should be backported to stable kernels as old as 3.2, that
contain the commit 2b69899934c63b7b9432568584fb4c4a2924f40c "xhci: USB
3.0 BW checking."

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 363cfe8903364aed741cc5c7f31610581a135be8)

BUG=None
TEST=Together with other cherry-picks: run BVT trybots on all platforms,
manually confirm that USB network/storage/input devices still work
(including across suspend/resume)

Change-Id: Id9c36819ac8ef396719975bc0f6bf50c4c7dec3c
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46064
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoUPSTREAM: usb hub: send clear_tt_buffer_complete events when canceling TT clear work
Octavian Purdila [Mon, 1 Oct 2012 19:21:12 +0000 (22:21 +0300)]
UPSTREAM: usb hub: send clear_tt_buffer_complete events when canceling TT clear work

commit 3b6054da68f9b0d5ed6a7ed0f42a79e61904352c upstream.

There is a race condition in the USB hub code with regard to handling
TT clear requests that can get the HCD driver in a deadlock. Usually
when an TT clear request is scheduled it will be executed immediately:

<7>[    6.077583] usb 2-1.3: unlink qh1-0e01/f4d4db00 start 0 [1/2 us]
<3>[    6.078041] usb 2-1: clear tt buffer port 3, a3 ep2 t04048d82
<7>[    6.078299] hub_tt_work:731
<7>[    9.309089] usb 2-1.5: link qh1-0e01/f4d506c0 start 0 [1/2 us]
<7>[    9.324526] ehci_hcd 0000:00:1d.0: reused qh f4d4db00 schedule
<7>[    9.324539] usb 2-1.3: link qh1-0e01/f4d4db00 start 0 [1/2 us]
<7>[    9.341530] usb 1-1.1: link qh4-0e01/f397aec0 start 2 [1/2 us]
<7>[   10.116159] usb 2-1.3: unlink qh1-0e01/f4d4db00 start 0 [1/2 us]
<3>[   10.116459] usb 2-1: clear tt buffer port 3, a3 ep2 t04048d82
<7>[   10.116537] hub_tt_work:731

However, if a suspend operation is triggered before hub_tt_work is
scheduled, hub_quiesce will cancel the work without notifying the HCD
driver:

<3>[   35.033941] usb 2-1: clear tt buffer port 3, a3 ep2 t04048d80
<5>[   35.034022] sd 0:0:0:0: [sda] Stopping disk
<7>[   35.034039] hub 2-1:1.0: hub_suspend
<7>[   35.034067] usb 2-1: unlink qh256-0001/f3b1ab00 start 1 [1/0 us]
<7>[   35.035085] hub 1-0:1.0: hub_suspend
<7>[   35.035102] usb usb1: bus suspend, wakeup 0
<7>[   35.035106] ehci_hcd 0000:00:1a.0: suspend root hub
<7>[   35.035298] hub 2-0:1.0: hub_suspend
<7>[   35.035313] usb usb2: bus suspend, wakeup 0
<7>[   35.035315] ehci_hcd 0000:00:1d.0: suspend root hub
<6>[   35.250017] PM: suspend of devices complete after 216.979 msecs
<6>[   35.250822] PM: late suspend of devices complete after 0.799 msecs
<7>[   35.252343] ehci_hcd 0000:00:1d.0: wakeup: 1
<7>[   35.262923] ehci_hcd 0000:00:1d.0: --> PCI D3hot
<7>[   35.263302] ehci_hcd 0000:00:1a.0: wakeup: 1
<7>[   35.273912] ehci_hcd 0000:00:1a.0: --> PCI D3hot
<6>[   35.274254] PM: noirq suspend of devices complete after 23.442 msecs
<6>[   35.274975] ACPI: Preparing to enter system sleep state S3
<6>[   35.292666] PM: Saving platform NVS memory
<7>[   35.295030] Disabling non-boot CPUs ...
<6>[   35.297351] CPU 1 is now offline
<6>[   35.300345] CPU 2 is now offline
<6>[   35.303929] CPU 3 is now offline
<7>[   35.303931] lockdep: fixing up alternatives.
<6>[   35.304825] Extended CMOS year: 2000

When the device will resume the EHCI driver will get stuck in
ehci_endpoint_disable waiting for the tt_clearing flag to reset:

<0>[   47.610967] usb 2-1.3: **** DPM device timeout ****
<7>[   47.610972]  f2f11c60 00000092 f2f11c0c c10624a5 00000003 f4c6e880 c1c8a4c0 c1c8a4c0
<7>[   47.610983]  15c55698 0000000b f56b34c0 f2a45b70 f4c6e880 00000082 f2a4602c f2f11c30
<7>[   47.610993]  c10787f8 f4cac000 f2a45b70 00000000 f4cac010 f2f11c58 00000046 00000001
<7>[   47.611004] Call Trace:
<7>[   47.611006]  [<c10624a5>] ? sched_clock_cpu+0xf5/0x160
<7>[   47.611019]  [<c10787f8>] ? lock_release_holdtime.part.22+0x88/0xf0
<7>[   47.611026]  [<c103ed46>] ? lock_timer_base.isra.35+0x26/0x50
<7>[   47.611034]  [<c17592d3>] ? schedule_timeout+0x133/0x290
<7>[   47.611044]  [<c175b43e>] schedule+0x1e/0x50
<7>[   47.611051]  [<c17592d8>] schedule_timeout+0x138/0x290
<7>[   47.611057]  [<c10624a5>] ? sched_clock_cpu+0xf5/0x160
<7>[   47.611063]  [<c103e560>] ? usleep_range+0x40/0x40
<7>[   47.611070]  [<c1759445>] schedule_timeout_uninterruptible+0x15/0x20
<7>[   47.611077]  [<c14935f4>] ehci_endpoint_disable+0x64/0x160
<7>[   47.611084]  [<c147d1ee>] ? usb_hcd_flush_endpoint+0x10e/0x1d0
<7>[   47.611092]  [<c1165663>] ? sysfs_add_file+0x13/0x20
<7>[   47.611100]  [<c147d5a9>] usb_hcd_disable_endpoint+0x29/0x40
<7>[   47.611107]  [<c147fafc>] usb_disable_endpoint+0x5c/0x80
<7>[   47.611111]  [<c147fb57>] usb_disable_interface+0x37/0x50
<7>[   47.611116]  [<c1477650>] usb_reset_and_verify_device+0x4b0/0x640
<7>[   47.611122]  [<c1474665>] ? hub_port_status+0xb5/0x100
<7>[   47.611129]  [<c147a975>] usb_port_resume+0xd5/0x220
<7>[   47.611136]  [<c148877f>] generic_resume+0xf/0x30
<7>[   47.611142]  [<c14821a3>] usb_resume+0x133/0x180
<7>[   47.611147]  [<c1473b10>] ? usb_dev_thaw+0x10/0x10
<7>[   47.611152]  [<c1473b1d>] usb_dev_resume+0xd/0x10
<7>[   47.611157]  [<c13baa60>] dpm_run_callback+0x40/0xb0
<7>[   47.611164]  [<c13bdb03>] ? pm_runtime_enable+0x43/0x70
<7>[   47.611171]  [<c13bafc6>] device_resume+0x1a6/0x2c0
<7>[   47.611177]  [<c13ba940>] ? dpm_show_time+0xe0/0xe0
<7>[   47.611183]  [<c13bb0f9>] async_resume+0x19/0x40
<7>[   47.611189]  [<c10580c4>] async_run_entry_fn+0x64/0x160
<7>[   47.611196]  [<c104a244>] ? process_one_work+0x104/0x480
<7>[   47.611203]  [<c104a24c>] ? process_one_work+0x10c/0x480
<7>[   47.611209]  [<c104a2c0>] process_one_work+0x180/0x480
<7>[   47.611215]  [<c104a244>] ? process_one_work+0x104/0x480
<7>[   47.611220]  [<c1058060>] ? async_schedule+0x10/0x10
<7>[   47.611226]  [<c104c15c>] worker_thread+0x11c/0x2f0
<7>[   47.611233]  [<c104c040>] ? manage_workers.isra.27+0x1f0/0x1f0
<7>[   47.611239]  [<c10507f8>] kthread+0x78/0x80
<7>[   47.611244]  [<c1750000>] ? timer_cpu_notify+0xd6/0x20d
<7>[   47.611253]  [<c1050780>] ? __init_kthread_worker+0x60/0x60
<7>[   47.611258]  [<c176357e>] kernel_thread_helper+0x6/0xd
<7>[   47.611283] ------------[ cut here ]------------

This patch changes hub_quiesce behavior to flush the TT clear work
instead of canceling it, to make sure that no TT clear request remains
uncompleted before suspend.

Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 891fe9688fbd2ef1c04d8314b74c0037be2adb89)

BUG=None
TEST=Together with other cherry-picks: run BVT trybots on all platforms,
manually confirm that USB network/storage/input devices still work
(including across suspend/resume)

Change-Id: I0f4493f639cd8add900846e0f41bd99f108e97ee
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46063
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoUPSTREAM: xhci: Fix potential NULL ptr deref in command cancellation.
Sarah Sharp [Tue, 16 Oct 2012 20:17:43 +0000 (13:17 -0700)]
UPSTREAM: xhci: Fix potential NULL ptr deref in command cancellation.

commit 43a09f7fb01fa1e091416a2aa49b6c666458c1ee upstream.

The command cancellation code doesn't check whether find_trb_seg()
couldn't find the segment that contains the TRB to be canceled.  This
could cause a NULL pointer deference later in the function when next_trb
is called.  It's unlikely to happen unless something is wrong with the
command ring pointers, so add some debugging in case it happens.

This patch should be backported to stable kernels as old as 3.0, that
contain the commit b63f4053cc8aa22a98e3f9a97845afe6c15d0a0d "xHCI:
handle command after aborting the command ring".

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 325c6bf91fd3c2e4fea473e9ca4eb30666dadb52)

BUG=None
TEST=Together with other cherry-picks: run BVT trybots on all platforms,
manually confirm that USB network/storage/input devices still work
(including across suspend/resume)

Change-Id: I1006d7b5c8cdfc2ca373a0fbb8967a19368d91ae
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46062
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoUPSTREAM: xHCI: handle command after aborting the command ring
Elric Fu [Wed, 27 Jun 2012 08:55:43 +0000 (16:55 +0800)]
UPSTREAM: xHCI: handle command after aborting the command ring

commit b63f4053cc8aa22a98e3f9a97845afe6c15d0a0d upstream.

According to xHCI spec section 4.6.1.1 and section 4.6.1.2,
after aborting a command on the command ring, xHC will
generate a command completion event with its completion
code set to Command Ring Stopped at least. If a command is
currently executing at the time of aborting a command, xHC
also generate a command completion event with its completion
code set to Command Abort. When the command ring is stopped,
software may remove, add, or rearrage Command Descriptors.

To cancel a command, software will initialize a command
descriptor for the cancel command, and add it into a
cancel_cmd_list of xhci. When the command ring is stopped,
software will find the command trbs described by command
descriptors in cancel_cmd_list and modify it to No Op
command. If software can't find the matched trbs, we can
think it had been finished.

This patch should be backported to kernels as old as 3.0, that contain
the commit 7ed603ecf8b68ab81f4c83097d3063d43ec73bb8 "xhci: Add an
assertion to check for virt_dev=0 bug." That commit papers over a NULL
pointer dereference, and this patch fixes the underlying issue that
caused the NULL pointer dereference.

Signed-off-by: Elric Fu <elricfu1@gmail.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Tested-by: Miroslav Sabljic <miroslav.sabljic@avl.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c4f132c4c23d6b822242c98def8be15182c24ff4)

BUG=None
TEST=Together with other cherry-picks: run BVT trybots on all platforms,
manually confirm that USB network/storage/input devices still work
(including across suspend/resume)

Change-Id: I4ace36faa890373143277d43aa6b91d678c6cf45
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46061
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoUPSTREAM: xHCI: cancel command after command timeout
Elric Fu [Wed, 27 Jun 2012 08:31:52 +0000 (16:31 +0800)]
UPSTREAM: xHCI: cancel command after command timeout

commit 6e4468b9a0793dfb53eb80d9fe52c739b13b27fd upstream.

The patch is used to cancel command when the command isn't
acknowledged and a timeout occurs.

This patch should be backported to kernels as old as 3.0, that contain
the commit 7ed603ecf8b68ab81f4c83097d3063d43ec73bb8 "xhci: Add an
assertion to check for virt_dev=0 bug." That commit papers over a NULL
pointer dereference, and this patch fixes the underlying issue that
caused the NULL pointer dereference.

Signed-off-by: Elric Fu <elricfu1@gmail.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Tested-by: Miroslav Sabljic <miroslav.sabljic@avl.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 75382341d888ba0132c5eeb94711840acf972034)

BUG=None
TEST=Together with other cherry-picks: run BVT trybots on all platforms,
manually confirm that USB network/storage/input devices still work
(including across suspend/resume)

Change-Id: I36f4ea343230e394d99a0e081ce5738a8d68a886
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46060
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoUPSTREAM: xHCI: add aborting command ring function
Elric Fu [Wed, 27 Jun 2012 08:31:12 +0000 (16:31 +0800)]
UPSTREAM: xHCI: add aborting command ring function

commit b92cc66c047ff7cf587b318fe377061a353c120f upstream.

Software have to abort command ring and cancel command
when a command is failed or hang. Otherwise, the command
ring will hang up and can't handle the others. An example
of a command that may hang is the Address Device Command,
because waiting for a SET_ADDRESS request to be acknowledged
by a USB device is outside of the xHC's ability to control.

To cancel a command, software will initialize a command
descriptor for the cancel command, and add it into a
cancel_cmd_list of xhci.

Sarah: Fixed missing newline on "Have the command ring been stopped?"
debugging statement.

This patch should be backported to kernels as old as 3.0, that contain
the commit 7ed603ecf8b68ab81f4c83097d3063d43ec73bb8 "xhci: Add an
assertion to check for virt_dev=0 bug." That commit papers over a NULL
pointer dereference, and this patch fixes the underlying issue that
caused the NULL pointer dereference.

Signed-off-by: Elric Fu <elricfu1@gmail.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Tested-by: Miroslav Sabljic <miroslav.sabljic@avl.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 2818247b6565b7adfbcd53b74509448a8e1fad84)

BUG=None
TEST=Together with other cherry-picks: run BVT trybots on all platforms,
manually confirm that USB network/storage/input devices still work
(including across suspend/resume)

Change-Id: Iac376fec030eae1d2f85598c48fc136080fac129
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46059
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoUPSTREAM: xHCI: add cmd_ring_state
Elric Fu [Wed, 27 Jun 2012 08:30:57 +0000 (16:30 +0800)]
UPSTREAM: xHCI: add cmd_ring_state

commit c181bc5b5d5c79b71203cd10cef97f802fb6f9c1 upstream.

Adding cmd_ring_state for command ring. It helps to verify
the current command ring state for controlling the command
ring operations.

This patch should be backported to kernels as old as 3.0.  The commit
7ed603ecf8b68ab81f4c83097d3063d43ec73bb8 "xhci: Add an assertion to
check for virt_dev=0 bug." papers over the NULL pointer dereference that
I now believe is related to a timed out Set Address command.  This (and
the four patches that follow it) contain the real fix that also allows
VIA USB 3.0 hubs to consistently re-enumerate during the plug/unplug
stress tests.

Signed-off-by: Elric Fu <elricfu1@gmail.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Tested-by: Miroslav Sabljic <miroslav.sabljic@avl.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 1976fffe9dc839e9d25c903a65723600f7641a50)

BUG=None
TEST=Together with other cherry-picks: run BVT trybots on all platforms,
manually confirm that USB network/storage/input devices still work
(including across suspend/resume)

Change-Id: Ib07ee436e4288ddcd9d13776ff8bcd2c44d99217
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46058
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoUPSTREAM: xhci: Intel Panther Point BEI quirk.
Sarah Sharp [Wed, 19 Sep 2012 23:27:26 +0000 (16:27 -0700)]
UPSTREAM: xhci: Intel Panther Point BEI quirk.

commit 80fab3b244a22e0ca539d2439bdda50e81e5666f upstream.

When a device with an isochronous endpoint is behind a hub plugged into
the Intel Panther Point xHCI host controller, and the driver submits
multiple frames per URB, the xHCI driver will set the Block Event
Interrupt (BEI) flag on all but the last TD for the URB.  This causes
the host controller to place an event on the event ring, but not send an
interrupt.  When the last TD for the URB completes, BEI is cleared, and
we get an interrupt for the whole URB.

However, under a Panther Point xHCI host controller, if the parent hub
is unplugged when one or more events from transfers with BEI set are on
the event ring, a port status change event is placed on the event ring,
but no interrupt is generated.  This means URBs stop completing, and the
USB device disconnect is not noticed.  Something like a USB headset will
cause mplayer to hang when the device is disconnected.

If another transfer is sent (such as running `sudo lsusb -v`), the next
transfer event seems to "unstick" the event ring, the xHCI driver gets
an interrupt, and the disconnect is reported to the USB core.

The fix is not to use the BEI flag under the Panther Point xHCI host.
This will impact power consumption and system responsiveness, because
the xHCI driver will receive an interrupt for every frame in all
isochronous URBs instead of once per URB.

Intel chipset developers confirm that this bug will be hit if the BEI
flag is used on any endpoint, not just ones that are behind a hub.

This patch should be backported to kernels as old as 3.0, that contain
the commit 69e848c2090aebba5698a1620604c7dccb448684 "Intel xhci: Support
EHCI/xHCI port switching."

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 59b91d284b24d4ec17f917421b169fcb40805544)

Conflicts:
drivers/usb/host/xhci-pci.c
drivers/usb/host/xhci.h

BUG=None
TEST=Together with other cherry-picks: run BVT trybots on all platforms,
manually confirm that USB network/storage/input devices still work
(including across suspend/resume)

Change-Id: Ifdd43eaccc32480f62eff51601f006e36e2e0aa7
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46057
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoUPSTREAM: xhci: Fix invalid loop check in xhci_free_tt_info()
Takashi Iwai [Fri, 1 Jun 2012 08:06:23 +0000 (10:06 +0200)]
UPSTREAM: xhci: Fix invalid loop check in xhci_free_tt_info()

commit 46ed8f00d8982e49f8fe2c1a9cea192f640cb3ba upstream.

xhci_free_tt_info() may access the invalid memory when it removes the
last entry but the list is not empty.  Then tt_next reaches to the
list head but it still tries to check the tt_info of that entry.

This patch fixes the bug and cleans up the messy code by rewriting
with a simple list_for_each_entry_safe().

This patch should be backported to kernels as old as 3.2, that contain
the commit 839c817ce67178ca3c7c7ad534c571bba1e69ebe "xhci: Store
information about roothubs and TTs."

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reviewed-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit b063a624f08cfa64c2d9162d1525da95519e6156)

BUG=None
TEST=Together with other cherry-picks: run BVT trybots on all platforms,
manually confirm that USB network/storage/input devices still work
(including across suspend/resume)

Change-Id: I6b86ca835e1a915cbbbbf47356d696efe86a96d8
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46056
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoUPSTREAM: usbcore: enable USB2 LPM if port suspend fails
Andiry Xu [Fri, 4 May 2012 16:50:10 +0000 (00:50 +0800)]
UPSTREAM: usbcore: enable USB2 LPM if port suspend fails

commit c3e751e4f4754793bb52bd5ae30e9cc027edbb12 upstream.

USB2 LPM is disabled when device begin to suspend and enabled after device
is resumed. That's because USB spec does not define the transition from
U1/U2 state to U3 state.

If usb_port_suspend() fails, usb_port_resume() is never called, and USB2 LPM
is disabled in this situation. Enable USB2 LPM if port suspend fails.

This patch should be backported to kernels as old as 3.2, that contain
the commit 65580b4321eb36f16ae8b5987bfa1bb948fc5112 "xHCI: set USB2
hardware LPM".

Signed-off-by: Andiry Xu <andiry.xu@gmail.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit edad2199132a88f160c4939d1ad3eecc4c33b211)

BUG=None
TEST=Together with other cherry-picks: run BVT trybots on all platforms,
manually confirm that USB network/storage/input devices still work
(including across suspend/resume)

Change-Id: I3762df7d8d42c3d8228b1f19ce5f1439e19457e1
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46055
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoRevert "Revert "UPSTREAM: mmc: dw_mmc: correct the calculation for CLKDIV""
Grant Grundler [Thu, 21 Mar 2013 16:13:41 +0000 (09:13 -0700)]
Revert "Revert "UPSTREAM: mmc: dw_mmc: correct the calculation for CLKDIV""

This reverts commit f786fcc8d52e5a7d15a90cf266f2ac1d40f54a5e

Cannot reproduce "won't boot" with "normal" FW versions. See bug for details.

Change-Id: Ibb2730ecef525831883ff26bc04c72a55f47f06d
Reviewed-on: https://gerrit.chromium.org/gerrit/46128
Reviewed-by: Grant Grundler <grundler@chromium.org>
Tested-by: Grant Grundler <grundler@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>

11 years agoCHROMIUM: CONFIG: Add debug info
Doug Anderson [Tue, 11 Sep 2012 16:10:08 +0000 (09:10 -0700)]
CHROMIUM: CONFIG: Add debug info

This was default on all builds but got lost in a kernel rebase. It
adds no-overhead to release builds since they are stripped but means
the vmlinux we get from the bots has symbols.

BUG=chromium:222294
TEST=Build the kernel and run with it.  Use kgdb with this kernel.

Change-Id: Ief705b2a1a09917b6885ed84c7a405cb12e105f2
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33566
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agosamsung: snow: bitfix: Don't bail if we can't recover unused memory
Doug Anderson [Mon, 18 Mar 2013 23:12:42 +0000 (16:12 -0700)]
samsung: snow: bitfix: Don't bail if we can't recover unused memory

The bitfix code has the requirement that you can only recover an
entire 8K chunk of memory at a time, even though memory can be
"skipped" (not processed by bitfix) in 4K chunks.  If we ever detect
corruption in a 8K chunk that contained skipped pages then we'd bail
and reboot.

The original concept of "skipping" pages was there for sacred areas of
memory: the stack, console buffer, MMU structures, etc.  For these
areas of memory the above logic makes a lot of sense.  Dealing with a
page at a time meant that we could still _detect_ corruption on that
page.  ...and we could even fix it!  ...but since evidence suggested
that if one half of a chunk was corrupted that there's a good chance
of corruption in the other half, we chose to bail and reboot.

The above logic didn't take into account that we added another reason
for skipping a page: if it was unused.  For part of a chunk is unused
then we should just recover the half of the chunk that we care about
and not worry about corruption in the other half.

BUG=chromium-os:39522
TEST=suspend_stress_test

Change-Id: I57ad2fe24755e8867fdd4a5b729521b0ddb1d5fc
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45807
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoUPSTREAM: mmc: dw_mmc: enable controller interrupt before calling mmc_start_host
Yuvaraj CD [Mon, 8 Oct 2012 08:59:51 +0000 (14:29 +0530)]
UPSTREAM: mmc: dw_mmc: enable controller interrupt before calling mmc_start_host

As mmc_start_host is getting called before enabling the dw_mmc controller
interrupt, there is a problem of missing the SDMMC_INT_CMD_DONE for the
very first command sent by the sdio_reset.

This problem occurs only when we disable MMC debugging i.e, MMC_DEBUG=n.
This patch enables the dw_mmc controller interrupt before mmc_start_host.

BUG=chrome-os-partner:17015
TEST=Stress test on flaky device that generates CRC errors.

Signed-off-by: Yuvaraj CD <yuvaraj.cd@samsung.com>
Reviewed-by: Girish K S <girish.shivananjappa@linaro.org>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Doug Anderson <dianders@chromium.org>
Change-Id: I02ffde04115a707d03d694d3539b3111007cd58c
(cherry picked from commit 2da1d7f2948900cd50d38643db39f790edb3cc96)
Reviewed-on: https://gerrit.chromium.org/gerrit/45581
Reviewed-by: Bing Zhao <bzhao@marvell.com>
Reviewed-by: Paul Stewart <pstew@chromium.org>
11 years agoUPSTREAM: mmc: dw_mmc: correct mishandling error interrupt
Seungwon Jeon [Wed, 1 Aug 2012 00:30:40 +0000 (09:30 +0900)]
UPSTREAM: mmc: dw_mmc: correct mishandling error interrupt

Datasheet of SYNOPSYS mentions that DTO(Data Transfer Over) interrupt
will be raised even if some error interrupts, however it is actually
found that DTO does not occur. SYNOPSYS has confirmed this issue.
Current implementation defers the call of tasklet_schedule until DTO
when the error interrupts is happened. This patch fixes error handling.

BUG=chrome-os-partner:17015
TEST=Stress test on flaky device that generates CRC errors.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Doug Anderson <dianders@chromium.org>
Change-Id: I6c9d0ccff6f23d41f9f9eb15de99fffdb3422dff
(cherry picked from commit 9b2026a12511439d906a5d8d302ae285ebe7378a)
Reviewed-on: https://gerrit.chromium.org/gerrit/45580
Reviewed-by: Bing Zhao <bzhao@marvell.com>
Reviewed-by: Paul Stewart <pstew@chromium.org>
11 years agoUPSTREAM: mmc: dw_mmc: amend using error interrupt status
Seungwon Jeon [Wed, 1 Aug 2012 00:30:30 +0000 (09:30 +0900)]
UPSTREAM: mmc: dw_mmc: amend using error interrupt status

RINTSTS status includes masked interrupts as well as unmasked.
data_status and cmd_status are set by value of RINTSTS in interrupt handler
and tasklet finally uses it to decide whether error is happened or not.
In addition, MINTSTS status is used for setting data_status in PIO.
Masked error interrupt will not be handled and that status can be considered
non-error case.

BUG=chrome-os-partner:17015
TEST=Stress test on flaky device that generates CRC errors.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Reviewed By: Girish K S <girish.shivananjappa@linaro.org>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Doug Anderson <dianders@chromium.org>
Change-Id: Ibf3eb215ad9b03593cf486fe483428510eb5c175
(cherry picked from commit 182c90815993452f1902837cc342ac2c05ef13f5)
Reviewed-on: https://gerrit.chromium.org/gerrit/45579
Reviewed-by: Bing Zhao <bzhao@marvell.com>
Reviewed-by: Paul Stewart <pstew@chromium.org>
11 years agoUPSTREAM: mmc: dw_mmc: fix error handling in PIO mode
Seungwon Jeon [Wed, 1 Aug 2012 00:30:46 +0000 (09:30 +0900)]
UPSTREAM: mmc: dw_mmc: fix error handling in PIO mode

Data transfer will be continued until all the bytes are transmitted,
even if data crc error occurs during a multiple-block data transfer.
This means RXDR/TXDR interrupts will occurs until data transfer is
terminated. Early setting of host->sg to NULL prevents going into
xxx_data_pio functions, hence permanent unhandled RXDR/TXDR interrupts
occurs. And checking error interrupt status in the xxx_data_pio functions
is no need because dw_mci_interrupt does do the same. This patch also
removes it.

BUG=chrome-os-partner:17015
TEST=Stress test on flaky device that generates CRC errors.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Doug Anderson <dianders@chromium.org>
Change-Id: I8f33ed81c9034c1127a363aef303f82a02acc44c
(cherry picked from commit e74f3a9c993a088f0a067e13941075e4acb7300a)
Reviewed-on: https://gerrit.chromium.org/gerrit/45578
Reviewed-by: Bing Zhao <bzhao@marvell.com>
Reviewed-by: Paul Stewart <pstew@chromium.org>
11 years agoCHROMIUM: arm: exynos: s5p-mfc: Disable PMU configuration for MFC
John Sheu [Tue, 19 Mar 2013 22:20:45 +0000 (15:20 -0700)]
CHROMIUM: arm: exynos: s5p-mfc: Disable PMU configuration for MFC

For s5p-mfc, initializing the PMU configuration for the MFC block
appears to occasionally cause the MFC block to run in a
lower-performance state during video decoding, resulting in sub-realtime
performance for 1080p video decoding.  Revert the PMU configuration,
just for the MFC block, while further debugging occurs.

BUG=chromium:220275
TEST=local build, run on snow

Change-Id: I70b04de1cd872a9b87b6e8cf8e7e85e48c87ad87
Reviewed-on: https://gerrit.chromium.org/gerrit/45928
Tested-by: John Sheu <sheu@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Commit-Queue: John Sheu <sheu@chromium.org>

11 years agos5p-mfc: end-of-stream handling in encoder bug fix
Kamil Debski [Fri, 11 Jan 2013 14:29:34 +0000 (11:29 -0300)]
s5p-mfc: end-of-stream handling in encoder bug fix

<UPSTREAM MERGE NOT REQUIRED>

linux-media commit eb36209297b7aadbd3144c74cb79d35704c3086e
Original commit message as follows:

  In some circumstances after issuing the V4L2_ENC_CMD_STOP the application
  could freeze. This patch prevents this behavior.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Change-Id: I4c2befaedf39882c86b694ce30d25367449b1260
Signed-off-by: John Sheu <sheu@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45101

11 years agos5p-mfc: Fix kernel warning on memory init
John Sheu [Fri, 8 Mar 2013 02:37:13 +0000 (18:37 -0800)]
s5p-mfc: Fix kernel warning on memory init

<UPSTREAM MERGE NOT REQUIRED>

linux-media commit 6e83e6e25eb49dc57a69b3f8ecc1e764c9775101
Original commit message as follows:

  Cleaned up the memory devices allocation code and added
  missing device_initialize() call to remove the kernel warning
  during memory allocations.

Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Change-Id: Ie9cf1d8fcdc3e70acf23329449c8985eab5cd68e
Signed-off-by: John Sheu <sheu@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45100

11 years agos5p-mfc: Use WARN_ON(condition) directly
Sachin Kamat [Tue, 22 Jan 2013 04:00:06 +0000 (01:00 -0300)]
s5p-mfc: Use WARN_ON(condition) directly

<UPSTREAM MERGE NOT REQUIRED>

linux-media commit e82564475eab196b2e8a11572fff8e268329530e
Original commit message as follows:

  Use WARN_ON(condition) directly instead of wrapping around an if
  condition.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Change-Id: Iea1296a0452dd1b948bd1e6ba41b3e8149f579a3
Signed-off-by: John Sheu <sheu@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45099

11 years agos5p-mfc: Use NULL instead of 0 for pointer
Sachin Kamat [Mon, 14 Jan 2013 09:09:41 +0000 (06:09 -0300)]
s5p-mfc: Use NULL instead of 0 for pointer

<UPSTREAM MERGE NOT REQUIRED>

linux-media commit 0e5d61d87b3a1ad5591e0dfbe4c548f862e9f5a6
Original commit message as follows:

  Fixes the following warning:
  drivers/media/video/s5p-mfc/s5p_mfc_opr.c:56:27: warning:
  Using plain integer as NULL pointer

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Change-Id: I94dadee385729b0bd35639d6a1f3b3f937370499
Signed-off-by: John Sheu <sheu@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45098

11 years agos5p-mfc: Fix a watchdog bug
Kamil Debski [Fri, 11 Jan 2013 14:29:32 +0000 (11:29 -0300)]
s5p-mfc: Fix a watchdog bug

<UPSTREAM MERGE NOT REQUIRED>

linux-media commit 33133ea7aca7eedf8b1b4cee514c76dce7654a8c
Original commit message as follows:

  Fixed wrong condition in firmware reload function used by the watchdog.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Change-Id: I484659ec7100051b83df128a6aef28f02df91a3e
Signed-off-by: John Sheu <sheu@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45097

11 years agoCHROMIUM: s5p-mfc: fix DISPLAY_DELAY
John Sheu [Wed, 13 Feb 2013 22:03:59 +0000 (14:03 -0800)]
CHROMIUM: s5p-mfc: fix DISPLAY_DELAY

V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE is being
ignored, and the display delay is always being applied.  Fix this.

Signed-off-by: John Sheu <sheu@google.com>
BUG=chromium:175638
BUG=chromium-os:38121
BUG=chromium-os:38376
BUG=chromium-os:38693
TEST=local build, run on snow

Change-Id: I0b098d021d656197d058e573cf66a3b1f624a275
Reviewed-on: https://gerrit.chromium.org/gerrit/43677
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Commit-Queue: John Sheu <sheu@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45655
Reviewed-by: John Sheu <sheu@chromium.org>
11 years agoCHROMIUM: s5p-mfc: Fix input/output format reporting
John Sheu [Wed, 13 Feb 2013 21:53:56 +0000 (13:53 -0800)]
CHROMIUM: s5p-mfc: Fix input/output format reporting

The video encode/decode paths have duplicated logic between
VIDIOC_TRY_FMT and VIDIOC_S_FMT that should be de-duped.  Also, video
decode reports V4L2_PIX_FMT_NV12MT_16X16 output format, regardless of
what the actual output has been set at.  Fix this.

Signed-off-by: John Sheu <sheu@google.com>
BUG=chromium-os:38376
TEST=local build, run on snow

Change-Id: I3c4c5258733421f54340ca8237d2c5200cb76fc4
Reviewed-on: https://gerrit.chromium.org/gerrit/43676
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Commit-Queue: John Sheu <sheu@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45654
Reviewed-by: John Sheu <sheu@chromium.org>
11 years agoexynos/mfc: add mfc device to power domain
Naveen krishna Chatradhi [Tue, 31 Jul 2012 06:30:19 +0000 (12:00 +0530)]
exynos/mfc: add mfc device to power domain

This patch adds the mfc device to the genpd by calling the
function 'pm_genpd_of_add_device_by_name'. The power domain
is found by searching for a of property 'samsung,pd' in the of node.

BUG=chrome-os-partner:11793
Test=MFC/GSC/Sysmmu get suspended after probe and resume upon
video playback. Tested on Daisy.

Change-Id: I171fab67eb63a2e779dd2405befb080b35fa018e
Signed-off-by: Naveen krishna Chatradhi <ch.naveen@samsung.com>
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/29164
Tested-by: Prathyush Kalashwaram <prathyush@chromium.org>
Commit-Ready: Olof Johansson <olofj@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45653
Reviewed-by: John Sheu <sheu@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
Commit-Queue: John Sheu <sheu@chromium.org>

11 years agoexynos/mfc: add sysmmu power on/off calls
Prathyush K [Tue, 31 Jul 2012 07:50:52 +0000 (13:20 +0530)]
exynos/mfc: add sysmmu power on/off calls

This patch calls the sysmmu driver helper functions for resuming
and suspending its two sysmmus during mfc power on/off. This is required
for the sysmmus to resume/suspend along with the parent mfc device.

BUG=chrome-os-partner:11793
TEST=MFC/GSC/Sysmmu get suspended after probe and resume upon
video playback. Tested on Daisy.

Change-Id: I3faacf3dfc397c72402e9c981ff314007c94887d
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/29165
Tested-by: Prathyush Kalashwaram <prathyush@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42960
Commit-Queue: John Sheu <sheu@chromium.org>
Reviewed-by: John Sheu <sheu@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/44767

11 years agoarm: exynos: sysmmu: release iommu mapping during module exit
Subash Patel [Fri, 20 Jul 2012 10:16:20 +0000 (15:46 +0530)]
arm: exynos: sysmmu: release iommu mapping during module exit

This change will add support for detaching iommu mapping, domain
and switchoff the hardware for an attached device.

This commit adds the following changes:
a) support in dma-mapping framework to call iommu_detach_device()
b) support in the exynos to call arm_iommu_detach_device() and
   arm_iommu_release_mapping()
c) changes to the module exit of drm_drv, drm_fimd, gsc, tv and mfc

BUG=chrome-os-partner:11310
TEST=none

Change-Id: I35afd8c96ea3ad8427d9b8a7c0cf449aa4121f4e
Signed-off-by: Subash Patel <subash.ramaswamy@linaro.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/27362
Tested-by: Jon Kliegman <kliegs@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Commit-Ready: Anush Elangovan <anush@google.com>
Reviewed-by: Anush Elangovan <anush@google.com>
Reviewed-by: Pawel Osciak <posciak@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/45652
Reviewed-by: John Sheu <sheu@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
Commit-Queue: John Sheu <sheu@chromium.org>

11 years agoARM: EXYNOS: MFC: Add IOMMU mapping to MFC probe
John Sheu [Thu, 7 Feb 2013 01:13:54 +0000 (17:13 -0800)]
ARM: EXYNOS: MFC: Add IOMMU mapping to MFC probe

IOMMU mapping is created for mfc device during probe. This
requires the sysmmu_l and sysmmu_r property be set in the DTS
file. First, the sysmmu device nodes are found and then the
sysmmu platform devices are retrieved. A IOMMU mapping is then created
for mfc_l and mfc_r devices.

Change-Id: Ic7e6669911d2629c8872e78e5e187950484a8c35
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/42958
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Commit-Queue: John Sheu <sheu@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45096
Reviewed-by: John Sheu <sheu@chromium.org>
11 years agos5p-mfc: remove V4L2_FL_LOCK_ALL_FOPS from s5p-mfc
John Sheu [Fri, 8 Mar 2013 04:32:08 +0000 (20:32 -0800)]
s5p-mfc: remove V4L2_FL_LOCK_ALL_FOPS from s5p-mfc

<UPSTREAM MERGE NOT REQUIRED>

The upstream (3.9+) s5p-mfc driver handles its own locking.

BUG=chromium-os:38376
TEST=local build, run on snow

Change-Id: I0aaff284a6b0a156f10d5dca39b5ee37f3287e9c
Signed-off-by: John Sheu <sheu@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45095

11 years agoCHROMIUM: rtc: fix bug with setting control register
Derek Basehore [Tue, 19 Mar 2013 00:36:25 +0000 (17:36 -0700)]
CHROMIUM: rtc: fix bug with setting control register

A bit in the RTC_CONTROL register was accidentally lost in cmos_caused_wake.
It seems that this effectively moved us from 24 hour format to 12 hour format in
practice. This can cause the time from the RTC to be misinterpreted, so the
system will read the wrong time from the RTC. It might then go back to an
old value for the system time (and also store that in the RTC).

BUG=chromium:216936
TEST=suspend resume system (with dark resume happening)

Change-Id: I1425b857caf49ce3e538dfc05b981153729565f9
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45823
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
11 years agos5p-mfc: merge upstream merge
Mauro Carvalho Chehab [Thu, 24 Jan 2013 20:49:18 +0000 (18:49 -0200)]
s5p-mfc: merge upstream merge

<UPSTREAM MERGE NOT REQUIRED>

linux-media commit a32f7d1ad3744914273c6907204c2ab3b5d496a0
Only changes to drivers/media/video/s5p-mfc are merged here.
Original commit message follows:

  Merge branch 'v4l_for_linus' into staging/for_v3.9

  * v4l_for_linus: (464 commits)
    [media] uvcvideo: Set error_idx properly for S_EXT_CTRLS failures
    [media] uvcvideo: Cleanup leftovers of partial revert
    [media] uvcvideo: Return -EACCES when trying to set a read-only control
    Linux 3.8-rc3
    mm: reinstante dropped pmd_trans_splitting() check
    cred: Remove tgcred pointer from struct cred
    drm/ttm: fix fence locking in ttm_buffer_object_transfer
    ARM: clps711x: Fix bad merge of clockevents setup
    ARM: highbank: save and restore L2 cache and GIC on suspend
    ARM: highbank: add a power request clear
    ARM: highbank: fix secondary boot and hotplug
    ARM: highbank: fix typos with hignbank in power request functions
    ARM: dts: fix highbank cpu mpidr values
    ARM: dts: add device_type prop to cpu nodes on Calxeda platforms
    drm/prime: drop reference on imported dma-buf come from gem
    xen/netfront: improve truesize tracking
    ARM: mx5: Fix MX53 flexcan2 clock
    ARM: OMAP2+: am33xx-hwmod: Fix wrongly terminated am33xx_usbss_mpu_irqs array
    sctp: fix Kconfig bug in default cookie hmac selection
    EDAC: Cleanup device deregistering path
    ...

  Conflicts:
    drivers/media/pci/dm1105/dm1105.c
    drivers/media/video/soc_camera/mx2_camera.c

Change-Id: I80ec2451fff2a9ff43927f31dcd8cacd1dd44a6c
Signed-off-by: John Sheu <sheu@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/44766
Reviewed-by: Pawel Osciak <posciak@chromium.org>
11 years agoCHROMIUM: Disable USB persist system-wide by default.
Julius Werner [Wed, 13 Mar 2013 18:39:27 +0000 (11:39 -0700)]
CHROMIUM: Disable USB persist system-wide by default.

This patch effectively reverts upstream commit 9214d1d8, which enabled
USB persist by default. We have long had disabled persist on ChromeOS
through an explicit sysfs write from powerd_suspend to save kernel
resume time. This change will make that solution obsolete by disabling
persist by default from the kernel, resulting in a much cleaner system
state that does not flip-flop between persist/non-persist during
suspend/resume. This will also solve issues with autosuspend on drivers
that do not provide a reset_resume method.

BUG=chrome-os-partner:17609
TEST=Boot kernel, make sure that /sys/bus/usb/devices/*/power/persist
are all zeroes (and stay that way over suspend and when plugging in more
devices).

Change-Id: If3ef6423a82aa9af0cb1b10c49da0ffa8201224a
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45326
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Sameer Nanda <snanda@chromium.org>
11 years agoCHROMIUM: MFC video nodes should start from video10
Pawel Osciak [Tue, 19 Mar 2013 17:22:40 +0000 (10:22 -0700)]
CHROMIUM: MFC video nodes should start from video10

This restores a patch that was overwritten by MFC driver backport.
This workaround is required for factory camera tests that don't understand
mem2mem devices and fail on trying to interrogate MFC.

Signed-off-by: Pawel Osciak <posciak@chromium.org>
BUG=chromium:222071
TEST=manual

Change-Id: Ie7a2b4e52c45ff254535c783725f6a572a16cf02
Reviewed-on: https://gerrit.chromium.org/gerrit/45864
Reviewed-by: John Sheu <sheu@chromium.org>
Commit-Queue: Pawel Osciak <posciak@chromium.org>
Tested-by: Pawel Osciak <posciak@chromium.org>
11 years agoRestrict DP sink wake up to non-EDP.
Stuart Abercrombie [Tue, 19 Mar 2013 01:00:57 +0000 (18:00 -0700)]
Restrict DP sink wake up to non-EDP.

Doing it on EDP was producing a kernel warning with screen power down.

BUG=chrome-os-partner:17893
TEST=No warning with screen power down.  Apple mini DP->VGA adapter still works.

Change-Id: I769c31b43753c7ced7cb0b2f0d50fc96c2486779
Reviewed-on: https://gerrit.chromium.org/gerrit/45814
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stuart Abercrombie <sabercrombie@chromium.org>
Tested-by: Stuart Abercrombie <sabercrombie@chromium.org>
11 years agov4l2-dev: add flag to have the core lock all file operations
Hans Verkuil [Thu, 10 May 2012 07:57:22 +0000 (04:57 -0300)]
v4l2-dev: add flag to have the core lock all file operations

This used to be the default if the lock pointer was set, but now that lock is by
default only used for ioctl serialization. Those drivers that already used
core locking have this flag set explicitly, except for some drivers where
it was obvious that there was no need to serialize any file operations other
than ioctl.

The drivers that didn't need this flag were:

drivers/media/radio/dsbr100.c
drivers/media/radio/radio-isa.c
drivers/media/radio/radio-keene.c
drivers/media/radio/radio-miropcm20.c
drivers/media/radio/radio-mr800.c
drivers/media/radio/radio-tea5764.c
drivers/media/radio/radio-timb.c
drivers/media/video/vivi.c
sound/i2c/other/tea575x-tuner.c

The other drivers that use core locking and where it was not immediately
obvious that this flag wasn't needed were changed so that the flag is set
together with a comment that that driver needs work to avoid having to
set that flag. This will often involve taking the core lock in the fops
themselves.

Eventually this flag should go and it should not be used in new drivers.

There are a few reasons why we want to avoid core locking of non-ioctl
fops: in the case of mmap this can lead to a deadlock in rare situations
since when mmap is called the mmap_sem is held and it is possible for
other parts of the code to take that lock as well (copy_from_user()/copy_to_user()
perform a down_read(&mm->mmap_sem) when a page fault occurs).

It is very unlikely that that happens since the core lock serializes all
fops, but the kernel warns about it if lock validation is turned on.

For poll it is also undesirable to take the core lock as that can introduce
increased latency. The same is true for read/write.

While it was possible to make flags or something to turn on/off taking the
core lock for each file operation, in practice it is much simpler to just
not take it at all except for ioctl and leave it to the driver to take the
lock. There are only a handful fops compared to the zillion ioctls we have.

I also wanted to make it obvious which drivers still take the lock for all
fops, so that's why I chose to have drivers set it explicitly.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Change-Id: I0dc54aee9b2797dd1e799254a928af06524f45b0
Reviewed-on: https://gerrit.chromium.org/gerrit/45651
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Commit-Queue: John Sheu <sheu@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
11 years agoBluetooth: update stack to 3.8
Andrei Emeltchenko [Thu, 24 May 2012 12:42:51 +0000 (15:42 +0300)]
Bluetooth: update stack to 3.8

AceLan Kao (3):
      Bluetooth: Add support for IMC Networks [13d3:3393]
      Bluetooth: Add support for Foxconn / Hon Hai [0489:e04e]
      Bluetooth: Add support for Foxconn / Hon Hai [0489:e056]

Anderson Lizardo (1):
      Bluetooth: Fix incorrect strncpy() in hidp_setup_hid()

Andre Guedes (48):
      Bluetooth: Check FINDING state in interleaved discovery
      Bluetooth: Add hci_cancel_le_scan() to hci_core
      Bluetooth: LE support for MGMT stop discovery
      Bluetooth: Replace EPERM by EALREADY in hci_cancel_inquiry
      Bluetooth: Refactor stop_discovery
      Bluetooth: Add Periodic Inquiry command complete handler
      Bluetooth: Add HCI_PERIODIC_INQ to dev_flags
      Bluetooth: Check HCI_PERIODIC_INQ in start_discovery
      Bluetooth: Ignore inquiry results from periodic inquiry
      Bluetooth: Add Periodic Inquiry command complete handler
      Bluetooth: Add HCI_PERIODIC_INQ to dev_flags
      Bluetooth: Remove MGMT_ADDR_INVALID macro
      Bluetooth: Remove useless code in hci_connect
      Bluetooth: Move address type macros to bluetooth.h
      Bluetooth: Rename link_to_mgmt to link_to_bdaddr
      Bluetooth: Add address type to struct sockaddr_l2
      Bluetooth: Rename mgmt_to_le to bdaddr_to_le
      Bluetooth: Move bdaddr_to_le to hci_core
      Bluetooth: Add dst_type parameter to hci_connect
      Bluetooth: Use address type info from user-space
      Bluetooth: Remove advertising cache
      Bluetooth: Change default MTU for L2CAP ATT channel
      Bluetooth: Check MTU value in l2cap_sock_setsockopt_old
      Bluetooth: Rename L2CAP_LE_DEFAULT_MTU
      Bluetooth: Filter duplicated reports in LE scan
      Bluetooth: Remove magic value in disconnect mgmt handler
      Bluetooth: Use GFP_KERNEL in mgmt_handlers
      Bluetooth: Use GFP_KERNEL in mgmt_pending_add
      Bluetooth: Use GFP_KERNEL in mgmt events functions
      Bluetooth: Remove missing code
      Bluetooth: Use lmp_bredr_capable where applicable
      Bluetooth: Use lmp_le_capable where applicable
      Bluetooth: Use lmp_ssp_capable where applicable
      Bluetooth: Use lmp_esco_capable where applicable
      Bluetooth: Use lmp_rswitch_capable where applicable
      Bluetooth: Use lmp_sniff_capable where applicable
      Bluetooth: Use lmp_sniffsubr_capable where applicable
      Bluetooth: Use lmp_no_flush_capable where applicable
      Bluetooth: Remove locking in hci_user_passkey_request_evt
      Bluetooth: Trivial refactoring
      Bluetooth: Fix hci_le_conn_complete_evt
      Bluetooth: Remove unneeded code
      Bluetooth: Refactor hci_cs_le_create_conn
      Bluetooth: Find hci_conn by BT_CONNECT state
      Bluetooth: Lookup hci_conn in hci_le_conn_complete_evt
      Bluetooth: Refactor in hci_le_conn_complete_evt
      Bluetooth: Fix use-after-free bug in SMP
      Bluetooth: Fix hci_conn timeout routine

Andrei Emeltchenko (181):
      Revert "CHROMIUM: bluetooth: initialize rfc struct in l2cap_core.c"
      Bluetooth: trivial: Correct endian conversion
      Bluetooth: Correct type for hdev lmp_subver
      Bluetooth: Correct type for ediv to __le16
      Bluetooth: Fix extra conversion to __le32
      Bluetooth: Correct chan->psm endian conversions
      Bluetooth: Correct ediv in SMP
      Bluetooth: Correct length calc in L2CAP conf rsp
      Bluetooth: Correct CID endian notation
      Bluetooth: Convert error codes to le16
      Bluetooth: trivial: Fix endian conversion mode
      Bluetooth: trivial: Correct types
      Bluetooth: Fix type in cpu_to_le conversion
      Bluetooth: Fix opcode access in hci_complete
      Bluetooth: trivial: Remove sparse warnings
      Bluetooth: Silence sparse warning
      Bluetooth: Comments and style fixes
      Bluetooth: Remove unneeded timer clear
      Bluetooth: Make L2CAP chan_add functions static
      Bluetooth: Remove unneeded zero initialization
      Bluetooth: Add Read Local AMP Info to init
      Bluetooth: Adds set_default function in L2CAP setup
      Bluetooth: Fix debug printing unallocated name
      Bluetooth: trivial: Remove empty line
      Bluetooth: Remove unneeded calculation and magic number
      Bluetooth: Silent sparse warnings
      Bluetooth: Use defined link key size
      Bluetooth: Preserve L2CAP flags values
      Bluetooth: trivial: Remove empty line
      Bluetooth: Define L2CAP conf continuation flag
      Bluetooth: Define and use PSM identifiers
      Bluetooth: Use __constant when dealing with constants
      Bluetooth: Use __constant modifier in HCI code
      Bluetooth: Define HCI AMP cmd struct
      Bluetooth: Move clean up code and set of SOCK_ZAPPED to l2cap_sock.c
      Bluetooth: Add l2cap_chan->ops->ready()
      Bluetooth: trivial: Use defined PSMLEN instead of magic
      Bluetooth: A2MP: Create A2MP channel
      Bluetooth: A2MP: AMP Manager basic functions
      Bluetooth: A2MP: Build and Send msg helpers
      Bluetooth: A2MP: Add chan callbacks
      Bluetooth: A2MP: Definitions for A2MP commands
      Bluetooth: A2MP: Define A2MP status codes
      Bluetooth: A2MP: Process A2MP messages
      Bluetooth: A2MP: Process A2MP Command Reject
      Bluetooth: A2MP: Process A2MP Discover Request
      Bluetooth: A2MP: Process A2MP Change Notify
      Bluetooth: A2MP: Process A2MP Get Info Request
      Bluetooth: A2MP: Process A2MP Get AMP Assoc Request
      Bluetooth: A2MP: Process A2MP Create Physlink Request
      Bluetooth: A2MP: Process A2MP Disc Physlink Request
      Bluetooth: A2MP: Process A2MP Command Responses
      Bluetooth: A2MP: Handling fixed channels
      Bluetooth: A2MP: Manage incoming connections
      Bluetooth: Do not check func ready existence
      Bluetooth: A2MP: Do not reference hci_conn
      Bluetooth: Make l2cap_data_channel return void
      Bluetooth: Make l2cap_conless_channel return void
      Bluetooth: Make l2cap_att_channel return void
      Bluetooth: Remove magic disconnect reason
      Bluetooth: Use standard HCI cmd timeout for RESET
      Bluetooth: Update HCI timeouts constants to use msecs_to_jiffies
      Bluetooth: Add opcode to error message
      Bluetooth: Correct debug print specifier for u16 objects
      Bluetooth: Fix not setting HCI_RESET flag for AMP
      Bluetooth: Fix compile warnings in mgmt
      Bluetooth: Use AUTO_OFF constant in jiffies
      Bluetooth: btmrvl: Do not send vendor events to bluetooth stack
      Bluetooth: Improve debugging messages for hci_conn
      Bluetooth: Fix warning: using int as NULL pointer
      Bluetooth: Route traffic only through BR/EDR controller
      Bluetooth: bluecard_cs: Shorten scope for iobase
      Bluetooth: Do not auto off AMP controller
      Bluetooth: btmrvl: trivial style fixes
      Bluetooth: debug: Add printing num of cmds queued
      Bluetooth: debug: Correct types specifiers for L2CAP
      Bluetooth: debug: Print CID and PSM in hex format
      Bluetooth: debug: Add debug to l2cap_security_cfm
      Bluetooth: debug: Use standard hex object specifiers in hci_event
      Bluetooth: debug: Print l2cap_chan refcount
      Bluetooth: debug: Print amp_mgr refcnt
      Bluetooth: mgmt: Managing only BR/EDR HCI controllers
      Bluetooth: debug: Fix printing A2MP cmd code format
      Bluetooth: debug: Fix printing refcnt for hci_conn
      Bluetooth: trivial: Fix mixing spaces and tabs in smp
      Bluetooth: Define AMP controller statuses
      Bluetooth: Do not shadow hdr variable
      Bluetooth: Fix processing A2MP chan in security_cfm
      Bluetooth: Make connect / disconnect cfm functions return void
      Bluetooth: smp: Fix possible NULL dereference
      Bluetooth: trivial: Shorten variable scope
      Bluetooth: trivial: Use preferred method for NULL check
      Bluetooth: Remove unneeded zero init
      Bluetooth: trivial: Make hci_chan_del return void
      Bluetooth: trivial: Remove empty line
      Bluetooth: debug: Print refcnt for hci_dev
      Bluetooth: AMP: Add Read Data Block Size to amp_init
      Bluetooth: Fix freeing uninitialized delayed works
      Bluetooth: Add HCI logical link cmds definitions
      Bluetooth: A2MP: Create amp_mgr global list
      Bluetooth: AMP: Use HCI cmd to Read AMP Info
      Bluetooth: AMP: Use HCI cmd to Read Loc AMP Assoc
      Bluetooth: A2MP: Process Discover Response
      Bluetooth: AMP: Physical link struct and helpers
      Bluetooth: AMP: Remote AMP ctrl definitions
      Bluetooth: AMP: Handle create / disc phylink req
      Bluetooth: A2MP: Process A2MP Getinfo Rsp
      Bluetooth: A2MP: Process A2MP Get AMP Assoc Rsp
      Bluetooth: Choose connection based on capabilities
      Bluetooth: AMP: Add AMP key calculation
      Bluetooth: AMP: Create Physical Link
      Bluetooth: AMP: Write remote AMP Assoc
      Bluetooth: A2MP: Add fallback to normal l2cap init sequence
      Bluetooth: AMP: Process Chan Selected event
      Bluetooth: AMP: Accept Physical Link
      Bluetooth: AMP: Handle Accept phylink command status evt
      Bluetooth: Use %pMR in debug instead of batostr
      Bluetooth: Use %pMR in sprintf/seq_printf instead of batostr
      Bluetooth: Use %pMR instead of baswap in seq_show
      bluetooth: Remove unneeded batostr function
      Bluetooth: Factor out hci_queue_acl
      Bluetooth: Factor out Create Configuration Response
      Bluetooth: Use %zu print specifier for size_t type
      Bluetooth: A2MP: Correct assoc_len size
      Bluetooth: btmrvl: Correct num_block name
      Bluetooth: btmrvl: Use DIV_ROUND_UP macro
      Bluetooth: btmrvl: Fix skb buffer overflow
      Bluetooth: A2MP: Fix potential NULL dereference
      Bluetooth: AMP: Fix possible NULL dereference
      Bluetooth: Fix dereference after NULL check
      Bluetooth: AMP: Factor out amp_ctrl_add
      Bluetooth: AMP: Factor out phylink_add
      Bluetooth: AMP: Use block_mtu for AMP controller
      Bluetooth: Adjust L2CAP Max PDU size for AMP packets
      Bluetooth: L2CAP: Fix using default Flush Timeout for EFS
      Bluetooth: btmrv: Use %*ph specifier instead of print_hex_dump_bytes
      Bluetooth: Allow to set flush timeout
      Bluetooth: AMP: Handle AMP_LINK timeout
      Bluetooth: AMP: Add handle to hci_chan structure
      Bluetooth: AMP: Handle number of compl blocks for AMP_LINK
      Bluetooth: AMP: Handle AMP_LINK connection
      Bluetooth: AMP: Hanlde AMP_LINK case in conn_put
      Bluetooth: AMP: Use Loglink handle in ACL Handle field
      Bluetooth: AMP: Handle complete frames in l2cap
      Bluetooth: AMP: Drop packets when no l2cap conn exist
      Bluetooth: Send EFS Conf Rsp only for BR/EDR chan
      Bluetooth: Zero bredr pointer when chan is deleted
      Bluetooth: AMP: Get amp_mgr reference in HS hci_conn
      Bluetooth: trivial: Remove unneeded assignment
      Bluetooth: Use helper function sending EFS conf rsp
      Bluetooth: AMP: Process Physical Link Complete evt
      Bluetooth: AMP: Process Logical Link complete evt
      Bluetooth: Add put(hcon) when deleting hchan
      Bluetooth: trivial: Fix braces style and remove empty line
      Bluetooth: Save hs_hchan instead of hs_hcon in loglink complete
      Bluetooth: Return correct L2CAP response type
      Bluetooth: Derive remote and local amp id from chan struct
      Bluetooth: AMP: Add Logical Link Create function
      Bluetooth: AMP: Process Disc Logical Link
      Bluetooth: AMP: Process Disc Physical Link Complete evt
      Bluetooth: AMP: Remove hci_conn receiving error command status
      Bluetooth: Disconnect logical link when deleting chan
      Bluetooth: AMP: Check for hs_hcon instead of ctrl_id
      Bluetooth: AMP: Use l2cap_physical_cfm in phylink complete evt
      Bluetooth: Process Create Chan Request
      Bluetooth: Rename ctrl_id to remote_amp_id
      Bluetooth: Use __l2cap_no_conn_pending helper
      Bluetooth: Remove unneeded local_amp_id initialization
      Bluetooth: Refactor locking in amp_physical_cfm
      Bluetooth: Disable FCS only for new HS channels
      Bluetooth: trivial: Use __constant for constants
      Bluetooth: Fix sending L2CAP Create Chan Req
      Bluetooth: Set local_amp_id after getting Phylink Completed evt
      Bluetooth: Improve error message printing
      Bluetooth: AMP: Set no FCS for incoming L2CAP chan
      Bluetooth: Refactor l2cap_send_disconn_req
      Bluetooth: AMP: Mark controller radio powered down after HCIDEVDOWN
      Bluetooth: AMP: Check that AMP is present and active
      Bluetooth: Fix missing L2CAP EWS Conf parameter
      Bluetooth: Process receiving FCS_NONE in L2CAP Conf Rsp
      Bluetooth: trivial: Change NO_FCS_RECV to RECV_NO_FCS

Andrzej Kaczmarek (5):
      Bluetooth: Allow only one LE connection attempt
      Bluetooth: Return proper mgmt state when LE pairing connection failed
      Bluetooth: Fix not removing hci_conn for failed LE connection
      Bluetooth: mgmt: Fix enabling SSP while powered off
      Bluetooth: mgmt: Fix enabling LE while powered off

Bing Zhao (1):
      Bluetooth: btmrvl: add SD8787 Bluetooth AMP device ID

Cristian Chilipirea (1):
      Bluetooth: Fixed checkpatch warnings

David Herrmann (5):
      Bluetooth: Remove redundant hdev->parent field
      Bluetooth: vhci: Ignore return code of nonseekable_open()
      Bluetooth: Move hci_alloc/free_dev close to hci_register/unregister_dev
      Bluetooth: Move device initialization to hci_alloc_dev()
      Bluetooth: Remove unneeded initialization in hci_alloc_dev()

Denis Kirjanov (1):
      Bluetooth:Replace list_for_each with list_for_each_entry() helper

Devendra Naga (1):
      Bluetooth: cleanup dtl1_config

Dmitry Kasatkin (1):
      Bluetooth: Add function to derive AMP key using hmac

Eldad Zack (1):
      Bluetooth: bnep: use constant for ethertype

Frédéric Dalleau (2):
      Bluetooth: Add BT_DEFER_SETUP option to sco socket
      Bluetooth: Implement deferred sco socket setup

Giancarlo Formicuccia (1):
      Bluetooth: add support for atheros 0930:0219

Gustavo Padovan (59):
      Bluetooth: Remove sk parameter from l2cap_chan_create()
      Bluetooth: Remove err parameter from alloc_skb()
      Bluetooth: remove unneeded declaration of sco_conn_del()
      Bluetooth: Remove unneeded elements from size calculation
      Bluetooth: Remove hlen variable
      Bluetooth: Fix wrong set of skb fragments
      Bluetooth: Fix packet size provided to the controller
      Bluetooth: Fix skb length calculation
      Bluetooth: improve readability of l2cap_seq_list code
      Bluetooth: report the right security level in getsockopt
      Bluetooth: Create flags for bt_sk()
      Bluetooth: Report proper error number in disconnection
      Bluetooth: Fix coding style in mgmt.c
      Bluetooth: Fix coding style in sco.c
      Bluetooth: Fix coding style in hci_sock.c
      Bluetooth: Fix coding style in hci_sysfs.c
      Bluetooth: Fix coding style in hci_event.c
      Bluetooth: Fix coding style in hci_conn.c
      Bluetooth: Fix coding style in hci_core.c
      Bluetooth: Do not purge queue in Basic Mode
      Bluetooth: Remove double check for BT_CONNECTED
      Bluetooth: Remove dead int returns
      Bluetooth: Fix trailing whitespaces in license text
      Bluetooth: Remove most of the inline usage
      Bluetooth: Remove 'register' usage from the subsystem
      Bluetooth: Fix coding style in include/net/bluetooth
      Bluetooth: Fix coding style in the subsystem
      Bluetooth: Remove unnecessary headers include
      Bluetooth: Remove unneeded EXPORT_SYMBOL
      Bluetooth: Use lmp_ssp_capable() macro
      Bluetooth: Get a more accurate L2CAP PDU len
      Bluetooth: Remove extra l2cap_state_change(BT_CONNECTED)
      Bluetooth: Use l2cap_chan_ready() in LE path
      Bluetooth: Use chan as parameters for l2cap chan ops
      Bluetooth: Use chan->state instead of sk->sk_state
      Bluetooth: Move check for backlog size to l2cap_sock.c
      Bluetooth: check for already existent channel before create new one
      Bluetooth: Create function to return the ERTM header size
      Bluetooth: Remove unused err var from l2cap_segment_sdu()
      Bluetooth: Create empty l2cap ops function
      Bluetooth: Fix style in hidp code
      Bluetooth: Fix possible deadlock in SCO code
      Bluetooth: Use USB_VENDOR_AND_INTERFACE() for Broadcom devices
      Bluetooth: Add USB_VENDOR_AND_INTERFACE_INFO() for Broadcom/Foxconn
      Bluetooth: Fix two warnings in BT_DBG
      Bluetooth: Fix L2CAP coding style
      Bluetooth: Remove GFP_ATOMIC usage from l2cap_core.c
      Bluetooth: use l2cap_chan_set_err()
      Bluetooth: Use locked l2cap_state_change()
      Bluetooth: Call ops->teardown() without checking for NULL
      Bluetooth: Move bt_accept_enqueue() to l2cap_sock.c
      Bluetooth: Add chan->ops->defer()
      Bluetooth: Rename __l2cap_connect() to l2cap_connect()
      Bluetooth: Replace *_init() for *_setup()
      Bluetooth: Add missing lock nesting notation
      Bluetooth: cancel power_on work when unregistering the device
      Bluetooth: Move double negation to macros
      Revert "Bluetooth: Fix possible deadlock in SCO code"
      Bluetooth: Check if the hci connection exists in SCO shutdown

Hemant Gupta (5):
      Bluetooth: Send correct address type for LTK
      Bluetooth: Fix clearing discovery type when stopping discovery
      Bluetooth: mgmt: Fix missing connect failed event for LE
      Bluetooth: mgmt: Fix address type while loading Long Term Key
      Bluetooth: Don't distribute keys in case of Encryption Failure

Henrik Rydberg (1):
      Bluetooth: Add support for Apple vendor-specific devices

Ido Yariv (1):
      Bluetooth: Search global l2cap channels by src/dst addresses

Jaganath Kanakkassery (5):
      Bluetooth: Refactor PIN code rejection to use user_pairing_resp()
      Bluetooth: Move l2cap_chan_hold/put to l2cap_core.c
      Bluetooth: Free the l2cap channel list only when refcount is zero
      Bluetooth: Fix socket not getting freed if l2cap channel create fails
      Bluetooth: Fix authentication if acl data comes before remote feature evt

Jaroslav Resler (1):
      Bluetooth: Add support for BCM20702A0 [04ca, 2003]

Jeff Cook (1):
      Bluetooth: Add support for BCM20702A0 [0b05, 17b5]

Jefferson Delfes (2):
      Bluetooth: Fix flags of mgmt_device_found event
      Bluetooth: Force the process of unpair command if disconnect failed

Jesper Juhl (1):
      Bluetooth: btmrvl_sdio: remove pointless conditional before release_firmware()

Joe Perches (1):
      bluetooth: Convert compare_ether_addr to ether_addr_equal

Johan Hedberg (49):
      Bluetooth: Fix Inquiry with RSSI event mask
      Bluetooth: Fix SMP pairing method selection
      Bluetooth: Fix deadlock and crash when SMP pairing times out
      Bluetooth: Fix SMP security elevation from medium to high
      Bluetooth: Add support for encryption key refresh
      Bluetooth: Change page scan interval in fast connectable mode
      Bluetooth: Initial skeleton for Three-wire UART (H5) support
      Bluetooth: Add basic state tracking to Three-wire UART driver
      Bluetooth: Add initial reliable packet support for Three-wire UART
      Bluetooth: Add basic packet parsing to Three-wire UART driver
      Bluetooth: Add initial packet sending support to Three-wire UART
      Bluetooth: Add Three-wire header value convenience macros
      Bluetooth: Fix/implement Three-wire reliable packet sending
      Bluetooth: Add support for Three-wire Link Control packets
      Bluetooth: Simplify hci_uart_tty_close logic
      Bluetooth: Add delayed init sequence support for UART controllers
      Bluetooth: Use delayed init for Three-wire UART
      Bluetooth: Improve rx debug logs for Three-wire UART
      Bluetooth: Add initial sleep support to Three-wire UART
      Bluetooth: Add initialization tracking to HCI Three-wire driver
      Bluetooth: Implement proper low-power support for Three-wire UART
      Bluetooth: Remove unnecessary h5_build_pkt function
      Bluetooth: Improve Three-wire UART configuration handling
      Bluetooth: Introduce a flags variable to Three-wire UART state
      Bluetooth: mgmt: Implement support for passkey notification
      Bluetooth: Update management interface revision
      Bluetooth: SMP: Fix setting unknown auth_req bits
      Bluetooth: Add initial support for LE-only controllers
      Bluetooth: Fix LE MTU reporting for HCIGETDEVINFO
      Bluetooth: Add setting of the LE event mask
      Bluetooth: Read adversiting channel TX power during init sequence
      Bluetooth: Fix HCI command sending when powering on LE-only adapters
      Bluetooth: mgmt: Restrict BR/EDR settings to BR/EDR-only adapters
      Bluetooth: Fix updating host feature bits for LE
      Bluetooth: Add missing feature test macros
      Bluetooth: Make use feature test macros
      Bluetooth: Add flag for LE GAP Peripheral role
      Bluetooth: Disallow LE scanning and connecting in peripheral role
      Bluetooth: Fix setting host feature bits for SSP
      Bluetooth: Fix sending unnecessary HCI_Write_SSP_Mode command
      Bluetooth: Fix unnecessary EIR update during powering on
      Bluetooth: Fix sending unnecessary HCI_LE_Host_Enable
      Bluetooth: Fix parameter order of hci_get_route
      Bluetooth: Fix having bogus entries in mgmt_read_index_list reply
      Bluetooth: Fix memory leak when removing a UUID
      Bluetooth: Use proper invalid value for tx_power
      Bluetooth: Add support for setting LE advertising data
      Bluetooth: Fix updating advertising state flags and data
      Bluetooth: Fix handling of unexpected SMP PDUs

Lamarque V. Souza (1):
      HID: hidp: fallback to input session properly if hid is blacklisted

Lukasz Rymanowski (1):
      Bluetooth: Remove not needed status parameter

Manoj Iyer (1):
      Bluetooth: btusb: Add vendor specific ID (0a5c:21f4) BCM20702A0

Marcel Holtmann (12):
      Bluetooth: Add TX power tag to EIR data
      Bluetooth: Handle EIR tags for Device ID
      Bluetooth: Add management command for setting Device ID
      Bluetooth: Fix broken usage of put_unaligned_le16
      Bluetooth: Fix broken usage of get_unaligned_le16
      Bluetooth: Update management interface revision
      Bluetooth: Split error handling for L2CAP listen sockets
      Bluetooth: Split error handling for SCO listen sockets
      Bluetooth: Don't check source address in SCO bind function
      Bluetooth: Restrict to one SCO listening socket
      Bluetooth: Enable Low Energy support by default
      Bluetooth: Notify about device registration before power on

Marcos Chaparro (1):
      Bluetooth: ath3k: Add support for VAIO VPCEH [0489:e027]

Marek Vasut (1):
      Bluetooth: Support AR3011 in Acer Iconia Tab W500

Masatake YAMATO (8):
      Bluetooth: /proc/net/ entries for bluetooth protocols
      Bluetooth: Added /proc/net/bnep via bt_procfs_init()
      Bluetooth: Added /proc/net/cmtp via bt_procfs_init()
      Bluetooth: Added /proc/net/hci via bt_procfs_init()
      Bluetooth: Added /proc/net/hidp via bt_procfs_init()
      Bluetooth: Added /proc/net/l2cap via bt_procfs_init()
      Bluetooth: Added /proc/net/rfcomm via bt_procfs_init()
      Bluetooth: Added /proc/net/sco via bt_procfs_init()

Mat Martineau (66):
      Bluetooth: Add definitions and struct members for new ERTM state machine
      Bluetooth: Add a structure to carry ERTM data in skb control blocks
      Bluetooth: Add the l2cap_seq_list structure for tracking frames
      Bluetooth: Functions for handling ERTM control fields
      Bluetooth: Improve ERTM sequence number offset calculation
      Bluetooth: Remove duplicate structure members from bt_skb_cb
      Bluetooth: Move recently-added ERTM header packing functions
      Bluetooth: Initialize new l2cap_chan structure members
      Bluetooth: Remove unused function
      Bluetooth: Make better use of l2cap_chan reference counting
      Bluetooth: Add Code Aurora Forum copyright
      Bluetooth: Refactor L2CAP ERTM and streaming transmit segmentation
      Bluetooth: Update tx_send_head when sending ERTM data
      Bluetooth: Initialize the transmit queue for L2CAP streaming mode
      Bluetooth: Fix a redundant and problematic incoming MTU check
      Bluetooth: Restore locking semantics when looking up L2CAP channels
      Bluetooth: Lock the L2CAP channel when sending
      Bluetooth: Free allocated ERTM SREJ list if init fails
      Bluetooth: Fix early return from l2cap_chan_del
      Bluetooth: Change default state of ERTM disable flag
      Bluetooth: Add a new L2CAP ERTM transmit state machine.
      Bluetooth: Refactor l2cap_streaming_send
      Bluetooth: Refactor l2cap_ertm_send
      Bluetooth: Refactor l2cap_send_sframe
      Bluetooth: Consolidate common receive code for ERTM and streaming mode
      Bluetooth: Add streaming mode receive and incoming packet classifier
      Bluetooth: Remove receive code that has been superceded
      Bluetooth: Refactor l2cap_send_ack
      Bluetooth: Use the transmit state machine for busy state changes
      Bluetooth: Update l2cap_send_i_or_rr_or_rnr to fit the spec better
      Bluetooth: Add the ERTM receive state machine
      Bluetooth: Add implementation for retransmitting all unacked frames
      Bluetooth: Send SREJ frames when packets go missing
      Bluetooth: Reassemble all available data when retransmissions succeed.
      Bluetooth: Handle SREJ requests to resend unacked frames
      Bluetooth: Handle incoming REJ frames
      Bluetooth: Use new header structures in l2cap_send_rr_or_rnr
      Bluetooth: Check rules when setting retransmit or monitor timers
      Bluetooth: Use the ERTM transmit state machine from timeout handlers
      Bluetooth: Simplify the ERTM ack timeout
      Bluetooth: Remove unneccesary inline
      Bluetooth: Set txwin values for streaming mode
      Bluetooth: Remove unused ERTM control field macros
      Bluetooth: Enable ERTM by default
      Bluetooth: Send a configuration request after security confirmation
      Bluetooth: Use tx window from config response for ack timing
      Bluetooth: Process create response and connect response identically
      Bluetooth: Factor out common L2CAP connection code
      Bluetooth: Add new l2cap_chan struct members for high speed channels
      Bluetooth: Add L2CAP create channel request handling
      Bluetooth: Remove unnecessary intermediate function
      Bluetooth: Lookup channel structure based on DCID
      Bluetooth: Channel move request handling
      Bluetooth: Add new ERTM receive states for channel move
      Bluetooth: Add move channel confirm handling
      Bluetooth: Add state to hci_chan
      Bluetooth: Move channel response
      Bluetooth: Add logical link confirm
      Bluetooth: Add move confirm response handling
      Bluetooth: Handle physical link completion
      Bluetooth: Flag ACL frames as complete for AMP controllers
      Bluetooth: Do not send data during channel move
      Bluetooth: Configure appropriate timeouts for AMP controllers
      Bluetooth: Ignore BR/EDR packet size constraints when fragmenting for AMP
      Bluetooth: Do not retransmit data during a channel move
      Bluetooth: Start channel move when socket option is changed

Mathias Krause (6):
      Bluetooth: HCI - Fix info leak in getsockopt(HCI_FILTER)
      Bluetooth: HCI - Fix info leak via getsockname()
      Bluetooth: RFCOMM - Fix info leak in getsockopt(BT_SECURITY)
      Bluetooth: RFCOMM - Fix info leak in ioctl(RFCOMMGETDEVLIST)
      Bluetooth: RFCOMM - Fix info leak via getsockname()
      Bluetooth: L2CAP - Fix info leak via getsockname()

Michael Gruetzner (1):
      Bluetooth: Add support for Foxconn/Hon Hai AR5BBU22 0489:E03C

Mikel Astiz (6):
      Bluetooth: Use unsigned int instead of signed int
      Bluetooth: Remove unnecessary check
      Bluetooth: btusb: Dynamic alternate setting
      Bluetooth: Add more HCI error codes
      Bluetooth: Fix minor coding style in hci_event.c
      Bluetooth: mgmt: Add device disconnect reason

Paulo Sérgio (1):
      Bluetooth: Fix error status when pairing fails

Peng Chen (1):
      Bluetooth: add support for atheros 0489:e057

Peter Senna Tschudin (5):
      Bluetooth: bluecard_cs.c: removes unnecessary semicolon
      Bluetooth: hci_ldisc.c: removes unnecessary semicolon
      Bluetooth: hci_ll.c: removes unnecessary semicolon
      Bluetooth: hci_vhci.c: removes unnecessary semicolon
      Bluetooth: btuart_cs.c: removes unnecessary semicolon

Ram Malovany (3):
      Bluetooth: Fix using NULL inquiry entry
      Bluetooth: Fix using a NULL inquiry cache entry
      Bluetooth: Set name_state to unknown when entry name is empty

Rami Rosen (1):
      Bluetooth: remove unused member of hci_dev.

Sachin Kamat (12):
      Bluetooth: Use devm_kzalloc in bcm203x.c file.
      Bluetooth: Use devm_kzalloc in bfusb.c file
      Bluetooth: Use devm_kzalloc in bluecard_cs.c file
      Bluetooth: Use devm_kzalloc in bpa10x.c file
      Bluetooth: Use devm_kzalloc in bt3c_cs.c file
      Bluetooth: Use devm_kzalloc in btmrvl_sdio.c file
      Bluetooth: Use devm_kzalloc in btsdio.c file
      Bluetooth: Use devm_kzalloc in btuart_cs.c file
      Bluetooth: Use devm_kzalloc in btusb.c file
      Bluetooth: Use devm_kzalloc in btwilink.c file
      Bluetooth: Use devm_kzalloc in dtl1_cs.c file
      Bluetooth: Use module_platform_driver() in btwilink.c file

Sasha Levin (2):
      Bluetooth: Really fix registering hci with duplicate name
      Bluetooth: don't attempt to free a channel that wasn't created

Syam Sidhardhan (13):
      Bluetooth: mgmt: Remove unwanted goto statements
      Bluetooth: remove header declared but not defined
      Bluetooth: Remove strtoba header declared but not defined
      Bluetooth: Remove unused hci_le_ltk_reply()
      Bluetooth: Remove unused hci_le_ltk_neg_reply()
      Bluetooth: debug: Correct the PSM printing
      Bluetooth: Use kref for l2cap channel reference counting
      Bluetooth: Use __constant modifier for L2CAP SMP CID
      Bluetooth: Use __constant modifier for RFCOMM PSM
      Bluetooth: trivial: Remove newline before EOF
      Bluetooth: Replace include linux/module.h with linux/export.h
      Bluetooth: Remove unnecessary include export.h
      Bluetooth: mgmt: Use __constant when dealing with constants

Szymon Janc (8):
      Bluetooth: mgmt: Fix some code style and indentation issues
      Bluetooth: mgmt: Don't allow to set invalid value to DeviceID source
      Bluetooth: Remove unused HCI timeouts definitions
      Bluetooth: Fix using uninitialized option in RFCMode
      Bluetooth: Fix legacy pairing with some devices
      Bluetooth: Increase HCI command tx timeout
      Bluetooth: Remove OOB data if device was discovered in band
      Bluetooth: Fix sending HCI commands after reset

Ulisses Furquim (1):
      Bluetooth: Fix registering hci with duplicate name

Vinicius Costa Gomes (13):
      Bluetooth: Add support for reusing the same hci_conn for LE links
      Bluetooth: Fix checking the wrong flag when accepting a socket
      Bluetooth: Remove some functions from being exported
      Bluetooth: Rename LE and ACL connection functions
      Bluetooth: Refactor LE connection into its own function
      Bluetooth: Refactor ACL connection into its own function
      Bluetooth: Refactor SCO connection into its own function
      Bluetooth: Simplify a the connection type handling
      Bluetooth: Add type information to the hci_connect() debug statement
      Bluetooth: Fix establishing ESCO links
      Bluetooth: Change signature of smp_conn_security()
      Bluetooth: Fix sending a HCI Authorization Request over LE links
      Bluetooth: Fix not removing power_off delayed work

Vishal Agarwal (3):
      Bluetooth: Fix EIR data generation for mgmt_device_found
      Bluetooth: Fix LE pairing completion on connection failure
      Bluetooth: Fix sending HCI_Disconnect only when connected

Wei Yongjun (1):
      Bluetooth: btmrvl: remove pointless conditional before kfree_skb()

Yevgeniy Melnichuk (1):
      Bluetooth: Add support for Sony Vaio T-Series

Zhao Hongjiang (1):
      net: change return values from -EACCES to -EPERM

BUG=chromium-os:38832
TEST=emerge-${BOARD} chromeos-kernel

Change-Id: I8e22c32da0c9b07a9dcc27ef91dcafd1f5a221da
Signed-off-by: Scott James Remnant <keybuk@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/44888

11 years agoCHROMIUM: cpufreq: interactive: run at fraction of hispeed_freq when load is low
Todd Poynor [Wed, 3 Oct 2012 07:39:56 +0000 (00:39 -0700)]
CHROMIUM: cpufreq: interactive: run at fraction of hispeed_freq when load is low

When load is below go_hispeed_load, apply the percentage of CPU load to
a max frequency of hispeed_freq instead of the max speed.  This avoids
jumping too quickly to hispeed_freq when it is a relatively low
percentage of max speed.  This also allows go_hispeed_load to be set to
a high percentage relative to hispeed_freq (as a percentage of max speed,
again useful when hispeed_freq is a low fraction of max speed), to cap
larger loads at hispeed_freq.  For example, a load of 60% will typically
move to 60% of hispeed_freq, not 60% of max speed.  This causes the
governor to apply two different speed caps, depending on whether load is
below or above go_hispeed_load.

Also fix the type of hispeed_freq, which was u64, to match other
speed data types (and avoid overhead and allow division).

Signed-off-by: Todd Poynor <toddpoynor@google.com>
BUG=chrome-os-partner:11515
TEST=boot snow and sanity check governor stats (should be noop w/ current settings)

Change-Id: Ie2d0668be161c074aaad77db2037505431457b3a
Reviewed-on: https://gerrit.chromium.org/gerrit/38230
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Andrew Bresticker <abrestic@chromium.org>
Tested-by: Andrew Bresticker <abrestic@chromium.org>
11 years agoCHROMIUM: spring: dts: Use MAX98089 codec for audio.
Dylan Reid [Fri, 15 Feb 2013 00:05:03 +0000 (16:05 -0800)]
CHROMIUM: spring: dts: Use MAX98089 codec for audio.

Switch from 98095 for EVT build.

BUG=chrome-os-partner:17794
TEST=Play audio on Spring from speakers and headphones.

Change-Id: I1da995e905956c56a1c86f27eb71b735fc847a44
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43359
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoCHROMIUM: ASoC: samsung: Daisy - be specific about MAX98088/9
Dylan Reid [Sat, 2 Mar 2013 01:22:07 +0000 (17:22 -0800)]
CHROMIUM: ASoC: samsung: Daisy - be specific about MAX98088/9

Spring uses the MAX98089 codec, which is supported by max98088.c.  For
device tree indicate 98089 in case there is a need to differentiate in
the future.

BUG=chrome-os-partner:17794
TEST=play audio on snow and spring.

Change-Id: I9930363408e499c59ae66dd9719005eb769eb46e
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/44446
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoCHROMIUM: Input: synaptics - report ABS_X, ABS_Y positions on Cr48
Chung-yih Wang [Thu, 14 Mar 2013 06:25:38 +0000 (14:25 +0800)]
CHROMIUM: Input: synaptics - report ABS_X, ABS_Y positions on Cr48

Signed-off-by: Chung-yih Wang <cywang@chromium.org>
BUG=chromium:191329
TEST=on device, type 'evtest' and enter the ID for touchpad device
  Press a finger on the pad and see if there is ABS_X, ABS_Y
  printed from evtest.

Change-Id: If2ff89aabbcee348f401c3c3f16543fac93d5d2e
Reviewed-on: https://gerrit.chromium.org/gerrit/45392
Commit-Queue: Chung-yih Wang <cywang@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>
Reviewed-by: Chung-yih Wang <cywang@chromium.org>
11 years agoCHROMIUM: md: dm-verity: Fix to avoid a deadlock in dm-bufio
Paul Taysom [Thu, 31 Jan 2013 21:44:23 +0000 (13:44 -0800)]
CHROMIUM: md: dm-verity: Fix to avoid a deadlock in dm-bufio

Changed the dm-verity prefetching to use a worker thread to avoid
a deadlock in dm-bufio.

If generic_make_request is called recursively, it queues the I/O
request on the current->bio_list without making the I/O request
and returns. The routine making the recursive call cannot wait
for the I/O to complete.

The deadlock occurred when one thread grabbed the bufio_client
mutex and waited for an I/O to complete but the I/O was queued
on another thread's current->bio_list and it was waiting to get
the mutex held by the first thread.

The fix allows only one I/O request from dm-verity to dm-bufio
per thread. To do this, the prefetch requests were queued on worker
threads.

In addition to avoiding the deadlock, this fix made a slight
improvement in performance.

seconds_kernel_to_login:
  with prefetch:    8.43s
  without prefetch: 9.2s
  worker prefetch:  8.28s

BUG=chromium-os:39148
TEST=./run_remote_tests.sh --board=$B --remote=$IP suite:smoke
Signed-off-by: Paul Taysom <taysom@chromium.org>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@kernel.org
Change-Id: I5f3cddfed507abfb8198fee71e713495f076b772
Reviewed-on: https://gerrit.chromium.org/gerrit/42422
Tested-by: Paul Taysom <taysom@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Queue: Paul Taysom <taysom@chromium.org>

11 years agoCHROMIUM: md: dm-verity fixes chromeos needs
Paul Taysom [Wed, 16 Jan 2013 22:55:05 +0000 (14:55 -0800)]
CHROMIUM: md: dm-verity fixes chromeos needs

This CL has all the changes that needed to be made to
the upstream version of dm-verity.
1. Notify
2. Same paramaters as the old version of dm-verity
3. Opening device by uuid

See CL 41206

At Mandeep's suggestion, I've modified the upstream version of
verity to accept the legacy parameters. This means we can move
to the upstream version of verity without making changes to
out build, install and signing scripts.

Results from platform_BootPerfServer/control.perfalerts
on a Lucas
      baseline CL
reboot_in_syslog 23 111
seconds_firmware_boot 30.86 30.75
seconds_kernel_to_chrome_exec 4.64 4.82
seconds_kernel_to_chrome_main 5.55 6.11
seconds_kernel_to_login 8.32 8.14
seconds_kernel_to_network 8.73 8.17
seconds_kernel_to_startup 1.63 1.72
seconds_kernel_to_startup_done 2.4 2.37
seconds_kernel_to_x_started 4.55 4.73
seconds_power_on_to_kernel 30.86 30.75
seconds_power_on_to_login 39.18 38.89 (30 sec wait for dev)

BUG=chromium-os:31803
TEST=platform_DMVerityCorruption, platform_DMVerityBitCorruption

Change-Id: Iaedc50bc679c931d77044589de1a305fcb5b0180
Signed-off-by: Paul Taysom <taysom@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/41468

11 years agoCHROMIUM: md: dm-verity convert to upstream version
Paul Taysom [Mon, 14 Jan 2013 16:36:18 +0000 (08:36 -0800)]
CHROMIUM: md: dm-verity convert to upstream version

This CL only has the upstream version of dm-verity.c.
It was take from the 3.4.22 version of linux.
I've also removed dm-verity.h and dm-bht.c which are not
part of the upstream version of verity.
Removed the old documenation and added the new documents.
The next CL will have have the changes to make it work.

BUG=chromium-os:31803
TEST=platform_DMVerityCorruption, platform_DMVerityBitCorruption

Change-Id: Ic7050bc2609ef322080f76286a1f41417dc7def8
Signed-off-by: Paul Taysom <taysom@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/41206

11 years agoCHROMIUM: input: cyapa - handling rt_suspend for fw_update
Tai-Hsu Lin [Tue, 12 Mar 2013 07:03:31 +0000 (15:03 +0800)]
CHROMIUM: input: cyapa - handling rt_suspend for fw_update

This patch handle the case where fw update may fail if the
device is currently runtime suspended. It forces the device
to resume before issuing soft reset. The patch also increases
waiting time/retry counts for a few commands.

Signed-off-by: Tai-Hsu Lin <sheckylin@chromium.org>
CQ-DEPEND=If3bd68194309bbe225c2357609ede1a7595b5eba
BUG=chromium-os:39500
TEST=echo 1000 > ${DEVICE_PATH}/power/runtime_suspend_scanrate/ms
echo -n 1 > ${DEVICE_PATH}/update_fw

Before the fix, fw update would fail. After the fix, it should
succeed.

Change-Id: I2cb891e28c7564a5bb47924a231d25e57e70373c
Reviewed-on: https://gerrit.chromium.org/gerrit/45307
Reviewed-by: Benson Leung <bleung@chromium.org>
Commit-Queue: Tai-Hsu Lin <sheckylin@chromium.org>
Tested-by: Tai-Hsu Lin <sheckylin@chromium.org>
11 years agoCHROMIUM: input: cyapa - adding more debug message
Tai-Hsu Lin [Mon, 11 Mar 2013 10:08:15 +0000 (18:08 +0800)]
CHROMIUM: input: cyapa - adding more debug message

The patch adds debug messages when entering most functions
so that the call stack is more visible for the developer. It
also adds messages for some cases where the errors were silently
handled before.

Signed-off-by: Tai-Hsu Lin <sheckylin@chromium.org>
BUG=chromium-os:39606
TEST=boot a machine with Cypress trackpad and check the dmesg.

Change-Id: If3bd68194309bbe225c2357609ede1a7595b5eba
Reviewed-on: https://gerrit.chromium.org/gerrit/45063
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Tai-Hsu Lin <sheckylin@chromium.org>
Commit-Queue: Tai-Hsu Lin <sheckylin@chromium.org>

11 years agoCHROMIUM: charger-manager: Rewrite probe function
Simon Glass [Sun, 10 Feb 2013 04:32:57 +0000 (20:32 -0800)]
CHROMIUM: charger-manager: Rewrite probe function

Split the probe function into separate functions in preparation for device
tree enablement.

Drop the extra rtc warning in the setup function and just do it once in
the probe function.

BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow
See that the charger-manager still probes and appears to run correctly.

Change-Id: Ied0ddbc57c83869eb75a5b769ed2233b7742af15
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43025
Reviewed-by: Benson Leung <bleung@chromium.org>
11 years agoCHROMIUM: drm/i915: bounds check execbuffer relocations
Kees Cook [Fri, 8 Mar 2013 02:09:58 +0000 (18:09 -0800)]
CHROMIUM: drm/i915: bounds check execbuffer relocations

It is possible to wrap the counter used to allocate the buffer for
relocation copies. This could lead to heap writing overflows.

BUG=chromium-os:39733
TEST=link build, PoC fails

[sending upstream]

Change-Id: Ifdd4ae846042852a4462d70cfa3c3b84d5a9d133
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45118
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agoCHROMIUM: signal: always clear sa_restorer on execve
Kees Cook [Mon, 11 Mar 2013 20:33:13 +0000 (13:33 -0700)]
CHROMIUM: signal: always clear sa_restorer on execve

When the new signal handlers are set up, the location of sa_restorer is
not cleared, leaking a parent process's address space location to
children.  This allows for a potential bypass of the parent's ASLR by
examining the sa_restorer value returned when calling sigaction().

Based on what should be considered "secret" about addresses, it only
matters across the exec not the fork (since the VMAs haven't changed until
the exec).  But since exec sets SIG_DFL and keeps sa_restorer, this is
where it should be fixed.

Given the few uses of sa_restorer, a "set" function was not written since
this would be the only use.  Instead, we use __ARCH_HAS_SA_RESTORER, as
already done in other places.

Example of the leak before applying this patch:

$ cat /proc/$$/maps
...
7fb9f3083000-7fb9f3238000 r-xp 00000000 fd:01 404469 .../libc-2.15.so
...
$ ./leak
...
7f278bc74000-7f278be29000 r-xp 00000000 fd:01 404469 .../libc-2.15.so
...
1 0 (nil) 0x7fb9f30b94a0
4000000 (nil) 0x7f278bcaa4a0
4000000 (nil) 0x7f278bcaa4a0
4 0 (nil) 0x7fb9f30b94a0
...

BUG=chromium:177956
TEST=link build, PoC fails to show leaks

[sent upstream https://lkml.org/lkml/2013/3/11/498]
[changed #ifdef for pre-3.9 defines]
Change-Id: Icb92cc8a616f326f8df783b749ba1ffad24d98ce
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45130
Reviewed-by: Julien Tinnes <jln@chromium.org>
11 years agoCHROMIUM: power,mkbp: Update PSU status via EC's MKBP.
Todd Broch [Wed, 6 Mar 2013 17:11:37 +0000 (09:11 -0800)]
CHROMIUM: power,mkbp: Update PSU status via EC's MKBP.

EC has only one interrupt to the AP which is used to
signal keyboard input has arrived.

In order to signal change in power supply unit status (PSU) without
complicating and slowing keyboard response, we've added a virtual
keystroke, KEY_BATTERY, to signal change in PSU state.

Signed-off-by: Todd Broch <tbroch@chromium.org>
BUG=chrome-os-partner:17927
TEST=manual,

1. Plug-in AC supply, boot and login as root
2. Examine current PSU type
   cat /sys/class/power_supply/cros_ec-charger/type
   Mains
3. Unplug PSU, repeat 2. see same result
4. From EC console press 'BATTERY_KEY'
   kpbress 0 7 1
5. Re-examine PSU type
   cat /sys/class/power_supply/cros_ec-charger/type
   UNKNOWN

Repeat steps 1-5 for various PSUs

Change-Id: Ie80f7ae45f8bb47dbad893eb87e5fb6df7a3e3cd
Reviewed-on: https://gerrit.chromium.org/gerrit/45074
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
11 years agoCHROMIUM: ALSA: hda/ca0132 - Fix division by zero in ca0132_update_latency()
Chih-Chung Chang [Sat, 9 Mar 2013 13:05:33 +0000 (21:05 +0800)]
CHROMIUM: ALSA: hda/ca0132 - Fix division by zero in ca0132_update_latency()

The original code avoids the division if the runtime parameters have
not been set by checking if it is still in the SNDRV_PCM_STATE_OPEN
state. However if the system is suspended between snd_pcm_open() and
snd_pcm_hw_params(), the state is changed from SNDRV_PCM_STATE_OPEN to
SNDRV_PCM_STATE_SUSPENDED, and the check misses the case.

The new check just looks at the runtime parameters directly to see if
it is already set.

BUG=chromium-os:39661
TEST=compile kernel

Change-Id: I2ba983e00e61c330fe04a5a93f34101f01893ac3
Signed-off-by: Chih-Chung Chang <chihchung@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45022

11 years agoCHROMIUM: Input: atkbd - skip re-probing on non-KBD i8042 ports
Chung-yih Wang [Mon, 4 Mar 2013 11:10:07 +0000 (19:10 +0800)]
CHROMIUM: Input: atkbd - skip re-probing on non-KBD i8042 ports

The serio0 or "i8042 KBD port" (defined in i8042.c) is used for a system to
connect AT keyboard device in general. When a system resumes from suspend,
kernel rescans all serio ports again for matching devices with serio
driver one by one. Currently, the retry mechanism in atkbd_probe() may take
few milliseconds for each serial port. There will be four auxiliary ports if
multiplexing is enabled on the second serial port, and this will add the
latency of system resume or boot significantly. The patch tries to skip
reprobe mechanism for non-KBD ports in order to reduce the unresponsiveness
for a system with ps/2-type of touchpad resuming from suspend. By skipping
reprobes on non-KBD i8042 ports it could save 1+ seconds of latency.

BUG=chrome-os-partner:15015
TEST=on device; use powerd_suspend and then hit a key to wake it up
   see if the trackpoint/trackpoint could be active in 2+ seconds
   after resume instead of 3~4 seconds long

Change-Id: I0e62c351225b06af44b55e8600f6e37b05ae5a06
Signed-off-by: Chung-yih Wang <cywang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/44518
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
11 years agoCHROMIUM: power: charger-manager: Use device tree node
Simon Glass [Sun, 17 Jun 2012 17:26:42 +0000 (10:26 -0700)]
CHROMIUM: power: charger-manager: Use device tree node

We should use the device tree for charger manager. As a first step, check
the node and enable the driver only if present.

BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow

Change-Id: Ic57d927a8dc2a15c250fe280a8c330e3b8e896f1
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/40168

11 years agoCHROMIUM: power: dts: Add device tree binding for battery-system
Simon Glass [Sun, 17 Jun 2012 17:28:19 +0000 (10:28 -0700)]
CHROMIUM: power: dts: Add device tree binding for battery-system

This node brings together the various chargers and batteries into a single
unit called the battery system. It provides a unified view of the charge
state to user space.

This initial binding provides for the existing parameters in the driver.

BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow

Change-Id: Ib5714d10dc2849779abb3f413deb5446fdfbdf81
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/40167
Reviewed-by: Benson Leung <bleung@chromium.org>
11 years agoUPSTREAM: mwifiex: add set_antenna handler support
Amitkumar Karwar [Tue, 3 Jul 2012 02:32:33 +0000 (19:32 -0700)]
UPSTREAM: mwifiex: add set_antenna handler support

This enables user to set mode of Tx/Rx path using "iw set antenna"
command. For non MIMO chips, the command will be used for selecting
specific antenna or configuring antenna diversity mode.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chrome-os-partner:17995
TEST=Used "iw phy phy0 set antenna 3 3" and "iw phy phy0 set antenna 1 1"
("iw phy phy0 set antenna 2 2" does not work).

Change-Id: I34a16db8c9d14eb4f8123fbb8005a56f28f3c429
Reviewed-on: https://gerrit.chromium.org/gerrit/44729
Reviewed-by: Ajay Gummalla <agummalla@chromium.org>
Reviewed-by: Bing Zhao <bzhao@marvell.com>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
11 years agoUPSTREAM: ALSA: hda/ca0132 - Avoid division by zero in dspxfr_one_seg()
Xi Wang [Thu, 7 Mar 2013 05:13:51 +0000 (00:13 -0500)]
UPSTREAM: ALSA: hda/ca0132 - Avoid division by zero in dspxfr_one_seg()

Move the zero check `hda_frame_size_words == 0' before the modulus
`buffer_size_words % hda_frame_size_words'.

Also remove the redundant null check `buffer_addx == NULL'.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Conflicts:
sound/pci/hda/patch_ca0132.c

BUG=chromium-os:39661
TEST=play audio on link.

Change-Id: I926b440ba3a5d2a7ccbba63b60a7d5f116b93766
Reviewed-on: https://gerrit.chromium.org/gerrit/44902
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
Commit-Queue: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
11 years agoCHROMIUM: drm/exynos: Clean up DRM_DEBUG messages
Daniel Kurtz [Wed, 6 Mar 2013 04:29:09 +0000 (12:29 +0800)]
CHROMIUM: drm/exynos: Clean up DRM_DEBUG messages

The DRM_DEBUG messages in this driver do a pretty good job of generating
a function trace in dmesg when enabled.

This patch attempts to make this trace more useful in a few ways:
 (1) Instead of dumping file names (which can be trivially deduced from
function names using grep), prefer dumping function parameters, especially
when they are drm object handles.

 (2) Since DRM_DEBUG_* already dump function name; no need to explicitly
print it.

 (3) Use the same style for naming CRTC, CONNECTOR and ENCODER in debug
messages as is used in the drm common code.

 (4) Log when drm objects are created, add include the new objects handle.

 (5) Add debug messages to a few more non-critical path functions.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium-os:36608
TEST=Enable DRM_DEBUG_KMS, reboot, and inspect drm messages in dmesg

Change-Id: I6dc2e86be6ef64ca0384c407c9e90ad3c8b0f9e1
Reviewed-on: https://gerrit.chromium.org/gerrit/38890
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>

11 years agoRevert "UPSTREAM: mmc: dw_mmc: correct the calculation for CLKDIV"
Daniel Kurtz [Fri, 8 Mar 2013 03:56:36 +0000 (19:56 -0800)]
Revert "UPSTREAM: mmc: dw_mmc: correct the calculation for CLKDIV"

This reverts commit abde7fecdb4aa9cdf11fc90c6bef5ddf8c193265

For some reason, with this patch my daisy kernel won't boot on my Lucas.  Reverting for now for more investigation later.

BUG=chromium-os:39730
TEST=built & tested on daisy.  Chrome OS boots w/out black screen.

Change-Id: I0b9f9bf363fcf87766299e76152d2a03ad89e469
Reviewed-on: https://gerrit.chromium.org/gerrit/44910
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
11 years agoUPSTREAM: mmc: dw_mmc: correct the calculation for CLKDIV
Seungwon Jeon [Tue, 22 May 2012 04:01:21 +0000 (13:01 +0900)]
UPSTREAM: mmc: dw_mmc: correct the calculation for CLKDIV

In case of "host->bus_hz < slot->clock", divider value is
miscalculated. And clock divider register value is multiple of 2. If
calculated divider value is odd number, result can be over-clocking.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Acked-by: Will Newton <will.newton@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
BUG=chrome-os-partner:16752
TEST=Boot spring+HS200 eMMC and check dmesg for mmc.0 output.

Signed-off-by: Grant Grundler <grundler@chromium.org>
Resolved conflict with previously backported:
    Author: Abhilash Kesavan <a.kesavan@samsung.com>
    Date:   Mon Nov 19 10:26:21 2012 +0530

    mmc: dw_mmc: Add sdio power bindings

    Add dt-based retrieval of host sdio pm capabilities. Based on
    the dt based discovery do a bus init in the resume function.

Change-Id: I50a5e258c2fc0985bed327f898bd9c7cac86bd3f
Reviewed-on: https://gerrit.chromium.org/gerrit/44788
Reviewed-by: Doug Anderson <dianders@chromium.org>
Commit-Queue: Grant Grundler <grundler@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
Tested-by: Grant Grundler <grundler@chromium.org>
11 years agoCHROMIUM: power: tps65090: Add charger regulator and device tree support
Simon Glass [Sun, 17 Jun 2012 16:51:09 +0000 (09:51 -0700)]
CHROMIUM: power: tps65090: Add charger regulator and device tree support

Add a simple fdt binding to this driver. Also use a static struct to
provide the required power supply detail instead of assigning them at
run-time.

If the fdt node is not present or is disabled, we do not register the
driver. If the charger sub-node is not present, we do not register the
regulator, and operate entirely in passive mode (as the driver always
did before this change).

BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow

Change-Id: I93ec83b44f53f497d1adf745ddb45e2d438402e4
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/40166
Reviewed-by: Benson Leung <bleung@chromium.org>
11 years agoCHROMIUM: Update tps65090 device tree entry for charger
Simon Glass [Sun, 3 Feb 2013 22:30:20 +0000 (14:30 -0800)]
CHROMIUM: Update tps65090 device tree entry for charger

Add a sub-node for charger. We do not specify a name for the regulator
since that would enable this function of the driver, although it would
not really have any effect. Still, we don't want this until/unless
charger-manager is enabled.

BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow
With other changes, see that the charger can be enabled and disabled under
charger-manager control.

Change-Id: Ida12beedae31e848e775b7083ea2c998a35bda32
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43024

11 years agoRevert "CHROMEOS: config: Enable addrtype iptables match"
Paul Stewart [Wed, 6 Mar 2013 21:45:00 +0000 (13:45 -0800)]
Revert "CHROMEOS: config: Enable addrtype iptables match"

The addrtype rule ended up unused for multicast-reply
classification since this rule appears to interact improperly with NFQUEUE rules.  As such, since it is unused,
it should be removed.

This reverts commit 2dba2b3b1c217795cc72dc5b61057d7020e1b3f7

BUG=chromium-os:38605
TEST=Compile kernel

Change-Id: I4b05b73252a054249a4dd46f029277867798f2a5
Reviewed-on: https://gerrit.chromium.org/gerrit/44758
Reviewed-by: Grant Grundler <grundler@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
11 years agoCHROMIUM: Trigger a card reset on reaching tx_timeout threshold
Ashok Nagarajan [Thu, 21 Feb 2013 03:07:23 +0000 (19:07 -0800)]
CHROMIUM: Trigger a card reset on reaching tx_timeout threshold

tx_timeout doesn't always lead to a cmd_timeout. There are occurrences where
cmd_timeout never gets triggered for a long time and we encounter a kernel
crash. In this patch, we track the consecutive timeouts (tx_timeout_cnt). When
tx_timeout_cnt exceeds the threshold, trigger a card reset thereby avoiding a
kernel crash.

BUG=chrome-os-partner:15129
TEST=trigger tx_timeout and check if we see chip is reset after reaching
     threshold

Change-Id: Ie893630ef3da9a091b178843bdec6e0bb88eb16d
Signed-off-by: Ashok Nagarajan <asnagarajan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43696

11 years agoCHROMIUM: dts: spring: Enable cros_ec-charger in device tree.
Todd Broch [Tue, 5 Mar 2013 21:22:42 +0000 (13:22 -0800)]
CHROMIUM: dts: spring: Enable cros_ec-charger in device tree.

Signed-off-by: Todd Broch <tbroch@chromium.org>
BUG=chrome-os-partner:17927
TEST=manual,
1. boot kernel, login as root
2. plug in various PSU's
3. check online status
   power-supply-info | grep online
   online:           yes
4. unplug PSU
   power-supply-info | grep online
   online:           no

Change-Id: Idc1d9fb52f9288ca6b0cce243be18087a51a1803
Reviewed-on: https://gerrit.chromium.org/gerrit/44683
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
11 years agoCHROMIUM: config: exynos5: Enable cros_ec-charger driver.
Todd Broch [Tue, 5 Mar 2013 21:19:02 +0000 (13:19 -0800)]
CHROMIUM: config: exynos5: Enable cros_ec-charger driver.

Signed-off-by: Todd Broch <tbroch@chromium.org>
BUG=chrome-os-partner:17927
TEST=compile kernel successfully and see object file created.
  CC      drivers/power/chromeos_ec-charger.o

Change-Id: Idbb099932810e6d46a1ba65ccd711251caa98244
Reviewed-on: https://gerrit.chromium.org/gerrit/44682
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
11 years agoCHROMIUM: power: chromeos_ec: charger driver.
Todd Broch [Fri, 1 Mar 2013 15:30:32 +0000 (07:30 -0800)]
CHROMIUM: power: chromeos_ec: charger driver.

On spring, the charger (tps65090) is abstracted via EC interface.

This CL creates a driver for the charger using EC's MKBP interface
(EC_CMD_POWER_INFO) and provides power supply property
POWER_SUPPLY_PROP_ONLINE.

Signed-off-by: Todd Broch <tbroch@chromium.org>
BUG=chrome-os-partner:17927
TEST=code compiles

Change-Id: I03c444e82771871f47dbd12a7f4f282c2e95be3d
Reviewed-on: https://gerrit.chromium.org/gerrit/44681
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
11 years agoRevert "CHROMIUM: TEMPORARY: dump stack to help debug p/17609"
Luigi Semenzato [Tue, 5 Mar 2013 21:01:21 +0000 (13:01 -0800)]
Revert "CHROMIUM: TEMPORARY: dump stack to help debug p/17609"

This reverts commit 0af3fa94028ea0279311f81c0788910da770ce30.
Bug was reproduced, stack trace was achieved, done with this.

BUG=chrome-os-partner:17609
TEST=none

Change-Id: Ic8cc3dcc39dba88c43e3f22186c7b2feaa6036fe
Signed-off-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/44665
Reviewed-by: Doug Anderson <dianders@chromium.org>
11 years agoCHROMIUM: drm/bridge: control LCD and backlight FETs
Vincent Palatin [Tue, 5 Mar 2013 02:22:41 +0000 (18:22 -0800)]
CHROMIUM: drm/bridge: control LCD and backlight FETs

Ensure we are powering on and off the FETs controlling the backlight and
the LCD VDD.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:18122
TEST=on Spring, use "powerd_suspend" to suspend the machine, and check
the state of the TPS65090 FETs by using the "pmu" on the EC command
line.

Change-Id: I3a0d03fdac18b4d13de2d33de6ba2e0429dd0daf
Reviewed-on: https://gerrit.chromium.org/gerrit/44599
Reviewed-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: mfd: init/link earlier
Vincent Palatin [Tue, 5 Mar 2013 01:47:35 +0000 (17:47 -0800)]
CHROMIUM: mfd: init/link earlier

Move multi function devices earlier in the link sequence, in parity with
regulators.
The eDP bridge loaded by the DRM driver needs to be able to control the
screen regulators.

The regulators linking was moved earlier to have them available for
other subsystems :
https://lkml.org/lkml/2008/12/2/10

Now a lot of regulators are instantiated from MFD, so we need to move
the MFD to keep this benefit.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:18122
TEST=boot on Spring and see the traces from the virtual TPS65090
regulators earlier than the display port initialization.

Change-Id: I62223ea9fa79651a787754d45e05dd26edb7a029
Reviewed-on: https://gerrit.chromium.org/gerrit/44598
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoexynos/mfc: add sysmmu power on/off calls
Prathyush K [Tue, 31 Jul 2012 07:50:52 +0000 (13:20 +0530)]
exynos/mfc: add sysmmu power on/off calls

This patch calls the sysmmu driver helper functions for resuming
and suspending its two sysmmus during mfc power on/off. This is required
for the sysmmus to resume/suspend along with the parent mfc device.

BUG=chrome-os-partner:11793
TEST=MFC/GSC/Sysmmu get suspended after probe and resume upon
video playback. Tested on Daisy.

Change-Id: I989af8bb0aacb9991443ca90eb47068c67623a38
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/29165
Tested-by: Prathyush Kalashwaram <prathyush@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42960
Commit-Queue: John Sheu <sheu@chromium.org>
Reviewed-by: John Sheu <sheu@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
11 years agoexynos: mfc: Increase the IOMMU memory size from 128MB to 256MB
Arjun KV [Thu, 5 Jul 2012 09:47:48 +0000 (15:17 +0530)]
exynos: mfc: Increase the IOMMU memory size from 128MB to 256MB

This change is required for 1080p multiple instance video playback.
We need to increase the MFC, GSC and DRM-FIMD IOMMU memory size
from 128MB to 256MB.
With this change all VDA scenarios including multi instance playback
are handled.

BUG=None
TEST=emerge-daisy chromeos-kernel,
run 4 instance 1080p h264 video.

Change-Id: Iabbbccdc366145891b0e0f4eb12a41e68fe62451
Signed-off-by: Arjun KV <arjun.kv@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/26813
Reviewed-by: kiran <kiran@chromium.org>
Tested-by: kiran <kiran@chromium.org>
Reviewed-by: Sunil M <sunilm.samsung@gmail.com>
Reviewed-by: Subash Patel <subash@chromium.org>
Reviewed-by: Pawel Osciak <posciak@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/42959
Commit-Queue: John Sheu <sheu@chromium.org>
Reviewed-by: John Sheu <sheu@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
11 years agodrm/bridge: Convert ps8622 into a drm_bridge
Sean Paul [Wed, 27 Feb 2013 06:45:05 +0000 (01:45 -0500)]
drm/bridge: Convert ps8622 into a drm_bridge

Change ps8622 driver from an i2c driver to a drm_bridge. This allows us
to control the bridge with dpms, as well as more tightly control the
order of power on.

BUG=chrome-os-partner:17557
TEST=Builds

Change-Id: Ie98b5728ee99cad311c72122fdf781b40467c126
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43941
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoCHROMIUM: CONFIG: Change PS8622 to DRM_PS8622
Sean Paul [Mon, 25 Feb 2013 20:52:26 +0000 (15:52 -0500)]
CHROMIUM: CONFIG: Change PS8622 to DRM_PS8622

The config option changed, update to reflect the new name.

BUG=chrome-os-partner:17557
TEST=Builds

Change-Id: Id904cf20c2bda00dd7a2a9d59c70297ef1e05e2d
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43940
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agodrm/bridge: Move ps8622 driver into drm/bridge
Sean Paul [Mon, 25 Feb 2013 20:35:25 +0000 (15:35 -0500)]
drm/bridge: Move ps8622 driver into drm/bridge

Move the ps8622 bridge driver into drm/bridge.

BUG=chrome-os-partner:17557
TEST=Builds

Change-Id: I153539311c5a31aafab9deff1f74384a70bc48c4
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43939
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agodrm/exynos: Convert ptn bridge to drm_bridge
Sean Paul [Mon, 25 Feb 2013 20:26:25 +0000 (15:26 -0500)]
drm/exynos: Convert ptn bridge to drm_bridge

BUG=chrome-os-partner:17557
TEST=Tested on snow

Change-Id: Ie9cc502325953bcb97b69660bebfe4641cda4acd
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43926
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agodrm/i2c: Move ptn3460 from i2c to bridge directory
Sean Paul [Fri, 22 Feb 2013 20:17:24 +0000 (15:17 -0500)]
drm/i2c: Move ptn3460 from i2c to bridge directory

In preparation of drm_bridge-ifying the ptn3460 driver.

BUG=chrome-os-partner:17557
TEST=Build kernel for daisy

Change-Id: Ia17fe2d4de3c23734e86716b47ee0337c55f518b
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43925
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agodrm/exynos: Move dp training into mode_set
Sean Paul [Mon, 25 Feb 2013 19:52:41 +0000 (14:52 -0500)]
drm/exynos: Move dp training into mode_set

Move the DP link training from the interrupt worker to the mode_set
callback.

BUG=chrome-os-partner:17557
TEST=Tested on snow, no regressions noted

Change-Id: I06fecce43500e4a2b64eda4aca18c889a811b1ed
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43924
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
11 years agoARM: EXYNOS: MFC: Add IOMMU mapping to MFC probe
John Sheu [Thu, 7 Feb 2013 01:13:54 +0000 (17:13 -0800)]
ARM: EXYNOS: MFC: Add IOMMU mapping to MFC probe

IOMMU mapping is created for mfc device during probe. This
requires the sysmmu_l and sysmmu_r property be set in the DTS
file. First, the sysmmu device nodes are found and then the
sysmmu platform devices are retrieved. A IOMMU mapping is then created
for mfc_l and mfc_r devices.

Change-Id: I270211bd2583492818d2f2eb2c9bac73ba3956cd
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/42958
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Commit-Queue: John Sheu <sheu@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
11 years agoCHROMIUM: s5p-mfc: backport upstream s5p-mfc driver.
John Sheu [Thu, 7 Feb 2013 00:23:15 +0000 (16:23 -0800)]
CHROMIUM: s5p-mfc: backport upstream s5p-mfc driver.

<UPSTREAM MERGE NOT REQUIRED>

Backport the upstream driver, for the purpose of enabling s5p-mfc hardware
video encoding.

Backport of changes up to 734d1ece37fbf3d2ddfc71bc6c69e0fe35f02542 from
linuxtv/staging/for_v3.9

Signed-off-by: John Sheu <sheu@google.com>
BUG=chromium-os:38376
BUG=chromium:167417
TEST=local build, run on snow

Change-Id: Iae484f49a16a8e753b8951b2db4433bc549a5e97
Reviewed-on: https://gerrit.chromium.org/gerrit/42957
Commit-Queue: John Sheu <sheu@chromium.org>
Reviewed-by: John Sheu <sheu@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
11 years agoCHROMIUM:config:Enable CP210X module
Steev Klimaszewski [Wed, 20 Feb 2013 20:12:03 +0000 (14:12 -0600)]
CHROMIUM:config:Enable CP210X module

The CP210X is another fairly common serial adapter.

BUG=None
TEST=Compile, boot kernel, plug in cp210x adapter, check that you get a
/dev/ttyUSB0 device.

Change-Id: Ibf79904fef9f93efca135960d48f7200b8c5fef8
Signed-off-by: Steev Klimaszewski <threeway@gmail.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/43625
Commit-Queue: Olof Johansson <olofj@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
11 years agoARM: GPU: MALI: G3D ASV Lock Bit implementation
Arjun KV [Wed, 19 Dec 2012 06:54:53 +0000 (12:24 +0530)]
ARM: GPU: MALI: G3D ASV Lock Bit implementation

If G3D ASV lock bit is configured, all voltages in the G3D ASV table
have to be increased by 25mV.

BUG=chrome-os-partner:16615
TEST=Compile and boot kernel, cannot test
the exact changes till we get the new chip.

Change-Id: I8784ed290807ac5db86c706177403260742bbe89
Signed-off-by: Arjun.K.V <arjun.kv@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/39467
Reviewed-by: Doug Anderson <dianders@chromium.org>
Tested-by: Doug Anderson <dianders@chromium.org>
Commit-Queue: Doug Anderson <dianders@chromium.org>

11 years agoarm: exynos5: INT ASV Lock Bit implementation
Arjun KV [Wed, 19 Dec 2012 06:10:25 +0000 (11:40 +0530)]
arm: exynos5: INT ASV Lock Bit implementation

If INT ASV lock bit is configured, all voltages in the INT ASV table
have to be increased by 25mV.

BUG=chrome-os-partner:16615
TEST=Compile and boot kernel, cannot test
the exact changes till we get the new chip.

Change-Id: I64ec69874bd4753b61efd46708cdf82046310dd2
Signed-off-by: Arjun.K.V <arjun.kv@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/39466
Reviewed-by: Doug Anderson <dianders@chromium.org>
Tested-by: Doug Anderson <dianders@chromium.org>
Commit-Queue: Doug Anderson <dianders@chromium.org>

11 years agoarm: exynos5: ARM ASV Lock Bit implementation
Arjun KV [Wed, 19 Dec 2012 05:29:00 +0000 (10:59 +0530)]
arm: exynos5: ARM ASV Lock Bit implementation

If lock bit is configured, voltage for cpu frequency in some
ranges(800-200MHz, 1000-200MHz, 1100-200MHz) should be locked with the
voltage of the locked cpu frequency.  e.g. in 800-200MHz range all
frequencies below 800MHz will be configured with same voltage as
800MHz.

BUG=chrome-os-partner:16615

TEST=Compile and boot kernel.  Add printouts to
exynos5250_cpufreq_get_asv() to confirm that the min_t() doesn't
actually change the index on existing systems where lock bits are all
0.  Check that `dmesg` contains "EXYNOS5250: ASV lock int: 0 g3d: 0
arm: 0" which means that lock bits are all disabled.

[dianders cleaned up patch and CL description]

Change-Id: If5fcfae38af1bd01a5646ae94f7b010e564411cd
Signed-off-by: Arjun.K.V <arjun.kv@samsung.com>
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/39465

11 years agoCHROMEOS: config: turn on HID_BATTERY_STRENGTH
Yufeng Shen [Wed, 27 Feb 2013 23:21:56 +0000 (18:21 -0500)]
CHROMEOS: config: turn on HID_BATTERY_STRENGTH

This option allows external HID device to report its battery info
under /sys/class/power_supply/hid-xxx-battery

Signed-off-by: Yufeng Shen <miletus@chromium.org>
BUG=chromium-os:39317
TEST=Tested on Link with the new kernel, connect an Apple Magic Mouse
     to it, and the battery info is shown under
     /sys/class/power_supply/hid-xxx-battery

Change-Id: Ia05d8593673d5d1bd0e3f0def643713d8cb81e8e
Reviewed-on: https://gerrit.chromium.org/gerrit/44245
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Queue: Yufeng Shen <miletus@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
11 years agoUPSTREAM: HID: add Kconfig text to HID_BATTERY_STRENGTH
Jiri Kosina [Tue, 24 Apr 2012 08:51:30 +0000 (10:51 +0200)]
UPSTREAM: HID: add Kconfig text to HID_BATTERY_STRENGTH

HID_BATTERY_STRENGTH is missing both help text and description text.

BUG=chromium-os:39317
TEST=set CONFIG_HID_BATTERY_STRENGTH=y in base.config. build the
  kernel, and check that this option is enabled in the built kernel

cherry-picked from upstream commit
692d30d63b80b174d0ed24bbffb7a1ea536d5fee
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Change-Id: I2925c344b918e8b03953679ee5f856860fa09aa7
Reviewed-on: https://gerrit.chromium.org/gerrit/44249
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Queue: Yufeng Shen <miletus@chromium.org>
Reviewed-by: Yufeng Shen <miletus@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
11 years agoCHROMIUM: config: Renormalize splitconfig
Doug Anderson [Thu, 28 Feb 2013 21:57:05 +0000 (13:57 -0800)]
CHROMIUM: config: Renormalize splitconfig

Just ran: ./chromeos/scripts/kernelconfig oldconfig
...and hit return for everything.  AKA: no functional change
here, this just tells us where we are.

BUG=None
TEST=Compiled and booted on one device.

Change-Id: I92d6e364e9c95882e5c8bc10450fe97c79115e76
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/44312
Reviewed-by: Mike Frysinger <vapier@chromium.org>
11 years agoCHROMIUM: config: Build spidev into the kernel (not a module)
Doug Anderson [Thu, 28 Feb 2013 21:58:11 +0000 (13:58 -0800)]
CHROMIUM: config: Build spidev into the kernel (not a module)

A recovery image needs to be able to access SPI in order to reflash
the firmware, but the recovery image doesn't include any modules.
Make spidev part of the kernel to avoid having yet another weird
config difference for the recovery kernel.

BUG=chrome-os-partner:13068
TEST=Manual:
1. Get an official recovery image (that is marked to do a firmware
   flash) that contains this CL plus the modification to
   mod_image_for_recovery.sh that enables it.
2. Boot on snow.
3. After reboot confirm that firmware got updated.
4. Also after reboot look in console-ramoops.  If you see this:
    [ 1157.020235] Chromium OS LSM: init_module locked module=
    "/lib/modules/3.4.0/kernel/drivers/spi/spidev.ko" pid=1574
    cmdline="modprobe spidev"
   ...then that's bad and it means that we loaded the spidev module
   from the target USB key which isn't what we want to do.
TEST=Manual:
1. Hack up recovery image as described in chrome-os-partner:13068.
2. From first shell prompt in hacked recovery image type:
   chroot /usb /usr/sbin/flashrom -r /tmp/foo.bin
3. Confirm that flashrom reports no errors.
4. Type lsmod
5. Confirm that spidev is not listed

Change-Id: Ic156895cb186d04d2c32370d7cf70a3ec4af55bc
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/44311
Reviewed-by: Mike Frysinger <vapier@chromium.org>
11 years agoCHROMIUM: eCryptfs: allow userspace messaging to be disabled
Kees Cook [Thu, 28 Feb 2013 00:01:13 +0000 (16:01 -0800)]
CHROMIUM: eCryptfs: allow userspace messaging to be disabled

When the userspace messaging (needed for ecryptfsd) is not needed, allow
eCryptfs to build with it removed. This saves on kernel code size and
reduces potential attack surface by removing the /dev/ecryptfs node.

BUG=chromium-os:35732
TEST=link build, /dev/ecryptfs is gone, eCryptfs still works.

[sent upstream for review:
 http://marc.info/?l=ecryptfs-users&m=136204079607329&w=2]

Change-Id: I1b2be61e0a455fc9f6e09a9f4a1b1f6d65d1903a
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/44278
Reviewed-by: Will Drewry <wad@chromium.org>
11 years agoUPSTREAM: eCryptfs: Copy up attributes of the lower target inode after rename
Tyler Hicks [Thu, 13 Sep 2012 19:00:56 +0000 (12:00 -0700)]
UPSTREAM: eCryptfs: Copy up attributes of the lower target inode after rename

After calling into the lower filesystem to do a rename, the lower target
inode's attributes were not copied up to the eCryptfs target inode. This
resulted in the eCryptfs target inode staying around, rather than being
evicted, because i_nlink was not updated for the eCryptfs inode. This
also meant that eCryptfs didn't do the final iput() on the lower target
inode so it stayed around, as well. This would result in a failure to
free up space occupied by the target file in the rename() operation.
Both target inodes would eventually be evicted when the eCryptfs
filesystem was unmounted.

This patch calls fsstack_copy_attr_all() after the lower filesystem
does its ->rename() so that important inode attributes, such as i_nlink,
are updated at the eCryptfs layer. ecryptfs_evict_inode() is now called
and eCryptfs can drop its final reference on the lower inode.

http://launchpad.net/bugs/561129

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Tested-by: Colin Ian King <colin.king@canonical.com>
Cc: <stable@vger.kernel.org> [2.6.39+]
BUG=chromium-os:35732
TEST=daisy build, ENOSPC bubbles up to userspace

(cherry picked from upstream commit 8335eafc2859e1a26282bef7c3d19f3d68868b8a)
Signed-off-by: Kees Cook <keescook@chromium.org>
Change-Id: I9d4aa7e91b6f132a1f16d9a8b509681977091907
Reviewed-on: https://gerrit.chromium.org/gerrit/44158
Tested-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Will Drewry <wad@chromium.org>
Commit-Queue: Kees Cook <keescook@chromium.org>

11 years agoUPSTREAM: eCryptfs: Call lower ->flush() from ecryptfs_flush()
Tyler Hicks [Thu, 13 Sep 2012 01:38:00 +0000 (18:38 -0700)]
UPSTREAM: eCryptfs: Call lower ->flush() from ecryptfs_flush()

Since eCryptfs only calls fput() on the lower file in
ecryptfs_release(), eCryptfs should call the lower filesystem's
->flush() from ecryptfs_flush().

If the lower filesystem implements ->flush(), then eCryptfs should try
to flush out any dirty pages prior to calling the lower ->flush(). If
the lower filesystem does not implement ->flush(), then eCryptfs has no
need to do anything in ecryptfs_flush() since dirty pages are now
written out to the lower filesystem in ecryptfs_release().

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
BUG=chromium-os:35732
TEST=daisy build, ENOSPC bubbles up to userspace

(cherry picked from upstream commit 64e6651dcc10e9d2cc6230208a8e6c2cfd19ae18)
Signed-off-by: Kees Cook <keescook@chromium.org>
Change-Id: I44d6ba0eb30b6eebbfbedf3a1d7a8d7eaed28c01
Reviewed-on: https://gerrit.chromium.org/gerrit/44157
Tested-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Will Drewry <wad@chromium.org>
Commit-Queue: Kees Cook <keescook@chromium.org>

11 years agoUPSTREAM: eCryptfs: Write out all dirty pages just before releasing the lower file
Tyler Hicks [Thu, 13 Sep 2012 01:02:46 +0000 (18:02 -0700)]
UPSTREAM: eCryptfs: Write out all dirty pages just before releasing the lower file

Fixes a regression caused by:

821f749 eCryptfs: Revert to a writethrough cache model

That patch reverted some code (specifically, 32001d6f) that was
necessary to properly handle open() -> mmap() -> close() -> dirty pages
-> munmap(), because the lower file could be closed before the dirty
pages are written out.

Rather than reapplying 32001d6f, this approach is a better way of
ensuring that the lower file is still open in order to handle writing
out the dirty pages. It is called from ecryptfs_release(), while we have
a lock on the lower file pointer, just before the lower file gets the
final fput() and we overwrite the pointer.

https://launchpad.net/bugs/1047261

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reported-by: Artemy Tregubenko <me@arty.name>
Tested-by: Artemy Tregubenko <me@arty.name>
Tested-by: Colin Ian King <colin.king@canonical.com>
BUG=chromium-os:35732
TEST=daisy build, ENOSPC bubbles up to userspace

(cherry picked from upstream commit 7149f2558d5b5b988726662fe58b1c388337805b)
Signed-off-by: Kees Cook <keescook@chromium.org>
Change-Id: Ie713a160fb3899869af63fcf4ad0c29a2ab8ea79
Reviewed-on: https://gerrit.chromium.org/gerrit/44156
Tested-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Will Drewry <wad@chromium.org>
Commit-Queue: Kees Cook <keescook@chromium.org>

11 years agoUPSTREAM: eCryptfs: check for eCryptfs cipher support at mount
Tim Sally [Thu, 12 Jul 2012 23:10:24 +0000 (19:10 -0400)]
UPSTREAM: eCryptfs: check for eCryptfs cipher support at mount

The issue occurs when eCryptfs is mounted with a cipher supported by
the crypto subsystem but not by eCryptfs. The mount succeeds and an
error does not occur until a write. This change checks for eCryptfs
cipher support at mount time.

Resolves Launchpad issue #338914, reported by Tyler Hicks in 03/2009.
https://bugs.launchpad.net/ecryptfs/+bug/338914

Signed-off-by: Tim Sally <tsally@atomicpeace.com>
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
BUG=chromium-os:35732
TEST=daisy build, ENOSPC bubbles up to userspace

(cherry picked from upstream commit 5f5b331d5c21228a6519dcb793fc1629646c51a6)
Signed-off-by: Kees Cook <keescook@chromium.org>
Change-Id: If3d6f7f13047e7a9a64c0f79441ca52ebab17979
Reviewed-on: https://gerrit.chromium.org/gerrit/44155
Tested-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Will Drewry <wad@chromium.org>
Commit-Queue: Kees Cook <keescook@chromium.org>

11 years agoUPSTREAM: eCryptfs: Revert to a writethrough cache model
Tyler Hicks [Tue, 3 Jul 2012 23:50:57 +0000 (16:50 -0700)]
UPSTREAM: eCryptfs: Revert to a writethrough cache model

A change was made about a year ago to get eCryptfs to better utilize its
page cache during writes. The idea was to do the page encryption
operations during page writeback, rather than doing them when initially
writing into the page cache, to reduce the number of page encryption
operations during sequential writes. This meant that the encrypted page
would only be written to the lower filesystem during page writeback,
which was a change from how eCryptfs had previously wrote to the lower
filesystem in ecryptfs_write_end().

The change caused a few eCryptfs-internal bugs that were shook out.
Unfortunately, more grave side effects have been identified that will
force changes outside of eCryptfs. Because the lower filesystem isn't
consulted until page writeback, eCryptfs has no way to pass lower write
errors (ENOSPC, mainly) back to userspace. Additionaly, it was reported
that quotas could be bypassed because of the way eCryptfs may sometimes
open the lower filesystem using a privileged kthread.

It would be nice to resolve the latest issues, but it is best if the
eCryptfs commits be reverted to the old behavior in the meantime.

This reverts:
32001d6f "eCryptfs: Flush file in vma close"
5be79de2 "eCryptfs: Flush dirty pages in setattr"
57db4e8d "ecryptfs: modify write path to encrypt page in writepage"

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Tested-by: Colin King <colin.king@canonical.com>
Cc: Colin King <colin.king@canonical.com>
Cc: Thieu Le <thieule@google.com>
BUG=chromium-os:35732
TEST=daisy build, ENOSPC bubbles up to userspace

(cherry picked from upstream commit 821f7494a77627fb1ab539591c57b22cdca702d6)
Signed-off-by: Kees Cook <keescook@chromium.org>
Change-Id: I78b810a47117ddc53f641150a6d097fd95856ae7
Reviewed-on: https://gerrit.chromium.org/gerrit/44154
Tested-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Will Drewry <wad@chromium.org>
Commit-Queue: Kees Cook <keescook@chromium.org>

11 years agoUPSTREAM: eCryptfs: Initialize empty lower files when opening them
Tyler Hicks [Thu, 21 Jun 2012 06:50:59 +0000 (23:50 -0700)]
UPSTREAM: eCryptfs: Initialize empty lower files when opening them

Historically, eCryptfs has only initialized lower files in the
ecryptfs_create() path. Lower file initialization is the act of writing
the cryptographic metadata from the inode's crypt_stat to the header of
the file. The ecryptfs_open() path already expects that metadata to be
in the header of the file.

A number of users have reported empty lower files in beneath their
eCryptfs mounts. Most of the causes for those empty files being left
around have been addressed, but the presence of empty files causes
problems due to the lack of proper cryptographic metadata.

To transparently solve this problem, this patch initializes empty lower
files in the ecryptfs_open() error path. If the metadata is unreadable
due to the lower inode size being 0, plaintext passthrough support is
not in use, and the metadata is stored in the header of the file (as
opposed to the user.ecryptfs extended attribute), the lower file will be
initialized.

The number of nested conditionals in ecryptfs_open() was getting out of
hand, so a helper function was created. To avoid the same nested
conditional problem, the conditional logic was reversed inside of the
helper function.

https://launchpad.net/bugs/911507

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Cc: John Johansen <john.johansen@canonical.com>
Cc: Colin Ian King <colin.king@canonical.com>
BUG=chromium-os:35732
TEST=daisy build, ENOSPC bubbles up to userspace

(cherry picked from upstream commit e3ccaa9761200952cc269b1f4b7d7bb77a5e071b)
Signed-off-by: Kees Cook <keescook@chromium.org>
Change-Id: Ic6b303d2b8ff2690bc938adce850b2eaedab98a7
Reviewed-on: https://gerrit.chromium.org/gerrit/44153
Tested-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Will Drewry <wad@chromium.org>
Commit-Queue: Kees Cook <keescook@chromium.org>

11 years agoUPSTREAM: eCryptfs: Unlink lower inode when ecryptfs_create() fails
Tyler Hicks [Tue, 22 May 2012 20:09:50 +0000 (15:09 -0500)]
UPSTREAM: eCryptfs: Unlink lower inode when ecryptfs_create() fails

ecryptfs_create() creates a lower inode, allocates an eCryptfs inode,
initializes the eCryptfs inode and cryptographic metadata attached to
the inode, and then writes the metadata to the header of the file.

If an error was to occur after the lower inode was created, an empty
lower file would be left in the lower filesystem. This is a problem
because ecryptfs_open() refuses to open any lower files which do not
have the appropriate metadata in the file header.

This patch properly unlinks the lower inode when an error occurs in the
later stages of ecryptfs_create(), reducing the chance that an empty
lower file will be left in the lower filesystem.

https://launchpad.net/bugs/872905

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Cc: John Johansen <john.johansen@canonical.com>
Cc: Colin Ian King <colin.king@canonical.com>
BUG=chromium-os:35732
TEST=daisy build, ENOSPC bubbles up to userspace

(cherry picked from upstream commit 8bc2d3cf612994a960c2e8eaea37f6676f67082a)
Signed-off-by: Kees Cook <keescook@chromium.org>
Change-Id: I9ef97db96f1e1e594e5f995ae6c1293d1b3527e0
Reviewed-on: https://gerrit.chromium.org/gerrit/44152
Tested-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Will Drewry <wad@chromium.org>
Commit-Queue: Kees Cook <keescook@chromium.org>