All the original Xen headers have xen_ulong_t as unsigned long type, however
when they have been imported in Linux, xen_ulong_t has been replaced with
unsigned long. That might work for x86 and ia64 but it does not for arm.
Bring back xen_ulong_t and let each architecture define xen_ulong_t as they
see fit.
Also explicitly size pointers (__DEFINE_GUEST_HANDLE) to 64 bit.
Changes in v3:
- remove the incorrect changes to multicall_entry;
- remove the change to apic_physbase.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Add a doc to describe the Xen ARM device tree bindings
Changes in v5:
- add a comment about the size of the grant table memory region;
- add a comment about the required presence of a GIC node;
- specify that the described properties are part of a top-level
"hypervisor" node;
- specify #address-cells and #size-cells for the example.
Changes in v4:
- "xen,xen" should be last as it is less specific;
- update reg property using 2 address-cells and 2 size-cells.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Rob Herring <rob.herring@calxeda.com> CC: devicetree-discuss@lists.ozlabs.org CC: David Vrabel <david.vrabel@citrix.com> CC: Rob Herring <robherring2@gmail.com> CC: Dave Martin <dave.martin@linaro.org>
sync_bitops functions are equivalent to the SMP implementation of the
original functions, independently from CONFIG_SMP being defined.
We need them because _set_bit etc are not SMP safe if !CONFIG_SMP. But
under Xen you might be communicating with a completely external entity
who might be on another CPU (e.g. two uniprocessor guests communicating
via event channels and grant tables). So we need a variant of the bit
ops which are SMP safe even on a UP kernel.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Use r12 to pass the hypercall number to the hypervisor.
We need a register to pass the hypercall number because we might not
know it at compile time and HVC only takes an immediate argument.
Among the available registers r12 seems to be the best choice because it
is defined as "intra-procedure call scratch register".
Use the ISS to pass an hypervisor specific tag.
Changes in v2:
- define an HYPERCALL macro for 5 arguments hypercall wrappers, even if
at the moment is unused;
- use ldm instead of pop;
- fix up comments.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
- Basic hypervisor.h and interface.h definitions.
- Skeleton enlighten.c, set xen_start_info to an empty struct.
- Make xen_initial_domain dependent on the SIF_PRIVILIGED_BIT.
The new code only compiles when CONFIG_XEN is set, that is going to be
added to arch/arm/Kconfig in patch #11 "xen/arm: introduce CONFIG_XEN on
ARM".
Changes in v3:
- improve comments.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reset the IRQ_NOAUTOEN and IRQ_NOREQUEST flags that are enabled by
default on ARM. If IRQ_NOAUTOEN is set, __setup_irq doesn't call
irq_startup, that is responsible for calling irq_unmask at startup time.
As a result event channels remain masked.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
This patch removes the "return -ENOSYS" for auto_translated_physmap
guests from privcmd_mmap, thus it allows ARM guests to issue privcmd
mmap calls. However privcmd mmap calls are still going to fail for HVM
and hybrid guests on x86 because the xen_remap_domain_mfn_range
implementation is currently PV only.
Changes in v2:
- better commit message;
- return -EINVAL from xen_remap_domain_mfn_range if
auto_translated_physmap.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
All the original Xen headers have xen_pfn_t as mfn and pfn type, however
when they have been imported in Linux, xen_pfn_t has been replaced with
unsigned long. That might work for x86 and ia64 but it does not for arm.
Bring back xen_pfn_t and let each architecture define xen_pfn_t as they
see fit.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/events: fix unmask_evtchn for PV on HVM guests
When unmask_evtchn is called, if we already have an event pending, we
just set evtchn_pending_sel waiting for local_irq_enable to be called.
That is because PV guests set the irq_enable pvops to
xen_irq_enable_direct in xen_setup_vcpu_info_placement:
xen_irq_enable_direct is implemented in assembly in
arch/x86/xen/xen-asm.S and call xen_force_evtchn_callback if
XEN_vcpu_info_pending is set.
However HVM guests (and ARM guests) do not change or do not have the
irq_enable pvop, so evtchn_unmask cannot work properly for them.
Considering that having the pending_irq bit set when unmask_evtchn is
called is not very common, and it is simpler to keep the
native_irq_enable implementation for HVM guests (and ARM guests), the
best thing to do is just use the EVTCHNOP_unmask hypercall (Xen
re-injects pending events in response).
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
David Vrabel [Mon, 17 Dec 2012 12:30:58 +0000 (12:30 +0000)]
HACK! arm: set v7 translation table entries as uncachable
There appears to be a bug in the model where the MMU does not
correctly see updates to translation table entries if they are marked
as cachable. This bug only happens when running under the Xen
hypervisor.
As a workaround, mark the entries as uncachable. This decreases
performance.
[ijc - rebase, applying to both proc-v7-{2,3}level.S]
Dave Martin [Mon, 3 Sep 2012 12:49:25 +0000 (13:49 +0100)]
ARM: 7511/1: opcodes: Opcode definitions for the Virtualization Extensions
For now, this patch just adds a definition for the HVC instruction.
More can be added here later, as needed.
Now that we have a real example of how to use the opcode injection
macros properly, this patch also adds a cross-reference from the
explanation in opcodes.h (since without an example, figuring out
how to use the macros is not that easy).
Signed-off-by: Dave Martin <dave.martin@linaro.org> Acked-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Conflicts:
arch/arm/include/asm/opcodes.h
Benson Leung [Thu, 6 Dec 2012 20:24:42 +0000 (12:24 -0800)]
CHROMIUM: Input: cyapa - Set to power mode OFF on remove
If the driver is unloaded, set the trackpad to the lowest
power state.
Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chromium-os:21047
TEST=Set CONFIG_MOUSE_CYAPA=m in the chromeos config.
Builds clean.
Load the driver on a test system with the trackpad INT line scoped.
Check that the touchpad is functional.
rmmod cyapa to unload the cyapa module.
Click on the trackpad.
Check that the INT line does not assert on the scope, indicating
that the trackpad is indeed in OFF power state.
Benson Leung [Thu, 6 Dec 2012 20:44:26 +0000 (12:44 -0800)]
CHROMIUM: Input: cyapa - Change phys to use a static array in cyapa
Simplify this so we don't have to worry about freeing memory
later.
Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chromium-os:21047
TEST=builds clean.
cat /proc/bus/input/devices | grep -A1 cyapa
Check that the output is something like this (middle number will vary
based on adapter number on particular platform and kernel):
N: Name="cyapa"
P: Phys=i2c-1-0067/input0
Benson Leung [Thu, 6 Dec 2012 21:00:36 +0000 (13:00 -0800)]
CHROMIUM: Input: cyapa - Only set INPUT_PROP_BUTTONPAD on buttonpads
Use the button capabilities to determine if this is a buttonpad,
ie, one where there is a single button under the trackpad.
If there is exactly one physical button, a left button, then set
INPUT_PROP_BUTTONPAD.
Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chromium-os:21047
TEST=builds clean.
Test on two systems, one with a buttonpad (such as Lumpy)
and another with real physical buttons (Butterfly).
Do the following on both:
from crosh, run tpcontrol log
Then, from the shell, grep isButtonPad /var/log/touchpad_activity_log.txt
On Lumpy, this should return "isButtonPad": true
On Butterfly, this should return "isButtonPad": false
The Cypress one is defined in the common device tree,
so we currently define both of them.
Also add another entry if the trackpad is in bootloader mode at
address 0x25.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17825
TEST=boot a machine with an Atmel trackpad attached and one with Cypress
trackpad and have a working pointer on both of them.
Change-Id: I1886f7d3b2eedf39d73ca31376bd3229f8373b2d
Reviewed-on: https://gerrit.chromium.org/gerrit/43230 Reviewed-by: Benson Leung <bleung@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
Vincent Palatin [Wed, 13 Feb 2013 23:29:49 +0000 (15:29 -0800)]
CHROMIUM: input: atmel_mxt_ts - bail out early if we have no hardware
When using the device tree to configure the kernel I2C devices,
the devices are not probed. So if we want to support multiple optional
peripherals, we might end up executing their probe callback.
In that case, just probe early the Atmel chip on the i2c and bail out
early if it is not present.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17825
TEST=boot a machine with an Atmel trackpad attached and one with Cypress
trackpad and have a working pointer on both of them.
Change-Id: I0c948cac2a38f587cc5f1efa5ba424715f25804d
Reviewed-on: https://gerrit.chromium.org/gerrit/43229 Reviewed-by: Benson Leung <bleung@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
Vincent Palatin [Wed, 13 Feb 2013 23:29:49 +0000 (15:29 -0800)]
CHROMIUM: input: cyapa - bail out early if we have no hardware
When using the device tree to configure the kernel I2C devices,
the devices are not probed. So if we want to support multiple optional
peripherals, we might end up executing their probe callback.
In that case, just probe early the Cypress chip on the i2c and bail out
early if it is not present.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17825
TEST=boot a machine with an Atmel trackpad attached and one with Cypress
trackpad and have a working pointer on both of them.
Change-Id: I7d8cc499c5844521fe1b0eb703001f734cc43499
Reviewed-on: https://gerrit.chromium.org/gerrit/43228 Reviewed-by: Benson Leung <bleung@chromium.org> Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
Vincent Palatin [Thu, 14 Feb 2013 20:29:57 +0000 (12:29 -0800)]
CHROMIUM: exynos: de-activate internal backlight on Spring
On Spring, the Parade eDP bridge generates internally the PWM for the
LCD backlight.
When it is present, we can avoid configuring the
internal Exynos PWM in order to save power and to have only one
backlight device.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17227
TEST=boot on Spring and Snow, see backlight coming up in both cases
Change-Id: Id4d9db185b5e928f0b81d7fb358575cf07a20e36
Reviewed-on: https://gerrit.chromium.org/gerrit/43308
Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
Vincent Palatin [Thu, 14 Feb 2013 19:40:36 +0000 (11:40 -0800)]
CHROMIUM: auxdisplay/ps8620: implement backlight control
Add a standard backlight interface to the PS8622 bridge.
Also refactor how we are storing the driver data in a more classical fashion.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17227
TEST=on Spring, boot ChromeOS and press Backlight+/- keys from 100% to 0%
and back.
Change-Id: I1989192161ed6f6d5aafb5399658114a2f60bd97
Reviewed-on: https://gerrit.chromium.org/gerrit/43307 Reviewed-by: Todd Broch <tbroch@chromium.org> Reviewed-by: Sean Paul <seanpaul@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
Luigi Semenzato [Thu, 14 Feb 2013 20:36:50 +0000 (12:36 -0800)]
CHROMIUM: atkbd: improve workaround for chromeos EC bug
This makes the workaround for commit b483f9730b97ba8812340cf1584b491d5aa1e774
(https://gerrit.chromium.org/gerrit/43049, "CHROMIUM: atkbd: workaround
for ChromeOS EC keyboard enable bug") work properly by re-enabling the
keyboard IRQ which was accidentally disabled.
BUG=chrome-os-partner:17810
TEST=tested with > 200 power cycles and > 30 workaround triggers
BRANCH=none
Change-Id: Ia8a817f665a3575eebeb1ba2ec3aa89f80c3e0e3 Signed-off-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43300
Paul Stewart [Thu, 7 Feb 2013 00:18:22 +0000 (16:18 -0800)]
CHROMEOS: config: Add support for iptables QUEUE
Add the QUEUE target to the kernel. This pulls in a bunch of
other modules we DON'T want, so explicilty configure these
off.
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:38605
TEST=Compile kernel. run ./chromeos/scripts/kernelconfig oldconfig
and confirm there are no additional changes
Change-Id: I07b53e81df045fae522c1048895138dd66e6d5d4
Reviewed-on: https://gerrit.chromium.org/gerrit/43133 Reviewed-by: mukesh agrawal <quiche@chromium.org> Reviewed-by: Grant Grundler <grundler@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org> Tested-by: Paul Stewart <pstew@chromium.org>
Jesse Barnes [Tue, 12 Feb 2013 20:12:20 +0000 (15:12 -0500)]
UPSTREAM: PM: make VT switching to the suspend console optional
KMS drivers can potentially restore the display configuration without
userspace help. Such drivers can can call a new funciton,
pm_vt_switch_required(false) if they support this feature. In that
case, the PM layer won't VT switch to the suspend console at suspend
time and then back to the original VT on resume, but rather leave things
alone for a nicer looking suspend and resume sequence.
BUG=chromium-os:38536
TEST=Tested on snow, verified no VT switch on powerd_suspend
Change-Id: Id392b1ea14a0fef165b75d3caa4a9fa9e593740f Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43117 Reviewed-by: Benson Leung <bleung@chromium.org>
Luigi Semenzato [Mon, 11 Feb 2013 19:47:48 +0000 (11:47 -0800)]
CHROMIUM: atkbd: workaround for ChromeOS EC keyboard enable bug
The ChromeOS EC enables keystrokes too early, and the driver
can get scancodes when it's expecting a response from the
GETID request. The workaround consists of repeating the request
a few times if it fails.
BUG=chrome-os-partner:17005
TEST=verified that the workaround works around the bug
BRANCH=none
Signed-off-by: Luigi Semenzato <semenzato@chromium.org>
Change-Id: Ica4ad7ed1564c07ab196b302d1a33732a48c680f
Reviewed-on: https://gerrit.chromium.org/gerrit/43049 Reviewed-by: Luigi Semenzato <semenzato@chromium.org> Tested-by: Luigi Semenzato <semenzato@chromium.org>
Commit-Queue: Luigi Semenzato <semenzato@chromium.org>
Vincent Palatin [Wed, 13 Feb 2013 00:20:12 +0000 (16:20 -0800)]
CHROMIUM: mmc: card: add a quirk for Kingston eMMC
The Kingston eMMC 16GB is sometimes freezing (not answering to the
request) when doing a multiple read (CMD18).
With this workaround, I'm no longer encountering the issue.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17397
TEST=on Spring with unreliable Kingston eMMC, /usr/sbin/chromeos-install,
then boot the board from eMMC and see both steps succeeding without freeze.
Change-Id: If22613093debafeb90ecdc90b8ad5373d2050de9
Reviewed-on: https://gerrit.chromium.org/gerrit/43149 Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
Ben Chan [Tue, 12 Feb 2013 02:23:58 +0000 (18:23 -0800)]
CHROMIUM: USB: add quirk for Novatel Wireless E362 modem
BUG=chrome-os-partner:17609
TEST=Tested the following:
1. Leave the Chromebook on battery and verify that the USB auto-suspend
is enabled on the E362 modem.
2. Repeatedly suspend and resume the Chromebook.
Change-Id: Ic9f0b82e6092f50b4e1f06192c29a1f3f4aa1326 Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43125 Reviewed-by: Scott James Remnant <keybuk@chromium.org>
regulator: s5m8767: Fix probe failure due to stack corruption
Prior to the upstream fix, the failure manifested itself as kernel
Oops. In CHROMIUM kernel (3.4) it quietly overwrote the i2c register
index to '0' (PMIC_ID) which led to successful return but without
writing the new voltage value.
This changelist mimics the upstream patch and can be dropped once
we've moved to 3.8 kernel.
BUG=chrome-os-partner:16430, chromium-os:38853
TEST=build & boot. See voltage levels change based on cpufreq.
On SLSI S5M8767 PMIC, the fixed regulator for the 32Khz clock for
Wifi/Bluetooth is called en32khz_bt.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17512
TEST=on Spring with S5M8767 PMIC, boot and see Wifi coming up properly
Change-Id: I0224d866bd59a242b77db28ec985d7a1f0fad589
Reviewed-on: https://gerrit.chromium.org/gerrit/42977 Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
Vincent Palatin [Sat, 9 Feb 2013 01:57:06 +0000 (17:57 -0800)]
CHROMIUM: regulator: s5m8767: add support for 32Khz clocks
Present the 32Khz clocks as fixed regulators.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17512
TEST=on Spring with S5M8767 PMIC, boot and see Wifi coming up properly
Change-Id: I51ff3adcacc2ea442c7a73aac0ab914767b2f8ce
Reviewed-on: https://gerrit.chromium.org/gerrit/42976 Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
Allow the voltage regulators operating mode to be configured via
device tree node 'reg_op_mode'. Previously operating modes were set
to 0x3 (always on) which is still the default for systems not using
device tree.
Simon Glass [Sun, 3 Feb 2013 22:26:25 +0000 (14:26 -0800)]
CHROMIUM: dts: Add node for MAX77686 RTC
We will use this timer for the charger manager, so add a phandle for it.
BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow
Use a pr_info() statement to check that the node is found in the driver on
boot.
Change-Id: I3239c108ce5b65c1c02ac328e27b7d5009d20c62 Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42576
Simon Glass [Sun, 3 Feb 2013 22:17:35 +0000 (14:17 -0800)]
CHROMIUM: power: max77686: Add basic device tree binding
This chip has an RTC within it, so define an "rtc" subnode. So far there
are no properties, but the existence of the node is enough to make it
accessible via a phandle.
BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow
With later commits, see that we can find this node in the rtc driver.
Change-Id: Ia6d3fdb22b77b17bc4887ff3671b711f2969a251 Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42575
Simon Glass [Sun, 17 Jun 2012 17:38:45 +0000 (10:38 -0700)]
CHROMIUM: charger-manager: Allow battery to provide temperature
In some systems the we cannot obtain the cell temperature using the charger
or an ADC; we must ask the battery (fuel cell) since it has thermistors
which are closer to the battery and thus give a more accurate reading.
Add this feature to charger-manager.
BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow
See that we obtain the correct temperature now (from the battery)
Simon Glass [Mon, 4 Feb 2013 23:04:27 +0000 (15:04 -0800)]
CHROMIUM: charger-manager: Show current state in status message
Charger-manager prints a status debug message each time it checks the
system. Adjust this so that it also prints the current charging state,
and tidy up the uevent emission code at the same time.
Keep a count of how many monitor cycles have been completed.
BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow
See that a debug message appears every 10 seconds, showing the current
charge state.
Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: Ia45d3489031fb79ca765206a7b56b4a82c7fab59
Reviewed-on: https://gerrit.chromium.org/gerrit/42573 Reviewed-by: Sameer Nanda <snanda@chromium.org>
Commit-Queue: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
Kees Cook [Fri, 8 Feb 2013 01:01:21 +0000 (17:01 -0800)]
CHROMIUM: msr: whitelist the i915 thermal control for wrmsr
Deny all userspace MSR writes except those explicitly whitelisted for
i915 thermal controls. Without this, processes with CAP_SYS_RAWIO can
run arbitrary kernel code via MSR writing.
BUG=chromium-os:38756
TEST=link build, wrmsr works only on i915 thermal registers
Alan Cox [Thu, 15 Nov 2012 13:06:22 +0000 (13:06 +0000)]
UPSTREAM: x86/msr: Add capabilities check
At the moment the MSR driver only relies upon file system
checks. This means that anything as root with any capability set
can write to MSRs. Historically that wasn't very interesting but
on modern processors the MSRs are such that writing to them
provides several ways to execute arbitary code in kernel space.
Sample code and documentation on doing this is circulating and
MSR attacks are used on Windows 64bit rootkits already.
In the Linux case you still need to be able to open the device
file so the impact is fairly limited and reduces the security of
some capability and security model based systems down towards
that of a generic "root owns the box" setup.
Therefore they should require CAP_SYS_RAWIO to prevent an
elevation of capabilities. The impact of this is fairly minimal
on most setups because they don't have heavy use of
capabilities. Those using SELinux, SMACK or AppArmor rules might
want to consider if their rulesets on the MSR driver could be
tighter.
Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Horses <stable@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org>
BUG=chromium-os:38633
TEST=link build, reading MSR correctly fails as uid 0 without caps:
(can't use iotools with minijail because iotools is statically linked)
`minijail0 -c 0 /usr/local/bin/python -c 'from struct import *; \
m = open("/dev/cpu/0/msr"); m.seek(0x3a); \
print "0x%016x" % (unpack("Q", m.read(8)))'`
Todd Broch [Wed, 6 Feb 2013 19:57:54 +0000 (11:57 -0800)]
CHROMIUM: spring: dts: Instantiate s5m8767 PMIC.
Note, this will enumerate multiple PMICs for the same design as the
max77686 PMIC is also enumerated via cros5250-common.dtsi. This is
remedied by the firmware (u-boot) at boot time by pruning the
non-existent PMIC.
See: https://gerrit.chromium.org/gerrit/#/c/41993/ for details.
CL also disables ADC node for Spring which is unused.
BUG=chrome-os-partner:16430
TEST=kernel compiles for BOARD=daisy_spring
Vincent Palatin [Wed, 6 Feb 2013 19:05:28 +0000 (11:05 -0800)]
CHROMIUM: exynos: enable ADCs only if there are used
Check the presence of an ADC node in the device tree before activating
the ADCs and the NTP thermistors connected to them.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:16430
TEST=on Spring with SLSI PMIC, boot with adc node de-activated and
doesn't see any ADC related panic.
on Snow, boot and check the thermistor temperatures in sysfs.
Change-Id: I1603d78805a8d0877c137b92bcd2c64cbb32564d
Reviewed-on: https://gerrit.chromium.org/gerrit/42868
Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Elly Fong-Jones [Tue, 5 Feb 2013 19:59:07 +0000 (14:59 -0500)]
CHROMIUM: gobi: check for overflow in buffer_new()
The size passed into buffer_new() can overflow. This isn't exploitable, since
all the calling paths check this, but still. Belt and suspenders and all that.
Yongqiang Yang [Wed, 5 Sep 2012 05:21:50 +0000 (01:21 -0400)]
UPSTREAM: ext4: ignore last group w/o enough space when resizing instead of BUG'ing
If the last group does not have enough space for group tables, ignore
it instead of calling BUG_ON().
Reported-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Cc: stable@vger.kernel.org
BUG=chromium-os:36118
TEST=link build, resize still works
John Sheu [Wed, 30 Jan 2013 10:04:36 +0000 (02:04 -0800)]
CHROMIUM: dma-buf: restore args on failure of dma_buf_mmap
Callers to dma_buf_mmap expect to fput() the vma struct's vm_file
themselves on failure. Not restoring the struct's data on failure
causes a double-decrement of the vm_file's refcount.
Signed-off-by: John Sheu <sheu@google.com>
BUG=chromium-os:38376
BUG=chromium:167417
TEST=local build, run on snow
Xi Wang [Thu, 31 May 2012 23:26:04 +0000 (16:26 -0700)]
UPSTREAM: introduce SIZE_MAX
ULONG_MAX is often used to check for integer overflow when calculating
allocation size. While ULONG_MAX happens to work on most systems, there
is no guarantee that `size_t' must be the same size as `long'.
This patch introduces SIZE_MAX, the maximum value of `size_t', to improve
portability and readability for allocation size validation.
Signed-off-by: Xi Wang <xi.wang@gmail.com> Acked-by: Alex Elder <elder@dreamhost.com> Cc: David Airlie <airlied@linux.ie> Cc: Pekka Enberg <penberg@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit a3860c1c5dd1137db23d7786d284939c5761d517)
Change-Id: Ic87ed61f0bbcd4d92ab3c8e898d0519d4d905ffb
BUG=chromium-os:38211
TEST=adhoc
build, boot, test for gobi presence
Dave Reisner [Wed, 2 Jan 2013 13:54:37 +0000 (08:54 -0500)]
UPSTREAM: debugfs: convert gid= argument from decimal, not octal
This patch technically breaks userspace, but I suspect that anyone who
actually used this flag would have encountered this brokenness, declared
it lunacy, and already sent a patch.
Signed-off-by: Dave Reisner <dreisner@archlinux.org> Reviewed-by: Vasiliy Kulikov <segoon@openwall.com> Acked-by: Kees Cook <keescook@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
BUG=chromium-os:23758
TEST=link build, debugfs mount options work with decimal for gid
CHROMIUM: sysrq-x: killall chrome process not just first one
Currently, sysrq-x just kills the first chrome process it finds.
We've seen in at least one occassion where there may be a stale
chrome process from a previous session. The fix is to kill all
processes we find that meet our criteria.
I also modified the printk to print the pid of the process
that is killed. Previously we were printing the pid of
session_manager which is not as useful.
BUG=chrome-os-partner:17522
TEST=manual (debugging feature):
hold down alt-volup then x - chrome should crash
repeat immediately afterward - session should restart
repeat and machine should reboot
2013-02-05T13:28:37.425355-08:00 localhost crash_reporter[2829]: Received crash notification for chrome[963] sig 6 (ignoring - chrome crash)
2013-02-05T13:28:37.557482-08:00 localhost session_manager: [0205/132837:INFO:session_manager_service.cc(523)] Handling child process exit: 963
2013-02-05T13:28:37.557537-08:00 localhost session_manager: [0205/132837:INFO:session_manager_service.cc(525)] Exited with signal 6
CHROMIUM: watchdog: don't free perf_event on disable
When offlining a CPU, we currently free the perf_event used for
the hardlockup detector. This sometimes results in an allocation
failure when bringing the CPU back online. The hotplug code to
bring the CPU back online is run while gfp flags are masked by
pm_restrict_gfp_mask.
The end result of the allocation failure is that the watchdog no
longer works sometimes after suspend/resume. The fix is to only
disable the event and not free it. This avoids the failed allocation.
BUG=chrome-os-partner:17522
TEST=Verify that detector still works after suspend/resume.
Vincent Palatin [Tue, 5 Feb 2013 17:12:19 +0000 (09:12 -0800)]
CHROMIUM: exynos: properly manage "regulator" for HSIC reset
We were violating something in the documentation for regulator_put,
namely:
Note: drivers must ensure that all regulator_enable calls made on
this regulator source are balanced by regulator_disable calls prior
to calling this function.
We now keep the regulator around until we've disabled it. That keeps
the regulator in the right state.
At the same time, add some error checking to regulator calls.
BUG=chromium-os:38403
TEST=on Snow with 3G modem, do a suspend/resume cycle and check in
"lsusb" that the modem (VID/PID 1410:a021) and the camera (VID/PID
2232:1037) are still there after resume.
On Spring, check we can still boot from USB.
TEST=Check state of hsichub-reset-l at boot and after resume:
1. cd /sys/kernel/debug/regulator/hsichub-reset-l
2. grep "" *
3. Check open_count of 1 and use_count of 1.
Change-Id: I31012c15e30c43a1259f15ffd3592ee68cb0b772 Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42621 Reviewed-by: Todd Broch <tbroch@chromium.org>
Change the NL80211_ATTR_SCAN_FLAGS value to match upstream kernels.
In doing so, fast-forward the contents of the nl80211_attrs enum to
its contents as of the current wireless-testing kernel.
CQ-DEPEND=I315dce8b3c39ae02db2a01401f83666f81b51f63
BUG=chromium-os:38618
TEST="test-flimflam scan" with new supplicant and kernel installed
Change-Id: Ie27c65a6eea1006f34346c51768d797ceadb7951 Signed-off-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42640 Reviewed-by: mukesh agrawal <quiche@chromium.org>
Change-Id: I85426fafa2e022fbf66e09f067e6380957561885 Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42591 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
Vincent Palatin [Wed, 30 Jan 2013 19:06:04 +0000 (11:06 -0800)]
CHROMIUM: exynos: dts: enable G781 thermal sensor on Spring
On Spring, we have a G781 thermal sensor on I2C bus 7.
The sensor is supported by the LM90 driver.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:16725
TEST=On spring, on the command-line
"cat /sys/bus/i2c/devices/7-004c/temp[12]_input"
and see board temperature in milli-celsius (e.g. 50750)
Change-Id: I84dfbc03f6b7f9399529f51965fe4dd4aeb04512
Reviewed-on: https://gerrit.chromium.org/gerrit/42380
Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Vincent Palatin [Wed, 30 Jan 2013 19:06:04 +0000 (11:06 -0800)]
CHROMIUM: config: add LM90 driver on Exynos platforms
On Spring, we have a G781 thermal sensor on I2C bus 7.
The sensor is supported by the LM90 driver.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:16725
TEST=On spring, on the command-line
"cat /sys/bus/i2c/devices/7-004c/temp[12]_input"
and see board temperature in milli-celsius (e.g. 50750)
Change-Id: I561df7bdc85cc07221235e85212a42b26598f5a4
Reviewed-on: https://gerrit.chromium.org/gerrit/42335
Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Vincent Palatin [Wed, 30 Jan 2013 19:06:04 +0000 (11:06 -0800)]
CHROMIUM: i2c: samsung: do not put a default class for the adapter
Avoid adding I2C_CLASS_HWMON and I2C_CLASS_SPD class flags to all
Samsung I2C adapters when the I2C mappings are defined in a device tree.
So the drivers doing an auto-detection by probing busses won't mess-up
sensitive I2C devices or trigger long timeouts on non-functional busses.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:16725
TEST=emerge-daisy_spring chromeos-kernel
On spring, run with LM90 driver compiled and do not see timeout at
startup on non-functional busses
Change-Id: Iacdba3846c59f605224ff61f5b7c605828486db3
Reviewed-on: https://gerrit.chromium.org/gerrit/42480 Reviewed-by: Olof Johansson <olofj@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Change-Id: I6db75cc715081a1c719060a3ae69a51ee7a243da Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42416 Reviewed-by: Mike Frysinger <vapier@chromium.org>
Daniel Lezcano [Tue, 15 Jan 2013 13:18:04 +0000 (14:18 +0100)]
UPSTREAM: cpuidle: remove the power_specified field in the driver
We realized that the power usage field is never filled and when it
is filled for tegra, the power_specified flag is not set causing all
of these values to be reset when the driver is initialized with
set_power_state().
However, the power_specified flag can be simply removed under the
assumption that the states are always backward sorted, which is the
case with the current code.
This change allows the menu governor select function and the
cpuidle_play_dead() to be simplified. Moreover, the
set_power_states() function can removed as it does not make sense
any more.
Drop the power_specified flag from struct cpuidle_driver and make
the related changes as described above.
As a consequence, this also fixes the bug where on the dynamic
C-states system, the power fields are not initialized.
[rjw: Changelog]
References: https://bugzilla.kernel.org/show_bug.cgi?id=42870
References: https://bugzilla.kernel.org/show_bug.cgi?id=43349
References: https://lkml.org/lkml/2012/10/16/518 Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 8aef33a7cf40ca9da188e8578b2abe7267a38c52)
BUG=chromium-os:35320
TEST=Boot a ZGB on AC and unplug it afterwards. Run powertop and notice
how the device correctly goes down into C3.
Change-Id: If4f34246ce62d77094bf8f1a1718631a4b8e8030
Reviewed-on: https://gerrit.chromium.org/gerrit/42433 Reviewed-by: Sameer Nanda <snanda@chromium.org>
Commit-Queue: Julius Werner <jwerner@chromium.org> Tested-by: Julius Werner <jwerner@chromium.org>
Julius Werner [Thu, 31 Jan 2013 02:02:45 +0000 (18:02 -0800)]
CHROMIUM: xhci: crude USB resume fix for Stout (temporary)
Stout's USB 3.0 ports show a variety of nasty issues after resume, some
of which are more reproducible than others. They all have in common that
the host controller bails with "Device not responding to set address."
during enumeration. A trace pulled from a USB cable showed that the host
controller just fills the bus with garbage and does not even generate
correct SOF sequences.
This seems like a large and time-consuming problem that could hide
anywhere in the USB software or hardware stack. With Stout being close
to release, we need an interim solution to make it usable while we find
the underlying problem.
This patch sets the XHCI_RESET_ON_RESUME quirk flag on Stout, which
makes device reenumeration after resume work, but it creates a new
issue that makes the host controller hang on the next suspend while
trying to save its state. This looks like an unrelated hardware bug...
but since we don't actually need to save state when we will reset
anyway, we can just add some code to skip that step in xhci_suspend().
This patch is intended to be temporary, and should be reverted as soon
as the root cause for this is found and fixed.
BUG=chrome-os-partner:16781
TEST=Plug a USB device into the yellow port on the right. Run lsusb. Run
powerd_suspend and wake the machine. Run lsusb again and ensure that the
output stayed the same.
Change-Id: Id21ab972c698d02c14937509f699c9bc659b70c0 Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42394 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Simon Que [Fri, 1 Feb 2013 19:31:04 +0000 (11:31 -0800)]
CHROMIUM: pm-check: s3c_pm_check_init returns int
The proper behavior for a late_initcall() function is to return int.
See include/linux/init.h. Otherwise compiler throws a warning.
BUG=chromium-os:5542
TEST=emerge-daisy chromeos-kernel, make sure there is no warning in this
file.
Change-Id: I47e1f81c622721b06fb715e7c4a876857d9b45b3 Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42468 Reviewed-by: Michael Spang <spang@chromium.org>
Simon Que [Wed, 30 Jan 2013 23:51:18 +0000 (15:51 -0800)]
CHROMIUM: net: ipw2x00: #ifdef condtionally used variable
The variable 'dev' is only used by a macro LIBIPW_DEBUG_WX() that is
conditional upon the config option 'CONFIG_LIBIPW_DEBUG'. When this
config option isn't defined, we get this warning:
libipw_wx.c:526:21: error: unused variable 'dev'
The solution is to define 'dev' only if CONFIG_LIBIPW_DEBUG is defined.
BUG=chromium-os:5542
TEST=emerge-x86-generic chromeos-kernel, make sure warning doesn't
appear.
Change-Id: I537c361f363879971ca045687e3dbd98475925fc Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42357 Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Simon Que [Thu, 31 Jan 2013 00:26:10 +0000 (16:26 -0800)]
CHROMIUM: drm: nouveau: initialize variables in nv40_pm
These variables are implicitly initialized by being passed as pointers
into nv40_calc_pll(). However, the compile still generates these
warnings:
nv40_pm.c:163:41: warning: 'log2P' may be used uninitialized in this
function
nv40_pm.c:164:38: warning: 'M2' may be used uninitialized in this
function
nv40_pm.c:164:45: warning: 'M1' may be used uninitialized in this
function
nv40_pm.c:164:25: warning: 'N2' may be used uninitialized in this
function
nv40_pm.c:164:51: warning: 'N1' may be used uninitialized in this
function
BUG=chromium-os:5542
TEST=emerge-x86-generic chromeos-kernel, make sure these warnings don't
appear.
Change-Id: Ib51a1744d809a395e2b599461f22f774313512d4 Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42358 Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Doug Anderson [Tue, 29 Jan 2013 17:59:12 +0000 (09:59 -0800)]
CHROMIUM: pm-check: Don't free memory after each resume
Once you use your device for a significant period of time pm_check
starts failing. This may have gotten worse recently with compressed
RAM. Change pm-check to avoid freeing memory between suspend/resume.
While I'm at it, also over-allocate pm-check memory a little bit to
make sure that normal memory doesn't overlap CRC memory. This ensures
that more in-use memory is actually checked for errors.
BUG=chrome-os-partner:17282
TEST=Run suspend_stress_test on a device with original (90.0)
read-only firmware and see pm_check work.
TEST=Use device with 90.0 read-only firmware for a while and then
suspend/resume. Don't see any warning in system messages.
TEST=Manually change pr_debug() to pr_info() in pm_check_alloc(). See
an allocate at bootup but no more allocates after a
suspend_stress_test
Change-Id: I2399c2d358d548089347aba5163f84adf3262d68 Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42242 Reviewed-by: Michael Spang <spang@chromium.org>
The variables here are really not used uninitialized.
arch/arm/mm/alignment.c: In function 'do_alignment':
arch/arm/mm/alignment.c:327:15: warning: 'offset.un' may be used
uninitialized in this function [-Wmaybe-uninitialized]
arch/arm/mm/alignment.c:748:21: note: 'offset.un' was declared here
BUG=chromium-os:5542
TEST=emerge-daisy chromeos-kernel, make sure warning is gone
Change-Id: I90d41bdc48203f8cc9ef75e6ca1e059b916428cc Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42370 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Simon Que [Thu, 31 Jan 2013 01:52:45 +0000 (17:52 -0800)]
CHROMIUM: usb: dwc: Fix ARM usb_phy init parameter warning
Adding the param "bool ext_clk" to phy_init() results in some warnings:
arch/arm/mach-exynos/mach-exynos5-dt.c:535:2: error: initialization from
incompatible pointer type [-Werror]
arch/arm/mach-exynos/mach-exynos5-dt.c:540:2: error: initialization from
incompatible pointer type [-Werror]
Instead of updating this function pointer to have the extra variable,
add a new function to set "ext_clk" as a static variable in
setup-usb-phy.c
BUG=chromium-os:5542
TEST=emerge-daisy chromeos-kernel, make sure warning is gone
Change-Id: Ic2c38acd945083b0509dafe9dadf12935868991d Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42367 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Bing Zhao [Thu, 31 Jan 2013 05:12:16 +0000 (21:12 -0800)]
UPSTREAM: mwifiex: fix incomplete scan in case of IE parsing error
A scan request is split into multiple scan commands queued in
scan_pending_q. Each scan command will be sent to firmware and
its response is handlded one after another.
If any error is detected while parsing IE in command response
buffer the remaining data will be ignored and error is returned.
We should check if there is any more scan commands pending in
the queue before returning error. This ensures that we will call
cfg80211_scan_done if this is the last scan command, or send
next scan command in scan_pending_q to firmware.
Cc: "3.6+" <stable@vger.kernel.org> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
BUG=none
TEST=Hacked the driver to simulate an IE parsing error.
Without this patch, "iw mlan0 scan" gets stuck.
With this patch applied, "iw mlan0 scan" returns AP list.
Change-Id: I93cb877650ad9e84e5109f4ea62cf5b5c638e26a
Reviewed-on: https://gerrit.chromium.org/gerrit/42377 Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Bing Zhao <bzhao@marvell.com> Tested-by: Bing Zhao <bzhao@marvell.com>
We have gathered all we need to know from this. The problem was in shill
and we have changed that to properly crash instead of silently fail. The
kernel netlink stack seems to work fine as it is and we don't need this
output anymore.
BUG=chromium-os:35479
TEST=Boot the kernel, make sure it still works fine and does not output
any messages with the string "RTM_NEWLINK" to dmesg anymore.
Change-Id: I9a12e41bb25adaf4ef7a7159d97adebfe2fd14e6 Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/41139 Reviewed-by: Sameer Nanda <snanda@chromium.org>
Vincent Palatin [Wed, 30 Jan 2013 18:45:37 +0000 (10:45 -0800)]
CHROMIUM: exynos: dts: ALS configuration is per board
Move the Ambient Light Sensor configuration to board-specific files.
Only Snow has an ISLxxxx light sensor.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17507
TEST=on Snow, boot and check the ambient light sensor is working when
putting the finger on it.
On Spring, boot and observe we no longer have isl driver failure in the kernel log.
Change-Id: I54a3031a4ea211c3a2cd5c56d9188387b329f72a
Reviewed-on: https://gerrit.chromium.org/gerrit/42334 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Bryan Freed <bfreed@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Vincent Palatin [Wed, 30 Jan 2013 18:45:37 +0000 (10:45 -0800)]
CHROMIUM: exynos: dts: TPM configuration is per board
Move the TPM configuration to board-specific files.
On Daisy and Snow, we have a SLB9635TT TPM with software I2C (the max
bus speed is 100kHz).
On Spring, we have a SLB9645TT TPM with hardware I2c (the max bus speed
is 400kHz).
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17506
TEST=on Snow and Spring, boot and grep the tpm_tis_i2c messages in the
kernel log.
Change-Id: I3c914c8647fad3f93c5273228c5a18e476efe100
Reviewed-on: https://gerrit.chromium.org/gerrit/42333 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Vincent Palatin [Wed, 30 Jan 2013 00:56:41 +0000 (16:56 -0800)]
BACKPORT: tpm: Add support for new Infineon I2C TPM (SLB 9645 TT 1.2 I2C)
This driver adds support for Infineon's new SLB 9645 TT 1.2 I2C TPMs,
which supports clockstretching, combined reads and a bus speed of
up to 400khz. The device also has a new device id.
The driver works now also fine with device trees, so you can instantiate
your device by adding:
+ tpm {
+ compatible = "infineon,slb9645tt";
+ reg = <0x20>;
+ };
for SLB 9645 devices or
+ tpm {
+ compatible = "infineon,slb9635tt";
+ reg = <0x20>;
+ };
for older SLB 9635 devices to your device tree.
tpm_i2c_infineon is also retained as a compatible id as a fallback to
slb9635 protocol.
The driver was tested on Beaglebone.
Signed-off-by: Peter Huewe <peter.huewe@infineon.com>
BUG=chrome-os-partner:17506
TEST=boot on Snow (with SLB9635) and Spring (with SLB9645)
and check tpm_tis_i2c traces in the kernel log.
Change-Id: I1d229a027dad193e7409261ee1039600cd7fdb01 Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42332 Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
On Spring, the I2S0 clock is connected to MCLK2/GPIO3 instead of MCLK1.
Explicitly configure the pin on boards I have tested and let the sane
default value (MCLK1 as before) for others.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17343
TEST=emerge-daisy_spring chromeos-kernel
play sound on Snow with the codec on MCLK1, on Spring proto-1 with the
codec on MCLK2.
Change-Id: I9792dc325bea67e9466cff04576d9a3bbcea4eb1
Reviewed-on: https://gerrit.chromium.org/gerrit/41790 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Vincent Palatin [Wed, 23 Jan 2013 00:41:26 +0000 (16:41 -0800)]
CHROMIUM: ASoC: max98095 - allow to select MCLK source
The codec clock can come from either MCLK1 or MCLK2 pin.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17343
TEST=emerge-daisy_spring chromeos-kernel
play sound on Snow with the codec on MCLK1, on Spring proto-1 with the codec
on MCLK2.
Change-Id: Ic82158c63f8fb5c8eb00771e9a1cbf186d561670
Reviewed-on: https://gerrit.chromium.org/gerrit/41876 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
John Sheu [Mon, 28 Jan 2013 23:36:21 +0000 (15:36 -0800)]
CHROMIUM: Fix DMABUF exporting for v4l2-m2m
<UPSTREAM MERGE NOT REQUIRED>
v4l2-mem2mem uses a constant offset to mmap to distinguish between input
and output queues. VIDIOC_EXPBUF should take this into account when
exporting a buffer as a DMABUF.
Signed-off-by: John Sheu <sheu@google.com>
BUG=chromium-os:38376
BUG=chromium:167417
TEST=local build, run on snow, unittests
Change-Id: Id7770666775a78c3e11b3d158052a81f67592c8f
Reviewed-on: https://gerrit.chromium.org/gerrit/42179
Commit-Queue: John Sheu <sheu@chromium.org> Reviewed-by: John Sheu <sheu@chromium.org> Tested-by: John Sheu <sheu@chromium.org> Reviewed-by: Pawel Osciak <posciak@chromium.org>
Bing Zhao [Mon, 28 Jan 2013 22:27:59 +0000 (14:27 -0800)]
UPSTREAM: mwifiex: do not overwrite error code from lower layer driver
Instead of converting it to a bogus error code -1, we should
return the original error code from lower layer driver. This
error code will be printed so it may give user some clues on
what has happened.
Signed-off-by: Bing Zhao <bzhao@marvell.com>
BUG=chrome-os-partner:17015
TEST=tested with the bad unit that fails with error message
"mwifiex_sdio_card_to_host: read iomem failed: -1". Now it says
"mwifiex_sdio_card_to_host: read iomem failed: -84".
Change-Id: I18fa13eb232739a4175e6e37469f3448fb0a58eb
Reviewed-on: https://gerrit.chromium.org/gerrit/42162 Reviewed-by: Paul Stewart <pstew@chromium.org> Tested-by: Bing Zhao <bzhao@marvell.com>
Commit-Queue: Bing Zhao <bzhao@marvell.com>
Benson Leung [Fri, 25 Jan 2013 03:49:38 +0000 (19:49 -0800)]
CHROMIUM: Input: cyapa - calibrate command
Add a sysfs property that allows userspace to trigger
a recalibration of the trackpad.
Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chrome-os-partner:17441
TEST=echo 1 > calibrate
After about a second, the command should return.
Check that the trackpad is responsive.
Benson Leung [Mon, 22 Oct 2012 03:53:39 +0000 (20:53 -0700)]
CHROMIUM: Input: cyapa - Read and output max/min baseline vals
Read min and max baseline values back from firmware to check
that the baseline value range is valid for normal usage after
calibration.
Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chrome-os-partner:17441
TEST=cd /sys/bus/i2c/devices/7-0067/
cat baseline
Check that two numbers are returned :
104 95
The actual values may vary depending depending on condition.